Skip to content

extDB3 System

SteezCram edited this page Aug 19, 2020 · 1 revision

System Commands

List of commands more info below. All System Commands are Sync in nature i.e will block while being run.

  • ADD_DATABASE
  • ADD_PROTOCOL
  • ADD_DATABASE_PROTOCOL
  • VERSION
  • OUTPUTSIZE
  • LOCK
  • LOCK_STATUS
  • UNLOCK
  • RESET
  • LOCAL_TIME
  • UTC_TIME
  • UPTIME
  • DATEADD

ADD_PROTOCOL

"extDB3" callExtension "9:ADD_PROTOCOL:<PROTOCOL>:<PROTOCOL_NAME>"

Protocol = Protocol Type i.e LOG (more to come later on) Protocol Name = how you refer to the instanced protocol later on. Can be used to make it harder for hacker to directly call extDB3.

So for example

"extDB3" callExtension "9:ADD_PROTOCOL:MISC:this_is_stupid"

Return Value

[1] // Loaded Protocol Ok  
[0, "Generic Error Message"] // ERROR  

"extDB3" callExtension "0:this_is_stupid:TIME"

Has to be done before LOCK

ADD_DATABASE

"extDB3" callExtension "9:ADD_DATABASE:<DATABASE_CONFIG_NAME>"
"extDB3" callExtension "9:ADD_DATABASE:<DATABASE_CONFIG_NAME>:<DATABASE_NAME>"

If no DATABASE_NAME set it is the same as DATABASE_CONFIG_NAME. Has to be done before `LOCK```

ADD_DATABASE_PROTOCOL

"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:<DATABASE_NAME>:<PROTOCOL>:<PROTOCOL_NAME>"

Protocol = Protocol Type i.e SQL // SQL_CUSTOM Can be used to connect to multiple database backends, or make it harder for hacker to directly call extDB3.

So for example

"extDB3" callExtension "9:ADD_DATABASE:Database1"
"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:Database1:SQL:SQL"
"extDB3" callExtension "0:SQL:SELECT * FROM PLAYERINFO"

Return Value

[1] // Loaded Protocol Ok  
[0, "Generic Error Message"] // ERROR  

Has to be done before LOCK

LOCK

"extDB3" callExtension "9:LOCK"

This is a real simple command. Once this is called it disables all System Commands except for VERSION + LOCK_STATUS + various TIME/DATA Commands. Not possible to Unlock.

"extDB3" callExtension "9:LOCK:qwerty"

This sets the unlock code to qwerty. This allows you to unlock extDB3 if you supply the correct code. LOCK_STATUS

"extDB3" callExtension "9:LOCK_STATUS"

Return Value

[0] // extension is unlocked.  
[1] // extension is locked.

UNLOCK

"extDB3" callExtension "9:UNLOCK:<code>"

Return Value

[0] // wrong unlock code.  
[1] // extension is unlocked.

RESET

"extDB3" callExtension "9:RESET"

This completes all outstanding jobs, so you don't need to worry. Basically this resets setup of extDB3 i.e closes All Database Connections & Protocols. extDB3 needs to be unlocked. This is usefully for when rotating missions or development work. Needs to enabled in main extdb3-conf.ini, disabled by default.

LOCAL_TIME

"extDB3" callExtension "9:LOCAL_TIME"
"extDB3" callExtension "9:LOCAL_TIME:3"
"extDB3" callExtension "9:LOCAL_TIME:[0,0,30,24,60,60]"

Returns Local Time Returns Local Time + 3 Hours Returns Local Time + 30 Days + 24 Hours + 60 Minutes + 60 Seconds Note: Years/Months not supported yet

UTC_TIME

"extDB3" callExtension "9:UTC_TIME"
"extDB3" callExtension "9:UTC_TIME:3"
"extDB3" callExtension "9:UTC_TIME:[0,0,30,24,60,60]"

Returns UTC Time Returns UTC Time + 3 Returns UTC Time + 30 Days + 24 Hours + 60 Minutes + 60 Seconds Note: Years/Months not supported yet

UPTIME

"extDB3" callExtension "9:UPTIME:SECONDS"
"extDB3" callExtension "9:UPTIME:MINUTES"
"extDB3" callExtension "9:UPTIME:HOURS"

Returns number of seconds/minutes/hours since the first callExtension. Useful for a rough idea of server uptime, i.e server restart warnings DATEADD

"extDB3" callExtension "9:DATEADD:[Year,Month,Day,Hour,Minute,Seconds]:[Days,Hours,Minutes,Seconds]"

Usefull to not have to work out the date i.e in 7 days time or 3 days ago etc

OUTPUTSIZE

"extDB3" callExtension "9:OUTPUTSIZE"

This is a just a debug command. This returns arma outputSize for extensions. outputSize is also logged to extDB3 log files when this command is called. So if you want you can just call this command before you LOCK the extension.