Changeset 332 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Nov 16, 2018, 10:38:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r327 r332 6 6 [Serializable] 7 7 public class Players { 8 p rivate readonly Dictionary<string, Player> players= new Dictionary<string, Player> (StringComparer.OrdinalIgnoreCase);8 public readonly Dictionary<string, Player> Dict = new Dictionary<string, Player> (StringComparer.OrdinalIgnoreCase); 9 9 10 10 public Player this [string steamId, bool create] { … … 14 14 } 15 15 16 if ( players.ContainsKey (steamId)) {17 return players[steamId];16 if (Dict.ContainsKey (steamId)) { 17 return Dict [steamId]; 18 18 } 19 19 … … 24 24 Log.Out ("Created new player entry for ID: " + steamId); 25 25 Player p = new Player (steamId); 26 players.Add (steamId, p);26 Dict.Add (steamId, p); 27 27 return p; 28 28 } 29 29 } 30 30 31 public List<string> SteamIDs {32 get { return new List<string> (players.Keys); }33 }34 35 31 public int Count { 36 get { return players.Count; }32 get { return Dict.Count; } 37 33 } 38 34 … … 58 54 int entityId; 59 55 if (int.TryParse (_nameOrId, out entityId)) { 60 foreach (KeyValuePair<string, Player> kvp in players) {56 foreach (KeyValuePair<string, Player> kvp in Dict) { 61 57 if (kvp.Value.IsOnline && kvp.Value.EntityID == entityId) { 62 58 return kvp.Key; … … 65 61 } 66 62 67 foreach (KeyValuePair<string, Player> kvp in players) {63 foreach (KeyValuePair<string, Player> kvp in Dict) { 68 64 string name = kvp.Value.Name; 69 65 if (_ignoreColorCodes) {
Note:
See TracChangeset
for help on using the changeset viewer.