@colyseus/core 0.18.12 → 0.18.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/MatchMaker.cjs +1 -0
- package/build/MatchMaker.cjs.map +2 -2
- package/build/MatchMaker.mjs +1 -0
- package/build/MatchMaker.mjs.map +2 -2
- package/build/Room.cjs +6 -3
- package/build/Room.cjs.map +2 -2
- package/build/Room.mjs +6 -3
- package/build/Room.mjs.map +2 -2
- package/package.json +4 -4
- package/src/MatchMaker.ts +4 -0
- package/src/Room.ts +10 -3
package/build/Room.mjs
CHANGED
|
@@ -1097,12 +1097,15 @@ var Room = class _Room {
|
|
|
1097
1097
|
try {
|
|
1098
1098
|
if (authData) {
|
|
1099
1099
|
client.auth = authData;
|
|
1100
|
-
}
|
|
1100
|
+
}
|
|
1101
|
+
const authedStatically = authData && this.constructor.onAuth !== _Room.onAuth;
|
|
1102
|
+
if (!authedStatically && this.onAuth !== _Room.prototype.onAuth) {
|
|
1101
1103
|
try {
|
|
1102
|
-
|
|
1103
|
-
if (!
|
|
1104
|
+
const result = await this.onAuth(client, joinOptions, authContext);
|
|
1105
|
+
if (!result) {
|
|
1104
1106
|
throw new ServerError(ErrorCode.AUTH_FAILED, "onAuth failed");
|
|
1105
1107
|
}
|
|
1108
|
+
client.auth = result === true && authData || result;
|
|
1106
1109
|
} catch (e) {
|
|
1107
1110
|
delete this._reservedSeats[sessionId];
|
|
1108
1111
|
await this.#_decrementClientCount();
|