- Timestamp:
- Nov 9, 2021, 6:28:33 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
r351 r369 13 13 foreach (KeyValuePair<int, EntityPlayer> current in w.Players.dict) { 14 14 ClientInfo ci = ConnectionManager.Instance.Clients.ForEntityId (current.Key); 15 Player player = PersistentContainer.Instance.Players [ci. playerId, false];15 Player player = PersistentContainer.Instance.Players [ci.PlatformId, false]; 16 16 17 17 JSONObject pos = new JSONObject (); … … 21 21 22 22 JSONObject p = new JSONObject (); 23 p.Add ("steamid", new JSONString (ci. playerId));23 p.Add ("steamid", new JSONString (ci.PlatformId.CombinedString)); 24 24 p.Add ("entityid", new JSONNumber (ci.entityId)); 25 25 p.Add ("ip", new JSONString (ci.ip)); … … 28 28 p.Add ("position", pos); 29 29 30 // Deprecated! 31 p.Add ("experience", new JSONNumber (-1)); 32 33 p.Add ("level", new JSONNumber (player != null ? player.Level : -1)); 30 p.Add ("level", new JSONNumber (player?.Level ?? -1)); 34 31 p.Add ("health", new JSONNumber (current.Value.Health)); 35 32 p.Add ("stamina", new JSONNumber (current.Value.Stamina)); … … 39 36 p.Add ("score", new JSONNumber (current.Value.Score)); 40 37 41 p.Add ("totalplaytime", new JSONNumber (player != null ? player.TotalPlayTime :-1));38 p.Add ("totalplaytime", new JSONNumber (player?.TotalPlayTime ?? -1)); 42 39 p.Add ("lastonline", new JSONString (player != null ? player.LastOnline.ToString ("s") : string.Empty)); 43 40 p.Add ("ping", new JSONNumber (ci.ping));
Note:
See TracChangeset
for help on using the changeset viewer.