Added at_server_start() and at_server_stop() hooks to allow users to safely initialize their custom systems whenever the server restarts.
This commit is contained in:
parent
7818ca077a
commit
309c03ce43
7 changed files with 81 additions and 33 deletions
30
game/gamesrc/conf/at_server_startstop.py
Normal file
30
game/gamesrc/conf/at_server_startstop.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"""
|
||||
This module contains functions that are imported and called by the
|
||||
server whenever it changes its running status. At the point these
|
||||
functions are run, all applicable hooks on individual objects have
|
||||
already been executed. The main purpose of this is module is to have a
|
||||
safe place to initialize eventual custom modules that your game needs
|
||||
to start up or load.
|
||||
|
||||
The module should define at least these global functions:
|
||||
|
||||
at_server_start()
|
||||
at_server_stop()
|
||||
|
||||
The module used is defined by settings.AT_SERVER_STARTSTOP_MODULE.
|
||||
|
||||
"""
|
||||
|
||||
def at_server_start():
|
||||
"""
|
||||
This is called every time the server starts up (also after a
|
||||
reload or reset).
|
||||
"""
|
||||
pass
|
||||
|
||||
def at_server_stop():
|
||||
"""
|
||||
This is called just before a server is shut down, reloaded or
|
||||
reset.
|
||||
"""
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue