evennia.server.profiling.dummyrunner_settings¶
Settings and actions for the dummyrunner
This module defines dummyrunner settings and sets up the actions available to dummy accounts.
The settings are global variables:
TIMESTEP - time in seconds between each ‘tick’. 1 is a good start.
CHANCE_OF_ACTION - chance 0-1 of action happening. Default is 0.5.
CHANCE_OF_LOGIN - chance 0-1 of login happening. 0.01 is a good number.
TELNET_PORT - port to use, defaults to settings.TELNET_PORT
ACTIONS - see below
ACTIONS is a tuple
(login_func, logout_func, (0.3, func1), (0.1, func2) ... )
where the first entry is the function to call on first connect, with a chance of occurring given by CHANCE_OF_LOGIN. This function is usually responsible for logging in the account. The second entry is always called when the dummyrunner disconnects from the server and should thus issue a logout command. The other entries are tuples (chance, func). They are picked randomly, their commonality based on the cumulative chance given (the chance is normalized between all options so if will still work also if the given chances don’t add up to 1).
The PROFILE variable define pre-made ACTION tuples for convenience.
Each function should return an iterable of one or more command-call strings (like “look here”), so each can group multiple command operations.
An action-function is called with a “client” argument which is a reference to the dummy client currently performing the action.
The client object has the following relevant properties and methods:
key - an optional client key. This is only used for dummyrunner output. Default is “Dummy-<cid>”
cid - client id
gid - globally unique id, hashed with time stamp
istep - the current step
exits - an empty list. Can be used to store exit names
objs - an empty list. Can be used to store object names
counter() - returns a unique increasing id, hashed with time stamp to make it unique also between dummyrunner instances.
The return should either be a single command string or a tuple of command strings. This list of commands will always be executed every TIMESTEP with a chance given by CHANCE_OF_ACTION by in the order given (no randomness) and allows for setting up a more complex chain of commands (such as creating an account and logging in).
-
evennia.server.profiling.dummyrunner_settings.
c_login_nodig
(client)[source]¶ logins, don’t dig its own room
-
evennia.server.profiling.dummyrunner_settings.
c_digs
(client)[source]¶ digs a new room, storing exit names on client
-
evennia.server.profiling.dummyrunner_settings.
c_creates_obj
(client)[source]¶ creates normal objects, storing their name on client
creates example button, storing name on client
socializechats on channel
-
evennia.server.profiling.dummyrunner_settings.
c_moves
(client)[source]¶ moves to a previously created room, using the stored exits
-
evennia.server.profiling.dummyrunner_settings.
c_moves_n
(client)[source]¶ move through north exit if available
-
evennia.server.profiling.dummyrunner_settings.
c_moves_s
(client)[source]¶ move through south exit if available
-
evennia.server.profiling.dummyrunner_settings.
c_measure_lag
(client)[source]¶ Special dummyrunner command, injected in c_login. It measures response time. Including this in the ACTION tuple will give more dummyrunner output about just how fast commands are being processed.
The dummyrunner will treat this special and inject the {timestamp} just before sending.