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: twisted.application.service.MultiService

__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

server_maintenance()[source]

This maintenance function handles repeated checks and updates that the server needs to do. It is called every minute.

process_idle_timeouts()[source]
privilegedStartService()[source]
register_plugins()[source]
register_amp()[source]
register_webserver()[source]
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’

create_default_channels()[source]

check so default channels exist on every restart, create if not.

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.

get_info_dict()[source]

Return the server info, for display.

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_server_reload_start()[source]

This is called only when server starts back up after a reload.

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’.

at_server_reload_stop()[source]

This is called only time the server stops before a reload.

at_server_cold_start()[source]

This is called only when the server starts “cold”, i.e. after a shutdown or a reset.

at_server_cold_stop()[source]

This is called only when the server goes down due to a shutdown or reset.