+ Besides variables, the engine also support functions that can be executed. These are commands + that can be typed into the console that will trigger some kind of response. +
+ In the previous section we had already met the list_var function, + which will print a list of available variables to the console. Similar, the + list_var function, wich will print a list of available functions: +
++>list_func + bind [key] [str] bind a command to a key + connect [ip] without ip, create a game + disconnect leave the current game + G intro [int] view specified introduction + . + . + . + view_next switch to next view + view_prev switch to previous view + S who get a list of connected players +Flags: G=Game S=Shared + 61 registered functions ++
+ Type a function's name into the console followed by enter to execute it. Some functions + require aditional parameters to work currectly. +
+ + Like variables, functions can have special flags that indicates their type: +
-
+
- Game +
- This is a game function and can only be executed by players. These functions + are used to interact with the game and includes commands like + buy and trade. + +
- Shared +
- These functions can be executed by both players and server administrators. +
-
+
+
- Functions without flags can only be executed through the local console. +
+ To understand the flow of commands we illustrate three different situations: +
-
+
- Playing a local game +
- In this case you're not connected to a remote server but are, in fact, + running your own, private server. You're both the player and the server administrator + and you'll be able to execute any function. +
- Playing on a remote server +
- If you're connected to a remote server and you execute a function, the engine will + first check if the function exists locally. The function you want to execute + could be client releated, like screenshot. Only functions + without flags can be executed this way. If the function does not exist, the engine will + send the command to the remote server. The remote server will check if the functions + exists and has the game flag set. If this is the case, the function will get executed + on the server. +
- Running a dedicated server +
- If you're using the dedicated server's command console, you can only execute + functions with the Shared flag set, and functions without the Game flag set. It doesn't + make sense or administrators to execute game functions, since they do not participate + as players in the game. +