public static void ChatMessage(Packet pPacket) { string senderName; string message; pPacket.ReadString (out senderName); pPacket.ReadString (out message); Log.WriteLine (ELogLevel.Info, "Chat Message: {0} - {1}", senderName, message); }
public static void ChatMessage(Packet pPacket) { string senderName; string message; pPacket.ReadString (out senderName); pPacket.ReadString (out message); Client.window.InvokeOnMainThread (() => { Client.window.AddLineToChatHistory (string.Format ("{0}: {1}", senderName, message)); }); }
public static void WelcomeMessage(Packet pPacket) { string message; pPacket.ReadString (out message); Log.WriteLine (ELogLevel.Info, "Welcome Message: {0}", message); Client.sServer.WelcomeMessage = message; }
public static void UpdateUsername(Packet pPacket) { string username; pPacket.ReadString (out username); Log.WriteLine (ELogLevel.Info, "Username: {0}", username); }
public static void UsernameChange(Client pClient, Packet pPacket) { string username; pPacket.ReadString (out username); Log.WriteLine (ELogLevel.Info, "[Server] Username change request recevied: {0} -> {1}", pClient.Username, username); Server.UpdateUsername (pClient, username); }
public static void WelcomeMessage(Packet pPacket) { string message; pPacket.ReadString (out message); Client.sServer.WelcomeMessage = message; Client.window.InvokeOnMainThread (() => { Client.window.AddLineToChatHistory (string.Format ("Welcome Message: {0}", message)); }); }
public static void ChatMessage(Client pClient, Packet pPacket) { string message; pPacket.ReadString (out message); Log.WriteLine (ELogLevel.Info, "[Server] Received Chat Message: {0}", message); Packet packet = new Packet(EOpcode.SMSG_CHAT_MESSAGE); packet.WriteString (pClient.Username); packet.WriteString(message); Server.SendPacketToAllExcept (packet, pClient); }
public static void UpdateUsername(Packet pPacket) { bool success = false; string username; pPacket.ReadBool (out success); if (success) { pPacket.ReadString (out username); Client.sUsername = username; Client.window.InvokeOnMainThread (() => { Client.window.AddLineToChatHistory (string.Format ("Username: {0}", username)); }); } else { Client.window.InvokeOnMainThread (() => { Client.window.AddLineToChatHistory (string.Format ("Cannot update username")); }); } }