Misc Fixes

This commit is contained in:
hondacrx
2017-10-25 17:07:28 -04:00
parent 62585dcfb3
commit d552c65668
15 changed files with 248 additions and 194 deletions
+4 -9
View File
@@ -25,6 +25,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Timers;
using System.Collections.Concurrent;
public class RealmManager : Singleton<RealmManager>
{
@@ -48,14 +49,8 @@ public class RealmManager : Singleton<RealmManager>
void UpdateRealm(Realm realm)
{
var oldRealm = _realms.LookupByKey(realm.Id);
if (oldRealm == null)
{
_realms[realm.Id] = realm;
return;
}
if (oldRealm == realm)
return;
if (oldRealm != null && oldRealm == realm)
return;
_realms[realm.Id] = realm;
}
@@ -323,7 +318,7 @@ public class RealmManager : Singleton<RealmManager>
public List<Realm> GetRealms() { return _realms.Values.ToList(); }
List<string> GetSubRegions() { return _subRegions; }
Dictionary<RealmHandle, Realm> _realms = new Dictionary<RealmHandle, Realm>();
ConcurrentDictionary<RealmHandle, Realm> _realms = new ConcurrentDictionary<RealmHandle, Realm>();
List<string> _subRegions = new List<string>();
Timer _updateTimer;
}