ramdb/api/latex/dc/dae/md_docs_2hash_2hash_get.tex
Jacob Schmidt ee1dd91b7f
All checks were successful
Build / Build (push) Successful in 40s
feat: Add documentation for fetch function
This commit adds documentation for the `ramdb_db_fnc_fetch` function. The documentation explains the function's purpose, which is to handle data chunks received from the database extension when data is too large to be returned in a single callback. The documentation includes a title, icon, and excerpt for better readability and understanding.
2025-03-30 17:16:31 -05:00

70 lines
7.4 KiB
TeX

\chapter{hash\+Get}
\hypertarget{md_docs_2hash_2hash_get}{}\label{md_docs_2hash_2hash_get}\index{hashGet@{hashGet}}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md204}{}\doxysubsection{\texorpdfstring{autotoc\+\_\+md204}{autotoc\+\_\+md204}}\label{md_docs_2hash_2hash_get_autotoc_md204}
title\+: Arma\+RAMDb -\/ Hash Get icon\+: mdi\+:file-\/text-\/outline \hypertarget{md_docs_2hash_2hash_get_autotoc_md205}{}\doxysubsection{\texorpdfstring{excerpt\+: Get a field value from the current client\textquotesingle{}s hash table in RAMDb.}{excerpt\+: Get a field value from the current client\textquotesingle{}s hash table in RAMDb.}}\label{md_docs_2hash_2hash_get_autotoc_md205}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md206}{}\doxysection{\texorpdfstring{ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Get}{ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Get}}\label{md_docs_2hash_2hash_get_autotoc_md206}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md207}{}\doxysubsection{\texorpdfstring{Description}{Description}}\label{md_docs_2hash_2hash_get_autotoc_md207}
Retrieves the value associated with a specific field in the hash table of the current client/player. This function automatically determines the appropriate hash ID based on the caller\textquotesingle{}s identity, making it more convenient than {\ttfamily hash\+Get\+Id} which requires manually specifying an ID. It accesses hash data asynchronously and returns the result through a callback function.\hypertarget{md_docs_2hash_2hash_get_autotoc_md208}{}\doxysubsection{\texorpdfstring{Syntax}{Syntax}}\label{md_docs_2hash_2hash_get_autotoc_md208}
\begin{DoxyCode}{0}
\DoxyCodeLine{[\_keyField,\ \_function,\ \_call,\ \_netId]\ call\ ramdb\_db\_fnc\_hashGet}
\end{DoxyCode}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md209}{}\doxysubsection{\texorpdfstring{Parameters}{Parameters}}\label{md_docs_2hash_2hash_get_autotoc_md209}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{4}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default }\\\cline{1-4}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default }\\\cline{1-4}
\endhead
{\ttfamily \+\_\+key\+Field} &String &Name of the field in the hash to retrieve &"{}"{} \\\cline{1-4}
{\ttfamily \+\_\+function} &String &Name of the function to receive the retrieved data &"{}"{} \\\cline{1-4}
{\ttfamily \+\_\+call} &Boolean &Whether to call the function directly (true) or spawn (false) &false \\\cline{1-4}
{\ttfamily \+\_\+net\+Id} &String &(Optional) Net\+ID of the player to receive the data &"{}"{} \\\cline{1-4}
\end{longtabu}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md210}{}\doxysubsection{\texorpdfstring{Return Value}{Return Value}}\label{md_docs_2hash_2hash_get_autotoc_md210}
None. The retrieved data is passed to the specified callback function asynchronously.\hypertarget{md_docs_2hash_2hash_get_autotoc_md211}{}\doxysubsection{\texorpdfstring{Examples}{Examples}}\label{md_docs_2hash_2hash_get_autotoc_md211}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md212}{}\doxysubsubsection{\texorpdfstring{Retrieve a player\textquotesingle{}s loadout\+:}{Retrieve a player\textquotesingle{}s loadout\+:}}\label{md_docs_2hash_2hash_get_autotoc_md212}
\begin{DoxyCode}{0}
\DoxyCodeLine{["{}loadout"{},\ "{}ramdb\_db\_fnc\_test"{}]\ call\ ramdb\_db\_fnc\_hashGet;}
\end{DoxyCode}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md213}{}\doxysubsubsection{\texorpdfstring{Retrieve data with synchronous callback\+:}{Retrieve data with synchronous callback\+:}}\label{md_docs_2hash_2hash_get_autotoc_md213}
\begin{DoxyCode}{0}
\DoxyCodeLine{["{}playerScore"{},\ "{}ramdb\_db\_fnc\_processScore"{},\ true]\ call\ ramdb\_db\_fnc\_hashGet;}
\end{DoxyCode}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md214}{}\doxysubsubsection{\texorpdfstring{Retrieve data and send it to a specific client\+:}{Retrieve data and send it to a specific client\+:}}\label{md_docs_2hash_2hash_get_autotoc_md214}
\begin{DoxyCode}{0}
\DoxyCodeLine{["{}loadout"{},\ "{}ramdb\_db\_fnc\_test"{},\ false,\ netId\ player]\ remoteExecCall\ ["{}ramdb\_db\_fnc\_hashGet"{},\ 2,\ false];}
\end{DoxyCode}
\hypertarget{md_docs_2hash_2hash_get_autotoc_md215}{}\doxysubsection{\texorpdfstring{Notes}{Notes}}\label{md_docs_2hash_2hash_get_autotoc_md215}
\begin{DoxyItemize}
\item Retrieves a value from the current client\textquotesingle{}s hash table
\item The data is retrieved asynchronously through the extension\textquotesingle{}s callback system
\item Both the field name and callback function name must be provided
\item Input validation ensures both required parameters are non-\/empty
\item When a net\+Id is provided, the data is sent to that specific client
\item The {\ttfamily \+\_\+call} parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)
\item This function automatically determines which hash table to use based on the caller\textquotesingle{}s identity
\item Use {\ttfamily hash\+Get\+Id} when you need to specify a particular hash table by ID
\item All operations are logged for debugging purposes
\end{DoxyItemize}\hypertarget{md_docs_2hash_2hash_get_autotoc_md216}{}\doxysubsection{\texorpdfstring{Related Functions}{Related Functions}}\label{md_docs_2hash_2hash_get_autotoc_md216}
\begin{DoxyItemize}
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Get\+Id}\+: Retrieves a field value from a specific hash table (when you need to specify the ID)
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Get\+All}\+: Retrieves all fields from the current client\textquotesingle{}s hash table
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Get\+All\+Id}\+: Retrieves all fields from a specific hash table
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+hash\+Set}\+: Sets a field value in the current client\textquotesingle{}s hash table
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+scheduler}\+: Processes the callback from the database extension
\end{DoxyItemize}\hypertarget{md_docs_2hash_2hash_get_autotoc_md217}{}\doxysubsection{\texorpdfstring{Links}{Links}}\label{md_docs_2hash_2hash_get_autotoc_md217}
\doxysectlink{md_docs_2hash_2hash_delete}{Hash Delete}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_delete_id}{Hash Delete ID}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_get}{Hash Get}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_get_all}{Hash Get All}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_get_all_id}{Hash Get All ID}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_get_id}{Hash Get ID}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_remove}{Hash Remove}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_remove_id}{Hash Remove ID}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_set}{Hash Set}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_set_bulk}{Hash Set Bulk}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_set_id}{Hash Set ID}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2hash_2hash_set_id_bulk}{Hash Set ID Bulk}{0}