Пример #1
0
        /// <summary>
        /// Ref Packet AA 00
        /// </summary>
        /// <param name="Lists"></param>
        /// <param name="Pangs"></param>
        /// <param name="Cookies"></param>
        /// <returns></returns>
        public static byte[] ShowBoxNewItem(List <object> Lists, uint Pangs, uint Cookies)
        {
            var result = new PangyaBinaryWriter();

            try
            {
                result.Write(new byte[] { 0xAA, 0x00 });
                result.WriteUInt16((ushort)Lists.Count);
                foreach (var APoint in Lists)
                {
                    result.WriteUInt32(((ItemData)APoint).TypeID);
                    result.WriteUInt32(((ItemData)APoint).ItemIndex);
                    result.WriteZero(3);
                    result.WriteUInt16((UInt16)((ItemData)APoint).ItemQuantity);
                    result.WriteZero(25);
                }
                result.WriteUInt64(Pangs);
                result.WriteUInt64(Cookies);
                return(result.GetBytes());
            }
            finally
            {
                result.Dispose();
            }
        }
Пример #2
0
        /// <summary>
        /// Size = 267 bytes
        /// </summary>
        /// <returns>login information</returns>
        public byte[] GetLoginInfo()
        {
            PangyaBinaryWriter Reply;

            Reply = new PangyaBinaryWriter();
            try
            {
                Reply.WriteUInt16(GameID);
                Reply.WriteStr(UserInfo.GetLogin, 22);
                Reply.WriteStr(UserInfo.GetNickname, 22);
                Reply.WriteStr(GuildInfo.Name, 17);
                Reply.WriteStr(GuildInfo.Image, 16);
                Reply.WriteUInt64(UserInfo.GetCapability);
                Reply.WriteUInt32(ConnectionID);
                Reply.WriteZero(12);
                Reply.WriteUInt64(GuildInfo.ID);
                Reply.WriteUInt16(UserInfo.GetSex);
                Reply.Write(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF });
                Reply.WriteZero(16);
                Reply.WriteZero(128);
                Reply.WriteUInt32(UserInfo.GetUID);
                return(Reply.GetBytes());
            }
            finally
            {
                Reply.Dispose();
            }
        }
Пример #3
0
        public static byte[] ShowBuyItemSucceed(GameShopFlag Code = GameShopFlag.BUY_SUCCESS, uint Pang = 0, uint Cookies = 0)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x68, 0x00 });
            result.WriteUInt32((uint)Code);
            if (Code == GameShopFlag.BUY_SUCCESS)
            {
                result.WriteUInt64(Pang);
                result.WriteUInt64(Cookies);
            }
            return(result.GetBytes());
        }
Пример #4
0
        public static byte[] ShowHoleData(uint ConID, uint CurrHole, byte TotalShot, uint Score, uint Pang, uint BonusPang, bool finish = true)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x6D, 0x00 });
            result.WriteUInt32(ConID);
            result.WriteByte((byte)CurrHole);
            result.WriteByte(TotalShot);
            result.WriteUInt32(Score);
            result.WriteUInt64(Pang);
            result.WriteUInt64(BonusPang);
            result.WriteByte(Compare.IfCompare <byte>(finish, 1, 0));
            return(result.GetBytes());
        }
Пример #5
0
        public void SendCookies()
        {
            PangyaBinaryWriter Reply;

            Reply = new PangyaBinaryWriter();
            try
            {
                Reply.Write(new byte[] { 0x96, 0x00 });
                Reply.WriteUInt64(UserInfo.GetCookie);
                Reply.WriteUInt64(0);
                Send(Reply.GetBytes());
            }
            finally
            {
                Reply.Dispose();
            }
        }
