class Gamefic::Mud::State::Play

The typical gameplay handler. This state processes client messages as commands to be executed by the player's character.

Public Instance Methods

process(message) click to toggle source
# File lib/gamefic-mud/state/play.rb, line 16
def process message
  adapter.character.queue.push message unless message == ''
end
start() click to toggle source
# File lib/gamefic-mud/state/play.rb, line 8
def start
  adapter.plot.introduce adapter.character
  # Since the game is already running when the player connects, the
  # plot update flushes messages received in the introduction. We're
  # working around the problem by sending them here.
  adapter.update({ messages: adapter.character.messages })
end