@Override
	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
		lastEvent = e;
		lastActivity = System.currentTimeMillis();
		
		//Grab command byte and message	
		Object[] obj = (Object[])e.getMessage();	
		ChatCommand cmd = (ChatCommand)obj[0];
		String message = (String)obj[1];
		
		switch (cmd) {
			case TEXT_ONE:
				//Client needs to be able to chat their password while unauthenticated
				ChatServer.processCommand(this, message);
				
				break;
				
			case VERSION:
				protocol.setVersion(message);
				//setVersion(message);
				break;
		}
		
		if (!authenticated)
			checkAuth();
		
		switch (cmd) {
			case TEXT_ALL:
			
				if (authenticated)
					forwardToRoom(message);
					
				break;
				
			case NAME_CHANGE:
				
				if (authenticated) {
					setName(message);
					ChatServer.getStats().namechanges++;
				}
					
				break;
				
			case SNOOP_DATA:
				handleSnoopData(message);
				break;
				
			case PING_REQUEST:
				handlePingRequest(message);
				break;
		}
		
	}