예제 #1
0
        public static void Handle(MapleClient c, PacketReader pr)
        {
            int    tickCount = pr.ReadInt();
            string message   = pr.ReadMapleString();
            byte   show      = pr.ReadByte();

            ServerConsole.Info(c.Account.Character.Name + ": " + message);

            if (message[0] == '@')
            {
                if (PlayerCommands.ProcessCommand(message.Substring(1).Split(' '), c))
                {
                    return;
                }
            }
            else if (message[0] == '!')
            {
                if (c.Account.IsGM)
                {
                    string[] split = message.Substring(1).Split(' ');
                    if (GMCommands.ProcessCommand(split, c))
                    {
                        return;
                    }
                    if (c.Account.IsAdmin)
                    {
                        if (AdminCommands.ProcessCommand(split, c))
                        {
                            return;
                        }
                        else
                        {
                            c.Account.Character.SendBlueMessage("Unrecognized Admin command");
                            return;
                        }
                    }
                    else
                    {
                        c.Account.Character.SendBlueMessage("Unrecognized GM command");
                        return;
                    }
                }
            }
            else if (message[0] == '#')
            {
                if (c.Account.IsGM || c.Account.IsDonor)
                {
                    string[] split = message.Substring(1).Split(' ');
                    if (DonorCommands.ProcessCommand(split, c))
                    {
                        return;
                    }
                    else
                    {
                        c.Account.Character.SendBlueMessage("Unrecognized Donor command");
                        return;
                    }
                }
            }

            PacketWriter packet = PlayerChatPacket(c.Account.Character.Id, message, show, c.Account.IsGM);

            c.Account.Character.Map.BroadcastPacket(packet);
        }