Пример #1
0
        async Task IStatistics.UpdateStats(string StatStorName, Dictionary <int, RequestStats> Data)
        {
            try
            {
                ActorId StoreId = StatStorName.ToActorId();
                Dictionary <int, RequestStats> Stored = await StoreId.LoadGeneric <Dictionary <int, RequestStats> >();

                if (Stored == null)
                {
                    Stored = new Dictionary <int, RequestStats>();
                }
                if (Data != null)
                {
                    foreach (int k in Data.Keys)
                    {
                        if (!Stored.ContainsKey(k))
                        {
                            Stored.Add(k, new RequestStats(k));
                        }
                        Stored[k].CompressedSize += Data[k].CompressedSize;
                        Stored[k].NumCalls       += Data[k].NumCalls;
                        Stored[k].TotalTime      += Data[k].TotalTime;
                        Stored[k].TotalSize      += Data[k].TotalSize;
                    }
                    await Stored.SaveGeneric(StoreId);
                }
            }
            catch (Exception E)
            {
                this.Log(E);
                throw (E);
            }
        }
Пример #2
0
 // produce or hint monsters
 public Monster CreateMonster(int x, int y, int playerLevel)
 {
     if (Stored.ContainsKey(y * Width + x) && Stored[y * Width + x] != null)
     {
         return(Stored[y * Width + x]);
     }
     if (monDict.ContainsKey(y * Width + x) && monDict[y * Width + x] != null)
     {
         return(monDict[y * Width + x].Create(playerLevel));
     }
     return(null);
 }