matt-jordan/mjmud — pull request #4 by matt-jordan (2014-12-28 17:47:22+00:00)
Title: command_set: Add the notion of commands

This patch adds the notion of commands to the game engine. Commands are wrapped
and managed by command sets, which parse JSON objects into a command. The
command objects themselves are responsible for executing themselves, and
returning messages to be sent to the engine and/or clients.

Specifically, this patch adds:
- An ICommandSet, ICommand, and ICommandResponse interfaces.
- The 'standard' command set, an ICommandSet that provides the normal
in-game commands.
- A set of tests for basic parsing in the StandardCommandSet class
- A set of tests for the say command
- A set of tests for the quit command
- Removed message handling code from WebSocketServerReceiver. This was always
a temporary place holder, as explicit message handling code should be in the
game namespace.
- Add an 'app_state' object attribute to MudWebSocketServerProtocol. This will
track the application state for the protocol, and is created for the protocol
by an explicit instance of WebSocketServerReceiver.
- Update ICommandResponse to contain a standard destination field. Note that
at some point in time, ICommandResponse should be renamed to something more
accurate, as it really isn't a command response.
- Add a temporary coordinator, which maintains the application state for the
protocol connections. This module should eventually go away, and get replaced
by a real initialization system and better application state management.
- Remove factory/protocol/receiver setup from bin/mud.py
- Add to_json handlers for quit_command say_command. Note that this could
get tweaked up further, once we have a better schema for our messages.
- Update bin/mudclient with expected response messages for 'quit' and 'say'