Territories

The Territory Model

The territory model contains public information about a territory, its location, town ownership, and battle status.

Properties

  • Name
    id
    Type
    string
    Description

    The MongoDB ObjectID of the territory

  • Name
    num
    Type
    string
    Description

    The territory number.

  • Name
    areaName
    Type
    string
    Description

    The data-name for the Biome this territory is in.

  • Name
    world
    Type
    string
    Description

    The data-name of the Continent that this territory is on:
    north = Kalros west = Ascalon south = Garama

  • Name
    tg
    Type
    TerritoryGenerator
    Description

    The Territory Generator for this territory.

The Territory Generator Model

The TGen model contains information about its location, module resource, battle status, and adjacent territories.

Properties

Territory Generators are the defending structure that powers a Territory.

  • Name
    beacon
    Type
    string
    Description

    The coordinates to the Beacon Block at the top of a Territory Generator.

  • Name
    townId
    Type
    string
    Description

    The MongoDB ObjectID of the Town that owns this territory.

  • Name
    moduleResource
    Type
    string
    Description

    The material type of the resource required to mod this territory.

  • Name
    lastBattle
    Type
    long
    Description

    The time since the last battle that was fought at this territory, in ms since the epoch.

  • Name
    adjacentTerritories
    Type
    array
    Description

    An array of territories that are adjacent to this one as defined by their territory number. This is used to calculate things like Territory Locking, etc.

  • Name
    inhibitor
    Type
    Inhibitor
    Description

    The Inhibitor for this tgen.

    This can sometimes be null when there is no active Inhibitor there, usually as a result of being a town.

The Inhibitor Model

The Inhibitor model contains information about its location, town ownership, and battle status.

Properties

Inhibitors are the attacking structure for Conquest Battles.

  • Name
    beacon
    Type
    string
    Description

    The coordinates to the Beacon Block at the middle of the Inhib warp pad.

  • Name
    townId
    Type
    string
    Description

    The MongoDB ObjectID of the Town that owns this Inhibitor.

  • Name
    starter
    Type
    uuid
    Description

    The UUID of the player that set up this Inhibitor for a Conquest Battle.

  • Name
    timePlaced
    Type
    long
    Description

    The time that the Inhibitor was set up to begin a Conquest Battle, in ms since the epoch.

  • Name
    onlineTime
    Type
    long
    Description

    The time that the Inhibitor became online, signifying the start of a Conquest Battle.


GET/territories

List all territories

This endpoint allows you to retrieve a list of all territories on Loka.

Optional Attributes

  • Name
    size
    Type
    integer
    Description
    Limit the number of territories returned.
  • Name
    page
    Type
    integer
    Description
    Page of territories to return.

Request

GET
/territories
const axios = require('axios');

axios.get('https://api.lokamc.com/territories')
.then((response) => console.log(response.data));

Response

{
    "_embedded": {
        "territories": [
        {
            "id": "6123973216376e26f1a0d03c",
            "areaName": "moor",
            "world": "north",
            "num": "1",
            "tg": {
                "beacon": "north,2571,114,3196",
                "townId": "6090042ae4929b7aa6acbfda",
                "moduleResource": "Terracotta",
                "lastBattle": 0,
                "adjacentTerritories": [
                "55",
                "56",
                "47",
                "4",
                "50",
                "54"
                ],
                "inhibitor": null
            },
            "battleZone": null,
            }
        }
        ]
    },
}

GET/territories/search/findByWorld{?world}

List Territories by World

This endpoint allows you to retrieve a list of all Territories on a world.

Required attributes

  • Name
    world
    Type
    string
    Description

    The data-name of the world of the territory.

Optional Attributes

  • Name
    size
    Type
    integer
    Description
    Limit the number of territories returned.
  • Name
    page
    Type
    integer
    Description
    Page of territories to return.

Request

GET
/territories/search/findByWorld
const axios = require('axios');

