File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,9 @@ setInterval(() => {
6565 pendingMessages.clear();
6666}, {{ #if tick }} {{ tick }} {{ else }} 50{{ /if }} );
6767setInterval(() => {
68- rooms.forEach(({ subscriptions }, stateId) => {
68+ rooms.forEach(async ({ impl, subscriptions }, stateId) => {
6969 if (subscriptions.size === 0) {
70+ await impl.onShutdown(ctxNoEvents(chance, time, stateId));
7071 rooms.delete(stateId);
7172 log.unload(stateId);
7273 }
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export class Impl implements Methods<InternalState> {
3737 {{ #if tick }}
3838 onTick(state: InternalState, ctx: Context, timeDelta: number): void {}
3939 {{ /if }}
40+ onShutdown(state: InternalState, ctx: Context): void {}
4041}
4142{{ #*inline " renderDefault" }}
4243{{ #if (eq type " array" )}}
You can’t perform that action at this time.
0 commit comments