public override byte[] GetDecorationData()
 {
     using (var result = new PangyaBinaryWriter())
     {
         result.WriteStruct(ItemDecoration);
         return(result.GetBytes());
     }
 }
Example #2
0
 public void SendResponse(PangyaBinaryWriter packet)
 {
     Send(packet);
     if (packet.GetSize > 0)
     {
         Response.Clear();
     }
 }
Example #3
0
        private void Handle()
        {
            switch (PacketResult.Action)
            {
            case ChangeEquipmentEnumB.GetCaddieSelected:
            {
                //response.Write(Player.Caddies.First().GetData());
            }
            break;

            case ChangeEquipmentEnumB.GetClubSelected:
            {
                //response.Write(Player.WarehouseCollection.GetClubData());
            }
            break;

            case ChangeEquipmentEnumB.GetBallSelected:
            {
                //response.Write(PacketResult.Id);
            }
            break;

            case ChangeEquipmentEnumB.GetCharSelected:
            {
                if (Player.Game == null)
                {
                    return;
                }


                foreach (var player in Player.Game.Players)
                {
                    var response = new PangyaBinaryWriter();

                    response.Write(new byte[] { 0x4B, 0x00 });
                    response.Write(0);
                    response.Write((byte)PacketResult.Action);
                    response.Write(Player.ConnectionId);
                    response.Write(Player.Characters.GetCharData());

                    player.SendResponse(response.GetBytes());
                }
            }
            break;

            case ChangeEquipmentEnumB.GetMascotSelected:
            {
                //response.Write(Player.Mascots.First()?.GetMascotInfo() ?? new byte[0x3E]);//62
            }
            break;

            case ChangeEquipmentEnumB.GameStart:
            {
                HandleAcquireData();
            }
            break;
            }
        }
Example #4
0
        public static byte[] ShowDropItem(uint ConID)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xCC, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte((byte)0);
            return(result.GetBytes());
        }
Example #5
0
        public static byte[] ShowPlayerTimeBoost(uint ConID)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xC7, 0x00 });
            result.Write(new byte[] { 0x00, 0x00, 0x40, 0x40 });
            result.WriteUInt32(ConID);
            return(result.GetBytes());
        }
Example #6
0
        public static byte[] ShowPlayerPauseGame(uint ConID, byte PauseType)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x8B, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte(PauseType);
            return(result.GetBytes());
        }
Example #7
0
        public static byte[] ShowGameReady(uint ConID, byte ReadyType)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x78, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte(ReadyType);
            return(result.GetBytes());
        }
Example #8
0
        public static byte[] ShowRingEffects(uint ConID, byte[] un)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x37, 0x02 });
            result.WriteUInt32(ConID);
            result.Write(un);
            return(result.GetBytes());
        }
Example #9
0
        public static byte[] ShowSleep(uint ConID, byte SleepType)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x8E, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteUInt16(SleepType);
            return(result.GetBytes());
        }
Example #10
0
        public static byte[] ShowGameIcon(uint ConID, ushort IconType)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x5D, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteUInt16(IconType);
            return(result.GetBytes());
        }
Example #11
0
        public static byte[] ShowGameLoading(uint ConID, byte Process)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xA3, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte(Process);
            return(result.GetBytes());
        }
Example #12
0
 public static byte[] ShowMessageGlobal(string message)
 {
     using (var response = new PangyaBinaryWriter())
     {
         response.Write(new byte[] { 0x42, 0x00 });
         response.WritePStr(message);
         return(response.GetBytes());
     }
 }
Example #13
0
        public static byte[] ShowWeather(ushort type = 0)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x9E, 0x00 });
            result.WriteUInt16(type);
            result.WriteByte(0);
            return(result.GetBytes());
        }
Example #14
0
 public static byte[] ShowGameStart(GameStartFlag result)
 {
     using (var response = new PangyaBinaryWriter())
     {
         response.Write(new byte[] { 0x7F, 0x00 });
         response.Write((uint)result);
         return(response.GetBytes());
     }
 }
Example #15
0
 public void PlayerGPTime(GPlayer player)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xbA, 0x00 });
         Response.Write(GameTools.Tools.GetFixTime(DateTime.Now));
         player.SendResponse(Response);
     }
 }
Example #16
0
        public static byte[] ShowLeaveMatch(uint ConID, byte Type)
        {
            var Response = new PangyaBinaryWriter();

            Response.Write(new byte[] { 0x6C, 0x00 });
            Response.WriteUInt32(ConID);
            Response.WriteByte(Type);//tipos
            return(Response.GetBytes());
        }
Example #17
0
        public static byte[] ShowPowerShot(uint ConID, PowerShotFlag PowerShot)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x58, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte((byte)PowerShot);
            return(result.GetBytes());
        }
Example #18
0
        public static byte[] ShowPlayerChangeClub(uint ConID, byte ClubType)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x59, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte(ClubType);
            return(result.GetBytes());
        }
Example #19
0
        public static byte[] ShowNewMaster(uint ConID)
        {
            var resp = new PangyaBinaryWriter();

            resp.Write(new byte[] { 0x7C, 0x00 });
            resp.WriteUInt32(ConID);
            resp.WriteUInt16(65535);
            return(resp.GetBytes());
        }
Example #20
0
        public static byte[] ShowPlayerRotate(uint ConID, float Angle)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x56, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteSingle(Angle);
            return(result.GetBytes());
        }
Example #21
0
        public static byte[] ShowTeam(uint ConID, GameTeamVersusFlag Team)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x32, 0x01 });
            result.WriteUInt32(ConID);
            result.WriteByte((byte)Team);
            return(result.GetBytes());
        }
Example #22
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");
        }
Example #23
0
 public static byte[] ShowLogin(uint UID)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0x2F, 0x00, 0x00 });
         Response.Write(UID); //uid player
         return(Response.GetBytes());
     }
 }
Example #24
0
 public byte[] GetGolfEQP()
 {
     using (var Packet = new PangyaBinaryWriter())
     {
         Packet.WriteUInt32(BallTypeID);
         Packet.WriteUInt32(ClubSetIndex);
         return(Packet.GetBytes());
     }
 }
Example #25
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);
            }
        }
Example #26
0
 public byte[] GetInfo()
 {
     using (var result = new PangyaBinaryWriter())
     {
         result.Write(Index);
         result.Write(TypeID);
         result.Write(Quantity);
         return(result.GetBytes());
     }
 }
Example #27
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());
     }
 }
Example #28
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());
     }
 }
Example #29
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());
        }
Example #30
0
        public byte[] GetToolbar()
        {
            PangyaBinaryWriter Reply;

            Reply = new PangyaBinaryWriter();

            Reply.Write(new byte[] { 0x72, 0x00 });
            Reply.Write(GetEquipData());
            return(Reply.GetBytes());
        }