evennia.server.service¶
This module contains the main EvenniaService class, which is the very core of the Evennia server. It is instantiated by the evennia/server/server.py module.
- class evennia.server.service.EvenniaServerService(*args, **kwargs)[source]¶
Bases:
MultiService
- server_maintenance()[source]¶
This maintenance function handles repeated checks and updates that the server needs to do. It is called every minute.
- sqlite3_prep()[source]¶
Optimize some SQLite stuff at startup since we can’t save it to the database.
- update_defaults()[source]¶
We make sure to store the most important object defaults here, so we can catch if they change and update them on-objects automatically. This allows for changing default cmdset locations and default typeclasses in the settings file and have them auto-update all already existing objects.
- run_initial_setup()[source]¶
This is triggered by the amp protocol when the connection to the portal has been established. This attempts to run the initial_setup script of the server. It returns if this is not the first time the server starts. Once finished the last_initial_setup_step is set to ‘done’
- run_init_hooks(mode)[source]¶
Called by the amp client once receiving sync back from Portal
- Parameters:
mode (str) – One of shutdown, reload or reset
- shutdown(mode='reload', _reactor_stopping=False)[source]¶
Shuts down the server from inside it.
- mode - sets the server restart mode.
‘reload’ - server restarts, no “persistent” scripts are stopped, at_reload hooks called.
‘reset’ - server restarts, non-persistent scripts stopped, at_shutdown hooks called but sessions will not be disconnected.
‘shutdown’ - like reset, but server will not auto-restart.
- _reactor_stopping - this is set if server is stopped by a kill
command OR this method was already called once - in both cases the reactor is dead/stopping already.
- at_server_init()[source]¶
This is called first when the server is starting, before any other hooks, regardless of how it’s starting.
- at_server_start()[source]¶
This is called every time the server starts up, regardless of how it was shut down.
- at_server_stop()[source]¶
This is called just before a server is shut down, regardless of it is fore a reload, reset or shutdown.
- at_post_portal_sync(mode)[source]¶
This is called just after the portal has finished syncing back data to the server after reconnecting.
- Parameters:
mode (str) – One of ‘reload’, ‘reset’ or ‘shutdown’.