This repository was archived by the owner on Mar 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
API
Gianlu edited this page Dec 31, 2017
·
3 revisions
All the communication with the server is made using POST requests. The server has two main endpoints:
- AjaxServlet
- LongPollServlet
The request parameters must be encoded in the body accordingly to application/x-www-form-urlencoded. The response is a JSON object. A response may be sent with any status code so better check that.
Every request to AjaxServlet must contain an operation code, specified with "o". Here are all the currently available codes:
- BAN -> b
- CARDCAST_ADD_CARDSET -> cac
- CARDCAST_LIST_CARDSETS -> clc
- CARDCAST_REMOVE_CARDSET -> crc
- CHANGE_GAME_OPTIONS -> cgo
- CHAT -> c
- CREATE_GAME -> cg
- FIRST_LOAD -> fl
- GAME_CHAT -> GC
- GAME_LIST -> ggl
- GET_CARDS -> gc
- GET_GAME_INFO -> ggi
- JOIN_GAME -> jg
- SPECTATE_GAME -> vg
- JUDGE_SELECT -> js
- KICK -> K
- LEAVE_GAME -> lg
- LOG_OUT -> lo
- NAMES -> gn
- PLAY_CARD -> pc
- REGISTER -> r
- SCORE -> SC
- START_GAME -> sg
- STOP_GAME -> Sg
Example request (register with nickname "test"):
POST /AjaxServlet HTTP/1.1
o=r&n=test