Example #1
0
        public static bool SendAuth(AuthPacket packet)
        {
            if (_server.AuthServer != null)
            {
                _server.AuthServer.Send(packet);
                return(true);
            }
            else
            {
                switch (packet.ID)
                {
                case AuthPacketEnum.SERVER_RELEASE_CHAT:
                {
                    bool   Type        = packet.Message.IsGM;
                    string GetNickName = packet.Message.GetNickName;
                    string GetMessage  = packet.Message.GetMessage;
                    if (Type)
                    {
                        PacketCreator.ChatText(GetNickName, GetMessage, Type);
                    }
                }
                break;

                case AuthPacketEnum.SERVER_RELEASE_TICKET:
                {
                    string GetNickName = packet.Message.GetNickName;
                    string GetMessage  = packet.Message.GetMessage;
                    using (var result = new PangyaBinaryWriter())
                    {
                        result.Write(new byte[] { 0xC9, 0x00 });
                        result.WritePStr(GetNickName);
                        result.WritePStr(GetMessage);
                        _server.SendToAll(result.GetBytes());
                    }
                }
                break;

                case AuthPacketEnum.SERVER_RELEASE_BOXRANDOM:
                {
                    string GetMessage = packet.Message.GetMessage;
                    _server.Notice(GetMessage);
                }
                break;

                case AuthPacketEnum.SERVER_RELEASE_NOTICE:
                {
                    string GetNickname = packet.Message.GetNickname;
                    string Messages    = packet.Message.mensagem;

                    PacketCreator.ShowGMNotice(Messages, GetNickname);
                }
                break;
                }
                return(false);
            }
        }