<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md_docs_2hash_2hash_set_bulk" xml:lang="en-US">
<title>hashSetBulk</title>
<indexterm><primary>hashSetBulk</primary></indexterm>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md301">
<title>autotoc_md301</title>
<para>title: ArmaRAMDb - Hash Set Bulk icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md302">
<title>excerpt: Set multiple fields in the current client&apos;s hash table in RAMDb.</title></section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md303">
<title>ramdb_db_fnc_hashSetBulk</title><section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md304">
<title>Description</title>
<para>Sets multiple field-value pairs in the hash table associated with the current client/player in a single operation. This function automatically determines the appropriate hash ID based on the caller&apos;s identity, making it more convenient than <computeroutput>hashSetIdBulk</computeroutput> which requires manually specifying an ID. It allows efficiently storing multiple related fields at once, reducing the number of separate database calls required.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md305">
<title>Syntax</title>
<para><literallayout><computeroutput>[_data]&#32;call&#32;ramdb_db_fnc_hashSetBulk
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md306">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="4" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
      <colspec colname='c4'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description   </para>
</entry><entry>
<para>Default    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_data</computeroutput>   </para>
</entry><entry>
<para>Array   </para>
</entry><entry>
<para>Array of alternating field names and values to store   </para>
</entry><entry>
<para>[]   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md307">
<title>Return Value</title>
<para>None. The operation runs synchronously to store all the data.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md308">
<title>Examples</title><section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md309">
<title>Store player loadout and position:</title>
<para><literallayout><computeroutput>[[&quot;loadout&quot;,&#32;[getUnitLoadout&#32;player],&#32;&quot;position&quot;,&#32;[getPosASLVisual&#32;player]]]&#32;call&#32;ramdb_db_fnc_hashSetBulk;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md310">
<title>Store multiple player settings:</title>
<para><literallayout><computeroutput>[[&quot;difficulty&quot;,&#32;[&quot;regular&quot;],&#32;&quot;respawn&quot;,&#32;[true],&#32;&quot;tickets&quot;,&#32;[500]]]&#32;call&#32;ramdb_db_fnc_hashSetBulk;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md311">
<title>Store player data from a client:</title>
<para><literallayout><computeroutput>[[&quot;name&quot;,&#32;[name&#32;player],&#32;&quot;uid&quot;,&#32;[getPlayerUID&#32;player],&#32;&quot;score&quot;,&#32;[score&#32;player]]]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_hashSetBulk&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md312">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>The data array must be structured as alternating field names and values: <computeroutput>[field1, value1, field2, value2, ...]</computeroutput></para>
</listitem><listitem>
<para>Each field name must be a string</para>
</listitem><listitem>
<para>Values can be arrays, strings, numbers, or booleans</para>
</listitem><listitem>
<para>All field-value pairs are stored in a single database operation</para>
</listitem><listitem>
<para>If any of the fields already exist, their values will be overwritten</para>
</listitem><listitem>
<para>This function automatically determines which hash table to use based on the caller&apos;s identity</para>
</listitem><listitem>
<para>Use <computeroutput>hashSetIdBulk</computeroutput> when you need to specify a particular hash table by ID</para>
</listitem><listitem>
<para>More efficient than multiple individual <computeroutput>hashSet</computeroutput> calls when setting several fields</para>
</listitem><listitem>
<para>The operation is executed immediately and synchronously</para>
</listitem><listitem>
<para>All operations are logged for debugging purposes</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md313">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_hashSet</computeroutput>: Sets a single field value in the current client&apos;s hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashSetIdBulk</computeroutput>: Sets multiple field-value pairs in a specific hash table (when you need to specify the ID)</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetAll</computeroutput>: Retrieves all fields from the current client&apos;s hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGet</computeroutput>: Retrieves a specific field value from the current client&apos;s hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashDelete</computeroutput>: Removes the current client&apos;s hash table</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_bulk_1autotoc_md314">
<title>Links</title>
<para><link linkend="_md_docs_2hash_2hash_delete">Hash Delete</link> | <link linkend="_md_docs_2hash_2hash_delete_id">Hash Delete ID</link> | <link linkend="_md_docs_2hash_2hash_get">Hash Get</link> | <link linkend="_md_docs_2hash_2hash_get_all">Hash Get All</link> | <link linkend="_md_docs_2hash_2hash_get_all_id">Hash Get All ID</link> | <link linkend="_md_docs_2hash_2hash_get_id">Hash Get ID</link> | <link linkend="_md_docs_2hash_2hash_remove">Hash Remove</link> | <link linkend="_md_docs_2hash_2hash_remove_id">Hash Remove ID</link> | <link linkend="_md_docs_2hash_2hash_set">Hash Set</link> | <link linkend="_md_docs_2hash_2hash_set_bulk">Hash Set Bulk</link> | <link linkend="_md_docs_2hash_2hash_set_id">Hash Set ID</link> | <link linkend="_md_docs_2hash_2hash_set_id_bulk">Hash Set ID Bulk</link> </para>
</section>
</section>
</section>
