evennia.commands.default.system

System commands

class evennia.commands.default.system.CmdReload(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

reload the server

Usage:

reload [reason]

This restarts the server. The Portal is not affected. Non-persistent scripts will survive a reload (use reset to purge) and at_reload() hooks will be called.

key = 'reload'
aliases = ['restart']
locks = 'cmd:perm(reload) or perm(Developer)'
help_category = 'system'
func()[source]

Reload the system.

lock_storage = 'cmd:perm(reload) or perm(Developer)'
search_index_entry = {'aliases': 'restart', 'category': 'system', 'key': 'reload', 'tags': '', 'text': '\n reload the server\n\n Usage:\n reload [reason]\n\n This restarts the server. The Portal is not\n affected. Non-persistent scripts will survive a reload (use\n reset to purge) and at_reload() hooks will be called.\n '}
class evennia.commands.default.system.CmdReset(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

reset and reboot the server

Usage:

reset

Notes

For normal updating you are recommended to use reload rather than this command. Use shutdown for a complete stop of everything.

This emulates a cold reboot of the Server component of Evennia. The difference to shutdown is that the Server will auto-reboot and that it does not affect the Portal, so no users will be disconnected. Contrary to reload however, all shutdown hooks will be called and any non-database saved scripts, ndb-attributes, cmdsets etc will be wiped.

key = 'reset'
aliases = ['reboot']
locks = 'cmd:perm(reload) or perm(Developer)'
help_category = 'system'
func()[source]

Reload the system.

lock_storage = 'cmd:perm(reload) or perm(Developer)'
search_index_entry = {'aliases': 'reboot', 'category': 'system', 'key': 'reset', 'tags': '', 'text': '\n reset and reboot the server\n\n Usage:\n reset\n\n Notes:\n For normal updating you are recommended to use reload rather\n than this command. Use shutdown for a complete stop of\n everything.\n\n This emulates a cold reboot of the Server component of Evennia.\n The difference to shutdown is that the Server will auto-reboot\n and that it does not affect the Portal, so no users will be\n disconnected. Contrary to reload however, all shutdown hooks will\n be called and any non-database saved scripts, ndb-attributes,\n cmdsets etc will be wiped.\n\n '}
class evennia.commands.default.system.CmdShutdown(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

stop the server completely

Usage:

shutdown [announcement]

Gracefully shut down both Server and Portal.

key = 'shutdown'
locks = 'cmd:perm(shutdown) or perm(Developer)'
help_category = 'system'
func()[source]

Define function

aliases = []
lock_storage = 'cmd:perm(shutdown) or perm(Developer)'
search_index_entry = {'aliases': '', 'category': 'system', 'key': 'shutdown', 'tags': '', 'text': '\n stop the server completely\n\n Usage:\n shutdown [announcement]\n\n Gracefully shut down both Server and Portal.\n '}
class evennia.commands.default.system.CmdPy(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

execute a snippet of python code

Usage:

py [cmd] py/edit py/time <cmd> py/clientraw <cmd> py/noecho

Switches:

time - output an approximate execution time for <cmd> edit - open a code editor for multi-line code experimentation clientraw - turn off all client-specific escaping. Note that this may

lead to different output depending on prototocol (such as angular brackets being parsed as HTML in the webclient but not in telnet clients)

noecho - in Python console mode, turn off the input echo (e.g. if your client

does this for you already)

Without argument, open a Python console in-game. This is a full console, accepting multi-line Python code for testing and debugging. Type exit() to return to the game. If Evennia is reloaded, the console will be closed.

Enter a line of instruction after the ‘py’ command to execute it immediately. Separate multiple commands by ‘;’ or open the code editor using the /edit switch (all lines added in editor will be executed immediately when closing or using the execute command in the editor).

A few variables are made available for convenience in order to offer access to the system (you can import more at execution time).

Available variables in py environment:

self, me : caller here : caller.location evennia : the evennia API inherits_from(obj, parent) : check object inheritance

You can explore The evennia API from inside the game by calling the __doc__ property on entities:

py evennia.__doc__ py evennia.managers.__doc__

|rNote: In the wrong hands this command is a severe security risk. It should only be accessible by trusted server admins/superusers.|n

key = 'py'
aliases = ['!']
switch_options = ('time', 'edit', 'clientraw', 'noecho')
locks = 'cmd:perm(py) or perm(Developer)'
help_category = 'system'
func()[source]

hook function

lock_storage = 'cmd:perm(py) or perm(Developer)'
search_index_entry = {'aliases': '!', 'category': 'system', 'key': 'py', 'tags': '', 'text': "\n execute a snippet of python code\n\n Usage:\n py [cmd]\n py/edit\n py/time <cmd>\n py/clientraw <cmd>\n py/noecho\n\n Switches:\n time - output an approximate execution time for <cmd>\n edit - open a code editor for multi-line code experimentation\n clientraw - turn off all client-specific escaping. Note that this may\n lead to different output depending on prototocol (such as angular brackets\n being parsed as HTML in the webclient but not in telnet clients)\n noecho - in Python console mode, turn off the input echo (e.g. if your client\n does this for you already)\n\n Without argument, open a Python console in-game. This is a full console,\n accepting multi-line Python code for testing and debugging. Type `exit()` to\n return to the game. If Evennia is reloaded, the console will be closed.\n\n Enter a line of instruction after the 'py' command to execute it\n immediately. Separate multiple commands by ';' or open the code editor\n using the /edit switch (all lines added in editor will be executed\n immediately when closing or using the execute command in the editor).\n\n A few variables are made available for convenience in order to offer access\n to the system (you can import more at execution time).\n\n Available variables in py environment:\n self, me : caller\n here : caller.location\n evennia : the evennia API\n inherits_from(obj, parent) : check object inheritance\n\n You can explore The evennia API from inside the game by calling\n the `__doc__` property on entities:\n py evennia.__doc__\n py evennia.managers.__doc__\n\n |rNote: In the wrong hands this command is a severe security risk. It\n should only be accessible by trusted server admins/superusers.|n\n\n "}
class evennia.commands.default.system.CmdScripts(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

list and manage all running scripts

Usage:

scripts[/switches] [#dbref, key, script.path or <obj>]

Switches:

start - start a script (must supply a script path) stop - stops an existing script kill - kills a script - without running its cleanup hooks validate - run a validation on the script(s)

If no switches are given, this command just views all active scripts. The argument can be either an object, at which point it will be searched for all scripts defined on it, or a script name or #dbref. For using the /stop switch, a unique script #dbref is required since whole classes of scripts often have the same name.

Use script for managing commands on objects.

key = 'scripts'
aliases = ['listscripts', 'globalscript']
switch_options = ('start', 'stop', 'kill', 'validate')
locks = 'cmd:perm(listscripts) or perm(Admin)'
help_category = 'system'
excluded_typeclass_paths = ['evennia.prototypes.prototypes.DbPrototype']
func()[source]

implement method

lock_storage = 'cmd:perm(listscripts) or perm(Admin)'
search_index_entry = {'aliases': 'listscripts globalscript', 'category': 'system', 'key': 'scripts', 'tags': '', 'text': '\n list and manage all running scripts\n\n Usage:\n scripts[/switches] [#dbref, key, script.path or <obj>]\n\n Switches:\n start - start a script (must supply a script path)\n stop - stops an existing script\n kill - kills a script - without running its cleanup hooks\n validate - run a validation on the script(s)\n\n If no switches are given, this command just views all active\n scripts. The argument can be either an object, at which point it\n will be searched for all scripts defined on it, or a script name\n or #dbref. For using the /stop switch, a unique script #dbref is\n required since whole classes of scripts often have the same name.\n\n Use script for managing commands on objects.\n '}
class evennia.commands.default.system.CmdObjects(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

statistics on objects in the database

Usage:

objects [<nr>]

Gives statictics on objects in database as well as a list of <nr> latest objects in database. If not given, <nr> defaults to 10.

key = 'objects'
aliases = ['listobjs', 'stats', 'listobjects', 'db']
locks = 'cmd:perm(listobjects) or perm(Builder)'
help_category = 'system'
func()[source]

Implement the command

lock_storage = 'cmd:perm(listobjects) or perm(Builder)'
search_index_entry = {'aliases': 'listobjs stats listobjects db', 'category': 'system', 'key': 'objects', 'tags': '', 'text': '\n statistics on objects in the database\n\n Usage:\n objects [<nr>]\n\n Gives statictics on objects in database as well as\n a list of <nr> latest objects in database. If not\n given, <nr> defaults to 10.\n '}
class evennia.commands.default.system.CmdService(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

manage system services

Usage:

service[/switch] <service>

Switches:

list - shows all available services (default) start - activates or reactivate a service stop - stops/inactivate a service (can often be restarted) delete - tries to permanently remove a service

Service management system. Allows for the listing, starting, and stopping of services. If no switches are given, services will be listed. Note that to operate on the service you have to supply the full (green or red) name as given in the list.

key = 'service'
aliases = ['services']
switch_options = ('list', 'start', 'stop', 'delete')
locks = 'cmd:perm(service) or perm(Developer)'
help_category = 'system'
func()[source]

Implement command

lock_storage = 'cmd:perm(service) or perm(Developer)'
search_index_entry = {'aliases': 'services', 'category': 'system', 'key': 'service', 'tags': '', 'text': '\n manage system services\n\n Usage:\n service[/switch] <service>\n\n Switches:\n list - shows all available services (default)\n start - activates or reactivate a service\n stop - stops/inactivate a service (can often be restarted)\n delete - tries to permanently remove a service\n\n Service management system. Allows for the listing,\n starting, and stopping of services. If no switches\n are given, services will be listed. Note that to operate on the\n service you have to supply the full (green or red) name as given\n in the list.\n '}
class evennia.commands.default.system.CmdAbout(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

show Evennia info

Usage:

about

Display info about the game engine.

key = 'about'
aliases = ['version']
locks = 'cmd:all()'
help_category = 'system'
func()[source]

Display information about server or target

lock_storage = 'cmd:all()'
search_index_entry = {'aliases': 'version', 'category': 'system', 'key': 'about', 'tags': '', 'text': '\n show Evennia info\n\n Usage:\n about\n\n Display info about the game engine.\n '}
class evennia.commands.default.system.CmdTime(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

show server time statistics

Usage:

time

List Server time statistics such as uptime and the current time stamp.

key = 'time'
aliases = ['uptime']
locks = 'cmd:perm(time) or perm(Player)'
help_category = 'system'
func()[source]

Show server time data in a table.

lock_storage = 'cmd:perm(time) or perm(Player)'
search_index_entry = {'aliases': 'uptime', 'category': 'system', 'key': 'time', 'tags': '', 'text': '\n show server time statistics\n\n Usage:\n time\n\n List Server time statistics such as uptime\n and the current time stamp.\n '}
class evennia.commands.default.system.CmdServerLoad(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

show server load and memory statistics

Usage:

server[/mem]

Switches:

mem - return only a string of the current memory usage flushmem - flush the idmapper cache

This command shows server load statistics and dynamic memory usage. It also allows to flush the cache of accessed database objects.

Some Important statistics in the table:

|wServer load|n is an average of processor usage. It’s usually between 0 (no usage) and 1 (100% usage), but may also be temporarily higher if your computer has multiple CPU cores.

The |wResident/Virtual memory|n displays the total memory used by the server process.

Evennia |wcaches|n all retrieved database entities when they are loaded by use of the idmapper functionality. This allows Evennia to maintain the same instances of an entity and allowing non-persistent storage schemes. The total amount of cached objects are displayed plus a breakdown of database object types.

The |wflushmem|n switch allows to flush the object cache. Please note that due to how Python’s memory management works, releasing caches may not show you a lower Residual/Virtual memory footprint, the released memory will instead be re-used by the program.

key = 'server'
aliases = ['serverload', 'serverprocess']
switch_options = ('mem', 'flushmem')
locks = 'cmd:perm(list) or perm(Developer)'
help_category = 'system'
func()[source]

Show list.

lock_storage = 'cmd:perm(list) or perm(Developer)'
search_index_entry = {'aliases': 'serverload serverprocess', 'category': 'system', 'key': 'server', 'tags': '', 'text': "\n show server load and memory statistics\n\n Usage:\n server[/mem]\n\n Switches:\n mem - return only a string of the current memory usage\n flushmem - flush the idmapper cache\n\n This command shows server load statistics and dynamic memory\n usage. It also allows to flush the cache of accessed database\n objects.\n\n Some Important statistics in the table:\n\n |wServer load|n is an average of processor usage. It's usually\n between 0 (no usage) and 1 (100% usage), but may also be\n temporarily higher if your computer has multiple CPU cores.\n\n The |wResident/Virtual memory|n displays the total memory used by\n the server process.\n\n Evennia |wcaches|n all retrieved database entities when they are\n loaded by use of the idmapper functionality. This allows Evennia\n to maintain the same instances of an entity and allowing\n non-persistent storage schemes. The total amount of cached objects\n are displayed plus a breakdown of database object types.\n\n The |wflushmem|n switch allows to flush the object cache. Please\n note that due to how Python's memory management works, releasing\n caches may not show you a lower Residual/Virtual memory footprint,\n the released memory will instead be re-used by the program.\n\n "}