本文整理汇总了C#中GameDataCacheSet类的典型用法代码示例。如果您正苦于以下问题:C# GameDataCacheSet类的具体用法?C# GameDataCacheSet怎么用?C# GameDataCacheSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GameDataCacheSet类属于命名空间,在下文中一共展示了GameDataCacheSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TakeAction
public override bool TakeAction()
{
var cacheSet = new GameDataCacheSet<GameUser>();
GameUser user = cacheSet.FindKey(_useridreq);
if (null != user)
{
if ((user.UserName != _username)
|| (user.UserType != _usertype))
{
return false;
}
/*更新客户端上报的存档信息*/
user.ClientArchive = _clientarchive;
cacheSet.Add(user);
cacheSet.Update();
return true;
}
else
{
return false;
}
}
示例2: TakeAction
public override bool TakeAction()
{
if (ops == 0)
{
UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, ContextUser.GeneralID);
if (userGeneral == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
return false;
}
userGeneral.TrainingPower = ContextUser.TrainingPower;
userGeneral.TrainingSoul = ContextUser.TrainingSoul;
userGeneral.TrainingIntellect = ContextUser.TrainingIntellect;
UserHelper.GetGameUserCombat(ContextUser.UserID);
}
else if (ops == 1)
{
this.ErrorCode = ops;
}
else
{
this.ErrorCode = LanguageManager.GetLang().ErrorCode;
this.ErrorInfo = LanguageManager.GetLang().ServerBusy;
return false;
}
return true;
}
示例3: TakeAction
public override bool TakeAction()
{
int useGold = ConfigEnvSet.GetInt("TrumpZodiac.ChangeZodiacUseGold");
if (ops == 1)
{
ErrorCode = ops;
ErrorInfo = string.Format(LanguageManager.GetLang().St1471_ChangeZodiac, useGold);
return false;
}
else if (ops == 2)
{
if (ContextUser.GoldNum < useGold)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
return false;
}
var cacheSet = new GameDataCacheSet<UserTrump>();
UserTrump userTrump = cacheSet.FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
if (userTrump != null)
{
userTrump.Zodiac = TrumpHelper.GetZodiacType(userTrump.Zodiac);
ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, useGold, int.MaxValue);
}
ErrorCode = ops;
}
return true;
}
示例4: AddExprerience
public static void AddExprerience(GameUser user, int experience)
{
string userID = user.UserID;
var userEmbattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == user.UseMagicID);
HashSet<int> generalHash = new HashSet<int>();
foreach (UserEmbattle userEmbattle in userEmbattleList)
{
//wuzf 8-18 修复多个相同佣兵阵形数据
if (generalHash.Contains(userEmbattle.GeneralID))
{
userEmbattle.GeneralID = 0;
//userEmbattle.Update();
continue;
}
else
{
generalHash.Add(userEmbattle.GeneralID);
}
//UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, userEmbattle.GeneralID);
//if (userGeneral != null)
//{
// userGeneral.CurrExperience = MathUtils.Addition(userGeneral.CurrExperience, experience);
//}
}
//UserHelper.UserGeneralExp(user.UserID, experience);
}
示例5: TakeAction
public override bool TakeAction()
{
if (ContextUser.UserStatus == UserStatus.CountryCombat)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1902_CountryCombatNotUpEmbattle;
return false;
}
var userMagicArray = new GameDataCacheSet<UserMagic>().FindAll(ContextUser.UserID, m => m.MagicType == MagicType.MoFaZhen);
foreach (UserMagic magic in userMagicArray)
{
if (magic.MagicID == _magicID)
{
magic.IsEnabled = true;
ContextUser.UseMagicID = _magicID;
//ContextUser.Update();
}
else
{
magic.IsEnabled = false;
}
//magic.Update();
UserHelper.GetGameUserCombat(ContextUser.UserID);
}
return true;
}
示例6: TakeAction
public override bool TakeAction()
{
var package = UserItemPackage.Get(ContextUser.UserID);
UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID == userItemID);
if (userItem != null)
{
UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
if (userTrump != null && userTrump.TrumpLv >= GameConfigSet.MaxTrumpLv)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1456_OutTrumpMaxLv;
return false;
}
ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem.ItemID);
if (itemInfo != null && itemInfo.PropType == 10)
{
TrumpHelper.CheckTrumpEscalate(ContextUser.UserID, itemInfo.EffectNum);
UserItemHelper.UseUserItem(ContextUser.UserID, itemInfo.ItemID, 1);
var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
if (usergeneral != null)
{
usergeneral.RefreshMaxLife();
}
}
}
return true;
}
示例7: CheckUserPlotHurdleNum
/// <summary>
/// 天地劫副本关数
/// </summary>
/// <param name="user"></param>
public static int CheckUserPlotHurdleNum(GameUser user)
{
int hurdleNum = 0;
PlotInfo plotInfo = CheckUserPlotKalpa(user);
if (plotInfo != null)
{
UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
if (dailyRestrain != null && dailyRestrain.UserExtend != null && dailyRestrain.UserExtend.KalpaDate.Date == DateTime.Now.Date)
{
hurdleNum = user.UserExtend.HurdleNum;
}
else
{
hurdleNum = plotInfo.PlotSeqNo;
if (user.UserExtend != null && hurdleNum > 0)
{
user.UserExtend.UpdateNotify(obj =>
{
user.UserExtend.HurdleNum = hurdleNum;
return true;
});
//user.Update();
}
}
}
else
{
hurdleNum = 1;
}
return hurdleNum;
}
示例8: TakeAction
public override bool TakeAction()
{
if (ContextUser.TempEnergyNum > 0 && ContextUser.UserStatus != UserStatus.Combat)
{
List<UserPlotCombat> plotCombatList = new GameDataCacheSet<UserPlotCombat>().FindAll(ContextUser.UserID, m => m.PlotID == plotID);
//没发生战斗或上次战斗失败都返还精力
if (plotCombatList.Count == 0 || (ContextUser.TempEnergyNum > 0 && IsNotCombat(plotCombatList)))
{
if (ContextUser.SurplusEnergy == 0 && !ContextUser.IsSurplus) //策划要求:领取的不返还
{
if (ContextUser.UserExtend != null && ContextUser.UserExtend.PlotStatusID > 0 && ContextUser.UserExtend.MercenarySeq <= 1)
{
ContextUser.TempEnergyNum = 0;
ContextUser.EnergyNum = MathUtils.Addition(ContextUser.EnergyNum, PlotInfo.BattleEnergyNum, short.MaxValue);
}
//ContextUser.Update();
}
}
}
if (ContextUser.UserExtend != null)
{
ContextUser.UserExtend.UpdateNotify(obj =>
{
ContextUser.UserExtend.PlotStatusID = 0;
ContextUser.UserExtend.PlotNpcID = -1;
ContextUser.UserExtend.MercenarySeq = 0;
ContextUser.UserExtend.IsBoss = false;
return true;
});
}
return true;
}
示例9: TakeAction
public override bool TakeAction()
{
GeneralProperty property = null;
UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
if (userTrump != null && userTrump.PropertyInfo.Count > 0)
{
property = userTrump.PropertyInfo.Find(m => m.AbilityType == propertyID);
}
if (property == null)
{
return false;
}
if (ops == 1)
{
ErrorCode = ops;
ErrorInfo = LanguageManager.GetLang().St1467_WorshipGridNotEnough;
return false;
}
else if (ops == 2)
{
ErrorCode = ops;
userTrump.PropertyInfo.Remove(property);
var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
if (usergeneral != null)
{
usergeneral.RefreshMaxLife();
}
}
return true;
}
示例10: CheckTrumpEscalate
/// <summary>
/// 法宝加经验,升级
/// </summary>
/// <param name="userID"></param>
/// <param name="experience"></param>
public static void CheckTrumpEscalate(string userID, int experience)
{
UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(userID, TrumpInfo.CurrTrumpID);
if (userTrump != null)
{
userTrump.Experience = MathUtils.Addition(userTrump.Experience, experience);
while (userTrump.TrumpLv < GameConfigSet.MaxTrumpLv)
{
short upLv = MathUtils.Addition(userTrump.TrumpLv, (short)1, GameConfigSet.MaxTrumpLv.ToShort());
TrumpInfo trumpInfo = new ConfigCacheSet<TrumpInfo>().FindKey(TrumpInfo.CurrTrumpID, upLv);
if (trumpInfo != null && userTrump.Experience >= trumpInfo.Experience)
{
userTrump.TrumpLv = MathUtils.Addition(userTrump.TrumpLv, (short)1, GameConfigSet.MaxTrumpLv.ToShort());
userTrump.Experience = MathUtils.Subtraction(userTrump.Experience, trumpInfo.Experience);
if (trumpInfo.SkillID > 0)
{
SkillInfo skillInfo = new SkillInfo();
skillInfo.AbilityID = trumpInfo.SkillID.ToInt();
skillInfo.AbilityLv = 1;
userTrump.SkillInfo.Add(skillInfo);
}
}
else
{
break;
}
}
if (userTrump.TrumpLv >= GameConfigSet.MaxTrumpLv)
{
userTrump.Experience = 0;
}
}
}
示例11: 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);
}
}
示例12: CreateSkillLvInfo
public static List<SkillLvInfo> CreateSkillLvInfo(CombatGeneral general)
{
List<SkillLvInfo> _skillLvList = new List<SkillLvInfo>();
if (general.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
{
var abilityCacheSet = new ConfigCacheSet<AbilityInfo>();
var skillLvSet = new ConfigCacheSet<SkillLvInfo>();
UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(general.UserID, TrumpInfo.CurrTrumpID) ?? new UserTrump();
if (userTrump.LiftNum > 0)
{
userTrump.SkillInfo.Foreach(obj =>
{
var abilityInfo = abilityCacheSet.FindKey(obj.AbilityID) ?? new AbilityInfo();
if (abilityInfo.AttackType == AttackType.Trigger)
{
var temp = skillLvSet.FindKey(obj.AbilityID, obj.AbilityLv);
if (temp != null)
{
_skillLvList.Add(temp);
}
}
return true;
});
}
}
return _skillLvList;
}
示例13: GetPayment
private static bool GetPayment(int game, int server, string account, string userID)
{
try
{
GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(userID);
if (userInfo == null) return false;
var chatService = new TjxChatService();
OrderInfo[] model = PayManager.getPayment(game, server, account);
foreach (OrderInfo order in model)
{
userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, order.GameCoins, int.MaxValue);
//userInfo.Update();
PayManager.Abnormal(order.OrderNO);
DialHelper.ReturnRatioGold(userID, order.GameCoins); //大转盘抽奖奖励充值返还
chatService.SystemSendWhisper(userInfo, string.Format(LanguageManager.GetLang().PaySuccessMsg, order.GameCoins));
DoGiff(userID, order);
FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.PayReward);
}
return true;
}
catch (Exception ex)
{
BaseLog log = new BaseLog("PaymentLog");
log.SaveLog(ex);
return false;
}
}
示例14: BuildPacket
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());
}
示例15: GameTable
private GameTable()
{
_cardRole = new CardRole();
_pokerConfig = new ShareCacheStruct<PokerInfo>();
_userCacheSet = new GameDataCacheSet<GameUser>();
_roomStruct = new MemoryCacheStruct<RoomData>();
}