本文整理汇总了C#中ShareCacheStruct.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# ShareCacheStruct.Delete方法的具体用法?C# ShareCacheStruct.Delete怎么用?C# ShareCacheStruct.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareCacheStruct
的用法示例。
在下文中一共展示了ShareCacheStruct.Delete方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TakeAction
public override bool TakeAction()
{
var cacheSet = new ShareCacheStruct<UserFriends>();
UserFriends userFriend = cacheSet.FindKey(ContextUser.UserID, friendID);
UserFriends userFriend1 = cacheSet.FindKey(friendID, ContextUser.UserID);
//如果原来是好友 要将对方的状态改为关注 其他的直接删除
if (userFriend.FriendType == FriendType.Friend)
{
cacheSet.Delete(userFriend);
userFriend1.FriendType = FriendType.Attention;
}else
{
cacheSet.Delete(userFriend);
}
return true;
}
示例2: TakeAction
public override bool TakeAction()
{
int totalDate = (ConfigEnvSet.GetInt("UserQueue.GuildMemberDel") * 60 * 60);
var memberSet = new ShareCacheStruct<GuildMember>();
List<GuildMember> memberArray = memberSet.FindAll(m => m.GuildID == guildID);
GuildMember userMember = memberSet.FindKey(guildID, ContextUser.UserID);
if (userMember != null && userMember.PostType == PostType.Chairman && memberArray.Count > 1)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St6010_Chairman;
return false;
}
if (userMember != null)
{
if (!string.IsNullOrEmpty(ContextUser.MercenariesID))
{
memberSet.Delete(userMember);
ContextUser.MercenariesID = string.Empty;
//ContextUser.Update();
CombatHelper.RemoveGuildAbility(ContextUser);
}
var guildSet = new ShareCacheStruct<UserGuild>();
UserGuild guildInfo = guildSet.FindKey(guildID);
if (guildInfo != null && userMember.PostType == PostType.Chairman && memberArray.Count <= 1)
{
guildSet.Delete(guildInfo);
}
List<UserQueue> queueArray = new PersonalCacheStruct<UserQueue>().FindAll(ContextUser.UserID, m => m.QueueType == QueueType.TuiChuGongHui);
if (queueArray.Count > 0)
{
UserQueue queue = queueArray[0];
queue.Timing = DateTime.Now;
queue.TotalColdTime = totalDate;
queue.ColdTime = totalDate;
//queue.Update();
}
else
{
UserQueue userQueue = new UserQueue()
{
QueueID =
Guid.NewGuid().ToString(),
QueueName = QueueType.TuiChuGongHui.ToString(),
QueueType = QueueType.TuiChuGongHui,
TotalColdTime = totalDate,
ColdTime = totalDate,
Timing = DateTime.Now,
IsSuspend = false,
UserID = ContextUser.UserID
};
new PersonalCacheStruct<UserQueue>().Add(userQueue);
}
}
return true;
}
示例3: TakeAction
public override bool TakeAction()
{
var cacheSet = new ShareCacheStruct<UserApply>();
UserApply apply = cacheSet.FindKey(guildID, ContextUser.UserID);
if (apply != null)
{
cacheSet.Delete(apply);
}
return true;
}
示例4: TakeAction
public override bool TakeAction()
{
var cacheSet = new ShareCacheStruct<UserApply>();
List<UserApply> applyArray = cacheSet.FindAll(m => m.GuildID==guildID);
if (applyArray.Count > 0)
{
foreach (UserApply apply in applyArray)
{
cacheSet.Delete(apply);
}
}
return true;
}
示例5: TakeAction
public override bool TakeAction()
{
GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(memberID);
var guildCacheSet = new ShareCacheStruct<GuildMember>();
GuildMember member = guildCacheSet.FindKey(guildID, memberID);
if (member != null)
{
if (string.IsNullOrEmpty(gameUser.MercenariesID))
{
return false;
}
guildCacheSet.Delete(member);
//gameUser.UserLocation = Location.City;
gameUser.MercenariesID = string.Empty;
//gameUser.Update();
CombatHelper.RemoveGuildAbility(gameUser);
}
int totalDate = (ConfigEnvSet.GetInt("UserQueue.GuildMemberDel") * 60 * 60);
List<UserQueue> queueArray = new GameDataCacheSet<UserQueue>().FindAll(memberID, m => m.QueueType == QueueType.TuiChuGongHui);
if (queueArray.Count > 0)
{
//new UserQueue().ReLoadUser(memberID);
queueArray = new GameDataCacheSet<UserQueue>().FindAll(memberID, m => m.QueueType == QueueType.TuiChuGongHui);
}
if (queueArray.Count > 0)
{
UserQueue queue = queueArray[0];
queue.Timing = DateTime.Now;
queue.TotalColdTime = totalDate;
queue.ColdTime = totalDate;
//queue.Update();
}
else
{
UserQueue userQueue = new UserQueue()
{
QueueID = Guid.NewGuid().ToString(),
QueueName = QueueType.TuiChuGongHui.ToString(),
QueueType = QueueType.TuiChuGongHui,
TotalColdTime = totalDate,
ColdTime = totalDate,
Timing = DateTime.Now,
IsSuspend = false,
UserID = ContextUser.UserID
};
new GameDataCacheSet<UserQueue>().Add(userQueue);
}
return true;
}
示例6: AddFoe
/// <summary>
/// 增加仇敌
/// </summary>
/// <param name="user"></param>
/// <param name="toUser"></param>
private static void AddFoe(GameUser user, GameUser toUser)
{
var cacheSet = new ShareCacheStruct<UserFriends>();
var friends = cacheSet.Find(s => s.FriendID == user.UserID && s.UserID == toUser.UserID && s.FriendType == FriendType.Friend);
var choudiFriends = cacheSet.Find(s => s.FriendID == user.UserID && s.UserID == toUser.UserID && s.FriendType == FriendType.ChouDi);
if (friends == null && choudiFriends == null)
{
var list = cacheSet.FindAll(s => s.UserID == toUser.UserID && s.FriendType == FriendType.ChouDi);
if (list.Count >= 50)
{
list.QuickSort((x, y) =>
{
if (x == null && y == null) return 0;
if (x != null && y == null) return 1;
if (x == null) return -1;
return (x.FightTime).CompareTo(y.FightTime);
});
int count = list.Count - 49 + 1;
for (int i = 0; i < count; i++)
{
cacheSet.Delete(list[i]);
}
}
var userFriends = new UserFriends();
userFriends.UserID = toUser.UserID;
userFriends.FriendID = user.UserID;
userFriends.FightTime = DateTime.Now;
userFriends.FriendType = FriendType.ChouDi;
userFriends.ChatTime = DateTime.Now;
cacheSet.Add(userFriends, GameEnvironment.CacheGlobalPeriod);
}
}
示例7: processDelete
string processDelete(string parm)
{
string info = "";
string[] p = parm.Split(',');
string deleteWhitch = p[0];
int deleteIndex = int.Parse(p[1]);
if("ranking"==deleteWhitch)
{
UserRanking ur = RankingFactorNew.Singleton().getRankingData<UserRanking, RankingScore>(deleteIndex);
if(ur==null)
{
info = "没有找到要删除的数据";
}
else
{
var cache = new ShareCacheStruct<UserRanking>();
cache.Delete(ur);
info = "删除数据成功";
}
}
return info;
}
示例8: delUserRanking
string delUserRanking(string parm)
{
doAdd_black(parm);
List<UserRanking> lst = RankingFactorNew.Singleton().get<UserRanking>(typeof(RankingScore).ToString());
List<UserRanking> delList = new List<UserRanking>();
if(null != lst && lst.Count!=0)
{
string []ids = parm.Split(',');
for(int i=0; i<ids.Length; ++i)
{
int id = int.Parse(ids[i]) - 1;
if (id >= lst.Count) continue;
delList.Add(lst[id]);
}
}
else
{
return "排行榜正在更新或为空";
}
if(delList.Count>0)
{
var cache = new ShareCacheStruct<UserRanking>();
resultSTR = "删除的玩家数据:{";
foreach (var v in delList)
{
cache.Delete(v);
resultSTR += v.UserName + ":" + v.Score + ",";
}
resultSTR += "}";
RankingFactorNew.Singleton().Refresh<UserRanking>(typeof(RankingScore).ToString());
}
else
{
resultSTR = "要删除的数据不存在";
}
return resultSTR;
}
示例9: SendNotice
public void SendNotice(GameNotice notice, bool isRemove)
{
try
{
var cacheSet = new ShareCacheStruct<GameNotice>();
GameNotice gameNotice = cacheSet.FindKey(notice.NoticeID);
if (isRemove)
{
if (gameNotice != null)
{
cacheSet.Delete(gameNotice);
}
}
else
{
if (gameNotice == null)
{
gameNotice = new GameNotice();
gameNotice.NoticeID = Guid.NewGuid().ToString();
cacheSet.Add(gameNotice);
gameNotice = cacheSet.FindKey(gameNotice.NoticeID);
}
gameNotice.Title = notice.Title;
gameNotice.Content = notice.Content;
gameNotice.ExpiryDate = notice.ExpiryDate;
gameNotice.IsTop = notice.IsTop;
gameNotice.IsBroadcast = notice.IsBroadcast;
gameNotice.Creater = notice.Creater;
gameNotice.CreateDate = notice.CreateDate;
gameNotice.NoticeType = notice.NoticeType;
if (gameNotice.IsBroadcast)
{
var broadcastService = new TjxBroadcastService(null);
var msg = broadcastService.Create(NoticeType.System, gameNotice.Content);
broadcastService.Send(msg);
}
}
}
catch (Exception ex)
{
new BaseLog().SaveLog("保存公告出错:", ex);
throw;
}
}
示例10: TakeAction
public override bool TakeAction()
{
GuildMember member = new ShareCacheStruct<GuildMember>().FindKey(ContextUser.MercenariesID, ContextUser.UserID);
if (member != null)
{
if (member.PostType == PostType.Member)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St6007_AuditPermissions;
return false;
}
else
{
var cacheSet = new ShareCacheStruct<UserApply>();
List<UserApply> userApplyArray = cacheSet.FindAll(m => m.GuildID == member.GuildID);
foreach (UserApply apply in userApplyArray)
{
List<GuildMember> gMemberArray = new ShareCacheStruct<GuildMember>().FindAll(m => m.UserID == apply.UserID);
if (gMemberArray.Count > 0)
{
cacheSet.Delete(apply);
}
}
applyArray = userApplyArray.GetPaging(pageIndex, pageSize, out pageCount);
}
}
return true;
}
示例11: TakeAction
public override bool TakeAction()
{
GuildMember member = new ShareCacheStruct<GuildMember>().FindKey(guildID, ContextUser.UserID);
if (member != null && member.PostType == PostType.Member)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St6007_AuditPermissions;
return false;
}
List<GuildMember> memberArray = new ShareCacheStruct<GuildMember>().FindAll(m => m.GuildID == guildID);
UserGuild guildInfo = new ShareCacheStruct<UserGuild>().FindKey(guildID);
if (guildInfo != null)
{
GuildLvInfo guildLvInfo = new ShareCacheStruct<GuildLvInfo>().FindKey(guildInfo.GuildLv);
if (guildLvInfo != null)
{
int maxPeople = MathUtils.Addition(guildInfo.AddMember, guildLvInfo.MaxPeople);
if (memberArray.Count > 0 && memberArray.Count >= maxPeople)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St6019_GuildMaxPeople;
return false;
}
}
}
GameUser userInfo = UserCacheGlobal.CheckLoadUser(memberID);
if (userInfo == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
return false;
}
var memberList = new ShareCacheStruct<GuildMember>().FindAll(s => s.UserID == memberID);
if (memberList.Count > 0)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St6019_AddGuild;
return false;
}
GuildMember gMember = new GuildMember()
{
GuildID = guildID,
UserID = memberID,
PostType = PostType.Member,
Contribution = 0,
TotalContribution = 0,
IncenseNum = 0,
DevilNum = 0,
IsDevil = 0,
InsertDate = DateTime.Now
};
new ShareCacheStruct<GuildMember>().Add(gMember);
userInfo.MercenariesID = guildID;
CombatHelper.LoadGuildAbility(userInfo.UserID); //加载公会技能
var cacheSet = new ShareCacheStruct<UserApply>();
List<UserApply> appliesArray = cacheSet.FindAll(m => m.UserID == memberID);
foreach (UserApply apply in appliesArray)
{
cacheSet.Delete(apply);
}
return true;
}