Changeset 394 for binary-improvements2/WebServer/src/WebAPI
- Timestamp:
 - Aug 8, 2022, 8:07:44 PM (3 years ago)
 - Location:
 - binary-improvements2/WebServer/src/WebAPI
 - Files:
 - 
      
- 2 edited
 
- 
          
  AbsRestApi.cs (modified) (2 diffs)
 - 
          
  GetPlayerList.cs (modified) (3 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
binary-improvements2/WebServer/src/WebAPI/AbsRestApi.cs
r391 r394 6 6 namespace Webserver.WebAPI { 7 7 public abstract class AbsRestApi : AbsWebAPI { 8 private static readonly UnityEngine.Profiling.CustomSampler jsonDeserializeSampler = UnityEngine.Profiling.CustomSampler.Create ("JSON_Deserialize"); 9 8 10 public sealed override void HandleRequest (RequestContext _context) { 9 11 JsonNode jsonBody = null; … … 14 16 if (!string.IsNullOrEmpty (body)) { 15 17 try { 18 jsonDeserializeSampler.Begin (); 16 19 jsonBody = Parser.Parse (body); 20 jsonDeserializeSampler.End (); 17 21 } catch (Exception e) { 22 jsonDeserializeSampler.End (); 23 18 24 SendEnvelopedResult (_context, null, HttpStatusCode.BadRequest, null, "INVALID_BODY", e); 19 25 return;  - 
      
binary-improvements2/WebServer/src/WebAPI/GetPlayerList.cs
r391 r394 13 13 new Regex (@"^(>=|=>|>|<=|=<|<|==|=)?\s*([0-9]+(\.[0-9]*)?)$"); 14 14 15 #if ENABLE_PROFILER16 15 private static readonly UnityEngine.Profiling.CustomSampler jsonSerializeSampler = UnityEngine.Profiling.CustomSampler.Create ("JSON_Build"); 17 #endif18 16 19 17 public override void HandleRequest (RequestContext _context) { … … 42 40 List<JsonObject> playerList = new List<JsonObject> (); 43 41 44 #if ENABLE_PROFILER45 42 jsonSerializeSampler.Begin (); 46 #endif47 43 48 44 foreach (KeyValuePair<PlatformUserIdentifierAbs, Player> kvp in playersList.Dict) { … … 76 72 } 77 73 78 #if ENABLE_PROFILER79 74 jsonSerializeSampler.End (); 80 #endif81 75 82 76 IEnumerable<JsonObject> list = playerList;  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  ![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)