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)'
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)'
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)'
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)'
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)'
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 = ['db', 'listobjects', 'stats', 'listobjs']
locks = 'cmd:perm(listobjects) or perm(Builder)'
help_category = 'system'
func()[source]

Implement the command

lock_storage = 'cmd:perm(listobjects) or perm(Builder)'
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)'
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()'
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)'
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)'
class evennia.commands.default.system.CmdAccounts(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

Manage registered accounts

Usage:

accounts [nr] accounts/delete <name or #id> [: reason]

Switches:

delete - delete an account from the server

By default, lists statistics about the Accounts registered with the game. It will list the <nr> amount of latest registered accounts If not given, <nr> defaults to 10.

key = 'accounts'
aliases = ['account', 'listaccounts']
switch_options = ('delete',)
locks = 'cmd:perm(listaccounts) or perm(Admin)'
help_category = 'system'
func()[source]

List the accounts

lock_storage = 'cmd:perm(listaccounts) or perm(Admin)'
class evennia.commands.default.system.CmdTickers(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

View running tickers

Usage:

tickers

Note: Tickers are created, stopped and manipulated in Python code using the TickerHandler. This is merely a convenience function for inspecting the current status.

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

This is the hook function that actually does all the work. It is called by the cmdhandler right after self.parser() finishes, and so has access to all the variables defined therein.

aliases = []
lock_storage = 'cmd:perm(tickers) or perm(Builder)'