new Api(paramsopt, optionsopt)
API client constructor
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
keyPub |
String
|
<optional>
|
test
|
Public API key |
keyPriv |
String
|
<optional>
|
test
|
Private API key |
api |
String
|
<optional>
|
http://api.survarium.com/
|
API address |
|
options |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Description |
retries |
Number
|
<optional>
|
Amount of retries |
|
- Source:
Methods
getClanAmounts() → {Promise}
Получить количество активных кланов в Survarium.
Return amount of active clans in Survarium.
- Source:
Returns:
-
Type
-
Promise
getClanInfo(params) → {Promise}
Получить информацию о клане по его ID (название, тег, уровень, рейтинг, PID командира).
Return name, abbr, level, elo rating and pid of clan commander.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
id |
Number
|
ID of clan |
|
- Source:
Returns:
-
Type
-
Promise
getClanMembers(params) → {Promise}
Получить список участников клана с их званиями.
Return members of given clan with their roles.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
id |
Number
|
ID of clan |
|
- Source:
Returns:
-
Type
-
Promise
getClans(params) → {Promise}
Получить paginated список кланов, сортированных по ELO рейтингу (от большего к меньшему).
Return list of the clan ids and names ordered by elo rating (begin from the top).
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
amount |
Number
|
<optional>
|
10
|
Amount of clans to fetch (limited by 25) |
offset |
Number
|
<optional>
|
0
|
Amount of skipped entities |
|
- Source:
Returns:
-
Type
-
Promise
getItemsDict(paramsopt) → {Promise}
Получить словарь игровых предметов.
Return game items dictionary.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
language |
String
|
<optional>
|
english
|
Dictionary language |
|
- Source:
Returns:
-
Type
-
Promise
getMapsDict(paramsopt) → {Promise}
Получить словарь карт.
Return game maps dictionary.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
language |
String
|
<optional>
|
english
|
Dictionary language |
|
- Source:
Returns:
-
Type
-
Promise
getMatchesIdByPublicId(params) → {Promise}
Получить paginated список сыгранных матчей по PID игрока.
Return particular amount of played matches of user with public account id = pid.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
pid |
String
|
|
|
Public player ID |
matchAmount |
Number
|
<optional>
|
10
|
Amount of matches to return (limited by 25) |
offset |
Number
|
<optional>
|
0
|
Amount of entries to skip |
|
- Source:
Returns:
-
Type
-
Promise
getMatchStatistic(params) → {Promise}
Получить статистику матча по его ID.
Return statistic of particular match by match_id.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
id |
Number
|
|
|
Match ID |
language |
String
|
<optional>
|
english
|
Results language |
|
- Source:
Returns:
-
Type
-
Promise
getMaxMatchId() → {Promise}
Получить последний сыгранный в Survarium match_id.
Return max match_id played in Survarium.
param pid - not implemented and hasn't been ported // TODO: investigate getMaxMatchId(pid)
- Source:
Returns:
-
Type
-
Promise
getNewMatches(params) → {Promise}
Получить лимитированный список матчей, прошедших с заданной даты.
Return limited matches list after timestamp.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
timestamp |
Number
|
|
|
Timestamp to search from |
limit |
Number
|
<optional>
|
50
|
Amount of matches to fetch |
offset |
Number
|
<optional>
|
50
|
Amount of matches to skip |
|
- Source:
Returns:
-
Type
-
Promise
getNicknamesByPublicIds(params) → {Promise}
Получить список никнеймов по массиву PID.
Return bunch of nicknames by array of public account ids.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
pids |
Array
|
String
|
Array of public ids or one PID |
|
- Source:
Returns:
-
Type
-
Promise
getPublicIdByNickname(params) → {Promise}
Получить PID игрока по его никнейму.
Return users public account id by nickname.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
nickname |
String
|
Player nickname |
|
- Source:
Returns:
-
Type
-
Promise
getSlotsDict(paramsopt) → {Promise}
Получить словарь игровых слотов.
Return game slots dictionary.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
language |
String
|
<optional>
|
english
|
Dictionary language |
|
- Source:
Returns:
-
Type
-
Promise
getUserData(params) → {Promise}
Получить информацию об игроке: рейтинг, инвентарь по PID.
Return all user data: rating, inventory.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Attributes |
Default |
Description |
pid |
String
|
|
|
Player ID |
language |
String
|
<optional>
|
english
|
Results language |
|
- Source:
Returns:
-
Type
-
Promise
getUserSkills(params) → {Promise}
Получить информацию о прокачке игрока.
Return user skill points.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
pid |
String
|
Player ID |
|
- Source:
Returns:
-
Type
-
Promise
matchesCountByPublicId(params) → {Promise}
Получить суммарное количество сыгранных матчей указанным PID.
Retrieve amount of played matches by user whose public account Id equals pid.
Parameters:
Name |
Type |
Description |
params |
Object
|
Properties
Name |
Type |
Description |
pid |
String
|
Public player ID |
|
- Source:
Returns:
-
Type
-
Promise