本文整理汇总了C#中ZyGames.Framework.Game.Service.DataStruct类的典型用法代码示例。如果您正苦于以下问题:C# DataStruct类的具体用法?C# DataStruct怎么用?C# DataStruct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataStruct类属于ZyGames.Framework.Game.Service命名空间,在下文中一共展示了DataStruct类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildPacket
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);
}
}
示例2: BuildPacket
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);
}
示例3: BuildPacket
public override void BuildPacket()
{
this.PushIntoStack(currNum);
this.PushIntoStack(unopened);
this.PushIntoStack(userGeneralArray.Count);
foreach (var general in userGeneralArray)
{
int worseNum = 0;
int demandNum = 0;
short isRecruit = GeneralHelper.IsGeneralRecruit(general.UserID, general.GeneralID, out worseNum, out demandNum);
DataStruct dsItem = new DataStruct();
dsItem.PushIntoStack(general.GeneralID);
dsItem.PushIntoStack(general.GeneralName.ToNotNullString());
dsItem.PushIntoStack(general.HeadID.ToNotNullString());
dsItem.PushIntoStack(general.GeneralLv);
dsItem.PushIntoStack((short)general.GeneralQuality);
dsItem.PushIntoStack(general.AtmanNum);
dsItem.PushIntoStack(worseNum);
dsItem.PushIntoStack((short)isRecruit);
dsItem.PushIntoStack(general.IsBattle ? 1 : 0);
dsItem.PushIntoStack(demandNum);
this.PushIntoStack(dsItem);
}
PushIntoStack(_isEnabled);
}
示例4: BuildPacket
public override void BuildPacket()
{
this.PushIntoStack(magicList.Count);
foreach (MagicInfo magicInfo in magicList)
{
DataStruct dsItem = new DataStruct();
dsItem.PushIntoStack(magicInfo.MagicID);
dsItem.PushIntoStack(magicInfo.MagicType.ToInt());
dsItem.PushIntoStack(magicInfo.MagicName.ToNotNullString());
dsItem.PushIntoStack(magicInfo.HeadID.ToNotNullString());
dsItem.PushIntoStack(magicInfo.MagicDesc.ToNotNullString());
var magicLvList = new ConfigCacheSet<MagicLvInfo>().FindAll(m => m.MagicID == magicInfo.MagicID);
dsItem.PushIntoStack(magicLvList.Count);
foreach (MagicLvInfo magicLv in magicLvList)
{
DataStruct dsItem1 = new DataStruct();
dsItem1.PushIntoStack(magicLv.MagicLv.ToShort());
dsItem1.PushIntoStack(magicLv.ExpNum);
dsItem1.PushIntoStack(magicLv.ColdTime);
dsItem1.PushIntoStack(magicLv.EscalateMinLv.ToShort());
dsItem1.PushIntoStack(magicLv.AbilityType.ToShort());
dsItem1.PushIntoStack(magicLv.EffectNum.ToNotNullString());
dsItem1.PushIntoStack(magicLv.GridMaxNum);
dsItem.PushIntoStack(dsItem1);
}
this.PushIntoStack(dsItem);
}
}
示例5: BuildPacket
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);
}
}
示例6: BuildPacket
public override void BuildPacket()
{
PushIntoStack(pageCount);
PushIntoStack(ContextUser.ExpNum);
PushIntoStack(queueID);
PushIntoStack(coldTime);
PushIntoStack(userMagicArray.Count);
foreach (UserMagic magic in userMagicArray)
{
magicInfo = new ConfigCacheSet<MagicInfo>().FindKey(magic.MagicID);
if (IsUp(magic.MagicID, magic.MagicLv, ContextUser))
{
isUp = 1;
}
else
{
isUp = 0;
}
DataStruct ds = new DataStruct();
ds.PushIntoStack(magic.MagicID);
ds.PushIntoStack((int)magic.MagicType);
ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.MagicName.ToNotNullString());
ds.PushIntoStack(magicInfo == null ? string.Empty : magicInfo.HeadID.ToNotNullString());
ds.PushIntoStack((short)magic.MagicLv);
ds.PushIntoStack(isUp);
ds.PushIntoStack(magic.IsOpen ? 1 : 0);
ds.PushIntoStack(magic.IsLv);
PushIntoStack(ds);
}
}
示例7: BuildPacket
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);
}
}
示例8: BuildPacket
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);
}
}
示例9: BuildPacket
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);
}
}
示例10: BuildPacket
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);
}
示例11: BuildPacket
public override void BuildPacket()
{
this.PushIntoStack(pageCount);
this.PushIntoStack(abilityArray.Count);
foreach (GuildAbility ability in abilityArray)
{
GuildAbilityInfo abilityInfo = new ConfigCacheSet<GuildAbilityInfo>().FindKey(ability.ID);
if (abilityInfo != null)
{
isCityCombat = abilityInfo.IsCityCombat ? (short)1 : (short)0;
}
GuildAbilityLvInfo abilityLvInfo = new ConfigCacheSet<GuildAbilityLvInfo>().FindKey(ability.ID, ability.Lv);
DataStruct dsItem = new DataStruct();
dsItem.PushIntoStack(ability.ID);
dsItem.PushIntoStack(abilityInfo == null ? string.Empty : abilityInfo.AbilityName.ToNotNullString());
dsItem.PushIntoStack(abilityInfo == null ? string.Empty : abilityInfo.AbilityHead.ToNotNullString());
dsItem.PushIntoStack(ability.Lv);
dsItem.PushIntoStack(abilityLvInfo == null ? string.Empty : abilityLvInfo.EffectNum.ToString().ToNotNullString());
dsItem.PushIntoStack(abilityLvInfo == null ? 0 : abilityLvInfo.UpDonateNum);
dsItem.PushIntoStack(isCityCombat);
dsItem.PushIntoStack(abilityInfo == null ? (short)0 : (short)abilityInfo.GuildAbilityType);
this.PushIntoStack(dsItem);
}
this.PushIntoStack(gAbilityInfo == null ? string.Empty : gAbilityInfo.AbilityName.ToNotNullString());
this.PushIntoStack(currExperience);
this.PushIntoStack(donateCoin);
this.PushIntoStack(donateGold);
}
示例12: BuildPacket
public override void BuildPacket()
{
this.PushIntoStack(lifeNum);
this.PushIntoStack((short)powerNum);
this.PushIntoStack((short)soulNum);
this.PushIntoStack((short)intelligenceNum);
this.PushIntoStack((short)isPractice);
this.PushIntoStack(storyTaskArray.Length);
foreach (var task in storyTaskArray)
{
int collectNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, task.TargetItemID);
iscomplete = IsComplete(ContextUser, task);
PlotInfo plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(task.PlotID);
ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(task.TargetItemID);
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);
this.PushIntoStack(dsItem);
}
}
示例13: BuildPacket
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);
}
}
示例14: BuildPacket
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);
}
示例15: BuildPacket
public override void BuildPacket()
{
PushIntoStack(_gameActiveList.Length);
foreach (GameActive gameActive in _gameActiveList)
{
DateTime enableTime = DateTime.MinValue;
DateTime endTime = DateTime.MinValue;
short isEnable = 0;
RefEnableTime(gameActive, ref enableTime, ref endTime, ref isEnable);
DataStruct dsItem = new DataStruct();
dsItem.PushIntoStack(gameActive.ActiveId);
dsItem.PushIntoStack(gameActive.ActiveName.ToNotNullString());
dsItem.PushIntoStack(gameActive.ActiveType.ToShort());
dsItem.PushIntoStack(enableTime.ToString("HH:mm").ToNotNullString());
dsItem.PushIntoStack(endTime.ToString("HH:mm").ToNotNullString());
dsItem.PushIntoStack(isEnable);
dsItem.PushIntoStack(gameActive.BossLv);
dsItem.PushIntoStack(gameActive.HeadID.ToNotNullString());
dsItem.PushIntoStack(gameActive.Descption.ToNotNullString());
dsItem.PushIntoStack(gameActive.ActiveStyle);
dsItem.PushIntoStack(!string.IsNullOrEmpty(ContextUser.MercenariesID)
? ContextUser.MercenariesID
: string.Empty);
PushIntoStack(dsItem);
}
}