Professional Documents
Culture Documents
GST - CODEFEST
version 2021-0122
INPUT PARAMETERS
- game_id:
- player_id:
Data Format:
Data Structure:
{
"game_id": "xxxx"
"player_id": "xxxx"
}
RESPONSE PARAMETERS
Response parameters of
Data Format:
Data Structure:
- game_id:
- player_id:
RESPONSE PARAMETERS
Response parameters of
Data Format:
Data Structure:
- id
- timestamp
- map_info
- tag:
- player_id:
- gameStatus:
- gameRemainTime:
INPUT PARAMETERS
- direction:
Data Format:
Data Structure:
{
"direction": "xxxxx
}
RESPONSE PARAMETERS
Response parameters of
Data Format:
Data Structure:
- direction:
- player_id:
KET-METHOD
T PARAMETERS
The verification key of a match. Data type is String.
Admin will share to you before every fighting time.
JSON
Structure:
"game_id": "xxxx"
"player_id": "xxxx"
ONSE PARAMETERS
Response parameters of callbackFuntion(Response)
Data Structure:
- game_id: The key of game.
- player_id: The key of player
ONSE PARAMETERS
Response parameters of callbackFuntion(Response)
Data Structure:
ID of request
- timestamp Time of request
- map_info Map information
Properties of Map Info
- size: The information of map.
Include size of map by horizotal and vertical squares.
Properties of Size:
- rows: The max number of cell of map by vertical.
- cols: The max number of cell of map by horizontal.
- players: The array list of player on map.
Properties of Player:
- id : The Id of competitor or player
- skin: The name of competitor or player
- spawnBegin: The player or conpetitor's position is born at the start
of the game on map (row,col) by horizotal and vertical
squares.
- currentPosition: The current position of player or competitor on
map(row,col) by horizotal and vertical squares.
- power: The power of the player's bomb (not of the competitor).
- speed: The speed of the player (not of the competitor)
- delay: Time interval between 2 times of placing a bomb of the
player(not of the competitor).
- score: Current score of player.
- lives: Player’s lives left.
- box: Number of destroyed box.
- pill: Amount of your pills.
- pillUsed: Amount of pill have used.
- humanCured: Amount of man have cured.
- humanSaved: Amount of man have rescued.
- virus: Amount of virus have destroyed.
- virusInfected: Amount of times infected sickness by virus.
- humanInfected: Amount of times infected sickness by man.
- quarantine: Amount of times you are quarantined.
- map: 2D array describing infomation of map.
Values of item in array:
0 - A Road
1 - A Wall (None destructible cell)
2 - A Balk (Destructible cell)
6 - A Teleport Gate
7 - A Quarantine Place
T PARAMETERS
The player's series of movement direction. Data type is String.
Value of direction:
1 - Move LEFT
2 - Move RIGHT.
3 - Move UP
4 - Move DOWN
b - Drop BOMB
x - Stop Moving
JSON
Structure:
"direction": "xxxxx"
ONSE PARAMETERS
Response parameters of callbackFuntion(Response)
Data Structure:
- direction: The player's movement direction.
- player_id: The moved player
DESCRIPTION
Emmited request to sign your bot to game.
It is required.
Example in JavaScript:
socketClient.emit('join game', { game_id: 'xxxx-xxxx-xxxx-xxxx',
player_id: 'xxxx-xxxx-xxxx-xxxx'});
ompetitor).
omb of the
val between 2 times
b of player
Send request to move your bot, set your bomb.
SocketIO
Client Server
SocketIO
B/ Server Information
- SocketIO Software, version 3.0.4
- NodeJS, version 10.16.3
C/ Examples
JavaScript Example
https://fpt.workplace.com/groups/398715607126625/permalink/1031631217168391/
Java Example
https://fpt.workplace.com/groups/398715607126625/permalink/1021696008161912/?comment_id=10992
https://fpt.workplace.com/groups/398715607126625/permalink/768569630141219/
12/?comment_id=1099262990405213
API WORKFLOW
GST - CODEFEST
CLIENT APP
(Bot Controlling Env)
People