public GSPacketIn SendAuctionRefresh(AuctionInfo info, int auctionID, bool isExist, ItemInfo item) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.AUCTION_REFRESH); pkg.WriteInt(auctionID); pkg.WriteBoolean(isExist); if (isExist) { pkg.WriteInt(info.AuctioneerID); pkg.WriteString(info.AuctioneerName); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.BuyerID); pkg.WriteString(info.BuyerName); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Mouthful); pkg.WriteInt(info.PayType); pkg.WriteInt(info.Price); pkg.WriteInt(info.Rise); pkg.WriteInt(info.ValidDate); pkg.WriteBoolean(item != null); if (item != null) { pkg.WriteInt(item.Count); pkg.WriteInt(item.TemplateID); pkg.WriteInt(item.AttackCompose); pkg.WriteInt(item.DefendCompose); pkg.WriteInt(item.AgilityCompose); pkg.WriteInt(item.LuckCompose); pkg.WriteInt(item.StrengthenLevel); pkg.WriteBoolean(item.IsBinds); pkg.WriteBoolean(item.IsJudge); pkg.WriteDateTime(item.BeginDate); pkg.WriteInt(item.ValidDate); pkg.WriteString(item.Color); pkg.WriteString(item.Skin); pkg.WriteBoolean(item.IsUsed); } } pkg.Compress(); SendTCP(pkg); return pkg; }
public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240); pkg.WriteInt(player.ID); pkg.WriteInt(player.Agility); pkg.WriteInt(player.Attack); pkg.WriteString(player.Colors); pkg.WriteString(player.Skin); pkg.WriteInt(player.Defence); pkg.WriteInt(player.GP); pkg.WriteInt(player.Grade); pkg.WriteInt(player.Luck); pkg.WriteInt(player.Hide); pkg.WriteInt(player.Repute); pkg.WriteBoolean(player.Sex); pkg.WriteString(player.Style); pkg.WriteInt(player.Offer); pkg.WriteString(player.NickName); pkg.WriteBoolean(true); pkg.WriteInt(5); pkg.WriteInt(player.Win); pkg.WriteInt(player.Total); pkg.WriteInt(player.Escape); pkg.WriteInt(player.ConsortiaID); pkg.WriteString(player.ConsortiaName); pkg.WriteInt(player.RichesOffer); pkg.WriteInt(player.RichesRob); pkg.WriteBoolean(player.IsMarried); pkg.WriteInt(player.SpouseID); pkg.WriteString(player.SpouseName); pkg.WriteString(player.DutyName); pkg.WriteInt(player.Nimbus); pkg.WriteInt(player.FightPower); pkg.WriteInt(5); pkg.WriteInt(-1); pkg.WriteString("Master"); pkg.WriteInt(5); pkg.WriteString("HoNorMaster"); //AchievementPoint pkg.WriteInt(9999); pkg.WriteString("Honor"); pkg.WriteDateTime(DateTime.Now.AddDays(-2)); pkg.WriteInt(items.Count); foreach (ItemInfo info in items) { pkg.WriteByte((byte)info.BagType); pkg.WriteInt(info.UserID); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Count); pkg.WriteInt(info.Place); pkg.WriteInt(info.TemplateID); pkg.WriteInt(info.AttackCompose); pkg.WriteInt(info.DefendCompose); pkg.WriteInt(info.AgilityCompose); pkg.WriteInt(info.LuckCompose); pkg.WriteInt(info.StrengthenLevel); pkg.WriteBoolean(info.IsBinds); pkg.WriteBoolean(info.IsJudge); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteString(info.Color); pkg.WriteString(info.Skin); pkg.WriteBoolean(info.IsUsed); pkg.WriteInt(info.Hole1); pkg.WriteInt(info.Hole2); pkg.WriteInt(info.Hole3); pkg.WriteInt(info.Hole4); pkg.WriteInt(info.Hole5); pkg.WriteInt(info.Hole6); pkg.WriteString(info.Template.Pic); pkg.WriteInt(info.Template.RefineryLevel); pkg.WriteDateTime(DateTime.Now); pkg.WriteByte(5); pkg.WriteInt(5); pkg.WriteByte(5); pkg.WriteInt(5); //item.Hole5Level = pkg.readByte(); //item.Hole5Exp = pkg.readInt(); //item.Hole6Level = pkg.readByte(); //item.Hole6Exp = pkg.readInt(); } pkg.Compress(); SendTCP(pkg); return pkg; }
public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items) { GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240); pkg.WriteInt(player.ID); pkg.WriteString(player.NickName); pkg.WriteInt(player.Agility); pkg.WriteInt(player.Attack); pkg.WriteString(player.Colors); pkg.WriteString(player.Skin); pkg.WriteInt(player.Defence); pkg.WriteInt(player.GP); pkg.WriteInt(player.Grade); pkg.WriteInt(player.Luck); pkg.WriteInt(player.hp);//_loc_5.hp = _loc_2.readInt(); pkg.WriteInt(player.Hide); pkg.WriteInt(player.Repute); pkg.WriteBoolean(player.Sex); pkg.WriteString(player.Style); pkg.WriteInt(player.Offer); pkg.WriteByte(player.typeVIP); pkg.WriteInt(player.VIPLevel); pkg.WriteInt(player.Win); pkg.WriteInt(player.Total); pkg.WriteInt(player.Escape); pkg.WriteInt(player.ConsortiaID); pkg.WriteString(player.ConsortiaName); pkg.WriteInt(0);//_loc_5.badgeID = _loc_2.readInt(); pkg.WriteInt(player.RichesOffer); pkg.WriteInt(player.RichesRob); pkg.WriteBoolean(player.IsMarried); pkg.WriteInt(player.SpouseID); pkg.WriteString(player.SpouseName); pkg.WriteString(player.DutyName); pkg.WriteInt(player.Nimbus); pkg.WriteInt(player.FightPower); pkg.WriteInt(5);//apprenticeshipState = _loc_2.readInt(); pkg.WriteInt(-1);//masterID = _loc_2.readInt(); pkg.WriteString("Master");//setMasterOrApprentices(_loc_2.readUTF()); pkg.WriteInt(0);//graduatesCount = _loc_2.readInt(); pkg.WriteString("HoNorMaster");//honourOfMaster = _loc_2.readUTF(); pkg.WriteInt(player.AchievementPoint);// pkg.WriteString("Tân Binh");//honor = _loc_2.readUTF(); pkg.WriteDateTime(DateTime.Now.AddDays(-2)); pkg.WriteInt(player.Offer); //_loc_5.spdTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.attTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.defTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.hpTexpExp = _loc_2.readInt(); pkg.WriteInt(player.Offer); //_loc_5.lukTexpExp = _loc_2.readInt(); pkg.WriteBoolean(false); //_loc_5.DailyLeagueFirst = _loc_2.readBoolean(); pkg.WriteInt(player.Offer); //_loc_5.DailyLeagueLastScore = _loc_2.readInt(); pkg.WriteInt(items.Count); foreach (ItemInfo info in items) { pkg.WriteByte((byte)info.BagType); pkg.WriteInt(info.UserID); pkg.WriteInt(info.ItemID); pkg.WriteInt(info.Count); pkg.WriteInt(info.Place); pkg.WriteInt(info.TemplateID); pkg.WriteInt(info.AttackCompose); pkg.WriteInt(info.DefendCompose); pkg.WriteInt(info.AgilityCompose); pkg.WriteInt(info.LuckCompose); pkg.WriteInt(info.StrengthenLevel); pkg.WriteBoolean(info.IsBinds); pkg.WriteBoolean(info.IsJudge); pkg.WriteDateTime(info.BeginDate); pkg.WriteInt(info.ValidDate); pkg.WriteString(info.Color); pkg.WriteString(info.Skin); pkg.WriteBoolean(info.IsUsed); pkg.WriteInt(info.Hole1); pkg.WriteInt(info.Hole2); pkg.WriteInt(info.Hole3); pkg.WriteInt(info.Hole4); pkg.WriteInt(info.Hole5); pkg.WriteInt(info.Hole6); pkg.WriteString(info.Template.Pic); pkg.WriteInt(info.Template.RefineryLevel); pkg.WriteDateTime(DateTime.Now); pkg.WriteByte((byte)info.Hole5Level); pkg.WriteInt(info.Hole5Exp); pkg.WriteByte((byte)info.Hole6Level); pkg.WriteInt(info.Hole6Exp); if (info.IsGold) { pkg.WriteBoolean(info.IsGold);//_loc_8.isGold = _loc_2.readBoolean(); pkg.WriteInt(365);//_loc_8.goldValidDate = _loc_2.readInt(); pkg.WriteDateTime(DateTime.Now);//_loc_8.goldBeginTime = _loc_2.readDateString(); } else { pkg.WriteBoolean(false); } } pkg.Compress(); SendTCP(pkg); return pkg; }