Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
            });
        }
Exemplo n.º 3
0
        public static void WelcomeMessage(Packet pPacket)
        {
            string message;
            pPacket.ReadString (out message);

            Log.WriteLine (ELogLevel.Info, "Welcome Message: {0}", message);
            Client.sServer.WelcomeMessage = message;
        }
Exemplo n.º 4
0
        public static void UpdateUsername(Packet pPacket)
        {
            string username;

            pPacket.ReadString (out username);

            Log.WriteLine (ELogLevel.Info, "Username: {0}", username);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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));
            });
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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"));
                });
            }
        }