Пример #1
0
        public void Notice(string message)
        {
            var response = new PangyaBinaryWriter(new MemoryStream());

            response.Write(new byte[] { 0x42, 0x00 });
            response.WritePStr("Aviso: " + message);
            SendToAll(response.GetBytes());
            Console.WriteLine("BroadCast enviado com sucesso");
        }
Пример #2
0
 public override byte[] GetGolfEQP()
 {
     using (var Packet = new PangyaBinaryWriter())
     {
         Packet.WriteUInt32(BallTypeID);
         Packet.WriteUInt32(ClubSetIndex);
         return(Packet.GetBytes());
     }
 }
Пример #3
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);
            }
        }
Пример #4
0
 public static byte[] ShowShopCountVisit(uint Count)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xE9, 0x00 });
         Response.Write(1);
         Response.Write(Count);
         return(Response.GetBytes());
     }
 }
Пример #5
0
 public static byte[] ShowPlayerAction(uint ConID, byte[] Message)
 {
     using (var response = new PangyaBinaryWriter())
     {
         response.Write(new byte[] { 0xC4, 0x00 });
         response.WriteUInt32(ConID);
         response.Write(Message);
         return(response.GetBytes());
     }
 }
Пример #6
0
        public static byte[] ShowAssistPutting(uint AssistTypeID, uint UID)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x6B, 0x02 });
            result.WriteUInt32(0);
            result.WriteUInt32(AssistTypeID);
            result.WriteUInt32(UID);
            return(result.GetBytes());
        }
Пример #7
0
        /// <summary>
        /// Size Packet 634
        /// </summary>
        /// <returns>Select(634 array of byte)</returns>
        public byte[] GetEquipInfo()
        {
            var Response = new PangyaBinaryWriter();

            Response.Write(GetCharData());
            Response.Write(GetCaddieData());
            Response.Write(GetClubData());
            Response.Write(GetMascotData());
            return(Response.GetBytes());
        }
Пример #8
0
 public static byte[] ShowDeleteFriend(uint FriendUID)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0x30, 0x00, 0x0B, 0x01 });
         Response.Write(0);
         Response.Write(FriendUID);
         return(Response.GetBytes());
     }
 }
Пример #9
0
        private byte[] GetVSInformation()
        {
            var result = new PangyaBinaryWriter();

            result.Write((byte)Player.Game.Players.Count);

            Player.Game.Players.ForEach(p => result.Write(p.GetGameInfoVS()));

            return(result.GetBytes());
        }
Пример #10
0
        public byte[] GetToolbar()
        {
            PangyaBinaryWriter Reply;

            Reply = new PangyaBinaryWriter();

            Reply.Write(new byte[] { 0x72, 0x00 });
            Reply.Write(GetEquipData());
            return(Reply.GetBytes());
        }
Пример #11
0
 public byte[] GetInfo()
 {
     using (var result = new PangyaBinaryWriter())
     {
         result.Write(Index);
         result.Write(TypeID);
         result.Write(Quantity);
         return(result.GetBytes());
     }
 }
Пример #12
0
 protected void PlayerShopPangsInfo(GPlayer player, Packet packet)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xEA, 0x00 });
         Response.Write(1);                                    // return code
         Response.WriteUInt64(player.GameInfo.GameShop.Pangs); // income
         player.SendResponse(Response.GetBytes());
     }
 }
Пример #13
0
        public static byte[] ShowWind(ushort WP = 0, ushort WD = 0, byte active = 1)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x5B, 0x00 });
            result.WriteUInt16(WP);
            result.WriteUInt16(WD);
            result.WriteByte(active);
            return(result.GetBytes());
        }
Пример #14
0
        public static byte[] ShowPlayerUseItem(uint ConID, uint ID)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x5A, 0x00 });
            result.WriteUInt32(ID);
            result.WriteInt32(new Random().Next());
            result.WriteUInt32(ConID);
            return(result.GetBytes());
        }
Пример #15
0
        public static byte[] ShowPlayerAction(Session lobbyPlayer, LobbyActionFlag action)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x46, 0x00 });
            result.WriteByte((byte)action); //ACTION PLAYER
            result.WriteByte(1);            //TOTAL PLAYERS IN ACTION
            result.Write((byte[])lobbyPlayer.GetLobbyInfo());
            return(result.GetBytes());
        }
