Курс: Углубленное программирование на Java
Учебный период: весенний семестр 2015г.
##Студенты
- Аксенов Михаил, AverageS, blabos@ya.ru
- Крутяков Михаил, mikrut, mihanik01@mail.ru
- Фатхи Дмитрий, Fatkhi, ?
Подробное о проекте можно прочесть на сайте [Технопарка] [1]
А всякие фронтовые штуки лежат вот тут: https://github.com/Fatkhi/DoDots-game [1]: http://tp.mail.ru/ "Технопарк@Mail.ru"
API can be easily customised just by changing XML config files in srv_tmpl directory. Exempli gratia, basic responses can be edited in response_resource.xml file.
Request
- Method: POST
- URL: /login
- Data: name, password
Response
- Format: JSON
- Data:
{
"status": "OK"/"Error",
"message": ${some_message}
}
Request
- Method: POST
- URL: /logout
- Data: -
Response
- Format: -
- Data: -
Request
- Method: POST
- URL: /signin
- Data: name, password
Response
- Format: JSON
- Data:
{
"status": "OK"/"Error",
"message": ${some_message}
}
Request
- Method: GET
- URL: /getinfo
Response
- Format: JSON
- Data:
{
"loggedIn": true/false,
"username": ${username},
"email": ${email},
"score": ${score},
"results": [
{
"user1" : ${user1name},
"score1": ${user1score},
"user2" : ${user2name},
"score2": ${user2score}
} ...
]
}
for admin only
Request
- Method: GET
- URL: /getadmin
Response
- Format: JSON / Forbidden
- Data:
{
"status":"OK",
"users":[
{
"username":${username},
"userid":${userid}
}
]
}
for admin only
Request
- Method: POST
- URL: /getadmin/stop
Response
- None
- Type: JSON
- Method: WebSocket
- URL: /chat
Nota bene: user should be authorized, user can play with himself if he uses different sessions
Response
{
"Status":"Connected",
"Message":"Connection successfull. Waiting for another player."
}
Response
{
"is_first":true/false,
"message":"Let the game start!",
"status":"Game start"
}
Request
{
"row":"1",
"col":"2"
}
Response
{
"col":"2",
"row":"1",
"message":"Data accepted."/"Invalid data."/"Game over!",
"board":[
[0,0,0,0,0],
[0,0,1,0,0], // 0 - free, 1 - first player, 2 - second player
[0,0,0,0,0],
[0,0,0,0,0],
[0,0,0,0,0]
],
"status":"OK"/"Error"/"GameEnd",
"who_moves":1 // Index of player having next step right: 0 - first, 1 - second
}