Towns
The town model
The town model contains public information about a town, such as its level and strength.
Properties
- Name
id
- Type
- string
- Description
The MongoDB ObjectID of the player
- Name
name
- Type
- string
- Description
The Town Name
- Name
strength
- Type
- integer
- Description
The town's Continent Conquest Strength
- Name
bbStrength
- Type
- integer
- Description
The town's Balak Strength
- Name
townLevel
- Type
- integer
- Description
The Town Level
- Name
recruiting
- Type
- boolean
- Description
Whether this town is actively recruiting as shown in-game with
/town list
- Name
deleted
- Type
- boolean
- Description
Whether this town has been deleted (is dead). For active towns, this is
false
.
- Name
owner
- Type
- ObjectId
- Description
The Identity ObjectId of the Player who owns this town.
- Name
vulnerabilityWindow
- Type
- integer
- Description
The town's Vulnerability Window.
This is the middle number of the (24) hour of the day (Server Time). To calculate the real vulnerability window, add and subtract 4 hours from this number to get the full 8-hour vulnerability window for the town.
In the example provided, a vuln window of
16
equates to4pm Server Time
and, with the 4hr padding is a vulnerability window of12pm - 8pm Server Time
.In the case that this town is in an Alliance, the Alliance's vuln window is used instead.
- Name
world
- Type
- string
- Description
The data-name of the Continent that this Town lives on where:
north = Kalros
west = Ascalon
south = Garama
- Name
bannerJson
- Type
- string
- Description
The escaped JSON for the ItemStack representing the town's banner.
- Name
members
- Type
- object
- Description
An object containing Town Members keyed by their
identityId
.Town Member
{ "id": Player ObjectId, "subowner": Whether this player is a subowner of their town }
List all towns
This endpoint allows you to retrieve a list of all towns.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of towns returned.
- Name
page
- Type
- integer
- Description
- Page of towns to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/towns/search/findAll')
.then((response) => console.log(response.data));
Response
{
_embedded: {
towns: [
{
"id": "6090042ae4929b7aa6acbfda",
"name": "Hilo",
"strength": 100.0,
"vulnerabilityWindow": 16,
"bbStrength": 100.0,
"world": "north",
"bannerJson": "{\"meta-type\":\"BANNER\",\"patterns\":[{\"color\":\"BLACK\",\"pattern\":\"STRIPE_MIDDLE\"},{\"color\":\"LIME\",\"pattern\":\"STRIPE_CENTER\"},{\"color\":\"BLACK\",\"pattern\":\"SQUARE_BOTTOM_RIGHT\"},{\"color\":\"LIME\",\"pattern\":\"BORDER\"},{\"color\":\"LIME\",\"pattern\":\"GRADIENT_UP\"}]}",
"townLevel": 25.0,
"recruiting": true,
"deleted": false,
"owner": "5462b7c5e4b0cad9a0f3e6a4",
"members": {
"e40a68cd-3161-4520-9978-0105a89ab4d8": {
"uuid": "e40a68cd-3161-4520-9978-0105a89ab4d8",
"subowner": false
},
//...
}
},
{
"id": "6090042be4929b7aa6acc080"
// ...
}
]
},
page: {
size: 20,
totalElements: 80,
totalPages: 4,
number: 0
}
}
List all towns by world
This endpoint allows you to retrieve a list of all towns on a specified world (Continent).
Required attributes
- Name
world
- Type
- string
- Description
The data-name of the Continent, as specified in the Town's
world
property.
Optional attributes
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of towns returned.
- Name
page
- Type
- integer
- Description
- Page of towns to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/towns/search/findByWorld', {
params: { world: 'north' }
}).then((response) => console.log(response.data));
Response
{
_embedded: {
towns: [
{
"id": "6090042ae4929b7aa6acbfda",
"name": "Hilo",
"strength": 100.0,
"vulnerabilityWindow": 16,
"bbStrength": 100.0,
"world": "north",
"bannerJson": "{\"meta-type\":\"BANNER\",\"patterns\":[{\"color\":\"BLACK\",\"pattern\":\"STRIPE_MIDDLE\"},{\"color\":\"LIME\",\"pattern\":\"STRIPE_CENTER\"},{\"color\":\"BLACK\",\"pattern\":\"SQUARE_BOTTOM_RIGHT\"},{\"color\":\"LIME\",\"pattern\":\"BORDER\"},{\"color\":\"LIME\",\"pattern\":\"GRADIENT_UP\"}]}",
"townLevel": 25.0,
"recruiting": true,
"deleted": false,
"owner": "5462b7c5e4b0cad9a0f3e6a4",
"members": {
"e40a68cd-3161-4520-9978-0105a89ab4d8": {
"uuid": "e40a68cd-3161-4520-9978-0105a89ab4d8",
"subowner": false
},
//...
}
},
{
"id": "6090042be4929b7aa6acc080"
// ...
}
]
},
page: {
size: 20,
totalElements: 80,
totalPages: 4,
number: 0
}
}
List all deleted towns
This endpoint allows you to retrieve a list of all deleted towns.
Optional attributes
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of towns returned.
- Name
page
- Type
- integer
- Description
- Page of towns to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/towns/search/findDeleted')
.then((response) => console.log(response.data));
Response
{
_embedded: {
towns: [
{
"id": "6090042ae4929b7aa6acbfda",
"name": "Hilo",
"strength": 100.0,
"vulnerabilityWindow": 16,
"bbStrength": 100.0,
"world": "north",
"bannerJson": "{\"meta-type\":\"BANNER\",\"patterns\":[{\"color\":\"BLACK\",\"pattern\":\"STRIPE_MIDDLE\"},{\"color\":\"LIME\",\"pattern\":\"STRIPE_CENTER\"},{\"color\":\"BLACK\",\"pattern\":\"SQUARE_BOTTOM_RIGHT\"},{\"color\":\"LIME\",\"pattern\":\"BORDER\"},{\"color\":\"LIME\",\"pattern\":\"GRADIENT_UP\"}]}",
"townLevel": 25.0,
"recruiting": true,
"deleted": false,
"owner": "5462b7c5e4b0cad9a0f3e6a4",
"members": {
"e40a68cd-3161-4520-9978-0105a89ab4d8": {
"uuid": "e40a68cd-3161-4520-9978-0105a89ab4d8",
"subowner": false
},
//...
}
},
{
"id": "6090042be4929b7aa6acc080"
// ...
}
]
},
page: {
size: 20,
totalElements: 80,
totalPages: 4,
number: 0
}
}
Find a town by name
This endpoint allows you to retrieve a Town by providing its name.
Required attributes
- Name
name
- Type
- string
- Description
The name of the town to retrieve.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/towns/search/findByWorld', {
params: { name: 'Hilo' }
}).then((response) => console.log(response.data));
Response
{
"id": "6090042ae4929b7aa6acbfda",
"name": "Hilo",
"strength": 100.0,
"vulnerabilityWindow": 16,
"bbStrength": 100.0,
"world": "north",
"bannerJson": "{\"meta-type\":\"BANNER\",\"patterns\":[{\"color\":\"BLACK\",\"pattern\":\"STRIPE_MIDDLE\"},{\"color\":\"LIME\",\"pattern\":\"STRIPE_CENTER\"},{\"color\":\"BLACK\",\"pattern\":\"SQUARE_BOTTOM_RIGHT\"},{\"color\":\"LIME\",\"pattern\":\"BORDER\"},{\"color\":\"LIME\",\"pattern\":\"GRADIENT_UP\"}]}",
"townLevel": 25.0,
"recruiting": true,
"deleted": false,
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"members": {
"e40a68cd-3161-4520-9978-0105a89ab4d8": {
"uuid": "e40a68cd-3161-4520-9978-0105a89ab4d8",
"subowner": false
},
//...
}
},