예제 #1
0
 public void OnNetworkClientMessage(NetworkClient client, NetworkMessage message)
 {
     // MH: or is it?
     //ClientPluginController.OnClientPluginEvent(ClientPluginEvent.LoginServerIncomingMessage, message);
 }
예제 #2
0
 public virtual void OnNetworkServerClientMessage(NetworkServer server, int client, NetworkMessage msg)
 {
     msgHandler.ProcessMessage(msg);
 }
예제 #3
0
 public NetSendResult Send(NetworkMessage message, NetDeliveryMethod deliveryType)
 {
     NetOutgoingMessage msg = client.CreateMessage();
     message.Write(msg);
     return client.SendMessage(msg, deliveryType);
 }
예제 #4
0
            public void OnNetworkClientMessage(NetworkClient netClient, NetworkMessage message)
            {
                if (message.type != NetworkMessageType.ReplyCreateAccount)
                    return;

                MsgReplyCreateAccount msg = message as MsgReplyCreateAccount;

                bool result = msg[MsgReplyCreateAccount.FIELD_RESULT] == MsgReplyCreateAccount.ACCOUNT_CREATED;

                netClient.clientDelegate = null;
                netClient.Disconnect();
            }
 public void ProcessMessage(NetworkMessage msg)
 {
     if (handlers[(int)msg.type] != null)
         handlers[(int)msg.type](msg);
 }
예제 #6
0
        /* Create account */
        private void HandleRequestCreateAccount(NetworkMessage msg)
        {
            MsgRequestCreateAccount message = (MsgRequestCreateAccount)msg;

            string email = message[MsgRequestCreateAccount.FIELD_EMAIL];
            string pass = message[MsgRequestCreateAccount.FIELD_PASSWORD];

            bool result = accountDatabase.CreateNewAccount(email, pass);

            MsgReplyCreateAccount reply = new MsgReplyCreateAccount();

            if (result)
                reply[MsgReplyCreateAccount.FIELD_RESULT] = MsgReplyCreateAccount.ACCOUNT_CREATED;
            else
                reply[MsgReplyCreateAccount.FIELD_RESULT] = MsgReplyCreateAccount.ACCOUNT_NOT_CREATED;

            server.Send(msg.source, reply, Lidgren.Network.NetDeliveryMethod.ReliableOrdered);
        }
예제 #7
0
 private void HandleRequestAccountLogout(NetworkMessage msg)
 {
 }
예제 #8
0
 public override void OnNetworkServerClientMessage(NetworkServer server, int client, NetworkMessage msg)
 {
     base.OnNetworkServerClientMessage(server, client, msg);
 }
예제 #9
0
        public void Send(int targetClient, NetworkMessage msg, NetDeliveryMethod deliveryType)
        {
            NetOutgoingMessage msgOut = server.CreateMessage();
            msg.Write(msgOut);

            if (targetClient == ALL_CLIENTS)
                server.SendToAll(msgOut, deliveryType);
            else
            {
                server.SendMessage(msgOut, clientData[targetClient].sc, deliveryType);
            }
        }