@colyseus/core
Advanced tools
Comparing version 0.15.49 to 0.15.50
@@ -95,6 +95,8 @@ /// <reference types="node" /> | ||
onShutdown(callback: () => void | Promise<any>): void; | ||
onBeforeShutdown(callback: () => void | Promise<any>): void; | ||
protected getDefaultTransport(_: any): Transport; | ||
protected onShutdownCallback: () => void | Promise<any>; | ||
protected onBeforeShutdownCallback: () => void | Promise<any>; | ||
protected attachMatchMakingRoutes(server: http.Server): void; | ||
protected handleMatchMakeRequest(req: IncomingMessage, res: ServerResponse): Promise<void>; | ||
} |
@@ -43,2 +43,3 @@ var __create = Object.create; | ||
this.onShutdownCallback = () => Promise.resolve(); | ||
this.onBeforeShutdownCallback = () => Promise.resolve(); | ||
const { gracefullyShutdown = true, greet = true } = options; | ||
@@ -128,3 +129,3 @@ (0, import_DevMode.setDevMode)(options.devMode === true); | ||
try { | ||
await this.onShutdownCallback(); | ||
await this.onBeforeShutdownCallback(); | ||
await matchMaker.gracefullyShutdown(); | ||
@@ -134,2 +135,3 @@ this.transport.shutdown(); | ||
this.driver.shutdown(); | ||
await this.onShutdownCallback(); | ||
} catch (e) { | ||
@@ -163,2 +165,5 @@ (0, import_Debug.debugAndPrintError)(`error during shutdown: ${e}`); | ||
} | ||
onBeforeShutdown(callback) { | ||
this.onBeforeShutdownCallback = callback; | ||
} | ||
getDefaultTransport(_) { | ||
@@ -165,0 +170,0 @@ throw new Error("Please provide a 'transport' layer. Default transport not set."); |
{ | ||
"name": "@colyseus/core", | ||
"version": "0.15.49", | ||
"version": "0.15.50", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
665345
7378