Skip to content

extDB3 General

SteezCram edited this page Aug 19, 2020 · 1 revision

Important

@extDB3 Addon comes with basic functions for talking to extDB3 extension. Unless you are planning on using custom sqf functions for talking to extDB3, you can skip reading this.

Message Format

CALL_TYPE:PROTOCOL_NAME:DATA

CALL_TYPE

0 = Sync  
1 = ASync (Doesnt save/return results, use for updating DB Values)  
2 = ASync + Save (Returns ID, for use with 5)

4 = Get (Retrieve Single Part Message)
5 = Get (Retrieves Multi-Msg Message)

9 = System Commands

PROTOCOL_NAME

FOO

DATA

This is the string/data passed onto the Protocol, look @ Protocol Specfics for more info.

Returned Message Format

[TYPE]  
[TYPE,DATA]

TYPE

0=ERROR       (When Error encounter, data = basic info)  
1=OK      
2=ID         (ID = ID for ASYNC / Multi-part Message)  
3=WAIT       (WAIT, means extDB hasn't got result yet)  
5=MULTIMSG   (When you call 4:, it will return [5] if message is Multi-part) 

Examples

Sync/ASync Requesting

0/1/2:Protocol Name:xxxxxxxxxxxxxxxxxxxxxxx  
0=Sync  
1=ASync  
2=ASync+Save  
Protocol Name = Class Name from plugins  
xxxxxxxxxxxxx = Data to send 

i.e

"extDB3" callExtension "0:RAW:DELETE ALL";

Return Value

[1,"message_data"] // Received if msg = SYNC + result fits in 1 message  
[2,"unique id"] // ID for ASYNC or Multi-Part Message

[0, "Generic Msg"] // Generic Error Message, more detailed info in log / console output  
// This will only be single message.. No Looping required (unlike below)

Retrieving Result / Single-Part Message

4:Unique ID  
4 = Retrieve  Single Part Message
Unique ID = ID received when u sent original ASync / Sync message (see Sync/ASync Requesting)

i.e

"extDB3" callExtension "4:75824"

Return Value

[3] // Not ready yet, sleep + try again  
[5] // Multi-Part Message, you must use 5: to fetch message

[1,"message_data"]
// Note: You don't need to keep calling until empty string (unlike 5: method)

Retrieving Result / Multi-Part Message

5:Unique ID  
5 = Retrieve  
Unique ID = ID received when u sent original ASync / Sync message (see Sync/ASync Requesting)

i.e

"extDB3" callExtension "5:75824"  

Return Value

[3] // Not ready yet, sleep + try again  

[1,"message_data"] // Keep asking for data till u get empty string ""  
(empty string) // Signals end of Multi-Part Message  

// You must keep going till you receive this message otherwise unique id won't get freed  
// Note: You will also receive empty string if u use wrong unique id aswell