Пример #6
0
        public static byte[] ShowBuyItem(AddItemData Item, BuyItemData BuyData, uint Pang, uint Cookies)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xAA, 0x00 });
            result.WriteUInt16(1);//count Sucess item(coloca sempre 1 eu acho)
            result.WriteUInt32(Item.ItemTypeID);
            result.WriteUInt32(Item.ItemIndex);
            result.WriteUInt16(BuyData.DayTotal);
            result.WriteByte(BuyData.Flag);
            result.WriteUInt32(Item.ItemNewQty);
            result.WriteTime((BuyData.EndDate));
            result.WriteStr(Item.ItemUCCKey, 7);
            result.WriteUInt64(Pang);
            result.WriteUInt64(Cookies);
            return(result.GetBytes());
        }
Пример #7
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());
     }
 }
Пример #8
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());
        }
Пример #9
0
        public static byte[] ShowClubStatus(TCLUB_ACTION Action, TCLUB_ACTION code, TCLUB_STATUS slot, uint ClubIndex, uint PangConsume = 0)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0xA5, 0x00 });
            result.WriteByte((byte)Action);
            result.WriteByte((byte)code);
            result.WriteByte((byte)slot);
            result.WriteUInt32(ClubIndex);
            result.WriteUInt64(PangConsume);
            return(result.GetBytes());
        }
Пример #10
0
 public static byte[] ShowShopItemBuy(ulong Pangs, ShopItem itens)
 {
     using (var Response = new PangyaBinaryWriter())
     {
         Response.Write(new byte[] { 0xEC, 0x00 });
         Response.Write(1);           //code
         Response.WriteByte(0);
         Response.WriteUInt64(Pangs); //
         Response.WriteByte(0);
         Response.WriteStruct(itens);
         return(Response.GetBytes());
     }
 }
Пример #11
0
        public static byte[] ShowNameScore(string Nick, int Score, uint Pang)
        {
            var result = new PangyaBinaryWriter();

            result.Write(new byte[] { 0x40, 0x00 });
            result.WriteByte(0x11);
            result.WritePStr(Nick);
            result.WriteUInt16(0);
            result.WriteInt32(Score); //Score
            result.WriteUInt64(Pang); //Pangs
            result.WriteByte(0);

            return(result.GetBytes());
        }
Пример #12
0
        public void SendLockerPang()
        {
            PangyaBinaryWriter Packet;

            Packet = new PangyaBinaryWriter();
            try
            {
                Packet.Write(new byte[] { 0x72, 0x01 });
                Packet.WriteUInt64(LockerPang);
                Send(Packet.GetBytes());
            }
            finally
            {
                Packet.Dispose();
            }
        }
Пример #13
0
        public void SendPang()
        {
            PangyaBinaryWriter Packet;

            Packet = new PangyaBinaryWriter();
            try
            {
                Packet.Write(new byte[] { 0xC8, 0x00 });
                Packet.WriteUInt64(UserInfo.GetPang);
                Packet.WriteUInt32(0);
                Send(Packet.GetBytes());
            }
            finally
            {
                Packet.Dispose();
            }
        }
