Changeset 268 for binary-improvements


Ignore:
Timestamp:
Apr 28, 2016, 1:51:17 PM (3 years ago)
Author:
alloc
Message:

Fixes #127: Added totalplaytime and lastonline to WebAPIs GetPlayersOnline and GetPlayersLocation

Location:
binary-improvements/MapRendering/Web/API
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs

    r256 r268  
    4545                    pJson.Add("position", pos);
    4646
    47                     playersJsResult.Add (pJson);
     47                                        pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime));
     48                                        pJson.Add ("lastonline", new JSONString (p.LastOnline.ToString ("s")));
     49
     50                                        playersJsResult.Add (pJson);
    4851                }
    4952            }
  • binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs

    r256 r268  
    4040                                p.Add ("score", new JSONNumber (current.Value.Score));
    4141
     42                                p.Add ("totalplaytime", new JSONNumber (player != null ? player.TotalPlayTime : -1));
     43                                p.Add ("lastonline", new JSONString (player != null ? player.LastOnline.ToString ("s") : string.Empty));
     44
    4245                                players.Add(p);
    4346                        }
Note: See TracChangeset for help on using the changeset viewer.