Changes between Initial Version and Version 1 of Hooks


Ignore:
Timestamp:
May 26, 2014, 8:10:56 PM (10 years ago)
Author:
Christian Illy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Hooks

    v1 v1  
     1Hooks are a way to add additional behaviour to the scripts. They are basically custom scripts that are called upon specific events. For example one could define a hook which is called on player connects and then send a message in the in-game chat to greet the new player.
     2
     3All hooks have to executable files in ''SDTD_BASE/<name of hook>/<any name>.sh''.
     4
     5Currently the following hooks are defined:
     6
     7* playerConnect
     8  * Called after a player has connected
     9  * Passed parameters:
     10    1. Instance name
     11    1. Player ID
     12    1. Entity ID
     13    1. Nickname
     14    1. Steam ID
     15* playerDisconnect
     16  * Called after player has disconnected
     17  * Passed parameters:
     18    1. Instance name
     19    1. Player ID
     20    1. Entity ID
     21    1. Nickname
     22    1. Steam ID
     23* serverPreStart
     24  * Called before an instance is started
     25  * Passed parameters:
     26    1. Instance name
     27* serverPostStart
     28  * Called after an instance was started
     29  * Passed parameters:
     30    1. Instance name
     31* serverPreStop
     32  * Called before an instance is stopped
     33  * Passed parameters:
     34    1. Instance name
     35* serverPostStop
     36  * Called after an instance was stopped
     37  * Passed parameters:
     38    1. Instance name