Пример #14
0
        /// <summary>
        /// return 239 bytes
        /// </summary>
        /// <returns></returns>
        public byte[] Statistic()
        {
            PangyaBinaryWriter result;

            result = new PangyaBinaryWriter();

            result.WriteUInt32(UserInfo.UserStatistic.Drive);
            result.WriteUInt32(UserInfo.UserStatistic.Putt);
            result.WriteUInt32(UserInfo.UserStatistic.PlayTime);
            result.WriteUInt32(UserInfo.UserStatistic.ShotTime);
            result.WriteSingle(UserInfo.UserStatistic.LongestDistance);
            result.WriteUInt32(UserInfo.UserStatistic.Pangya);
            result.WriteUInt32(UserInfo.UserStatistic.TimeOut);
            result.WriteUInt32(UserInfo.UserStatistic.OB);
            result.WriteUInt32(UserInfo.UserStatistic.DistanceTotal);
            result.WriteUInt32(UserInfo.UserStatistic.Hole);
            result.Write(new byte[] {
                0x00, 0x00, 0x00, 0x00, //team hole
                0x00, 0x00, 0x00, 0x00, //HIO
                0x1F, 0x00,             //bunker?
                0x00, 0x00, 0x00, 0x00, //fairway
                0x00, 0x00, 0x00, 0x00, //albatoss
                0x3E, 0x00, 0x00, 0x00, //hole in
                0x50, 0xC2, 0x70, 0x40, //puttin
                0x13, 0xC4, 0x4E, 0x41, //longestputt
            });
            //result.WriteUInt32(UserInfo.UserStatistic.TeamHole);
            //result.WriteUInt32(UserInfo.UserStatistic.HIO);
            //result.WriteUInt16(UserInfo.UserStatistic.Bunker);
            //result.WriteUInt32(UserInfo.UserStatistic.Fairway);
            //result.WriteUInt32(UserInfo.UserStatistic.Albratoss);
            //result.WriteUInt32(UserInfo.UserStatistic.Holein);
            //result.WriteUInt32(UserInfo.UserStatistic.Puttin);
            //result.WriteSingle(UserInfo.UserStatistic.LongestPutt);
            //result.WriteSingle(UserInfo.UserStatistic.LongestChip);
            result.WriteUInt32(UserInfo.UserStatistic.EXP);
            UserInfo.UserStatistic.Level = 70;
            result.WriteByte(UserInfo.UserStatistic.Level);
            result.WriteUInt64(UserInfo.UserStatistic.Pang);//pangs inicias
            result.WriteUInt32(UserInfo.UserStatistic.TotalScore);
            result.WriteByte(UserInfo.UserStatistic.Score[0]);
            result.WriteByte(UserInfo.UserStatistic.Score[1]);
            result.WriteByte(UserInfo.UserStatistic.Score[2]);
            result.WriteByte(UserInfo.UserStatistic.Score[3]);
            result.WriteByte(UserInfo.UserStatistic.Score[4]);
            result.Write(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
                                      0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

                                      0x00, 0x00, 0x00, 0x00,

                                      0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00,
                                      0x00, 0x00, 0x00, 0x00 });

            result.WriteByte(UserInfo.UserStatistic.Unknown1[0]);
            result.WriteByte(UserInfo.UserStatistic.Unknown1[1]);
            result.WriteByte(UserInfo.UserStatistic.Unknown1[2]);
            result.WriteByte(UserInfo.UserStatistic.Unknown1[3]);
            result.WriteByte(UserInfo.UserStatistic.Unknown1[4]);
            result.WriteByte(UserInfo.UserStatistic.Unknown); //Unknow3[5]
            result.WriteUInt32(UserInfo.UserStatistic.GameCountSeason);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[0]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[1]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[2]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[3]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[4]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[5]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[6]);
            result.WriteByte(UserInfo.UserStatistic.Unknown2[7]);
            var response = result.GetBytes();

            return(response);
        }
