Changeset 325 for binary-improvements/MapRendering/Web/API/GetServerInfo.cs
- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/API/GetServerInfo.cs
r279 r325 1 using System; 2 using System.Net; 1 3 using AllocsFixes.JSON; 2 using AllocsFixes.PersistentData;3 using System;4 using System.Collections.Generic;5 using System.Net;6 4 7 namespace AllocsFixes.NetConnections.Servers.Web.API 8 { 9 public class GetServerInfo : WebAPI 10 { 11 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) 12 { 5 namespace AllocsFixes.NetConnections.Servers.Web.API { 6 public class GetServerInfo : WebAPI { 7 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, 8 int permissionLevel) { 13 9 JSONObject serverInfo = new JSONObject (); 14 10 15 11 GameServerInfo gsi = Steam.Masterserver.Server.LocalGameInfo; 16 12 17 foreach (string stringGamePref in Enum.GetNames (typeof(GameInfoString))) {18 string value = gsi.GetValue ( (GameInfoString)Enum.Parse (typeof(GameInfoString), stringGamePref));13 foreach (string stringGamePref in Enum.GetNames (typeof (GameInfoString))) { 14 string value = gsi.GetValue ((GameInfoString) Enum.Parse (typeof (GameInfoString), stringGamePref)); 19 15 20 16 JSONObject singleStat = new JSONObject (); … … 25 21 } 26 22 27 foreach (string intGamePref in Enum.GetNames (typeof(GameInfoInt))) {28 int value = gsi.GetValue ( (GameInfoInt)Enum.Parse (typeof(GameInfoInt), intGamePref));23 foreach (string intGamePref in Enum.GetNames (typeof (GameInfoInt))) { 24 int value = gsi.GetValue ((GameInfoInt) Enum.Parse (typeof (GameInfoInt), intGamePref)); 29 25 30 26 JSONObject singleStat = new JSONObject (); … … 35 31 } 36 32 37 foreach (string boolGamePref in Enum.GetNames (typeof(GameInfoBool))) {38 bool value = gsi.GetValue ( (GameInfoBool)Enum.Parse (typeof(GameInfoBool), boolGamePref));33 foreach (string boolGamePref in Enum.GetNames (typeof (GameInfoBool))) { 34 bool value = gsi.GetValue ((GameInfoBool) Enum.Parse (typeof (GameInfoBool), boolGamePref)); 39 35 40 36 JSONObject singleStat = new JSONObject (); … … 46 42 47 43 48 WriteJSON (resp, serverInfo);44 WriteJSON (resp, serverInfo); 49 45 } 50 46 } 51 47 } 52
Note:
See TracChangeset
for help on using the changeset viewer.