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

ratings = require('./ratings')
config = require('./config')
alts = require('./alts')

@createServer = (port) ->
  app = express()

        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)
