evennia.server.inputfuncs

Functions for processing input commands.

All global functions in this module whose name does not start with “_” is considered an inputfunc. Each function must have the following callsign (where inputfunc name is always lower-case, no matter what the OOB input name looked like):

inputfunc(session, *args, **kwargs)

Where “options” is always one of the kwargs, containing eventual protocol-options. There is one special function, the “default” function, which is called on a no-match. It has this callsign:

default(session, cmdname, *args, **kwargs)

Evennia knows which modules to use for inputfuncs by settings.INPUT_FUNC_MODULES.

evennia.server.inputfuncs.text(session, *args, **kwargs)[源代码]

Main text input from the client. This will execute a command string on the server.

参数
  • session (Session) – The active Session to receive the input.

  • text (str) – First arg is used as text-command input. Other arguments are ignored.

evennia.server.inputfuncs.bot_data_in(session, *args, **kwargs)[源代码]

Text input from the IRC and RSS bots. This will trigger the execute_cmd method on the bots in-game counterpart.

参数
  • session (Session) – The active Session to receive the input.

  • text (str) – First arg is text input. Other arguments are ignored.

evennia.server.inputfuncs.echo(session, *args, **kwargs)[源代码]

Echo test function

evennia.server.inputfuncs.default(session, cmdname, *args, **kwargs)[源代码]

Default catch-function. This is like all other input functions except it will get cmdname as the first argument.

evennia.server.inputfuncs.client_options(session, *args, **kwargs)[源代码]

This allows the client an OOB way to inform us about its name and capabilities. This will be integrated into the session settings

关键字参数
  • get (bool) – If this is true, return the settings as a dict (ignore all other kwargs).

  • client (str) – A client identifier, like “mushclient”.

  • version (str) – A client version

  • ansi (bool) – Supports ansi colors

  • xterm256 (bool) – Supports xterm256 colors or not

  • mxp (bool) – Supports MXP or not

  • utf-8 (bool) – Supports UTF-8 or not

  • screenreader (bool) – Screen-reader mode on/off

  • mccp (bool) – MCCP compression on/off

  • screenheight (int) – Screen height in lines

  • screenwidth (int) – Screen width in characters

  • autoresize (bool) – Use NAWS updates to dynamically adjust format

  • inputdebug (bool) – Debug input functions

  • nocolor (bool) – Strip color

  • raw (bool) – Turn off parsing

  • localecho (bool) – Turn on server-side echo (for clients not supporting it)

evennia.server.inputfuncs.get_client_options(session, *args, **kwargs)[源代码]

Alias wrapper for getting options.

evennia.server.inputfuncs.get_inputfuncs(session, *args, **kwargs)[源代码]

Get the keys of all available inputfuncs. Note that we don’t get it from this module alone since multiple modules could be added. So we get it from the sessionhandler.

evennia.server.inputfuncs.login(session, *args, **kwargs)[源代码]

Peform a login. This only works if session is currently not logged in. This will also automatically throttle too quick attempts.

关键字参数
  • name (str) – Account name

  • password (str) – Plain-text password

evennia.server.inputfuncs.get_value(session, *args, **kwargs)[源代码]

Return the value of a given attribute or db_property on the session’s current account or character.

关键字参数

name (str) – Name of info value to return. Only names in the _gettable dictionary earlier in this module are accepted.

evennia.server.inputfuncs.repeat(session, *args, **kwargs)[源代码]

Call a named function repeatedly. Note that this is meant as an example of limiting the number of possible call functions.

关键字参数
  • callback (str) – The function to call. Only functions from the _repeatable dictionary earlier in this module are available.

  • interval (int) –

    How often to call function (s). Defaults to once every 60 seconds with a minimum

    of 5 seconds.

  • stop (bool) – Stop a previously assigned ticker with the above settings.

evennia.server.inputfuncs.unrepeat(session, *args, **kwargs)[源代码]

Wrapper for OOB use

