Changeset 434 for binary-improvements2/WebServer/src/WebAPI/APIs/WorldState
- Timestamp:
- May 17, 2023, 11:05:59 PM (18 months ago)
- Location:
- binary-improvements2/WebServer/src/WebAPI/APIs/WorldState
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/WebAPI/APIs/WorldState/Animal.cs
r433 r434 4 4 using Webserver.LiveData; 5 5 6 namespace Webserver.WebAPI.APIs {6 namespace Webserver.WebAPI.APIs.WorldState { 7 7 [UsedImplicitly] 8 8 internal class Animal : AbsRestApi { -
binary-improvements2/WebServer/src/WebAPI/APIs/WorldState/Hostile.cs
r433 r434 4 4 using Webserver.LiveData; 5 5 6 namespace Webserver.WebAPI.APIs {6 namespace Webserver.WebAPI.APIs.WorldState { 7 7 [UsedImplicitly] 8 8 internal class Hostile : AbsRestApi { -
binary-improvements2/WebServer/src/WebAPI/APIs/WorldState/Player.cs
r433 r434 6 6 using Webserver.Permissions; 7 7 8 namespace Webserver.WebAPI.APIs {8 namespace Webserver.WebAPI.APIs.WorldState { 9 9 [UsedImplicitly] 10 10 public class Player : AbsRestApi { … … 216 216 217 217 protected override void HandleRestPost (RequestContext _context, IDictionary<string, object> _jsonInput, byte[] _jsonInputData) { 218 if (! TryGetJsonField (_jsonInput, "command", out string commandString)) {219 SendE rrorResult(_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_COMMAND");218 if (!JsonCommons.TryGetJsonField (_jsonInput, "command", out string commandString)) { 219 SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_COMMAND"); 220 220 return; 221 221 } … … 223 223 WebCommandResult.ResultType responseType = WebCommandResult.ResultType.Full; 224 224 225 if ( TryGetJsonField (_jsonInput, "format", out string formatString)) {225 if (JsonCommons.TryGetJsonField (_jsonInput, "format", out string formatString)) { 226 226 if (formatString.EqualsCaseInsensitive ("raw")) { 227 227 responseType = WebCommandResult.ResultType.Raw; … … 240 240 241 241 if (command == null) { 242 SendE rrorResult(_context, HttpStatusCode.NotFound, _jsonInputData, "UNKNOWN_COMMAND");242 SendEmptyResponse (_context, HttpStatusCode.NotFound, _jsonInputData, "UNKNOWN_COMMAND"); 243 243 return; 244 244 } … … 247 247 248 248 if (_context.PermissionLevel > commandPermissionLevel) { 249 SendE rrorResult(_context, HttpStatusCode.Forbidden, _jsonInputData, "NO_PERMISSION");249 SendEmptyResponse (_context, HttpStatusCode.Forbidden, _jsonInputData, "NO_PERMISSION"); 250 250 return; 251 251 }
Note:
See TracChangeset
for help on using the changeset viewer.