public void ReceiveMessage(PiranhaMessage message)
        {
            int messageType            = message.GetMessageType();
            int messageServiceNodeType = message.GetServiceNodeType();

            ClientConnectionState state = this.m_connection.State;

            if (state != ClientConnectionState.LOGGED)
            {
                if (state == ClientConnectionState.DISCONNECTED)
                {
                    return;
                }
                if (messageType != ClientHelloMessage.MESSAGE_TYPE && messageType != LoginMessage.MESSAGE_TYPE &&
                    messageType != KeepAliveMessage.MESSAGE_TYPE && messageType != UnlockAccountMessage.MESSAGE_TYPE)
                {
                    return;
                }
            }

            Logging.Print("MessageManager.receiveMessage: " + message.GetType().Name);

            if (messageServiceNodeType == 1)
            {
                switch (messageType)
                {
                case ClientHelloMessage.MESSAGE_TYPE:
                    this.ClientHelloMessageReceived((ClientHelloMessage)message);
                    break;

                case LoginMessage.MESSAGE_TYPE:
                    this.LoginMessageReceived((LoginMessage)message);
                    break;

                case KeepAliveMessage.MESSAGE_TYPE:
                    this.KeepAliveMessageReceived((KeepAliveMessage)message);
                    break;

                case UnlockAccountMessage.MESSAGE_TYPE:
                    this.UnlockAccountMessageReceived((UnlockAccountMessage)message);
                    break;

                case BindFacebookAccountMessage.MESSAGE_TYPE:
                    this.OnBindFacebookAccountMessageReceived((BindFacebookAccountMessage)message);
                    break;
                }
            }
            else
            {
                if (state != ClientConnectionState.LOGGED)
                {
                    return;
                }

                ProxySession session = this.m_connection.Session;

                if (session == null)
                {
                    return;
                }

                if (this.IsRequestPiranhaMessage(message))
                {
                    switch (messageType)
                    {
                    case AskForAvatarProfileMessage.MESSAGE_TYPE:
                        this.SendForwardLogicMessageRequestMessage(message, ServerManager.GetDocumentSocket(9, ((AskForAvatarProfileMessage)message).RemoveAvatarId()));
                        break;

                    case AskForAllianceDataMessage.MESSAGE_TYPE:
                        this.SendForwardLogicMessageRequestMessage(message, ServerManager.GetDocumentSocket(11, ((AskForAllianceDataMessage)message).RemoveAllianceId()));
                        break;
                    }
                }
                else if (messageServiceNodeType == 28 || messageServiceNodeType == 29)
                {
                    this.SendForwardLogicMessageRequestMessage(message, ServerManager.GetNextSocket(messageServiceNodeType));
                }
                else
                {
                    session.SendPiranhaMessage(message, messageServiceNodeType);
                }
            }
        }