axios.get('https://api.lokamc.com/territories/search/findByWorld', {
    params: { world: 'north' }
}).then((response) => console.log(response.data));

Response

{
    "_embedded": {
        "territories": [
        {
            "id": "6123973216376e26f1a0d03c",
            "areaName": "moor",
            "world": "north",
            "num": "1",
            "tg": {
                "beacon": "north,2571,114,3196",
                "townId": "6090042ae4929b7aa6acbfda",
                "moduleResource": "Terracotta",
                "lastBattle": 0,
                "adjacentTerritories": [
                "55",
                "56",
                "47",
                "4",
                "50",
                "54"
                ],
                "inhibitor": null
            },
            "battleZone": null,
            }
        }
        ]
    },
}

GET/territories/search/findBattles

List all Active Battles

This endpoint allows you to retrieve a list of all Territories with an active Conquest Battle going on.

Optional Attributes

  • Name
    size
    Type
    integer
    Description
    Limit the number of territories returned.
  • Name
    page
    Type
    integer
    Description
    Page of territories to return.

Request

GET
/territories/search/findByWorld
const axios = require('axios');

axios.get('https://api.lokamc.com/territories/search/findByWorld', {
    params: { world: 'north' }
}).then((response) => console.log(response.data));

Response

{
    "_embedded": {
        "territories": [
        {
            "id": "6123973216376e26f1a0d03c",
            "areaName": "moor",
            "world": "north",
            "num": "1",
            "tg": {
                "beacon": "north,2571,114,3196",
                "townId": "6090042ae4929b7aa6acbfda",
                "moduleResource": "Terracotta",
                "lastBattle": 0,
                "adjacentTerritories": [
                "55",
                "56",
                "47",
                "4",
                "50",
                "54"
                ],
                "inhibitor": null
            },
            "battleZone": null,
            }
        }
        ]
    },
}

GET/territories/search/findById{?id}

Find Territory by Id

This endpoint allows you to retrieve a Territory by providing its Id.

Required attributes

  • Name
    id
    Type
    string
    Description

    The Id of the territory to retrieve.

Request

GET
/territories/search/findById
const axios = require('axios');

axios.get('https://api.lokamc.com/territories/search/findById', {
    params: { id: '6123973216376e26f1a0d03c' }
}).then((response) => console.log(response.data));

Response

{
    "id": "6123973216376e26f1a0d03c",
    "areaName": "moor",
    "world": "north",
    "num": "1",
    "tg": {
        "beacon": "north,2571,114,3196",
        "townId": "6090042ae4929b7aa6acbfda",
        "moduleResource": "Terracotta",
        "lastBattle": 0,
        "adjacentTerritories": [
        "55",
        "56",
        "47",
        "4",
        "50",
        "54"
        ],
        "inhibitor": null
    },
    "battleZone": null,
},

GET/territories/search/findByWorldAndNum{?world,num}

Find specific Territory

This endpoint allows you to retrieve a Territory given its world and number.

Required attributes

  • Name
    world
    Type
    string
    Description

    The data-name of the world of the territory.

  • Name
    num
    Type
    string
    Description

    The Territory number

Request

GET
/territories/search/findByWorldAndNum
const axios = require('axios');

axios.get('https://api.lokamc.com/territories/search/findByWorldAndNum', {
    params: { world: 'north', 'num': '2' }
}).then((response) => console.log(response.data));

Response

{
    "id": "6123973216376e26f1a0d03c",
    "areaName": "moor",
    "world": "north",
    "num": "1",
    "tg": {
        "beacon": "north,2571,114,3196",
        "townId": "6090042ae4929b7aa6acbfda",
        "moduleResource": "Terracotta",
        "lastBattle": 0,
        "adjacentTerritories": [
        "55",
        "56",
        "47",
        "4",
        "50",
        "54"
        ],
        "inhibitor": null
    },
    "battleZone": null,
},