redis for everything but timer/transferring mod/restarting game

This commit is contained in:
AlecM33
2023-01-09 19:28:54 -05:00
parent d74bdb4f27
commit 7d24916eed
8 changed files with 455 additions and 179 deletions

View File

@@ -12,13 +12,13 @@ const rateLimit = require('express-rate-limit').default;
const ServerBootstrapper = {
singletons: (logger) => {
singletons: (logger, instanceId) => {
return {
activeGameRunner: new ActiveGameRunner(logger),
socketManager: new SocketManager(logger, ActiveGameRunner.instance),
activeGameRunner: new ActiveGameRunner(logger, instanceId),
socketManager: new SocketManager(logger, ActiveGameRunner.instance, instanceId),
gameManager: process.env.NODE_ENV.trim() === 'development'
? new GameManager(logger, ENVIRONMENT.LOCAL, ActiveGameRunner.instance)
: new GameManager(logger, ENVIRONMENT.PRODUCTION, ActiveGameRunner.instance)
? new GameManager(logger, ENVIRONMENT.LOCAL, ActiveGameRunner.instance, instanceId)
: new GameManager(logger, ENVIRONMENT.PRODUCTION, ActiveGameRunner.instance, instanceId)
};
},