【冬日绘板】捞&补充
  • 板块灌水区
  • 楼主liucang
  • 当前回复21
  • 已保存回复21
  • 发布时间2022/12/14 20:27
  • 上次更新2023/10/24 07:42:14
查看原帖
【冬日绘板】捞&补充
378849
liucang楼主2022/12/14 20:27
//HTTP
get('/paintBoard') 返回 paintboard 页面
get('/paintBoard/board') 返回版面,格式与洛谷相同

post('/paintBoard/paint',{
    x: x,
    y: y,
    color: color,
    uid: LuoguUid,
    token: Token
})

其中 x,y,color 的定义与洛谷相同,uid,token 的定义详见活动页面

//WebSocket
地址 ws://segonoj.site:4000/paintboard/ws

//<握手过程>

你应该先发送 

{
    "type": "join_channel",
    "channel": "paintboard",
    "channel_param": ""
}

服务器将回复

{
    "type": "result"
}

//</握手过程>

如果版面有更新,服务器将发送

{
    type: "paintboard_update",
    "x": x,
    "y": y,
    "color": color,
}

定义与上述相同。

原帖链接 https://www.luogu.com.cn/discuss/544102,API 更新见上

2022/12/14 20:27
加载中...