mode.rb 247 B

1234567891011121314
  1. # different modes of the client state
  2. module Mode
  3. def do_command(str)
  4. met = "on_#{@state}".to_sym
  5. if self.respond_to?(met)
  6. self.send(met, str)
  7. else
  8. log "Unknown state #{@state}"
  9. @state = :login
  10. end
  11. end
  12. end