 ratings = require('./ratings')
 config = require('./config')
 alts = require('./alts')
+
+MAX_MESSAGE_LENGTH = 250
 
 @createServer = (port) ->
   app = express()

              user.send('altList', alts)

    'sendChat': (user, message) ->
      return  unless typeof message == "string" && message.trim().length > 0
      if message[0] == '/'
        [ command, args... ] = message.split(/\s+/)
        command = command.substr(1)

        server.userMessage(lobby, user, message)

    'sendBattleChat': (user, battleId, message) ->
      return  if typeof message != "string"
      return  if message.trim().length == 0
      return  if message.length > MAX_MESSAGE_LENGTH
      battle = server.findBattle(battleId)
      if !battle
        user.error(errors.BATTLE_DNE)
