コード例 #1
0
 /// <summary>
 /// Sets the dmap server + fills the dmap collection.
 /// </summary>
 /// <param name="dmaps">The dmapserver.</param>
 /// <returns>Returns true if the dmap handler was set and the dmap collection was filled correct.</returns>
 public static bool SetHandler(DMapServer dmaps)
 {
     if (!dmaps.Loaded)
     {
         while (!dmaps.Loaded)
             System.Threading.Thread.Sleep(100);
     }
     DmapHandler = dmaps;
     DMaps = new ConcurrentDictionary<ushort, DMap>();
     foreach (int key in DmapHandler.Maps.Keys)
     {
         if (!DMaps.TryAdd((ushort)key, DmapHandler.Maps[key]))
         {
             Console.WriteLine("Failed to add {0} to the dmaps.", key);
             return false;
         }
     }
     return true;
 }
コード例 #2
0
 /// <summary>
 /// Sets the dmap server + fills the dmap collection.
 /// </summary>
 /// <param name="dmaps">The dmapserver.</param>
 /// <returns>Returns true if the dmap handler was set and the dmap collection was filled correct.</returns>
 public static bool SetHandler(DMapServer dmaps)
 {
     if (!dmaps.Loaded)
     {
         while (!dmaps.Loaded)
         {
             System.Threading.Thread.Sleep(100);
         }
     }
     DmapHandler = dmaps;
     DMaps       = new ConcurrentDictionary <ushort, DMap>();
     foreach (int key in DmapHandler.Maps.Keys)
     {
         if (!DMaps.TryAdd((ushort)key, DmapHandler.Maps[key]))
         {
             Console.WriteLine("Failed to add {0} to the dmaps.", key);
             return(false);
         }
     }
     return(true);
 }