-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathProtocol.txt
112 lines (73 loc) · 3.19 KB
/
Protocol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
This is still a WIP + may be incorrect
0 = Sync
1 = ASync (Fire Command + Forget i.e if u wanted to save info to database, note u wont get any return info i.e if it failed or not)
2 = ASync + Save
5 = Get (Retrieves Multi-Msg or 2 [Async + Save] Msgs)
9 = System Commands
-------------------------------------------------------
System Commands
-------------------------------------------------------
VERSION
DATABASE
ADD
LOCK
List of commands more info below,
All System Commands are Sync in nature i.e will block while beening run.
-------------------------------------------------------
System Command - ADD
-------------------------------------------------------
"extDB" callExtension "9:AddProtocol:Name"
Protocol Name i.e MISC // DB_RAW
So for example
"extDB" callExtension "9:ADD:MISC:this_is_stupid"
"extDB" callExtension "0:this_is_stupid:TIME"
Return Value
["OK"] // Loaded Library
["ERROR", "Generic Msg"]
-------------------------------------------------------
System Command - DATABASE
-------------------------------------------------------
"extDB" callExtension "9:DATABASE:Wasteland"
This will load up the option Wasteland in the config file (conf-main.ini).
This way u can have multiple settings for different mission files in one config file,
and when mission starts it loads the correct option.
U must load an option before using a plugin that uses extDB Database Pool, otherwise it will seg-fault on you.
-------------------------------------------------------
System Command - LOCK
-------------------------------------------------------
"extDB" callExtension "9:LOCK"
This is a real simple command.
Once this is called.. it disables all System Commands i.easier
u will no longer be able to add any more plugins or get version info.
This is a paranoid option + u should call it after u finished loading all plugins u need.
This is OPTIONAL, but recommended
-------------------------------------------------------
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
"extDB" callExtension "0:RAW:DELETE ALL";
Return Value
["OK","message_data"] // Received if msg = SYNC + result fits in 1 message
["ID","unique id"] // ID for ASYNC or Multi-Part Message
["ERROR", "Generic Msg"] // Generic Error Message, more detailed info in log / console output
// This will only be single message.. No Looping required (unlike below)
-------------------------------------------------------
Retrieving ASYNC + Save Message / 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
"extDB" callExtension "5:75824"
Return Value
["WAIT"] // Not ready yet, sleep + try again
["OK","message_data"] // Keep asking for data till u get ["END"]
(empty string) // Signals end of Multi-Part Message
// U must keep going till you receive this message otherwise unique id wont get freed.
// Note: U will also receive empty string if u use wrong unique id aswell