Пример #15
0
        public static void PlayNormalPapel(GPlayer player)
        {
            var                rnd = new Random();
            byte               Count, IQuantity;
            uint               Stuff;
            AddData            ItemData;
            PangyaBinaryWriter packet;


            packet = new PangyaBinaryWriter();
            try
            {
                ItemData = new AddData();
                Stuff    = 0;
                foreach (var Supply in RandomWeight.FSupplies)
                {
                    ItemData = player.Inventory.Remove(Supply.TypeId, Supply.DelQuantity);
                    if (ItemData.Status)
                    {
                        Stuff = ItemData.ItemIndex;
                        break;
                    }
                }

                if (!ItemData.Status)
                {
                    if (!player.RemovePang(900))
                    {
                        player.SendResponse(new byte[] { 0x1B, 0x02, 0x7A, 0x73, 0x28, 0x00 });
                        return;
                    }
                    Stuff = 0;
                }

                if (rnd.Next(0, 21) + 1 >= 20)
                {
                    // 3 4 5
                    Count = (byte)rnd.Next(3, 6);
                }
                else
                {
                    Count = (byte)rnd.Next(2, 4);
                }
                // 2 3
                packet.WriteUInt32(Stuff);
                packet.WriteUInt32(Count);
                for (var I = 1; I <= Count; I++)
                {
                    var Reward = RandomWeight.GetItems();

                    if (Reward == null)
                    {
                        player.SendResponse(new byte[] { 0x6C, 0x02, 0x7A, 0x73, 0x28, 0x00 });
                        WriteConsole.WriteLine($" Error");
                        break;
                    }

                    if (new Random(0x64).Next() <= 20)
                    {
                        var QNT = rnd.Next((int)Reward.MaxQuantity) + 1;
                        IQuantity = (byte)QNT;
                    }
                    else
                    {
                        IQuantity = 1;
                    }
                    var Item = new AddItem
                    {
                        ItemIffId   = Reward.TypeId,
                        Quantity    = IQuantity,
                        Transaction = true,
                        Day         = 0
                    };
                    ItemData = player.AddItem(Item);

                    packet.WriteInt32(rnd.Next(3));
                    packet.WriteUInt32(ItemData.ItemTypeID);
                    packet.WriteUInt32(ItemData.ItemIndex);
                    packet.WriteUInt32(IQuantity);
                    packet.WriteUInt32(Reward.RareType);
                }
                packet.WriteUInt64(player.GetPang);
                packet.WriteUInt64(player.GetCookie);

                player.SendTransaction();

                player.SendResponse(new byte[] { 0x1B, 0x02, 0x00, 0x00, 0x00, 0x00 }, packet.GetBytes());

                RandomWeight.Restore();

                //{ **Achievement * * }
                //{ **Add Papel Counter ** }
                //player.AddAchivementQuest(1816133706, 1);
                //player.SendAchievement();
            }
            finally
            {
                packet.Dispose();
            }
        }
Пример #16
0
        public static void PlayBigPapel(GPlayer player)
        {
            var                rnd = new Random();
            byte               Count, IQuantity;
            AddData            ItemData;
            PangyaBinaryWriter packet;


            packet = new PangyaBinaryWriter();
            try
            {
                ItemData = new AddData();
                if (!player.RemovePang(10000))
                {
                    player.SendResponse(new byte[] { 0x6C, 0x02, 0x7A, 0x73, 0x28, 0x00 });
                    WriteConsole.WriteLine($" {player.GetLogin} esta sem pangs");
                    return;
                }

                player.SendPang();


                Count = (byte)rnd.Next(4, 10);

                packet.WriteUInt32(Count);

                for (var I = 1; I <= Count; I++)
                {
                    var Reward = RandomWeight.GetItems();
                    if (rnd.Next(0x64) <= 20)
                    {
                        // 3 4 5
                        IQuantity = (byte)rnd.Next(3, 6);
                    }
                    else
                    { // 5 6 7 8 9
                        IQuantity = (byte)rnd.Next(5, 10);
                    }

                    if ((Reward.RareType == 1) || (Reward.RareType == 2))
                    {
                        IQuantity = 1;
                    }
                    var Item = new AddItem
                    {
                        ItemIffId   = Reward.TypeId,
                        Quantity    = IQuantity,
                        Transaction = true,
                        Day         = 0
                    };

                    ItemData = player.AddItem(Item);
                    packet.WriteInt32(rnd.Next(3));
                    packet.WriteUInt32(ItemData.ItemTypeID);
                    packet.WriteUInt32(ItemData.ItemIndex);
                    packet.WriteUInt32(IQuantity);
                    packet.WriteUInt32(Reward.RareType);
                }
                packet.WriteUInt64(player.GetPang);
                packet.WriteUInt64(player.GetCookie);

                player.SendTransaction();

                player.SendResponse(new byte[] { 0x6C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, packet.GetBytes());

                RandomWeight.Restore();
            }
            finally
            {
                packet.Dispose();
            }
        }