示例#1
0
        public static BindAiRestrict Get(string BindAi)
        {
            var rec = MongoService <BindAiRestrict> .GetOnly(p => p.BindAi == BindAi);

            if (rec != null)
            {
                return(rec);
            }

            rec = new BindAiRestrict()
            {
                BindAi = BindAi, MaxLimit = RestrictorSvc.MaxRecentCommandCacheCount
            };
            MongoService <BindAiRestrict> .Insert(rec);

            return(rec);
        }
示例#2
0
 public void RefreshData()
 {
     BindAiLimit = BindAiSvc.AiDic.Keys.ToDictionary(p => p, p => BindAiRestrict.Get(p).MaxLimit);
 }