返回提交历史
Modified
src/services/wsService.ts
+2
-2
XFEstudio/XFESpaceNinjaServer
chore: ignore non-auth messages coming from game ws connection (#3508)
This further narrows the capabilities of a WS token. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3508 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
391d2c96
代码差异
1 个文件
+2
-2
@@ -191,7 +191,7 @@ const wsOnConnect = (ws: WebSocket, req: http.IncomingMessage): void => {
191
191
}
192
192
if (data.logout) {
193
193
const accountId = (ws as IWsCustomData).accountId;
194
if (accountId) {
194
if (accountId && !(ws as IWsCustomData).isGame) {
195
195
(ws as IWsCustomData).accountId = undefined;
196
196
197
197
const stat = await Account.updateOne(
@@ -210,7 +210,7 @@ const wsOnConnect = (ws: WebSocket, req: http.IncomingMessage): void => {
210
210
}
211
211
if (data.sync_inventory) {
212
212
const accountId = (ws as IWsCustomData).accountId;
213
if (accountId) {
213
if (accountId && !(ws as IWsCustomData).isGame) {
214
214
sendWsBroadcastToGame(accountId, { sync_inventory: true });
215
215
}
216
216
}