Esempio n. 1
0
 public void OnNetworkClientMessage(NetworkClient client, NetworkMessage message)
 {
     // MH: or is it?
     //ClientPluginController.OnClientPluginEvent(ClientPluginEvent.LoginServerIncomingMessage, message);
 }
Esempio n. 2
0
 public virtual void OnNetworkServerClientMessage(NetworkServer server, int client, NetworkMessage msg)
 {
     msgHandler.ProcessMessage(msg);
 }
Esempio n. 3
0
 public NetSendResult Send(NetworkMessage message, NetDeliveryMethod deliveryType)
 {
     NetOutgoingMessage msg = client.CreateMessage();
     message.Write(msg);
     return client.SendMessage(msg, deliveryType);
 }
Esempio n. 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);
 }
Esempio n. 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);
        }
Esempio n. 7
0
 private void HandleRequestAccountLogout(NetworkMessage msg)
 {
 }
Esempio n. 8
0
 public override void OnNetworkServerClientMessage(NetworkServer server, int client, NetworkMessage msg)
 {
     base.OnNetworkServerClientMessage(server, client, msg);
 }
Esempio n. 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);
            }
        }