Opens the binary data block with ID bdb_id. When exclusive_lock is enabled, other clients are prevented from reading and writing while this client has the block opened.
Callback is the script that will be called when the binary data block has been opened. The first argument of the script will be the handle to the opened block.
This stuff is vary confusing. Any chance you can explain further?
My goal is to transfer a lot of variables (4 decimals) and strings (OR, alternatively, an ini / txt file).
The binary data blocks seem unlike ini's.
If you can solve this question, it will help me vary much: If I have 2 variables i want to send, a string ("Hello") and a variable (1234.1234), to another player for them to pull data from, how would I go about doing that with this system?
Binary data blocks are quite different from INIs indeed. Whereas INIs use a section-key-value map to store data, binary data blocks just store, well, literally binary blocks of data. BDBs just store bytes, and don't provide a nice abstraction like a key-value map, which means you can virtually do anything you want with them. They work similarly to buffers in GM:Studio.
To write data to a BDB, you'd open the block, seek to a position in the block, write the data you'd want to write, and then close the block again. Since BDBs operate on byte-level, you can use integers of specific sizes (1, 2 or 4 bytes), doubles (the default type in GM, 4 or 8 bytes) or strings (variable number of bytes).
Alternatively, you could just directly copy any file into the BDB. (using the file_bin_ functions).
Ok, so I am trying to copy a INI file into the BDB. I believe I have to create a bin file before transfering it. Once i have the bin file, how do I transfer it as a BDB?
You don't have to write it to a binary file. You can read it in as a string, and then use gms_bdb_write(argument0, bdb_string, string_to_store) to store it. After that, you can use gms_bdb_read(argument0, bdb_string) to read it back in.
One last question: How do I transfer the entire INI to a string?
Just open the file and copy each line into a longer string, separating lines with some kind of indicator.
Yep, that would be the way to do it.