@colyseus/core
Advanced tools
Comparing version 0.15.37 to 0.15.38
@@ -27,3 +27,4 @@ /// <reference types="node" /> | ||
AUTH_FAILED = 4215, | ||
APPLICATION_ERROR = 4216 | ||
APPLICATION_ERROR = 4216, | ||
INVALID_PAYLOAD = 4217 | ||
} | ||
@@ -30,0 +31,0 @@ export declare enum IpcProtocol { |
@@ -57,2 +57,3 @@ var __defProp = Object.defineProperty; | ||
ErrorCode2[ErrorCode2["APPLICATION_ERROR"] = 4216] = "APPLICATION_ERROR"; | ||
ErrorCode2[ErrorCode2["INVALID_PAYLOAD"] = 4217] = "INVALID_PAYLOAD"; | ||
return ErrorCode2; | ||
@@ -59,0 +60,0 @@ })(ErrorCode || {}); |
@@ -527,2 +527,3 @@ var __create = Object.create; | ||
(0, import_Debug.debugAndPrintError)(e); | ||
client.leave(import_Protocol.Protocol.WS_CLOSE_WITH_ERROR); | ||
return; | ||
@@ -535,3 +536,9 @@ } | ||
} else { | ||
(0, import_Debug.debugAndPrintError)(`onMessage for "${messageType}" not registered.`); | ||
const errorMessage = `onMessage for "${messageType}" not registered.`; | ||
(0, import_Debug.debugAndPrintError)(errorMessage); | ||
if (import_DevMode.isDevMode) { | ||
client.error(import_Protocol.ErrorCode.INVALID_PAYLOAD, errorMessage); | ||
} else { | ||
client.leave(import_Protocol.Protocol.WS_CLOSE_WITH_ERROR, errorMessage); | ||
} | ||
} | ||
@@ -547,3 +554,9 @@ } else if (code === import_Protocol.Protocol.ROOM_DATA_BYTES) { | ||
} else { | ||
(0, import_Debug.debugAndPrintError)(`onMessage for "${messageType}" not registered.`); | ||
const errorMessage = `onMessage for "${messageType}" not registered.`; | ||
(0, import_Debug.debugAndPrintError)(errorMessage); | ||
if (import_DevMode.isDevMode) { | ||
client.error(import_Protocol.ErrorCode.INVALID_PAYLOAD, errorMessage); | ||
} else { | ||
client.leave(import_Protocol.Protocol.WS_CLOSE_WITH_ERROR, errorMessage); | ||
} | ||
} | ||
@@ -550,0 +563,0 @@ } else if (code === import_Protocol.Protocol.JOIN_ROOM && client.state === import_Transport.ClientState.JOINING) { |
{ | ||
"name": "@colyseus/core", | ||
"version": "0.15.37", | ||
"version": "0.15.38", | ||
"description": "Multiplayer Framework for Node.js.", | ||
@@ -5,0 +5,0 @@ "input": "./src/index.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
656621
7324