feat: support websocket connections from game client #2735
@ -233,7 +233,11 @@ export const sendWsBroadcastEx = (data: IWsMsgToClient, accountId?: string, excl
|
|||||||
|
|
||||||
export const broadcastInventoryUpdate = (req: Request): void => {
|
export const broadcastInventoryUpdate = (req: Request): void => {
|
||||||
const accountId = req.query.accountId as string;
|
const accountId = req.query.accountId as string;
|
||||||
|
|
||||||
|
// for webui requests, let other tabs know. for game requests, let all tabs know.
|
||||||
sendWsBroadcastEx({ update_inventory: true }, accountId, parseInt(String(req.query.wsid)));
|
sendWsBroadcastEx({ update_inventory: true }, accountId, parseInt(String(req.query.wsid)));
|
||||||
|
|
||||||
|
// for webui requests, also let the game know.
|
||||||
if (req.query.wsid) {
|
if (req.query.wsid) {
|
||||||
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user