- Timestamp:
- Nov 16, 2018, 10:38:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs
r326 r332 1 using System.Collections.Generic; 1 2 using System.Net; 2 3 using AllocsFixes.JSON; … … 8 9 int permissionLevel) { 9 10 AdminTools admTools = GameManager.Instance.adminTools; 10 user = user ?? new WebConnection ("", "", 0L);11 user = user ?? new WebConnection ("", IPAddress.None, 0L); 11 12 12 13 bool listOffline = false; … … 21 22 Players playersList = PersistentContainer.Instance.Players; 22 23 23 foreach ( string sid in playersList.SteamIDs) {24 foreach (KeyValuePair<string, Player> kvp in playersList.Dict) { 24 25 if (admTools != null) { 25 if (admTools.IsBanned ( sid)) {26 if (admTools.IsBanned (kvp.Key)) { 26 27 continue; 27 28 } 28 29 } 29 30 30 Player p = playersList [sid, false];31 Player p = kvp.Value; 31 32 32 33 if (listOffline || p.IsOnline) { 33 34 ulong player_steam_ID; 34 if (!ulong.TryParse ( sid, out player_steam_ID)) {35 if (!ulong.TryParse (kvp.Key, out player_steam_ID)) { 35 36 player_steam_ID = 0L; 36 37 } … … 43 44 44 45 JSONObject pJson = new JSONObject (); 45 pJson.Add ("steamid", new JSONString ( sid));46 pJson.Add ("steamid", new JSONString (kvp.Key)); 46 47 47 48 // pJson.Add("entityid", new JSONNumber (p.EntityID));
Note:
See TracChangeset
for help on using the changeset viewer.