Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.28 KB

api.md

File metadata and controls

64 lines (45 loc) · 1.28 KB

房间列表

说明
mesg room_list
room_list [1,2,3,4] 房间id数组

添加房间

说明
mesg add_room
type amazons amazons或surakarta
args [10, 10] 棋盘大小
time 900 时间 (s)
order 1 1为先手,2为后手

加入房间

说明
mesg join
room_id 2 房间号
order 1 1为先手,2为后手

添加和加入房间的返回值

说明
playerId 'A' 玩家ID

开始

说明
mesg start

返回值

说明
state ready 如果对方没有开始则返回ready,否则返回start

移动

说明
mesg move
location {'from': [0, 0], 'to': [1, 1]} 移动坐标
kw 0 如果棋种是亚马逊棋, 0为移动棋子, 1为移动障碍; 苏拉卡尔塔棋可空

悔棋

说明
mesg rollback

返回值

说明
board [[]] 棋盘