public override void BuildPacket() { this.PushIntoStack(pageCount); this.PushIntoStack(userItemArray.Count); foreach (UserItemInfo item in userItemArray) { ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(item.ItemID); DataStruct dsItem = new DataStruct(); int mallPrice = 0; if (itemInfo != null && itemInfo.ItemType == ItemType.ZhuangBei) { mallPrice = UserHelper.StrongEquPayPrice(Uid, item.UserItemID); } else if (itemInfo != null) { mallPrice = ((itemInfo.SalePrice) * item.Num / 4); } dsItem.PushIntoStack(item.UserItemID.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(mallPrice); PushIntoStack(dsItem); } PushIntoStack(ContextUser.GameCoin); PushIntoStack(ContextUser.GoldNum); }
public override void BuildPacket() { PushIntoStack(worshipLv); PushIntoStack(itemName.ToNotNullString()); PushIntoStack(worshipInfo == null ? 0 : worshipInfo.ItemNum); PushIntoStack(worshipInfo == null ? 0 : worshipInfo.GameCoin); PushIntoStack(worshipInfo == null ? 0 : worshipInfo.ObtainNum); PushIntoStack(TrumpHelper.IsUpWorshLv(ContextUser) ? (short)1 : (short)0); PushIntoStack(worshipInfoInfoArray.Length); int propertycount = 0; foreach (var item in worshipInfoInfoArray) { short isFull = 0; GeneralProperty property = GetPropertyType(ContextUser.UserID, propertycount); if (property != null && property.AbilityLv >= TrumpPropertyInfo.MaxTrumpPropertyLv) { isFull = 1; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(property == null ? 0 : (int)property.AbilityType); dsItem.PushIntoStack(property == null ? (short)0 : (short)property.AbilityLv); dsItem.PushIntoStack(totalNum > propertycount ? (short)1 : (short)0); dsItem.PushIntoStack(worshipLv >= item.WorshipLv ? (short)1 : (short)0); dsItem.PushIntoStack(isFull); PushIntoStack(dsItem); propertycount++; } this.PushIntoStack((short)isItem); this.PushIntoStack((short)isCoin); this.PushIntoStack((short)isObtain); PushIntoStack(successNum.ToNotNullString()); }
public override void BuildPacket() { PushIntoStack(ContextUser.GoldNum); PushIntoStack(ContextUser.GameCoin); PushIntoStack(freeNum); PushIntoStack(isSale); PushIntoStack(issTelegrams); PushIntoStack(grayCrystalArray.Count); foreach (GrayCrystal crystal in grayCrystalArray) { CrystalInfo crystalInfo = new ConfigCacheSet<CrystalInfo>().FindKey(crystal.CrystalID) ?? new CrystalInfo(); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(crystal.UserCrystalID); dsItem.PushIntoStack(crystalInfo.CrystalID); dsItem.PushIntoStack(crystalInfo.CrystalName.ToNotNullString()); dsItem.PushIntoStack(crystalInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack((short)crystalInfo.CrystalQuality); PushIntoStack(dsItem); } PushIntoStack(userLightArray.Count); foreach (UserLight light in userLightArray) { ProbabilityInfo probabilityInfo = new ConfigCacheSet<ProbabilityInfo>().FindKey(light.HuntingID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(light.HuntingID); dsItem.PushIntoStack(probabilityInfo == null ? 0 : probabilityInfo.Price); dsItem.PushIntoStack(light.IsLight); PushIntoStack(dsItem); } this.PushIntoStack(prompt.ToNotNullString()); }
public override void BuildPacket() { PushIntoStack(isSuccess); PushIntoStack(memberArray.Count); foreach (GuildMember member in memberArray) { UserCacheGlobal.CheckLoadUser(member.UserID); GameUser gameUser = new PersonalCacheStruct<GameUser>().FindKey(member.UserID); UserGeneral general = UserGeneral.GetMainGeneral(member.UserID); int isHelp = 0; if (member.DevilNum > 1) { isHelp = 1; } else { isHelp = 2; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(member.UserID); dsItem.PushIntoStack(gameUser == null ? string.Empty : gameUser.NickName.ToNotNullString()); dsItem.PushIntoStack(general == null ? string.Empty : general.HeadID.ToNotNullString()); dsItem.PushIntoStack(isHelp); PushIntoStack(dsItem); } PushIntoStack(currNum); PushIntoStack(isPilgrimage); PushIntoStack(chaoShengNum); }
public override void BuildPacket() { PushIntoStack(moreTeam.MorePlot.PlotID); PushIntoStack(moreTeam.MorePlot.PlotName.ToNotNullString()); PushIntoStack(moreTeam.UserList.Count); PushIntoStack(PlotTeamCombat.TeamMaxPeople); PushIntoStack(moreTeam.MorePlot.ItemId); PushIntoStack(moreTeam.MorePlot.ItemName.ToNotNullString()); PushIntoStack(moreTeam.MorePlot.ItemNum); PushIntoStack(moreTeam.MorePlot.ExpNum); PushIntoStack(moreTeam.TeamUser != null && moreTeam.TeamUser.UserId.ToNotNullString().Equals(Uid) ? 1 : 0); PushIntoStack(moreTeam.Status); PushIntoStack(moreTeam.UserList.Count); foreach (var teamUser in moreTeam.UserList) { var gameUser = new GameDataCacheSet<GameUser>().FindKey(teamUser.UserId); UserGeneral general = UserGeneral.GetMainGeneral(teamUser.UserId); CareerInfo careerInfo = null; if (general != null) { careerInfo = new ConfigCacheSet<CareerInfo>().FindKey(general.CareerID); } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(teamUser.UserId); dsItem.PushIntoStack(teamUser.NickName.ToNotNullString()); dsItem.PushIntoStack(careerInfo == null ? 0 : (int)careerInfo.CareerID); dsItem.PushIntoStack(careerInfo == null ? string.Empty : careerInfo.CareerName.ToNotNullString()); dsItem.PushIntoStack(gameUser == null ? (short)0 : gameUser.UserLv); PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(pageCount); PushIntoStack(memberArray.Count); foreach (GuildMember member in memberArray) { GameUser gameUser = UserCacheGlobal.CheckLoadUser(member.UserID); int isOnline = 0; if (gameUser != null && gameUser.IsOnline) { isOnline = 1; } else { isOnline = 2; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(member.UserID); dsItem.PushIntoStack(gameUser == null ? string.Empty : gameUser.NickName.ToNotNullString()); dsItem.PushIntoStack(gameUser == null ? LanguageManager.GetLang().shortInt : gameUser.UserLv); dsItem.PushIntoStack((short)member.PostType); dsItem.PushIntoStack(gameUser == null ? 0 : gameUser.RankID); dsItem.PushIntoStack(member.Contribution); dsItem.PushIntoStack(member.TotalContribution); dsItem.PushIntoStack(gameUser == null ? string.Empty : gameUser.LoginTime.ToString("t")); dsItem.PushIntoStack(isOnline); PushIntoStack(dsItem); } }
public override void BuildPacket() { this.PushIntoStack(abilityInfoArray.Count); foreach (GuildAbilityInfo abilityInfo in abilityInfoArray) { var guildAbilityLvInfos = new ConfigCacheSet<GuildAbilityLvInfo>().FindAll(m => m.ID == abilityInfo.ID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(abilityInfo.ID); dsItem.PushIntoStack(abilityInfo.IsCityCombat ? (short)1 : (short)0); dsItem.PushIntoStack(abilityInfo.AbilityName.ToNotNullString()); dsItem.PushIntoStack((short)abilityInfo.GuildAbilityType); dsItem.PushIntoStack(abilityInfo.AbilityHead.ToNotNullString()); dsItem.PushIntoStack(abilityInfo.AbilityDesc.ToNotNullString()); dsItem.PushIntoStack(guildAbilityLvInfos.Count); foreach (GuildAbilityLvInfo lvInfo in guildAbilityLvInfos) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(lvInfo.AbilityLv); dsItem1.PushIntoStack(lvInfo.UpDonateNum); dsItem1.PushIntoStack(lvInfo.EffectNum.ToString().ToNotNullString()); dsItem.PushIntoStack(dsItem1); } this.PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(codeTime); PushIntoStack(ContextUser.GameCoin); PushIntoStack(ContextUser.GoldNum); PushIntoStack(mysteryShopsList.Count); foreach (MysteryShops shops in mysteryShopsList) { ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(shops.ItemID); int mallPrice = 0; if (itemInfo != null) { mallPrice = itemInfo.MysteryPrice; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(shops.ItemID); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(mallPrice); dsItem.PushIntoStack(shops.ItemNum); dsItem.PushIntoStack(shops.BuyNum == 0 ? 1 : 2); PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(pageCount); PushIntoStack(_itemCount); PushIntoStack(_gridNum); PushIntoStack(ContextUser.GameCoin); PushIntoStack(ContextUser.GoldNum); PushIntoStack(mlist.Count); foreach (UserItemInfo item in mlist) { DataStruct ds = new DataStruct(); ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(item.ItemID); ds.PushIntoStack(item.UserItemID.ToNotNullString()); ds.PushIntoStack(itemInfo == null ? 0 : itemInfo.ItemID); ds.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.ItemType); ds.PushIntoStack(item.Num); ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); ds.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : itemInfo.PropType); ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemDesc.ToNotNullString()); ds.PushIntoStack(itemInfo == null ? 0 : itemInfo.SalePrice); ds.PushIntoStack(itemInfo == null ? 0 : itemInfo.IsUse ? 1 : 0); ds.PushIntoStack(itemInfo == null ? 0 : itemInfo.IsCostly ? 1 : 0); ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.MaxHeadID); ds.PushIntoStack(itemInfo == null ? 0 : itemInfo.PropType != 15 ? 0 : ItemUseHelper.ItemNum(ContextUser.UserID, itemInfo.EffectNum) <= 0 ? 0 : 1); PushIntoStack(ds); } }
public override void BuildPacket() { PushIntoStack(_chargePacksArray.Count); foreach (RechargePacks packs in _chargePacksArray) { short _isRevice = 0; short _isShow = 0; List<PackageReceive> receivesArray = new GameDataCacheSet<PackageReceive>().FindAll(ContextUser.UserID, u => u.IsReceive == false && u.PacksID == packs.PacksID); if (receivesArray.Count == 0) { _isRevice = 2; } else { _isRevice = 1; } SaveLog(receivesArray.Count + ContextUser.UserID + packs.PacksID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(packs.PacksID); dsItem.PushIntoStack(packs.PacksName); dsItem.PushIntoStack(_isRevice); dsItem.PushIntoStack(_isShow); dsItem.PushIntoStack(receivesArray.Count); PushIntoStack(dsItem); } }
public override void BuildPacket() { this.PushIntoStack(heritageList.Count); foreach (var item in heritageList) { UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, item.GeneralID); GeneralInfo general = new ConfigCacheSet<GeneralInfo>().FindKey(item.GeneralID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack((short)item.Type); dsItem.PushIntoStack(userGeneral == null ? 0 : userGeneral.GeneralID); dsItem.PushIntoStack(userGeneral == null ? string.Empty : ObjectExtend.ToNotNullString(userGeneral.GeneralName)); dsItem.PushIntoStack(general == null ? string.Empty : ObjectExtend.ToNotNullString(general.BattleHeadID)); dsItem.PushIntoStack(item.GeneralLv); dsItem.PushIntoStack(item.PowerNum); dsItem.PushIntoStack(item.SoulNum); dsItem.PushIntoStack(item.IntellectNum); dsItem.PushIntoStack(userGeneral == null ? (short)0 : (short)userGeneral.GeneralQuality); this.PushIntoStack(dsItem); } this.PushIntoStack(opsInfoList.Count); foreach (var item in opsInfoList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.Type); dsItem.PushIntoStack(item.VipLv); dsItem.PushIntoStack(item.UseGold); dsItem.PushIntoStack(item.ItemID); dsItem.PushIntoStack(item.ItemNum); this.PushIntoStack(dsItem); } this.PushIntoStack(heritageName.ToNotNullString()); this.PushIntoStack(heritageLv); this.PushIntoStack(disGeneralName.ToNotNullString()); }
public override void BuildPacket() { this.PushIntoStack(TaskHelper.DailyEveryMaxNum); this.PushIntoStack(currNum); this.PushIntoStack(userTaskList.Count); foreach (UserTask userTask in userTaskList) { DailyTaskInfo dtaskInfo = new ConfigCacheSet<DailyTaskInfo>().FindKey(userTask.TaskID); var userItem = userTask.GetDailyItem(userLv); ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem != null ? userItem.ItemID : 0); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(userTask.TaskID); dsItem.PushIntoStack(dtaskInfo.TaskName.ToNotNullString()); dsItem.PushIntoStack((short)userTask.TaskState); dsItem.PushIntoStack((short)userTask.TaskType); dsItem.PushIntoStack((short)userTask.TaskStar); dsItem.PushIntoStack(dtaskInfo.TaskDescp.ToNotNullString()); dsItem.PushIntoStack(dtaskInfo.TaskTarget); dsItem.PushIntoStack((int)userTask.TaskStar); dsItem.PushIntoStack(userTask.TaskTargetNum.ToInt()); dsItem.PushIntoStack(userTask.GetDailyExpNum(userLv)); dsItem.PushIntoStack(itemInfo != null ? itemInfo.ItemName.ToNotNullString() : string.Empty); dsItem.PushIntoStack(userItem != null ? userItem.Num : 0); this.PushIntoStack(dsItem); } }
public override void BuildPacket() { this.PushIntoStack(medicineArray.Length); foreach (string item in medicineArray) { short mType = (short)medicineType; string[] mArray = item.Replace("{", "").Replace("}", "").Split('='); short medicineLv = 0; int useGold = 0; List<ItemBaseInfo> itemInfoArray = new List<ItemBaseInfo>(); if (mArray.Length > 0) { string q = mArray[0]; string b = mArray[1]; medicineLv = q.ToShort(); useGold = b.ToShort(); itemInfoArray = new ConfigCacheSet<ItemBaseInfo>().FindAll(u => u.MedicineLv.Equals(medicineLv) && u.MedicineType.Equals(mType) && u.ItemType == ItemType.YaoJi); } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(itemInfoArray.Count == 0 ? 0 : itemInfoArray[0].ItemID); dsItem.PushIntoStack(itemInfoArray.Count == 0 ? string.Empty : itemInfoArray[0].ItemName.ToNotNullString()); dsItem.PushIntoStack(medicineLv); dsItem.PushIntoStack(itemInfoArray.Count == 0 ? string.Empty : itemInfoArray[0].HeadID.ToNotNullString()); dsItem.PushIntoStack(useGold); this.PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(bossPlotID); PushIntoStack(_guild == null ? (short)0 : _guild.GuildBossInfo.BossLv); PushIntoStack(_guild == null ? 0 : _guild.ColdTime); PushIntoStack(_regNum); PushIntoStack(_guild == null ? (short)0 : _guild.CombatStatus.ToShort()); PushIntoStack((_inspirePercent * 100).ToInt()); PushIntoStack(_reLiveNum); PushIntoStack(_bossUserList.Count); foreach (BossUser bossUser in _bossUserList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(bossUser.NickName.ToNotNullString()); UserGeneral userGeneral = UserGeneral.GetMainGeneral(bossUser.UserId); dsItem.PushIntoStack(userGeneral == null ? string.Empty : userGeneral.HeadID.ToNotNullString()); dsItem.PushIntoStack(bossUser.IsRelive ? 0 : 1); dsItem.PushIntoStack(bossUser.CodeTime); dsItem.PushIntoStack(NoviceHelper.IsWingFestivalInfo(bossUser.UserId) ? (short)1 : (short)0); dsItem.PushIntoStack(0); PushIntoStack(dsItem); } PushIntoStack((_reliveInspirePercent * 100).ToInt()); }
public override void BuildPacket() { PushIntoStack(pageCount); PushIntoStack(userRankArray.Count); foreach (UserRank userInfo in userRankArray) { if (rankType == RankType.UserLv) { baseNum = userInfo.UserLv; } else if (rankType == RankType.Obtion) { baseNum = userInfo.ObtainNum; } else if (rankType == RankType.GameCoin) { baseNum = userInfo.GameCoin; } else if (rankType == RankType.ZhanLi) { baseNum = userInfo.TotalCombatNum; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(userInfo.RankId); dsItem.PushIntoStack(userInfo.UserID.ToNotNullString()); dsItem.PushIntoStack(userInfo.NickName.ToNotNullString()); dsItem.PushIntoStack(baseNum); dsItem.PushIntoStack((short)userInfo.CountryID); dsItem.PushIntoStack((short)userInfo.VipLv); PushIntoStack(dsItem); } PushIntoStack(currRankID); }
public override void BuildPacket() { PushIntoStack(_currVersion); PushIntoStack(_chatArray.Count); foreach (var chatMessage in _chatArray) { var chat = chatMessage as ChatData ?? new ChatData(); UserFriends friends = new ShareCacheStruct<UserFriends>().FindKey(ContextUser.UserID, chat.FromUserID); int isFriend = friends != null && friends.FriendType == FriendType.Friend ? 1 : 2; DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(chat.FromUserID.ToNotNullString()); dsItem.PushIntoStack(chat.FromUserName.ToNotNullString()); dsItem.PushIntoStack(chat.Content.ToNotNullString()); dsItem.PushIntoStack(FormatDate(chat.SendDate)); dsItem.PushIntoStack((short)chat.ChatType); dsItem.PushIntoStack(chat.ToUserID.ToNotNullString()); dsItem.PushIntoStack(chat.ToUserName.ToNotNullString()); dsItem.PushIntoStack(isFriend); dsItem.PushIntoStack(chat.FromUserVip); dsItem.PushIntoStack(chat.ToUserVip); PushIntoStack(dsItem); } PushIntoStack(_charItemNum); }
public override void BuildPacket() { PushIntoStack(_pageCount); PushIntoStack(ContextUser.GameCoin); PushIntoStack(ContextUser.GoldNum); PushIntoStack(_mallItemsInfoArray.Count); foreach (MallItemsInfo mallItems in _mallItemsInfoArray) { ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(mallItems.ItemID); int mallPrice = 0; int specilPrice = 0; if (itemInfo != null) { mallPrice = mallItems.Price; if (mallItems.MallType == ShopType.Props || mallItems.MallType == ShopType.PresendBox) { mallPrice = (FestivalHelper.StoreDiscount() * mallPrice).ToInt(); } specilPrice = mallItems.SpecialPrice; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(mallItems.ItemID); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.MaxHeadID.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemDesc.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType); dsItem.PushIntoStack(mallPrice); dsItem.PushIntoStack(specilPrice); dsItem.PushIntoStack(mallItems.SeqNO); dsItem.PushIntoStack((short)_commandType); PushIntoStack(dsItem); } PushIntoStack(ContextUser.ObtainNum); }
public override void BuildPacket() { this.PushIntoStack(userGeneral == null ? string.Empty : userGeneral.GeneralName.ToNotNullString()); this.PushIntoStack(userGeneral == null ? string.Empty : userGeneral.HeadID.ToNotNullString()); this.PushIntoStack(userGeneral == null ? (short)0 : userGeneral.FeelLv); this.PushIntoStack(userGeneral == null ? 0 : userGeneral.FeelExperience); this.PushIntoStack(upExperience); this.PushIntoStack(giftName.ToNotNullString()); this.PushIntoStack(userGeneral == null ? (short)0 : userGeneral.SaturationNum); this.PushIntoStack(goldNum); this.PushIntoStack(skillName.ToNotNullString()); this.PushIntoStack(demandLv); this.PushIntoStack(isLearn); this.PushIntoStack(skillDesc.ToNotNullString()); this.PushIntoStack(isSaturation); this.PushIntoStack(propertyList.Count); foreach (var item in propertyList) { int upNum = GiftHelper.FeelUpPropertyNum(ContextUser.UserID, generalID, item.AbilityType); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack((int)item.AbilityType); dsItem.PushIntoStack((int)item.AbilityValue); dsItem.PushIntoStack(upNum); this.PushIntoStack(dsItem); } }
public override void BuildPacket() { var cacheSetItemEqu = new ShareCacheStruct<ItemEquAttrInfo>(); PushIntoStack(_userItemArray.Count); foreach (UserItemInfo item in _userItemArray) { ItemBaseInfo itemInfo = new ShareCacheStruct<ItemBaseInfo>().FindKey(item.ItemID); var general = new PersonalCacheStruct<UserGeneral>().FindKey(Uid, item.GeneralID); var itemEquList = cacheSetItemEqu.FindAll(e => e.ItemID.Equals(item.ItemID)); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.UserItemID.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(item.ItemLv); dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType); dsItem.PushIntoStack(general != null ? general.GeneralName : string.Empty); PushIntoStack(dsItem); dsItem.PushIntoStack(itemEquList.Count); foreach (var itemEquAttrInfo in itemEquList) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(itemEquAttrInfo.AttributeID.ToInt()); int strengNum = 0; strengNum = MathUtils.Addition(itemEquAttrInfo.BaseNum, (itemEquAttrInfo.IncreaseNum * item.ItemLv), int.MaxValue); // dsItem1.PushIntoStack(itemEqu.BaseNum); dsItem1.PushIntoStack(strengNum); dsItem.PushIntoStack(dsItem1); } } }
public override void BuildPacket() { this.PushIntoStack(itemBaseList.Count); foreach (ItemBaseInfo itemInfo in itemBaseList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(itemInfo.ItemID); dsItem.PushIntoStack(itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(itemInfo.ItemDesc.ToNotNullString()); dsItem.PushIntoStack(itemInfo.ItemType.ToShort()); dsItem.PushIntoStack(itemInfo.EquParts.ToShort()); dsItem.PushIntoStack(itemInfo.QualityType.ToShort()); dsItem.PushIntoStack(itemInfo.DemandLv.ToShort()); string[] careerList = itemInfo.CareerRange.Split(new char[] { ',' }); dsItem.PushIntoStack(careerList.Length); foreach (string CareerID in careerList) { CareerInfo careerInfo = new ConfigCacheSet<CareerInfo>().FindKey(CareerID.ToInt()); DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(careerInfo != null ? careerInfo.CareerID.ToInt() : (int)0); dsItem1.PushIntoStack(careerInfo != null ? careerInfo.CareerName.ToNotNullString() : string.Empty); dsItem.PushIntoStack(dsItem1); } var equList = new ConfigCacheSet<ItemEquAttrInfo>().FindAll(m => m.ItemID == itemInfo.ItemID); dsItem.PushIntoStack(equList.Count); foreach (ItemEquAttrInfo equ in equList) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(equ.AttributeID.ToInt()); dsItem1.PushIntoStack(equ.BaseNum); dsItem1.PushIntoStack(equ.IncreaseNum); dsItem.PushIntoStack(dsItem1); } dsItem.PushIntoStack(itemInfo.MedicineType); dsItem.PushIntoStack(itemInfo.MedicineLv); dsItem.PushIntoStack(itemInfo.MedicineNum); dsItem.PushIntoStack(itemInfo.PropType); dsItem.PushIntoStack(itemInfo.EffectNum.ToNotNullString()); var itemSynthesisList = new ConfigCacheSet<ItemSynthesisInfo>().FindAll(m => m.ItemID == itemInfo.ItemID); dsItem.PushIntoStack(itemSynthesisList.Count); foreach (ItemSynthesisInfo synthesisInfo in itemSynthesisList) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(synthesisInfo.SynthesisID); dsItem1.PushIntoStack(synthesisInfo.DemandNum); dsItem1.PushIntoStack(synthesisInfo.SynthesisNum); dsItem.PushIntoStack(dsItem1); } this.PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(firstName.ToNotNullString()); this.PushIntoStack((short)postType); this.PushIntoStack((short)isApply); this.PushIntoStack(fightList.Count); foreach (var fight in fightList) { CityInfo cityInfo = new ConfigCacheSet<CityInfo>().FindKey(fight.CityID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(fight.CityID); dsItem.PushIntoStack(cityInfo == null ? string.Empty : cityInfo.CityName.ToNotNullString()); dsItem.PushIntoStack(fight.CityHead.ToNotNullString()); dsItem.PushIntoStack((short)fight.GuildLv); dsItem.PushIntoStack(fight.SkillNum); this.PushIntoStack(dsItem); } this.PushIntoStack(currCityName.ToNotNullString()); this.PushIntoStack(rewardDesc.ToNotNullString()); this.PushIntoStack(guildName.ToNotNullString()); this.PushIntoStack(endData); this.PushIntoStack((short)isChampion); }
public override void BuildPacket() { PushIntoStack(_userMagicArray.Count); foreach (UserMagic userMagic in _userMagicArray) { MagicInfo magicInfo = new ConfigCacheSet<MagicInfo>().FindKey(userMagic.MagicID); short repostion = GeneralHelper.ReplacePostion(ContextUser.UserID, userMagic.MagicID); DataStruct ds = new DataStruct(); ds.PushIntoStack(userMagic.MagicID); ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.MagicName.ToNotNullString()); ds.PushIntoStack((short)userMagic.MagicLv); ds.PushIntoStack(userMagic.IsEnabled == false ? 0 : 1); ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.MagicDesc.ToNotNullString()); string gridPostion = string.Empty; string[] gridRanges = new string[0]; MagicLvInfo magicLv = new ConfigCacheSet<MagicLvInfo>().FindKey(userMagic.MagicID, userMagic.MagicLv); if (magicLv != null) { var userFunction = new GameDataCacheSet<UserFunction>().FindKey(ContextUser.UserID, FunctionEnum.ReplaceGeneral); gridPostion = magicLv.GridRange; if (magicLv.ReplacePostion > 0 && userFunction != null) { gridPostion = gridPostion.TrimEnd(',') + "," + magicLv.ReplacePostion; } } gridRanges = gridPostion.Split(','); ds.PushIntoStack(gridRanges.Length); foreach (string gridRang in gridRanges) { int isDisplace = repostion == gridRang.ToInt() ? 1 : 0; UserEmbattle userEmbattle = new GameDataCacheSet<UserEmbattle>().FindKey(ContextUser.UserID, userMagic.MagicID, gridRang.ToShort()); UserGeneral uGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, userEmbattle == null ? 0 : userEmbattle.GeneralID); DataStruct ds1 = new DataStruct(); ds1.PushIntoStack(uGeneral == null ? (short)0 : (short)1); ds1.PushIntoStack(gridRang.ToShort()); ds1.PushIntoStack(uGeneral == null ? 0 : uGeneral.GeneralID); ds1.PushIntoStack(uGeneral == null ? string.Empty : uGeneral.HeadID.ToNotNullString()); ds1.PushIntoStack((short)isDisplace); ds1.PushShortIntoStack(uGeneral == null ? (short)0 : MathUtils.ToShort(uGeneral.GeneralQuality)); ds.PushIntoStack(ds1); } PushIntoStack(ds); } // 获取佣兵品质 var generalInfoCacheSet = new ShareCacheStruct<GeneralInfo>(); PushIntoStack(_userGeneralArray.Count); foreach (UserGeneral general in _userGeneralArray) { GeneralInfo generalInfo = generalInfoCacheSet.FindKey(general.GeneralID); DataStruct ds = new DataStruct(); ds.PushIntoStack(general.GeneralID); ds.PushIntoStack(general.HeadID.ToNotNullString()); ds.PushShortIntoStack(generalInfo == null ? (short)0 : MathUtils.ToShort(generalInfo.GeneralQuality)); PushIntoStack(ds); } }
public override void BuildPacket() { PushIntoStack(userItemArray.Count); foreach (var item in userItemArray) { short isStrong = 0; int strongMoney = new UserItemHelper(item).StrongMoney; if (item.ItemLv >= ContextUser.UserLv || strongMoney > ContextUser.GameCoin) { isStrong = 1; } ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(item.ItemID); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item == null ? string.Empty : item.UserItemID.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? 0 : itemInfo.ItemID); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(item == null ? LanguageManager.GetLang().shortInt : item.ItemLv); dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType); dsItem.PushIntoStack(item == null ? 0 : strongMoney); dsItem.PushIntoStack(coldTime); dsItem.PushIntoStack(isStrong); dsItem.PushIntoStack(UserHelper.StrongEquPayPrice(Uid, item.UserItemID)); List<ItemEquAttrInfo> itemEquArray = new ConfigCacheSet<ItemEquAttrInfo>().FindAll(e => e.ItemID.Equals(item.ItemID)); //当前等级装备属性 dsItem.PushIntoStack(itemEquArray.Count); foreach (ItemEquAttrInfo equ in itemEquArray) { DataStruct dsDetail = new DataStruct(); dsDetail.PushIntoStack((int)equ.AttributeID); if (equ != null && item != null) { baseNum = MathUtils.Addition(equ.BaseNum, item.ItemLv * equ.IncreaseNum, int.MaxValue); } dsDetail.PushIntoStack(baseNum); dsItem.PushIntoStack(dsDetail); } //下级别装备属性 dsItem.PushIntoStack(itemEquArray.Count); foreach (ItemEquAttrInfo equ in itemEquArray) { DataStruct dsDetail = new DataStruct(); dsDetail.PushIntoStack((int)equ.AttributeID); if (equ != null && item != null) { stengBaseNum = MathUtils.Addition(equ.BaseNum, (int)(MathUtils.Addition(item.ItemLv, (short)1, short.MaxValue)) * equ.IncreaseNum, int.MaxValue); } dsDetail.PushIntoStack(stengBaseNum); dsItem.PushIntoStack(dsDetail); } PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(plotInfo.PlotName.ToNotNullString()); PushIntoStack(plotInfo.BgScene.ToNotNullString()); PushIntoStack(plotInfo.FgScene.ToNotNullString()); PushIntoStack(npcList.Count); foreach (PlotNPCInfo item in npcList) { DataStruct ds = new DataStruct(); ds.PushIntoStack(item.PlotNpcID); ds.PushIntoStack(item.NpcSeqNo); ds.PushIntoStack(item.NpcName.ToNotNullString()); ds.PushIntoStack(item.HeadID.ToNotNullString()); ds.PushIntoStack(item.NpcTip.ToNotNullString()); ds.PushIntoStack(item.PointX); ds.PushIntoStack(item.PointY); bool isPlayStory = false; var userPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, plotID); if (userPlot == null || userPlot.PlotStatus != PlotStatus.Completed) { isPlayStory = true; } ds.PushIntoStack(isPlayStory ? item.PreStoryCode.ToNotNullString() : string.Empty); ds.PushIntoStack(isPlayStory ? item.AftStoryCode.ToNotNullString() : string.Empty); PushIntoStack(ds); } PushIntoStack(_isOverCombat ? (short)1 : (short)0); PushIntoStack(_plotNum); }
public override void BuildPacket() { PushIntoStack(_pageCount); PushIntoStack(_petRunPools.Count); foreach (var item in _petRunPools) { var user = UserCacheGlobal.LoadOffline(item.UserID) ?? new GameUser(); string guidName = string.Empty; if (!string.IsNullOrEmpty(user.MercenariesID)) { guidName = (new ShareCacheStruct<UserGuild>().FindKey(user.MercenariesID) ?? new UserGuild()).GuildName; } string friendName = string.Empty; if (!string.IsNullOrEmpty(item.FriendID)) { friendName = (UserCacheGlobal.LoadOffline(item.FriendID) ?? new GameUser()).NickName; } DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.UserID.ToNotNullString()); dsItem.PushIntoStack(user.NickName.ToNotNullString()); dsItem.PushIntoStack(user.UserLv); dsItem.PushIntoStack(guidName.ToNotNullString()); dsItem.PushIntoStack(item.ColdTime); dsItem.PushIntoStack(item.PetID); dsItem.PushIntoStack(friendName.ToNotNullString()); dsItem.PushIntoStack(item.InterceptGameCoin); dsItem.PushIntoStack(item.InterceptObtainNum); this.PushIntoStack(dsItem); } }
public override void BuildPacket() { this.PushIntoStack(_generalArray.Length); foreach (var general in _generalArray) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(general.GeneralID); dsItem.PushIntoStack(general.GeneralName.ToNotNullString()); this.PushIntoStack(dsItem); } this.PushIntoStack(_firstName.ToNotNullString()); this.PushIntoStack(_headID.ToNotNullString()); this.PushIntoStack(_lifeNum); this.PushIntoStack((short)_careerID); this.PushIntoStack(_careerName.ToNotNullString()); this.PushIntoStack((short)_powerNum); this.PushIntoStack((short)_soulNum); this.PushIntoStack((short)_intellectNum); this.PushIntoStack(_abilityName.ToNotNullString()); this.PushIntoStack(_abilityDesc.ToNotNullString()); this.PushIntoStack((short)_isRecruit); this.PushIntoStack(_storyTaskArray.Length); foreach (var task in _storyTaskArray) { int collectNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, task.TargetItemID); PlotInfo plotInfo = new ShareCacheStruct<PlotInfo>().FindKey(task.PlotID); ItemBaseInfo itemInfo = new ShareCacheStruct<ItemBaseInfo>().FindKey(task.TargetItemID); iscomplete = GeneralHelper.IsComplete(ContextUser, task); DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(task.TaskID); dsItem.PushIntoStack(task.TaskName.ToNotNullString()); dsItem.PushIntoStack(task.TaskDescp.ToNotNullString()); dsItem.PushIntoStack(plotInfo == null ? 0 : plotInfo.CityID); dsItem.PushIntoStack(task.PlotID); dsItem.PushIntoStack(task.TargetItemID); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString()); dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString()); dsItem.PushIntoStack(collectNum); dsItem.PushIntoStack(task.TargetItemNum); dsItem.PushIntoStack((short)iscomplete); dsItem.PushIntoStack(task.Reward.Count); foreach (var prize in task.Reward) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack((short)prize.Type); dsItem1.PushIntoStack(GeneralHelper.PrizeItemName(prize).ToNotNullString()); dsItem1.PushIntoStack(prize.Num); dsItem.PushIntoStack(dsItem1); } this.PushIntoStack(dsItem); } }
public override void BuildPacket() { this.PushIntoStack(versionList.Count); foreach (ConfigVersion version in versionList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(version.ActionID); dsItem.PushIntoStack(version.CurVersion); this.PushIntoStack(dsItem); } }
public override void BuildPacket() { PushIntoStack(pageCount); PushIntoStack(rankingList.Count); foreach (var item in rankingList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(item.UserName); dsItem.PushIntoStack(item.Score); //Console.WriteLine("Num count:{0}", item.Items.Count); PushIntoStack(dsItem); } }
/// <summary> /// 创建返回协议内容输出栈 /// </summary> public override void BuildPacket() { PushIntoStack(appList.Count); foreach (var item in appList) { DataStruct ds = new DataStruct(); ds.PushIntoStack(item.Dollar.ToString()); ds.PushIntoStack(item.ProductId); ds.PushIntoStack(item.SilverPiece); PushIntoStack(ds); } }
public override void BuildPacket() { this.PushIntoStack(bossDatesList.Count); foreach (BossDate bossDate in bossDatesList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack((short)bossDate.EnableWeek); dsItem.PushIntoStack(IsSelect(guildID, bossDate)); PushIntoStack(dsItem); } PushIntoStack(isWeek); }
/// <summary> /// /// </summary> public void PushIntoStack(UInt64 obj) { dataStruct.PushIntoStack(obj); }
/// <summary> /// int类型 /// </summary> /// <param name="obj"></param> public void PushIntoStack(int obj) { dataStruct.PushIntoStack(obj); }