本文整理汇总了C#中PersonalCacheStruct类的典型用法代码示例。如果您正苦于以下问题:C# PersonalCacheStruct类的具体用法?C# PersonalCacheStruct怎么用?C# PersonalCacheStruct使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersonalCacheStruct类属于命名空间,在下文中一共展示了PersonalCacheStruct类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildPacket
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);
}
示例2: TakeAction
public override bool TakeAction()
{
int sumGold = 0;
UserExpedition userExp = new PersonalCacheStruct<UserExpedition>().FindKey(ContextUser.UserID);
if (userExp == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
return false;
}
if (DateTime.Now.Date == userExp.InsertDate.Date)
{
sumGold = MathUtils.Addition(userExp.DoRefresh() / 60, 1, int.MaxValue);
}
if (ops == 1)
{
this.ErrorCode = 1;
this.ErrorInfo = string.Format(LanguageManager.GetLang().St11003_DelCodeTime, sumGold);
return false;
}
else if (ops == 2)
{
if (ContextUser.GoldNum < sumGold)
{
this.ErrorCode = LanguageManager.GetLang().ErrorCode;
this.ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
return false;
}
ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, sumGold, int.MaxValue);
userExp.CodeTime = 0;
}
return true;
}
示例3: TakeAction
public override bool TakeAction()
{
UserGeneral userGeneral = new PersonalCacheStruct<UserGeneral>().FindKey(ContextUser.UserID, generalID);
if (userGeneral == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
this.ErrorInfo = LanguageManager.GetLang().St1405_GeneralIDNotEnough;
return false;
}
if (ops == 1)
{
//佣兵离队时,传承清空
if (ContextUser.HeritageList.Count > 0)
{
GeneralHeritage heritage = ContextUser.HeritageList.Find(m => m.GeneralID == generalID);
if (heritage != null)
{
ContextUser.HeritageList = new CacheList<GeneralHeritage>();
}
}
List<UserEmbattle> embattleArray = new PersonalCacheStruct<UserEmbattle>().FindAll(ContextUser.UserID, u => u.GeneralID == generalID);
foreach (UserEmbattle embattle in embattleArray)
{
embattle.GeneralID = 0;
}
if (userGeneral.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
{
this.ErrorCode = LanguageManager.GetLang().ErrorCode;
this.ErrorInfo = LanguageManager.GetLang().St1405_LiDuiNotFilter;
return false;
}
userGeneral.GeneralStatus = GeneralStatus.LiDui;
}
return true;
}
示例4: GetMaxLife
public static short _currMaxLv = ObjectExtend.ToShort(ConfigEnvSet.GetInt("User.CurrMaxLv")); //玩家最大等级
/// <summary>
/// 获取生命上限,等级*职业初始值+装备+命运水晶(未完成)
/// </summary>
/// <returns></returns>
public static int GetMaxLife(string userID, int generalID)
{
//修改者wuzf 2012-04-19
UserGeneral general = new PersonalCacheStruct<UserGeneral>().FindKey(userID, generalID);
return general == null ? 0 : general.LifeMaxNum;
}
示例5: TakeAction
public override bool TakeAction()
{
UserDailyRestrain dailyRestrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(ContextUser.UserID);
if (RankingHelper.IsGainSportsReward(ContextUser.UserID) && dailyRestrain != null && dailyRestrain.UserExtend != null)
{
var envSet = ServerEnvSet.Get(ServerEnvKey.JingJiChangReward, "");
SportsRewardInfo sportsInfo = new ShareCacheStruct<SportsRewardInfo>().FindKey(dailyRestrain.UserExtend.UserRankID);
{ if (envSet != null && sportsInfo != null)
if (envSet.ToDateTime().Date > dailyRestrain.Funtion11.Date && dailyRestrain.UserExtend.UserRankID > 0)
{
dailyRestrain.Funtion11 = DateTime.Now;
dailyRestrain.UserExtend.UserRankID = 0;
//dailyRestrain.Update();
ContextUser.ObtainNum = MathUtils.Addition(ContextUser.ObtainNum, sportsInfo.RewardObtian, int.MaxValue);
ContextUser.GameCoin = MathUtils.Addition(ContextUser.GameCoin, sportsInfo.RewardGoin, int.MaxValue);
//ContextUser.Update();
UserHelper.Contribution(ContextUser.UserID, sportsInfo.RewardObtian);
ErrorInfo = string.Format(LanguageManager.GetLang().St5106_JingJiChangRankReward, sportsInfo.RewardObtian, sportsInfo.RewardGoin);
}
}
}
return true;
}
示例6: TakeAction
public override bool TakeAction()
{
if (new PersonalCacheStruct<UserFunction>().FindKey(Uid, FunctionEnum.PetRun) == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_NoFun;
return false;
}
UserDailyRestrain restrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(Uid);
if (restrain != null && restrain.UserExtend != null)
{
var dailyCacheSet = new ShareCacheStruct<DailyRestrainSet>();
if (dailyCacheSet.FindKey(RestrainType.PetRun) != null)
_runTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetRun).MaxNum, restrain.UserExtend.PetRunTimes, 0);
if (dailyCacheSet.FindKey(RestrainType.PetIntercept) != null)
_interceptTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetIntercept).MaxNum, restrain.UserExtend.PetIntercept, 0);
if (dailyCacheSet.FindKey(RestrainType.PetHelp) != null)
_helpTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetHelp).MaxNum, restrain.UserExtend.PetHelp, 0);
}
var petRun = new ShareCacheStruct<PetRunPool>().FindKey(Uid);
if (petRun != null)
{
//问题:在赛跑时有重刷点亮宠物后,等赛跑完服务端与客户端记录宠物ID不一致,原因是赛跑完有将宠物ID清除
if (petRun.PetID > 0 && petRun.ColdTime == 0)
{
UserHelper.ProcessPetPrize(petRun);
}
_coldTime = petRun.ColdTime;
_petHead = (new ShareCacheStruct<PetInfo>().FindKey(petRun.PetID) ?? new PetInfo()).PetHead;
if (ContextUser.UserExtend != null)
_petId = ContextUser.UserExtend.LightPetID;
}
return true;
}
示例7: TakeAction
public override bool TakeAction()
{
if (ops == 0)
{
UserGeneral userGeneral = new PersonalCacheStruct<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;
}
示例8: TakeAction
public override bool TakeAction()
{
int sumGold = 0;
int userGold = ConfigEnvSet.GetInt("UserLand.UseGold");
int intervalDate = ConfigEnvSet.GetInt("UserLand.IntervalDate");
UserLand land = new PersonalCacheStruct<UserLand>().FindKey(ContextUser.UserID, landPostion);
if (land != null)
{
int subDate = (land.DoRefresh() / intervalDate);
sumGold = (MathUtils.Addition(subDate, 1, int.MaxValue) * userGold);
}
if (Ops == 1)
{
this.ErrorCode = 1;
this.ErrorInfo = string.Format(LanguageManager.GetLang().St10007_DoRefresh, sumGold);
return false;
}
else if (Ops == 2)
{
if (ContextUser.GoldNum < sumGold)
{
this.ErrorCode = 2;
this.ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
return false;
}
if (land != null && (DateTime.Now - land.GainDate).TotalSeconds < 28800)
{
land.GainDate = MathUtils.SqlMinDate;
ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, sumGold, int.MaxValue);
}
}
return true;
}
示例9: TakeAction
public override bool TakeAction()
{
if (ContextUser.UserStatus == UserStatus.CountryCombat)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1902_CountryCombatNotUpEmbattle;
return false;
}
var userMagicArray = new PersonalCacheStruct<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;
}
示例10: FathersDay
/// <summary>
/// 父亲节奖励
/// </summary>
public static void FathersDay(GameUser user)
{
short energyNum = 30;
int obtainNum = 50;
int gameGoin = 20000;
string fatherTime = "2012-06-17 00:00:00";
DateTime fatherDate = DateTime.Parse(fatherTime);
UserDailyRestrain dailyRestrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(user.UserID);
if (dailyRestrain != null && dailyRestrain.Funtion13 < 1)
{
if (DateTime.Now.Date == fatherDate.Date)
{
dailyRestrain.Funtion13 = 1;
//dailyRestrain.Update();
user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum, short.MaxValue);
user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum, int.MaxValue);
user.GameCoin = MathUtils.Addition(user.GameCoin, gameGoin, int.MaxValue);
//user.Update();
string content = string.Format(LanguageManager.GetLang().St_FathersDay,
energyNum, obtainNum,
gameGoin);
new TjxChatService().SystemSendWhisper(user, content);
}
}
}
示例11: action_HappyModeData_enterNum
public void action_HappyModeData_enterNum(object state)
{
ConsoleLog.showNotifyInfo("action_HappyModeData_enterNum begin.");
var cache = new PersonalCacheStruct<HappyModeData>();
cache.Foreach(update_HappyModeData_enterNum);
ConsoleLog.showNotifyInfo("action_HappyModeData_enterNum end.");
}
示例12: BuildPacket
public override void BuildPacket()
{
this.PushIntoStack(heritageList.Count);
foreach (var item in heritageList)
{
UserGeneral userGeneral = new PersonalCacheStruct<UserGeneral>().FindKey(ContextUser.UserID, item.GeneralID);
GeneralInfo general = new ShareCacheStruct<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());
}
示例13: CreateSkillLvInfo
public static List<SkillLvInfo> CreateSkillLvInfo(CombatGeneral general)
{
List<SkillLvInfo> _skillLvList = new List<SkillLvInfo>();
if (general.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
{
var abilityCacheSet = new ShareCacheStruct<AbilityInfo>();
var skillLvSet = new ShareCacheStruct<SkillLvInfo>();
UserTrump userTrump = new PersonalCacheStruct<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;
}
示例14: GetPayment
private static bool GetPayment(int game, int server, string account, string userID)
{
try
{
GameUser userInfo = new PersonalCacheStruct<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;
}
}
示例15: TakeAction
public override bool TakeAction()
{
UserTrump userTrump = new PersonalCacheStruct<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
if (userTrump != null && userTrump.PropertyInfo.Count > 0)
{
GeneralProperty property = userTrump.PropertyInfo.Find(m => m.AbilityType == propertyID);
if (property != null)
{
if (property.AbilityLv >= TrumpPropertyInfo.MaxTrumpPropertyLv)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1466_OutPropertyMaxLv;
return false;
}
TrumpPropertyInfo trumpProperty = new ShareCacheStruct<TrumpPropertyInfo>().FindKey(property.AbilityType, property.AbilityLv);
if (trumpProperty != null)
{
int upItemNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, trumpProperty.ItemID);
if (upItemNum < trumpProperty.ItemNum)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1462_ItemNumNotEnough;
return false;
}
if (ContextUser.GameCoin < trumpProperty.GameCoin)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_GameCoinNotEnough;
return false;
}
if (ContextUser.ObtainNum < trumpProperty.ObtainNum)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_ObtainNumNotEnough;
return false;
}
ContextUser.ObtainNum = MathUtils.Subtraction(ContextUser.ObtainNum, trumpProperty.ObtainNum);
ContextUser.GameCoin = MathUtils.Subtraction(ContextUser.GameCoin, trumpProperty.GameCoin);
UserItemHelper.UseUserItem(ContextUser.UserID, trumpProperty.ItemID, trumpProperty.ItemNum);
short upLv = MathUtils.Addition(property.AbilityLv, (short)1, (short)TrumpPropertyInfo.MaxTrumpPropertyLv);
TrumpPropertyInfo uptrumpProperty = new ShareCacheStruct<TrumpPropertyInfo>().FindKey(property.AbilityType, upLv);
property.UpdateNotify(obj =>
{
property.AbilityLv = MathUtils.Addition(property.AbilityLv, (short)1, TrumpPropertyInfo.MaxTrumpPropertyLv);
property.AbilityValue = uptrumpProperty.PropertyNum;
return true;
});
var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
if (usergeneral != null)
{
usergeneral.RefreshMaxLife();
}
ErrorCode = 0;
ErrorInfo = LanguageManager.GetLang().St1464_UpgradeWasSsuccessful;
}
}
}
return true;
}