Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public void RefreshData()
 {
     BindAiLimit = BindAiSvc.AiDic.Keys.ToDictionary(p => p, p => BindAiRestrict.Get(p).MaxLimit);
 }