Пример #16
0
        public static byte[] ChatText(string nickname, string Chat, bool GM)
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0x40, 0x00 });
            response.WriteByte(Compare.IfCompare <byte>(GM, 0x80, 0)); //Tipo de chat
            response.WritePStr(nickname);
            response.WritePStr(Chat);
            return(response.GetBytes());
        }
        private void GameWind(ushort windPower, ushort windDirection)
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0x5B, 0x00 });
            response.Write(windPower);
            response.Write(windDirection);
            response.Write((byte)1);

            Player.Game.Players.ForEach(p => p.SendResponse(response.GetBytes()));
        }
Пример #18
0
        private void Handle()
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0x40, 0x00 });
            response.Write((byte)(Player.Member_Old.Capabilities == 4 || Player.Member_Old.Capabilities == 15 ? 0x80 : 0)); //Tipo de chat
            response.WritePStr(PacketResult.Nickname);
            response.WritePStr(PacketResult.Message);

            Player.Channel.Lobby.SendToAll(response.GetBytes());
        }
Пример #19
0
 public static byte[] ShowShopItemBuyResult(string NickName, uint ShopID, ShopItem itens)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xED, 0x00 });
         Response.WritePStr(NickName);
         Response.Write(ShopID);
         Response.WriteStruct(itens);
         return(Response.GetBytes());
     }
 }
Пример #20
0
 public static byte[] ShowChatText(uint UID, string NickName, string Message)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0x30, 0x00, 0x13, 0x01 });
         Response.Write(UID);
         Response.WritePStr(NickName);
         Response.WritePStr(Message);
         return(Response.GetBytes());
     }
 }
Пример #21
0
        public static byte[] ShowClubStatus(byte Action, byte slot, uint ClubIndex, uint PangConsume = 0)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xA5, 0x00 });
            result.WriteUInt16(Action);
            result.WriteByte((byte)slot);
            result.WriteUInt32(ClubIndex);
            result.WriteUInt64(PangConsume);
            return(result.GetBytes());
        }
Пример #22
0
        public static byte[] ShowBoxItem(uint BoxTypeID, uint TypeID, uint Quantity)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x9D, 0x01 });
            result.WriteUInt32(0);
            result.WriteUInt32(BoxTypeID);
            result.WriteUInt32(TypeID);
            result.WriteUInt32(Quantity);
            return(result.GetBytes());
        }
Пример #23
0
        public void ServerMessage(string message)
        {
            var response = new PangyaBinaryWriter(new MemoryStream());

            response.Write(new byte[] { 0x43, 0x00 });
            response.WritePStr(message);

            SendToAll(response.GetBytes());

            Console.WriteLine("Mensagem enviada com sucesso");
        }
        private void HandleGameWeather()
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0x9E, 0x00 });
            response.Write(new byte[] { 0x00, 0x00, 0x00 });
            //response.Write(0); //type
            //response.Write((byte)0);

            Player.Game.Players.ForEach(p => p.SendResponse(response.GetBytes()));
        }
Пример #25
0
 public byte[] GetData()
 {
     using (var result = new PangyaBinaryWriter())
     {
         foreach (var item in Items)
         {
             result.WriteStruct(item);
         }
         return(result.GetBytes());
     }
 }
Пример #26
0
 public static byte[] ShowChangeFriendSubNick(uint UID, string NickName)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0x30, 0x00, 0x19, 0x01 });
         Response.Write(0);
         Response.Write(UID);
         Response.WritePStr(NickName);
         return(Response.GetBytes());
     }
 }
Пример #27
0
        private void Handle()
        {
            var response = new PangyaBinaryWriter();

            response.Write(new byte[] { 0x78, 0x00 });
            response.Write(Player.ConnectionId);
            response.Write(PacketResult.Ready);

            //Envia para todos
            Player.Game.Players.ForEach(p => p.SendResponse(response.GetBytes()));
        }
Пример #28
0
        public byte[] GetInfo()
        {
            var result = new PangyaBinaryWriter();

            result.Write((ushort)Count);
            foreach (var data in this)
            {
                result.Write(data.GetInfo());
            }
            return(result.GetBytes());
        }
Пример #29
0
 public static byte[] ShowShopClose(string Nickname, uint UID)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xE4, 0x00 });
         Response.WriteUInt32(1);
         Response.WritePStr(Nickname);
         Response.Write(UID);
         return(Response.GetBytes());
     }
 }
Пример #30
0
        /// <summary>
        /// Cria as informações
        /// </summary>
        /// <param name="Code"> 0 == Todas as sessoes, Sessão 5 </param>
        /// <returns></returns>
        public byte[] Build(byte Code = 5)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xB4, 0x00, Code });
            result.Write((ushort)Count);
            foreach (var data in this)
            {
                result.Write(data.GetInfo());
            }
            return(result.GetBytes());
        }