evennia.server.inputfuncs.monitor(session, *args, **kwargs)[源代码]

Adds monitoring to a given property or Attribute.

关键字参数
  • name (str) – The name of the property or Attribute to report. No db_* prefix is needed. Only names in the _monitorable dict earlier in this module are accepted.

  • stop (bool) – Stop monitoring the above name.

  • outputfunc_name (str, optional) – Change the name of the outputfunc name. This is used e.g. by MSDP which has its own specific output format.

evennia.server.inputfuncs.unmonitor(session, *args, **kwargs)[源代码]

Wrapper for turning off monitoring

evennia.server.inputfuncs.monitored(session, *args, **kwargs)[源代码]

Report on what is being monitored

evennia.server.inputfuncs.webclient_options(session, *args, **kwargs)[源代码]

Handles retrieving and changing of options related to the webclient.

If kwargs is empty (or contains just a “cmdid”), the saved options will be sent back to the session. A monitor handler will be created to inform the client of any future options that changes.

If kwargs is not empty, the key/values stored in there will be persisted to the account object.

关键字参数

name> (<option) – an option to save

evennia.server.inputfuncs.hello(session, *args, **kwargs)

This allows the client an OOB way to inform us about its name and capabilities. This will be integrated into the session settings

关键字参数
  • get (bool) – If this is true, return the settings as a dict (ignore all other kwargs).

  • client (str) – A client identifier, like “mushclient”.

  • version (str) – A client version

  • ansi (bool) – Supports ansi colors

  • xterm256 (bool) – Supports xterm256 colors or not

  • mxp (bool) – Supports MXP or not

  • utf-8 (bool) – Supports UTF-8 or not

  • screenreader (bool) – Screen-reader mode on/off

  • mccp (bool) – MCCP compression on/off

  • screenheight (int) – Screen height in lines

  • screenwidth (int) – Screen width in characters

  • autoresize (bool) – Use NAWS updates to dynamically adjust format

  • inputdebug (bool) – Debug input functions

  • nocolor (bool) – Strip color

  • raw (bool) – Turn off parsing

  • localecho (bool) – Turn on server-side echo (for clients not supporting it)

evennia.server.inputfuncs.supports_set(session, *args, **kwargs)

This allows the client an OOB way to inform us about its name and capabilities. This will be integrated into the session settings

关键字参数
  • get (bool) – If this is true, return the settings as a dict (ignore all other kwargs).

  • client (str) – A client identifier, like “mushclient”.

  • version (str) – A client version

  • ansi (bool) – Supports ansi colors

  • xterm256 (bool) – Supports xterm256 colors or not

  • mxp (bool) – Supports MXP or not

  • utf-8 (bool) – Supports UTF-8 or not

  • screenreader (bool) – Screen-reader mode on/off

  • mccp (bool) – MCCP compression on/off

  • screenheight (int) – Screen height in lines

  • screenwidth (int) – Screen width in characters

  • autoresize (bool) – Use NAWS updates to dynamically adjust format

  • inputdebug (bool) – Debug input functions

  • nocolor (bool) – Strip color

  • raw (bool) – Turn off parsing

  • localecho (bool) – Turn on server-side echo (for clients not supporting it)

evennia.server.inputfuncs.msdp_list(session, *args, **kwargs)[源代码]

MSDP LIST command

evennia.server.inputfuncs.msdp_report(session, *args, **kwargs)[源代码]

MSDP REPORT command

evennia.server.inputfuncs.msdp_unreport(session, *args, **kwargs)[源代码]

MSDP UNREPORT command

evennia.server.inputfuncs.msdp_send(session, *args, **kwargs)[源代码]

MSDP SEND command

evennia.server.inputfuncs.external_discord_hello(session, *args, **kwargs)

Dummy used to swallow missing-inputfunc errors for common clients.

evennia.server.inputfuncs.client_gui(session, *args, **kwargs)

Dummy used to swallow missing-inputfunc errors for common clients.