\chapter{handler}
\hypertarget{md_docs_2core_2handler}{}\label{md_docs_2core_2handler}\index{handler@{handler}}
\hypertarget{md_docs_2core_2handler_autotoc_md95}{}\doxysubsection{\texorpdfstring{autotoc\+\_\+md95}{autotoc\+\_\+md95}}\label{md_docs_2core_2handler_autotoc_md95}
title\+: Arma\+RAMDb -\/ Handler icon\+: mdi\+:file-\/text-\/outline \hypertarget{md_docs_2core_2handler_autotoc_md96}{}\doxysubsection{\texorpdfstring{excerpt\+: Handle data from DB.}{excerpt\+: Handle data from DB.}}\label{md_docs_2core_2handler_autotoc_md96}
\hypertarget{md_docs_2core_2handler_autotoc_md97}{}\doxysection{\texorpdfstring{ramdb\+\_\+db\+\_\+fnc\+\_\+handler}{ramdb\+\_\+db\+\_\+fnc\+\_\+handler}}\label{md_docs_2core_2handler_autotoc_md97}
\hypertarget{md_docs_2core_2handler_autotoc_md98}{}\doxysubsection{\texorpdfstring{Description}{Description}}\label{md_docs_2core_2handler_autotoc_md98}
Handles data received from the database and routes it to the appropriate function. This function is a critical component of the callback system, receiving data from database operations and directing it to the specified function, either locally or to a remote client.\hypertarget{md_docs_2core_2handler_autotoc_md99}{}\doxysubsection{\texorpdfstring{Syntax}{Syntax}}\label{md_docs_2core_2handler_autotoc_md99}

\begin{DoxyCode}{0}
\DoxyCodeLine{[\_uniqueID,\ \_function,\ \_call,\ \_data,\ \_netId]\ call\ ramdb\_db\_fnc\_handler}

\end{DoxyCode}
\hypertarget{md_docs_2core_2handler_autotoc_md100}{}\doxysubsection{\texorpdfstring{Parameters}{Parameters}}\label{md_docs_2core_2handler_autotoc_md100}
\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 \+\_\+unique\+ID}   &String   &Unique identifier for the data chunk   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+function}   &String   &Name of function to receive the data   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+call}   &Boolean   &Whether to call the function directly (true) or spawn (false)   &false    \\\cline{1-4}
{\ttfamily \+\_\+data}   &Array, String, Number, or Boolean   &The data retrieved from the database   &\mbox{[}\mbox{]}    \\\cline{1-4}
{\ttfamily \+\_\+net\+Id}   &String   &(Optional) Net\+ID of the player to receive the data   &nil   \\\cline{1-4}
\end{longtabu}
\hypertarget{md_docs_2core_2handler_autotoc_md101}{}\doxysubsection{\texorpdfstring{Return Value}{Return Value}}\label{md_docs_2core_2handler_autotoc_md101}
None. The data is passed to the specified function for processing.\hypertarget{md_docs_2core_2handler_autotoc_md102}{}\doxysubsection{\texorpdfstring{Examples}{Examples}}\label{md_docs_2core_2handler_autotoc_md102}
\hypertarget{md_docs_2core_2handler_autotoc_md103}{}\doxysubsubsection{\texorpdfstring{Process data locally\+:}{Process data locally\+:}}\label{md_docs_2core_2handler_autotoc_md103}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}0123456789"{},\ "{}ramdb\_db\_fnc\_test"{},\ false,\ ["{}Hello\ World!"{}]]\ call\ ramdb\_db\_fnc\_handler;}

\end{DoxyCode}
\hypertarget{md_docs_2core_2handler_autotoc_md104}{}\doxysubsubsection{\texorpdfstring{Send data to a specific client\+:}{Send data to a specific client\+:}}\label{md_docs_2core_2handler_autotoc_md104}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}0123456789"{},\ "{}ramdb\_db\_fnc\_test"{},\ false,\ ["{}Hello\ World!"{}],\ netId\ player]\ remoteExecCall\ ["{}ramdb\_db\_fnc\_handler"{},\ 2,\ false];}

\end{DoxyCode}
\hypertarget{md_docs_2core_2handler_autotoc_md105}{}\doxysubsubsection{\texorpdfstring{Process data with direct call (synchronous)\+:}{Process data with direct call (synchronous)\+:}}\label{md_docs_2core_2handler_autotoc_md105}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}0123456789"{},\ "{}ramdb\_db\_fnc\_processInventory"{},\ true,\ [["{}weapon1"{},\ 30],\ ["{}item2"{},\ 5]]]\ call\ ramdb\_db\_fnc\_handler;}

\end{DoxyCode}
\hypertarget{md_docs_2core_2handler_autotoc_md106}{}\doxysubsection{\texorpdfstring{Notes}{Notes}}\label{md_docs_2core_2handler_autotoc_md106}

\begin{DoxyItemize}
\item The function validates that both the function name and data are valid before proceeding
\item When a net\+Id is provided, the data is sent to that specific client using remote\+Exec
\item The {\ttfamily \+\_\+call} parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)
\item This function is typically called by the scheduler or other core components rather than directly by user code
\item Each handler call is logged, which is useful for debugging data flow
\end{DoxyItemize}\hypertarget{md_docs_2core_2handler_autotoc_md107}{}\doxysubsection{\texorpdfstring{Related Functions}{Related Functions}}\label{md_docs_2core_2handler_autotoc_md107}

\begin{DoxyItemize}
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+scheduler}\+: Processes callbacks from the database extension
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+fetch}\+: Assembles data chunks for large datasets
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+add\+Task}\+: Adds tasks to the database operation queue
\end{DoxyItemize}\hypertarget{md_docs_2core_2handler_autotoc_md108}{}\doxysubsection{\texorpdfstring{Links}{Links}}\label{md_docs_2core_2handler_autotoc_md108}
\doxysectlink{md_docs_2core_2add_task}{Add Task}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2handler}{Handler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2init}{Init}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2print_addon_name}{Print Addon Name}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2process_queue}{Process Queue}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2scheduler}{Scheduler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2test}{Test}{0} 