Mod Loading Class

Modification loader class code for ScalyMUCK. This class is used to store and track loaded modifications that are in use by the server application

class modloader.ModLoader(world=None, interface=None, session=None, workdir=None, permissions=None)[source]

Mod loading class for ScalyMUCK.

__init__(world=None, interface=None, session=None, workdir=None, permissions=None)[source]

Initializes an instance of the ScalyMUCK mod loader.

There are several keyword arguments that should be used with this __init__ command:
  • world – An instance of the game.World object to be used with this ModLoader.
  • interface – An instance of the game.Interface object to be used with this ModLoader.
  • session – An active database session from SQLAlchemy to be used with this ModLoader.
  • workdir – The work directory of the current running application.
  • permissions – An instance of the game.Permissions object to be used with this ModLoader.
command_load(**kwargs)[source]

Internal command to load mods.

command_mods(**kwargs)[source]

Internal command to list installed mods.

command_unload(**kwargs)[source]

Internal command to unload mods.

commands = {}

A dictionary of all loaded commands. The keys are the actual name a command is referred to by and said keys point to Python functions to be called upon use.

find_command(name)[source]

Returns a command by name.

load(modifications)[source]

Loads a semicolon deliminated list of modifications from application/game.

If any of the specified modifications happen to already be loaded into ScalyMUCK, they are merely reloaded so that any changes made since the last load will be applied and take affect.

Note

If there happens to be a low-level Python error (IE: SyntaxError) then the server application will merely crash as of the moment. Same goes for any internal errors in a mod code base that happen to raise an exception that is not derived from one of the exception classes in game.Exception.

modifications = {}

A dictionary of all loaded modifications. The keys are the internal name of the mod and each key refers to a tuple with the following format: (instance, module).

set_defaults()[source]

This command merely makes sure that the core commands are loaded.

It should be called everytime a modification is loaded in order to guarantee that a modification doesn’t attempt to overwrite the core commands, even though by standard they shouldn’t be defining these commands in the first place.

Previous topic

User Interface Class

Next topic

Exception Classes

This Page