Ejemplo n.º 1
0
        public static void HandleChatMessageSay(ref PacketReader packet, ref WorldClass session)
        {
            BitUnpack BitUnpack = new BitUnpack(packet);
            int       language  = packet.ReadInt32();

            uint   messageLength = BitUnpack.GetBits <uint>(9);
            string chatMessage   = packet.ReadString(messageLength);

            if (chatMessage.StartsWith("!"))
            {
                WorldMgr.Session = session;
                ChatCommandParser.ExecuteChatHandler(chatMessage);
            }
            else
            {
                SendMessageByType(ref session, MessageType.ChatMessageSay, language, chatMessage);
            }
        }
Ejemplo n.º 2
0
        public static void HandleChatMessageSay(ref PacketReader packet, ref WorldClass session)
        {
            BitUnpack BitUnpack = new BitUnpack(packet);

            var language = packet.Read <int>();

            var messageLength = BitUnpack.GetBits <byte>(8);
            var message       = packet.ReadString(messageLength);

            ChatMessageValues chatMessage = new ChatMessageValues(MessageType.ChatMessageSay, message, true, true);

            chatMessage.Language = (byte)language;

            if (ChatCommandParser.CheckForCommand(message))
            {
                ChatCommandParser.ExecuteChatHandler(message, session);
            }
            else
            {
                SendMessage(ref session, chatMessage);
            }
        }
Ejemplo n.º 3
0
        public static void HandleChatMessageSay(ref PacketReader packet, WorldClass session)
        {
            BitUnpack         arg_0F_0 = new BitUnpack(packet);
            int               num      = packet.Read <int>();
            int               num2     = (int)arg_0F_0.GetBits <byte>(8) << 1;
            bool              bit      = arg_0F_0.GetBit();
            ChatMessageValues chatMessageValues;

            while (true)
            {
IL_10D:
                uint arg_E0_0 = 325641967u;
                while (true)
                {
                    uint num3;
                    switch ((num3 = (arg_E0_0 ^ 1114592966u)) % 8u)
                    {
                    case 0u:
                        goto IL_10D;

                    case 1u:
                    {
                        string text = packet.ReadString((uint)(bit ? ((byte)num2 + 1) : ((byte)num2)));
                        arg_E0_0 = 1695780296u;
                        continue;
                    }

                    case 2u:
                        return;

                    case 3u:
                    {
                        string text;
                        arg_E0_0 = ((ChatCommandParser.CheckForCommand(text) ? 3993131816u : 2950447498u) ^ num3 * 3295186339u);
                        continue;
                    }

                    case 4u:
                    {
                        string text;
                        ChatCommandParser.ExecuteChatHandler2(text, Manager.WorldMgr.GetSession2(session.Character.Guid));
                        arg_E0_0 = (num3 * 451064634u ^ 332353724u);
                        continue;
                    }

                    case 6u:
                    {
                        string text;
                        chatMessageValues          = new ChatMessageValues(MessageType.ChatMessageSay, text, true, true, session.Character.Name);
                        chatMessageValues.Language = (byte)num;
                        arg_E0_0 = (num3 * 3671775661u ^ 3376883115u);
                        continue;
                    }

                    case 7u:
                    {
                        string text;
                        ChatCommandParser.ExecuteChatHandler(text, session);
                        arg_E0_0 = (num3 * 3654367289u ^ 3353498485u);
                        continue;
                    }
                    }
                    goto Block_3;
                }
            }
Block_3:
            ChatHandler.SendMessage(ref session, chatMessageValues, null);
        }