Changeset 326 for binary-improvements/MapRendering/Web/API/GetPlayerList.cs
- Timestamp:
- Sep 4, 2018, 2:33:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetPlayerList.cs
r325 r326 40 40 Player p = playersList [sid, false]; 41 41 42 ulong player_steam_ID = 0L;42 ulong player_steam_ID; 43 43 if (!ulong.TryParse (sid, out player_steam_ID)) { 44 44 player_steam_ID = 0L; … … 64 64 pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1)); 65 65 66 JSONBoolean banned = null;66 JSONBoolean banned; 67 67 if (admTools != null) { 68 68 banned = new JSONBoolean (admTools.IsBanned (sid)); … … 132 132 133 133 if (colType == typeof (JSONBoolean)) { 134 bool value = _filterVal.Trim ().ToLower () == "true";135 return _list.Where (line => ( line [_filterCol] as JSONBoolean).GetBool () == value);134 bool value = StringParsers.ParseBool (_filterVal); 135 return _list.Where (line => ((JSONBoolean) line [_filterCol]).GetBool () == value); 136 136 } 137 137 … … 143 143 //Log.Out ("GetPlayerList: Filter on String with Regex '" + _filterVal + "'"); 144 144 Regex matcher = new Regex (_filterVal, RegexOptions.IgnoreCase); 145 return _list.Where (line => matcher.IsMatch (( line [_filterCol] as JSONString).GetString ()));145 return _list.Where (line => matcher.IsMatch (((JSONString) line [_filterCol]).GetString ())); 146 146 } 147 147 } … … 185 185 186 186 return _list.Where (delegate (JSONObject line) { 187 double objVal = ( line [_filterCol] as JSONNumber).GetDouble ();187 double objVal = ((JSONNumber) line [_filterCol]).GetDouble (); 188 188 switch (matchType) { 189 189 case NumberMatchType.Greater: … … 216 216 if (colType == typeof (JSONNumber)) { 217 217 if (_ascending) { 218 return _list.OrderBy (line => ( line [_sortCol] as JSONNumber).GetDouble ());219 } 220 221 return _list.OrderByDescending (line => ( line [_sortCol] as JSONNumber).GetDouble ());218 return _list.OrderBy (line => ((JSONNumber) line [_sortCol]).GetDouble ()); 219 } 220 221 return _list.OrderByDescending (line => ((JSONNumber) line [_sortCol]).GetDouble ()); 222 222 } 223 223 224 224 if (colType == typeof (JSONBoolean)) { 225 225 if (_ascending) { 226 return _list.OrderBy (line => ( line [_sortCol] as JSONBoolean).GetBool ());227 } 228 229 return _list.OrderByDescending (line => ( line [_sortCol] as JSONBoolean).GetBool ());226 return _list.OrderBy (line => ((JSONBoolean) line [_sortCol]).GetBool ()); 227 } 228 229 return _list.OrderByDescending (line => ((JSONBoolean) line [_sortCol]).GetBool ()); 230 230 } 231 231
Note:
See TracChangeset
for help on using the changeset viewer.