mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
connection/reconnection logic
This commit is contained in:
@@ -43,9 +43,9 @@ logger.log('LOG LEVEL IS: ' + logLevel)
|
||||
if (localServer) {
|
||||
environment = globals.ENVIRONMENT.LOCAL;
|
||||
logger.log('starting main in LOCAL mode.');
|
||||
if (useHttps && fs.existsSync(path.join(__dirname, './certs/localhost-key.pem')) && fs.existsSync(path.join(__dirname, './certs/localhost.pem'))) {
|
||||
const key = fs.readFileSync(path.join(__dirname, './certs/localhost-key.pem'), 'utf-8');
|
||||
const cert = fs.readFileSync(path.join(__dirname, './certs/localhost.pem'), 'utf-8');
|
||||
if (useHttps && fs.existsSync(path.join(__dirname, '../client/certs/localhost-key.pem')) && fs.existsSync(path.join(__dirname, '../client/certs/localhost.pem'))) {
|
||||
const key = fs.readFileSync(path.join(__dirname, '../client/certs/localhost-key.pem'), 'utf-8');
|
||||
const cert = fs.readFileSync(path.join(__dirname, '../client/certs/localhost.pem'), 'utf-8');
|
||||
logger.log('local certs detected. Using HTTPS.');
|
||||
main = https.createServer({ key, cert }, app);
|
||||
logger.log(`navigate to https://localhost:${port}`);
|
||||
|
||||
@@ -17,6 +17,7 @@ class GameManager {
|
||||
addGameSocketHandlers = (namespace, socket) => {
|
||||
this.namespace = namespace;
|
||||
socket.on(globals.CLIENT_COMMANDS.FETCH_GAME_STATE, (accessCode, personId, ackFn) => {
|
||||
this.logger.trace('request for game state for accessCode ' + accessCode + ', person ' + personId);
|
||||
handleRequestForGameState(
|
||||
this.namespace,
|
||||
this.logger,
|
||||
|
||||
Reference in New Issue
Block a user