本文整理汇总了C#中ShareCacheStruct.FindAll方法的典型用法代码示例。如果您正苦于以下问题:C# ShareCacheStruct.FindAll方法的具体用法?C# ShareCacheStruct.FindAll怎么用?C# ShareCacheStruct.FindAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareCacheStruct
的用法示例。
在下文中一共展示了ShareCacheStruct.FindAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TakeAction
public override bool TakeAction() {
var cache = new ShareCacheStruct<UserRanking>();
rankingList = cache.FindAll(false);
rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo);
rankingList = rankingList.GetPaging(pageIndex, pageSize, out pageCount);
return true;
}
示例2: BuildPacket
public override void BuildPacket()
{
var cacheSetItemEqu = new ShareCacheStruct<ItemEquAttrInfo>();
PushIntoStack(_userItemArray.Count);
foreach (UserItemInfo item in _userItemArray)
{
ItemBaseInfo itemInfo = new ShareCacheStruct<ItemBaseInfo>().FindKey(item.ItemID);
var general = new PersonalCacheStruct<UserGeneral>().FindKey(Uid, item.GeneralID);
var itemEquList = cacheSetItemEqu.FindAll(e => e.ItemID.Equals(item.ItemID));
DataStruct dsItem = new DataStruct();
dsItem.PushIntoStack(item.UserItemID.ToNotNullString());
dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString());
dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString());
dsItem.PushIntoStack(item.ItemLv);
dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType);
dsItem.PushIntoStack(general != null ? general.GeneralName : string.Empty);
PushIntoStack(dsItem);
dsItem.PushIntoStack(itemEquList.Count);
foreach (var itemEquAttrInfo in itemEquList)
{
DataStruct dsItem1 = new DataStruct();
dsItem1.PushIntoStack(itemEquAttrInfo.AttributeID.ToInt());
int strengNum = 0;
strengNum = MathUtils.Addition(itemEquAttrInfo.BaseNum, (itemEquAttrInfo.IncreaseNum * item.ItemLv), int.MaxValue);
// dsItem1.PushIntoStack(itemEqu.BaseNum);
dsItem1.PushIntoStack(strengNum);
dsItem.PushIntoStack(dsItem1);
}
}
}
示例3: GetUserRankingList
/// <summary>
///
/// </summary>
/// <returns></returns>
public UserRanking[] GetUserRankingList()
{
var cache = new ShareCacheStruct<UserRanking>();
var rankingList = cache.FindAll(false);
//rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo);
//rankingList = rankingList.GetPaging(PageIndex, PageSize, out PageCount);
return rankingList.ToArray();
}
示例4: TakeAction
public override bool TakeAction()
{
var cache = new ShareCacheStruct<UserScore>();
_dsItemList_1 = cache.FindAll(false);
_dsItemList_1 = MathUtils.QuickSort<UserScore>(_dsItemList_1, compareTo);
_dsItemList_1 = _dsItemList_1.GetPaging(_pindex, _psize, out _pcount);
return true;
}
示例5: 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;
}
示例6: TakeAction
/// <summary>
/// 业务逻辑处理
/// </summary>
/// <returns>false:中断后面的方式执行并返回Error</returns>
public override bool TakeAction()
{
var serverCache = new ShareCacheStruct<StaticServer>();
staticServerList = serverCache.FindAll(false);
//StaticServer serverData;
return true;
}
示例7: TakeAction
public override bool TakeAction()
{
var cache = new ShareCacheStruct<UserRanking>();
rankingList = cache.FindAll(false);
int count = rankingList.Count;
rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo);
rankingList = rankingList.GetPaging(PageIndex, PageSize, out PageCount);
int rcount = rankingList.Count;
Console.WriteLine("count:{0}/{1}", rcount, count);
return true;
}
示例8: 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;
}
示例9: MonsterQueue
/// <summary>
/// 圣吉塔战役
/// </summary>
/// <param name="plotNpcID"></param>
/// <param name="difficultNum"></param>
public MonsterQueue(int plotNpcID, double difficultNum)
{
var sjtEmbattleList = new ShareCacheStruct<SJTPlotEmbattleInfo>().FindAll();
sjtEmbattleList = sjtEmbattleList.FindAll(m => m.PlotNpcID == plotNpcID);
foreach (SJTPlotEmbattleInfo embattle in sjtEmbattleList)
{
int index = embattle.GridSeqNo - 1;
IGeneral general = Create(embattle, difficultNum);
if (general != null)
{
SetQueue(index, general);
}
}
this.PriorityNum = 0;
}
示例10: TakeAction
public override bool TakeAction()
{
int pageCount;
var cache = new ShareCacheStruct<UserRanking>();
var rankingList = cache.FindAll(false);
rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo);
rankingList = rankingList.GetPaging(requestPack.PageIndex, requestPack.PageSize, out pageCount);
responsePack = new Response1001Pack();
responsePack.PageCount = pageCount;
responsePack.Items = new List<RankData>();
foreach (var item in rankingList)
{
responsePack.Items.Add(new RankData() { UserName = item.UserName, Score = item.Score });
}
return true;
}
示例11: 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);
}
}
示例12: TakeAction
public override bool TakeAction()
{
var cacheSet = new ShareCacheStruct<UserFriends>();
if (_friendId != "" && _friendId != ContextUser.UserID)
{
//找到本玩家的数据
List<UserFriends> friendArray = cacheSet.FindAll(m => m.UserID == ContextUser.UserID);
int friendNum = ConfigEnvSet.GetInt("UserFriends.MaxFriendNum");
//添加的好友上限
if (friendArray.Count >= friendNum)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St9103_TheMaximumReachedAFriend;
return false;
}
//查看是否在user库中有该玩家
GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(_friendId);
if (userInfo == null)
{
UserCacheGlobal.LoadOffline(_friendId);
userInfo = new GameDataCacheSet<GameUser>().FindKey(_friendId);
}
if (userInfo == null)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St9103_NotFriendsUserID;
return false;
}
//在好友表中查找本玩家 和添加好友的关系
var userFriend = cacheSet.FindKey(ContextUser.UserID, _friendId);
var userFriend1 = cacheSet.FindKey(_friendId, ContextUser.UserID);
//同意
if (_ops == 1)
{
//有信息表 没信息表
if (userFriend == null)
{
//创建新的数据 并且添加成关注类型
var friends = new UserFriends
{
UserID = ContextUser.UserID,
FriendID = _friendId,
FriendType = FriendType.Friend
};
cacheSet.Add(friends);
//todo test
friends.ChatTime = DateTime.Now;
}else
{
//玩家原来就有数据
//判断两个玩家的关系
if (userFriend.FriendType == FriendType.Friend)
{
ErrorCode = LanguageManager.GetLang().ErrorCode;
ErrorInfo = LanguageManager.GetLang().St9103_TheUserHasAFriendIn;
return false;
}
userFriend.FriendType = FriendType.Friend;
}
//判断对方是否有和本玩家的数据 如果没有创建 有改状态
if (userFriend1 == null)
{
var friends2 = new UserFriends
{
UserID = _friendId,
FriendID = ContextUser.UserID,
FriendType = FriendType.Friend,
};
cacheSet.Add(friends2);
//todo test
friends2.ChatTime = DateTime.Now;
}
else
{
userFriend1.FriendType = FriendType.Friend;
}
//加为好友成功后发送一条邮件
try
{
Guid newGuid = Guid.NewGuid();
UserMail userMail = new UserMail(newGuid);
userMail.UserId = Int32.Parse(_friendId);
userMail.MailType = (int)MailType.Friends;
userMail.Title = LanguageManager.GetLang().St_AskFirendMailTitle;
userMail.Content = string.Format(LanguageManager.GetLang().St_FirendNotice, ContextUser.NickName);
userMail.SendDate = DateTime.Now;
userMail.FromUserId = Int32.Parse(ContextUser.UserID);
userMail.FromUserName = ContextUser.NickName;
TjxMailService mailService = new TjxMailService(ContextUser);
mailService.Send(userMail);
var noticeMail = mailService.ReadMail(ContextUser.UserID, _mailId);
noticeMail.ReplyStatus = 1;
}
//.........这里部分代码省略.........
示例13: TakeAction
public override bool TakeAction()
{
GameRanking.Server.Script.Lib.TestHelper.Test();
var cache = new ShareCacheStruct<UserRanking>();
rankingList = cache.FindAll();
rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo);
rankingList = rankingList.GetPaging(PageIndex, PageSize, out PageCount);
return true;
}
示例14: OnStartAffer
protected override void OnStartAffer()
{
try
{
var setting = new EnvironmentSetting();
setting.EntityAssembly = Assembly.Load("GameRanking.Model");
setting.ScriptStartBeforeHandle += () =>
{
ScriptEngines.AddReferencedAssembly("GameRanking.Model.dll");
ActionFactory.SetActionIgnoreAuthorize(1000, 1001);
var cache = new ShareCacheStruct<UserRanking>();
Stopwatch t = new Stopwatch();
t.Start();
var list = cache.FindAll(false);
t.Stop();
if(list.Count > 0)
{
}
};
var cacheSetting = new CacheSetting();
cacheSetting.ChangedHandle += OnChangedNotify;
GameEnvironment.Start(setting, cacheSetting);
Console.WriteLine("The server is staring...");
}
catch (Exception ex)
{
TraceLog.WriteError("App star error:{0}", ex);
}
}
示例15: GetKeyWordSubstitution
/// <summary>
/// 屏蔽敏感词
/// </summary>
/// <param name="keyWord"></param>
/// <returns></returns>
public static bool GetKeyWordSubstitution(string keyWord)
{
keyWord = keyWord.Trim();
bool IsWord = false;
ShareCacheStruct<ChatKeyWord> cacheSet = new ShareCacheStruct<ChatKeyWord>();
List<ChatKeyWord> chatKeyWordArray = cacheSet.FindAll();
foreach (ChatKeyWord chatKeyWord in chatKeyWordArray)
{
if (keyWord.IndexOf(chatKeyWord.KeyWord) >= 0)
{
IsWord = true;
break;
}
}
return IsWord;
}