本文整理汇总了C#中GameDataCacheSet.DoRefresh方法的典型用法代码示例。如果您正苦于以下问题:C# GameDataCacheSet.DoRefresh方法的具体用法?C# GameDataCacheSet.DoRefresh怎么用?C# GameDataCacheSet.DoRefresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameDataCacheSet
的用法示例。
在下文中一共展示了GameDataCacheSet.DoRefresh方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TakeAction
public override bool TakeAction()
{
int sumGold = 0;
int userGold = ConfigEnvSet.GetInt("UserLand.UseGold");
int intervalDate = ConfigEnvSet.GetInt("UserLand.IntervalDate");
UserLand land = new GameDataCacheSet<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;
}
示例2: TakeAction
public override bool TakeAction()
{
int sumGold = 0;
UserExpedition userExp = new GameDataCacheSet<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()
{
//消除冷却以分钟为单位
UserQueue queue = new GameDataCacheSet<UserQueue>().FindKey(ContextUser.UserID, queueID);
if (queue == null)
{
return false;
}
int queueColdTime = queue.DoRefresh();
queueColdTime = queueColdTime < 0 ? 0 : queueColdTime;
if (ops == 1)
{
//加速所需晶石
ErrorCode = ops;
ErrorInfo = string.Format(LanguageManager.GetLang().St1702_UseGold, GetPrice());
return false;
}
else if (ops == 2)
{
if (ContextUser.GoldNum >= GetPrice())
{
ErrorCode = ops;
if (ContextUser.GoldNum >= GetPrice())
{
ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, GetPrice(), int.MaxValue);
//ContextUser.Update();
queue.ColdTime = 0;
queue.TotalColdTime = 0;
//queue.Update();
}
}
else
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
return false;
}
}
else
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().UrlElement;
return false;
}
return true;
}
示例4: DoCaiLiaoYueBingItem
/// <summary>
/// 双倍材料,月饼道具使用
/// </summary>
/// <param name="userItem"></param>
/// <param name="itemInfo"></param>
/// <returns></returns>
private bool DoCaiLiaoYueBingItem(UserItemInfo userItem, ItemBaseInfo itemInfo)
{
UserProps props = new GameDataCacheSet<UserProps>().FindKey(ContextUser.UserID, userItem.ItemID);
if (props != null)
{
if (userItem.ItemID == 5200 && props.DoRefresh() > 0)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St1608_CombatPowerNotEnough;
return false;
}
props.SurplusNum += itemInfo.EffectNum;
props.ChangeTime = DateTime.Now;
//props.Update();
}
else
{
UserProps uProps = new UserProps(ContextUser.UserID, itemInfo.ItemID)
{
SurplusNum = itemInfo.EffectNum,
ChangeTime = DateTime.Now
};
new GameDataCacheSet<UserProps>().Add(uProps, GameEnvironment.CacheUserPeriod);
}
return true;
}
示例5: TakeAction
public override bool TakeAction()
{
//List<UserQueue> queueArray = new GameDataCacheSet<UserQueue>().FindAll(ContextUser.UserID, m => m.QueueType == QueueType.TianXianStrong);
//if (queueArray.Count > 0)
//{
// int codeDate = queueArray[0].DoRefresh();
// if (codeDate > 0)
// {
// ErrorCode = LanguageManager.GetLang().ErrorCode;
// ErrorInfo = LanguageManager.GetLang().St11002_Colding;
// return false;
// }
//}
UserExpedition userExpedition = new GameDataCacheSet<UserExpedition>().FindKey(ContextUser.UserID);
if (userExpedition != null && userExpedition.ExpeditionNum >= 10 && userExpedition.InsertDate.Date == DateTime.Now.Date)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St11002_ExpeditionFull;
return false;
}
if (userExpedition != null && userExpedition.DoRefresh() > 0)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St11002_Colding;
return false;
}
int sumGold = MathUtils.Addition((GetExpCodeTime(ContextUser.UserID) / 60), 1);
if (isRemove == 1)
{
if (ContextUser.GoldNum < sumGold)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
return false;
}
codeTime = 0;
ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, sumGold);
}
else if (isRemove == 2)
{
codeTime = GetExpCodeTime(ContextUser.UserID);
//if (queueArray.Count > 0)
//{
// queueArray[0].ColdTime = codeTime;
// queueArray[0].TotalColdTime = codeTime;
// queueArray[0].Timing = DateTime.Now;
// //queueArray[0].Update();
//}
//else
//{
// UserQueue queue = new UserQueue()
// {
// QueueID = Guid.NewGuid().ToString(),
// QueueType = QueueType.TianXianStrong,
// QueueName = QueueType.TianXianStrong.ToString(),
// UserID = ContextUser.UserID,
// ColdTime = codeTime,
// IsSuspend = false,
// TotalColdTime = codeTime,
// Timing = DateTime.Now,
// };
// new GameDataCacheSet<UserQueue>().Add(queue, ContextUser.UserID.ToInt());
//}
}
if (userExpedition == null)
{
userExpedition = new UserExpedition()
{
UserID = ContextUser.UserID,
};
new GameDataCacheSet<UserExpedition>().Add(userExpedition, ContextUser.UserID.ToInt());
}
if (DateTime.Now.Date == userExpedition.InsertDate.Date)
{
userExpedition.ExpeditionNum = MathUtils.Addition(userExpedition.ExpeditionNum, 1, int.MaxValue);
}
else
{
userExpedition.ExpeditionNum = 1;
}
userExpedition.CodeTime = codeTime;
userExpedition.InsertDate = DateTime.Now;
ExpeditionInfo expInfo = new ConfigCacheSet<ExpeditionInfo>().FindKey(questionID);
if (expInfo != null)
{
if (answerID == 1)
{
rewardShowArray = expInfo.RewardNum1.ToList();
}
else if (answerID == 2)
{
rewardShowArray = expInfo.RewardNum2.ToList();
//.........这里部分代码省略.........
示例6: TakeAction
public override bool TakeAction()
{
int question = 0;
int index = 0;
answerID1 = 1;
answerID2 = 2;
int expID = 0;
int usegoldTime = GetExpCodeTime(ContextUser.UserID);
useGold = MathUtils.Addition((usegoldTime / 60), 1, int.MaxValue);
UserExpedition userExp = new GameDataCacheSet<UserExpedition>().FindKey(ContextUser.UserID);
if (userExp != null && DateTime.Now.Date == userExp.InsertDate.Date)
{
if (userExp.ExpeditionNum >= 10)
{
isEnd = 1;
}
else
{
isEnd = 2;
}
question = MathUtils.Addition(userExp.ExpeditionNum, 1, int.MaxValue);
expID = userExp.ExpID;
codeTime = userExp.DoRefresh();
}
else
{
isEnd = 2;
question = 1;
}
List<ExpeditionInfo> expeditionArray = new ConfigCacheSet<ExpeditionInfo>().FindAll(m => m.GroupID == question);
if (expeditionArray.Count > 0)
{
if (IsAnswer(expeditionArray, expID))
{
expInfo = new ConfigCacheSet<ExpeditionInfo>().FindKey(expID);
}
else
{
index = RandomUtils.GetRandom(0, expeditionArray.Count);
expInfo = new ConfigCacheSet<ExpeditionInfo>().FindKey(expeditionArray[index].ExpID);
if (userExp != null)
{
userExp.ExpID = expeditionArray[index].ExpID;
}
}
}
return true;
}
示例7: GetPrice
private int GetPrice()
{
int currGoldNum = 0;
UserQueue queue = new GameDataCacheSet<UserQueue>().FindKey(ContextUser.UserID, queueID);
if (queue != null)
{
int queueColdTime = (queue.DoRefresh() / 60);
currGoldNum = MathUtils.Addition(queueColdTime, 1, int.MaxValue);
}
return currGoldNum;
}
示例8: UserQueueCodeTime
/// <summary>
/// 队列剩余时间
/// </summary>
/// <param name="userID"></param>
/// <param name="type"></param>
/// <returns></returns>
public static int UserQueueCodeTime(string userID, RecruitType type)
{
QueueType queueType = QueueType.Nomal;
if (type == RecruitType.ShiLiTiaoYi)
{
queueType = QueueType.ShiLiTiaoYi;
}
else if (type == RecruitType.BaiLiTiaoYi)
{
queueType = QueueType.BaiLiTiaoYi;
}
else if (type == RecruitType.Golden)
{
queueType = QueueType.Golden;
}
UserQueue userQueue = new GameDataCacheSet<UserQueue>().Find(userID, s => s.QueueType == queueType);
if (userQueue != null)
{
return userQueue.DoRefresh();
}
return 0;
}
示例9: GeneralRecruitColdTime
/// <summary>
/// 是否有冷却时间
/// </summary>
/// <param name="userID"></param>
/// <param name="recruitRule"></param>
/// <returns></returns>
public static bool GeneralRecruitColdTime(string userID, RecruitType recruitType)
{
QueueType queueType = QueueType.ShiLiTiaoYi;
if (recruitType == RecruitType.ShiLiTiaoYi)
{
queueType = QueueType.ShiLiTiaoYi;
}
else if (recruitType == RecruitType.BaiLiTiaoYi)
{
queueType = QueueType.BaiLiTiaoYi;
}
else if (recruitType == RecruitType.Golden)
{
queueType = QueueType.Golden;
}
UserQueue userQueue = new GameDataCacheSet<UserQueue>().Find(userID, s => s.QueueType == queueType);
if (userQueue != null && userQueue.DoRefresh() > 0)
{
return true;
}
return false;
}