Server Side Scripting – ArmA: Armed Assault

From Bohemia Interactive Community
Jump to navigation Jump to search
(Transferred from internal docs - WIP, translation needed)
 
m (Text replacement - "server.cfg" to "server config")
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The server has a separate Virtual Machine (VM) running administration scripts. This VM is completely independent on the game scripting environment and is designed to automate some administration tasks related to player administration and cheat detection. The basic way how scripts are executed is via event handlers reacting to some typical events, server admin can also execute individual commands using a chat command #exec.
The server has a separate Virtual Machine (VM) running administration scripts. This VM is completely independent on the game scripting environment and is designed to automate some administration tasks related to player administration and cheat detection. The basic way how scripts are executed is via event handlers reacting to some typical events, server admin can also execute individual commands using a chat command #exec.


Event handlers are defined in [[server.cfg]] file.
Event handlers are defined in [[Arma 3: Server Config File|server config]] file.


The scripting language shares the core (overall structure and syntax, arithmetic operations, control structures) with the scripting used in the game. The are a few commands specific to Server Side Scripting:
The scripting language shares the core (overall structure and syntax, arithmetic operations, control structures) with the scripting used in the game. There are a few commands specific to Server Side Scripting:


{| border="true"
{| class="wikitable"
! příkaz !! popis
! command !! description
|-
|-
|  users || vrací pole uživatelů, uživatel je popsán jako pár [id,name]
|  users || list of users, each user is described as [id,name] array
|-
|-
|  ban id || přidat uživatele id do ban listu
|  ban id (sometext) || add given user id into the ban list, with an optional text
|-
|-
|  kick id || vykopnout uživatele ze serveru
|  kick id (sometext)|| kick off given user id from the server, with an optional text
|-
|-
|  level checkFile [id,name] || provést test integrity souboru name u hráče id, level udává důkladnost testu
|  level checkFile [id,file index] || check [[ArmA: Addon Signatures|signature]] for a file with given index on given user computer, level determines test depth (0 = default, 1 = deep. Note: deep can be very slow)
|-
|-
|  level checkFile [id,index]  || provést test integrity se souborem s daným indexem u hráče id
|  numberOfFiles id || number of addons files used for given player - can be used to determine suitable values for checkFile
|-
|  numberOfFiles id || počet používaných souborů pro daného hráče
|-
|  listOfFiles id || seznam názvů používaných souborů pro daného hráče
|-
|  level checkExe id ||  provést test integrity exe u hráče id
|}
|}


Following event handlers are executed:
Following event handlers are executed:


{| border="true"
{| class="wikitable"
! událost !! popis !! parametry handleru
! event !! description !! handler parameters
|-
|  doubleIdDetected || 2nd user with the same ID detected || user id
|-
|-
doubleIdDetected || detekováni dva uživatelé se stejným id || id uživatele
onUserConnected || user has connected || user id
|-
|-
onUserConnected || reakce na připojení uživatele || id uživatele
onUserDisconnected || user has disconnected  || user id
|-
|-
onUserDisconnected || reakce na odpojení uživatele || id uživatele
onHackedData || modification of signed pbo detected || user id, file name
|-
|-
onHackedData || zjištěna manipulace s pbo soubory  || id uživatele, název souboru
onDifferentData || signed pbo detected with a valid signature, but a different version than a server has (very strict test, use sparingly, no longer supported in Arma 2 OA 95232) || user id, file name
|-
|-
onDifferentData || zjištěn soubor odlišný od verze na serveru, s platným podpisem || id uživatele, název souboru
onUnsignedData || unsigned data detected || user id, file name
|-
|-
onUnsignedData || zjištěn soubor bez podpisu || id uživatele, název souboru
onUserKicked || if a user is kicked || user id, kick type ID, reason
|-
|-
|  regularCheck || volána pro každého uživatele víceméně pravidelně, s náhodnou variací || id uživatele, pořadové číslo testu
|  regularCheck || called time by time for each user, test index is growing, example:  ''0 checkFile _this'' || user id, test index
|}
|}


[[Category:ArmA: Multiplayer|Server Side Scripting]]
{{Feature|important|NOTE: Be careful with onDifferentData. This "kick (_this select 0)"; will also kick players with only a different, but valid, version of a PBO than the server.}}
 
 
{{GameCategory|arma1|Multiplayer}}

Latest revision as of 13:36, 17 May 2024

The server has a separate Virtual Machine (VM) running administration scripts. This VM is completely independent on the game scripting environment and is designed to automate some administration tasks related to player administration and cheat detection. The basic way how scripts are executed is via event handlers reacting to some typical events, server admin can also execute individual commands using a chat command #exec.

Event handlers are defined in server config file.

The scripting language shares the core (overall structure and syntax, arithmetic operations, control structures) with the scripting used in the game. There are a few commands specific to Server Side Scripting:

command description
users list of users, each user is described as [id,name] array
ban id (sometext) add given user id into the ban list, with an optional text
kick id (sometext) kick off given user id from the server, with an optional text
level checkFile [id,file index] check signature for a file with given index on given user computer, level determines test depth (0 = default, 1 = deep. Note: deep can be very slow)
numberOfFiles id number of addons files used for given player - can be used to determine suitable values for checkFile

Following event handlers are executed:

event description handler parameters
doubleIdDetected 2nd user with the same ID detected user id
onUserConnected user has connected user id
onUserDisconnected user has disconnected user id
onHackedData modification of signed pbo detected user id, file name
onDifferentData signed pbo detected with a valid signature, but a different version than a server has (very strict test, use sparingly, no longer supported in Arma 2 OA 95232) user id, file name
onUnsignedData unsigned data detected user id, file name
onUserKicked if a user is kicked user id, kick type ID, reason
regularCheck called time by time for each user, test index is growing, example: 0 checkFile _this user id, test index
NOTE: Be careful with onDifferentData. This "kick (_this select 0)"; will also kick players with only a different, but valid, version of a PBO than the server.