Skip to content

Commit

Permalink
Fix callback not function for c2s
Browse files Browse the repository at this point in the history
  • Loading branch information
john0312 authored and aoaaceai committed Aug 20, 2022
1 parent ab397b6 commit 317452c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/gateway/gateway-service.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ class GatewayService {
* Called on callS2cAPI event.
*/
_onCallC2sAPI(socket, msg, callback) {
if (typeof callback !== 'function') {
console.error('_onCallC2sAPI() callback not function');
return;
}

const p = this.extMan.onC2sCalled(msg, socket.playerID);
p.then((msg) => {
if (typeof msg === 'object' && msg !== null && 'error' in msg && typeof msg.error === 'string') {
Expand Down

0 comments on commit 317452c

Please sign in to comment.