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