Skip to content

Latest commit

 

History

History
186 lines (147 loc) · 3.53 KB

File metadata and controls

186 lines (147 loc) · 3.53 KB

Webserver managements

POST /stop

Stop the webserver. Useful for restarting the Lua mods. Note that it will still try to complete any ongoing request before stopping. Future request will be rejected.

Response data:

Returns 200 OK for successful stop command. Will output Webserver stopped in the log to confirm the full webserver shutdown.

GET /status

Returns Lua HTTP server status. Doesn't require any authentication.

Response data:

Returns 200 OK if ready to accept connection:

{ "status": "ok" }

Returns 503 Service Unavailable if not ready to accept any connection:

{ "status": "not ready" }

GET /status/general

Returns general server status

Response data:
{
  "data": {
    "ZoneStates": [
      {
        "BusTransportRate": 0.0,
        "NumResidents": 42,
        "ZoneKey": "Ara",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 11,
        "ZoneKey": "Gwangjin",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 64,
        "ZoneKey": "Gangjung",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 63,
        "ZoneKey": "Jeju",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 24,
        "ZoneKey": "Hallim",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 31,
        "ZoneKey": "Seongsan",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      },
      {
        "BusTransportRate": 0.0,
        "NumResidents": 20,
        "ZoneKey": "Gapa",
        "FoodSupplyRate": 0.0,
        "GarbageCollectRate": 0.0,
        "PolicePatrolRate": 0.0
      }
    ],
    "GarbageCollectRate": 0.0,
    "NumResidents": 255,
    "PolicePatrolRate": 0.0,
    "ServerPlatformTimeSeconds": 16793104.642075,
    "FoodSupplyRate": 0.0,
    "BusTransportRate": 0.0,
    "FPS": 75
  }
}

GET /status/general/<zone>

Returns a specific zone status. Available zone keys can be found from /status/general data.

Response data:
{
  "data": {
    "FoodSupplyRate": 0.0,
    "BusTransportRate": 0.0,
    "GarbageCollectRate": 0.0,
    "NumResidents": 65,
    "ZoneKey": "Gangjung",
    "PolicePatrolRate": 0.0
  }
}

POST /status/traffic

Update the traffic related settings. Each request parameter is optional.

Request body:
{
  "NPCVehicleDensity": 1.0,
  "MaxVehiclePerPlayer": 10
}
Response data:
{ "status": "ok" }

POST /command

Execute a console command on the server. Optionally can be executed on a specific player controller.

Request body:
{
  "Command": "mh.aIVehicleStuckTimeSeconds=120",
  "PlayerId": ""
}
Response data:
{ "status": "ok" }