API Reference - tepel-chen/DeMiLService GitHub Wiki

Following APIs are available. They accept any HTTP request method(although they probably shouldn't)

http://localhost:{port}/missions

List of all mission packs that are currently loaded, or saved in DeMiL setting file(Modsettings/DeMiLService.json). Please note that all unloaded mods can be loaded through following API even if they are not listed here, as long as they are already downloaded.

Result

[
  {
    "SteamID": "2324805341",
    "ModID": "tepelsMissions",
    "Title": "tepel's Missions",
    "LoadURL": "http://localhost:8095/loadMission?steamID=2324805341",
    "DetailURL": "http://localhost:8095/missionDetail?steamID=2324805341"
  },...
]

http://localhost:{port}/missionDetail?steamID={steamID}

Shows detail of the mission pack, as well as all the available missions. This also load the mod in game.

Following query parameters are also accepted.

  • refreshBinder=false - Binder will not refresh after the code is run. Default true.

Result

{
  "SteamID": "2324805341",
  "ModID": "tepelsMissions",
  "Title": "tepel's Missions",
  "Missions": [{
      "Title": "Grammaphobia",
      "MissionID": "mod_tepelsMissions_mission 1",
      "Description": "Sorry, but I can only read sphenogram. ",
      "FactoryMode": "Static",
      "BombData": [...],
      "BombCount": 1,
      "StartURL": "http://localhost:8095/startMission?steamID=2324805341&missionID=mod_tepelsMissions_mission 1"
  }],
  "LoadURL": "http://localhost:8095/loadMission?steamID=2324805341",
  "Version": "2.1.0"
}

BombData includes information about the bomb(s) that spawns in the mission.

{
    "TimeLimit": 7260.0,
    "NumStrikes": 8,
    "TimeBeforeNeedyActivation": 90,
    "FrontFaceOnly": false,
    "OptionalWidgetCount": 5,
    "ComponentPools": [
        [
            "GSNineBall"
        ],...
    ],
    "Version": "2.1.0"
}

http://localhost:{port}/tocDetail?steamID={steamID}

Shows detail of the mission pack, the table of contents, sections and mission detail. This also load the mod in game.

Following query parameters are also accepted.

  • refreshBinder=false - Binder will not refresh after the code is run. Default true.

Result

{
  "SteamID": "2324805341",
  "ModID": "tepelsMissions",
  "Title": "tepel's Missions",
  "ToCs": [
    {
      "Title": "tepel's mission",
      "Sections": [
        {
          "Title": "Big bombs",
          "SectionNum": 1,
          "Missions": [...]
        },...
      ]
    },...
  ],
  "LoadURL": "http://localhost:8095/loadMission?steamID=2324805341",
  "Version": "2.1.0"
}

Missions includes information about the missions included in the section. See the previous section for details.

http://localhost:{port}/loadMission?steamID={steamID}

Loads the mod in game and refresh the mission binder.

Following query parameters are also accepted.

  • refreshBinder=false - Binder will not refresh after the code is run. Default true.

Result

{
  "LoadedMission": "2324805341",
  "Version": "2.1.0"
}

http://localhost:{port}/startMission?missionID={missionID}

Start the mission with specified mission ID.

Following query parameters are also accepted.

  • steamID={steamID} - Load the specified mod before starting the mission.
  • seed={seed} - Specify mission seed.
  • force=true - Start the mission without checking the mission can be run in the current setting.

Result

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "Seed": "-1",
  "Version": "2.1.0"
}

If there are missing mods, the list of missing moduleIDs will be returned.

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "MissingModules": ["OneDimensionalMaze", ...],
  "Version": "2.1.0"
}

If there too many modules that no bomb casing can hold them, the numbers will be returned. In general case:

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "MaximumSupportedModulesCount": 11,
  "MissionModulesCount": 15,
  "Version": "2.1.0"
}

If front face only mission:

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "MaximumSupportedFrontfaceModulesCount": 11,
  "MissionModulesCount": 15,
  "Version": "2.1.0"
}

If there too many bombs that no room can hold them, the numbers will be returned.

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "MaximumSupportedBombsCount": 4,
  "MissionBombsCount": 8,
  "Version": "2.1.0"
}

http://localhost:{port}/startMission?missionName={missionName}&steamID={steamID}

Start the mission with specified mission name in the specified mission pack. All spaces before and after the query and the mission names are ignored, and they are case insensitive. The game will search for missions in the following order, and start the mission if there is only one mission that satisfies the condition. If there are multiple missions that satisfies the condition, error will be returned.

  • The query exactly matches the name
  • "The " + query exactly matches the name
  • The query partially matches the name

Following query parameters are also accepted.

  • seed={seed} - Specify mission seed.
  • force=true - Start the mission without checking the mission can be run in the current setting.

Result

{
  "MissionID": "mod_tepelsMissions_mission 1",
  "Seed": "-1",
  "Version": "2.1.0"
}

See the previous section for errors.

http://localhost:{port}/saveAndDisable

Save mission pack data to the DeMiL setting file(Modsettings/DeMiLService.json), and disables the mods. The game will enter the mod manager and leave immidiately. This is only possible in setup room.

Result

{
  "SavedMissions": [
    {
      "SteamID": "2324805341",
      "ModID": "tepelsMissions",
      "Title": "tepel's Missions",
      "LoadURL": "http://localhost:8095/loadMission?steamID=2324805341",
      "DetailURL": "http://localhost:8095/missionDetail?steamID=2324805341"
    },...
  ],
  "Version": "2.1.0"
}

http://localhost:{port}/version

Print current installed version of DeMiL.

Result

{
  "Version": "2.1.0"
}

Errors

If any errors occurred while running the query, error object will be returned in the following form:

{
  "ERROR": "",
  "Stacktrace": "",
  "Version": "2.1.0"
}

There are some entrypoints that returns unique error object. See the corresponding sections for details.