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