- Timestamp:
- Feb 16, 2023, 3:50:53 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/WebAPI/APIs/ServerInfo.cs
r402 r404 1 using System.Collections.Generic; 1 2 using JetBrains.Annotations; 2 3 using Utf8Json; … … 22 23 GameServerInfo gsi = ConnectionManager.Instance.LocalServerInfo; 23 24 24 bool first = true;25 26 25 IList<GameInfoString> list = EnumUtils.Values<GameInfoString> (); 26 for (int i = 0; i < list.Count; i++) { 27 GameInfoString stringGamePref = list [i]; 27 28 28 foreach (GameInfoString stringGamePref in EnumUtils.Values<GameInfoString> ()) { 29 string value = gsi.GetValue (stringGamePref); 30 31 if (!first) { 29 if (i > 0) { 32 30 writer.WriteValueSeparator (); 33 31 } 34 32 35 first = false;36 37 33 writer.WriteString (stringGamePref.ToStringCached ()); 38 34 writer.WriteNameSeparator (); 39 35 40 36 writer.WriteRaw (keyType); 41 37 writer.WriteString ("string"); 42 38 43 39 writer.WriteRaw (keyValue); 44 writer.WriteString ( value);45 40 writer.WriteString (gsi.GetValue (stringGamePref)); 41 46 42 writer.WriteEndObject (); 47 43 } 48 44 49 foreach (GameInfoInt intGamePref in EnumUtils.Values<GameInfoInt> ()) { 50 int value = gsi.GetValue (intGamePref); 45 IList<GameInfoInt> ints = EnumUtils.Values<GameInfoInt> (); 46 for (int i = 0; i < ints.Count; i++) { 47 GameInfoInt intGamePref = ints [i]; 51 48 52 if ( !first) {49 if (i > 0) { 53 50 writer.WriteValueSeparator (); 54 51 } 55 52 56 first = false;57 58 53 writer.WriteString (intGamePref.ToStringCached ()); 59 54 writer.WriteNameSeparator (); 60 55 61 56 writer.WriteRaw (keyType); 62 57 writer.WriteString ("int"); 63 58 64 59 writer.WriteRaw (keyValue); 65 writer.WriteInt32 ( value);66 60 writer.WriteInt32 (gsi.GetValue (intGamePref)); 61 67 62 writer.WriteEndObject (); 68 63 } 69 64 70 foreach (GameInfoBool boolGamePref in EnumUtils.Values<GameInfoBool> ()) { 71 bool value = gsi.GetValue (boolGamePref); 65 IList<GameInfoBool> prefs = EnumUtils.Values<GameInfoBool> (); 66 for (int i = 0; i < prefs.Count; i++) { 67 GameInfoBool boolGamePref = prefs [i]; 72 68 73 if ( !first) {69 if (i > 0) { 74 70 writer.WriteValueSeparator (); 75 71 } 76 72 77 first = false;78 79 73 writer.WriteString (boolGamePref.ToStringCached ()); 80 74 writer.WriteNameSeparator (); 81 75 82 76 writer.WriteRaw (keyType); 83 77 writer.WriteString ("bool"); 84 78 85 79 writer.WriteRaw (keyValue); 86 writer.WriteBoolean ( value);87 80 writer.WriteBoolean (gsi.GetValue (boolGamePref)); 81 88 82 writer.WriteEndObject (); 89 83 } 90 84 91 85 writer.WriteEndObject (); 92 86
Note:
See TracChangeset
for help on using the changeset viewer.