From b56eff7783af32caccaa28a96775b9d920ece9ec Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Mon, 22 Jan 2024 11:49:28 -0300 Subject: [PATCH] Move attributes to game protocol --- protocols/asa.js | 7 +++++++ protocols/epic.js | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/protocols/asa.js b/protocols/asa.js index 72e18c4..c8c2f69 100644 --- a/protocols/asa.js +++ b/protocols/asa.js @@ -9,4 +9,11 @@ export default class asa extends Epic { this.clientSecret = 'PP5UGxysEieNfSrEicaD1N2Bb3TdXuD7xHYcsdUHZ7s' this.deploymentId = 'ad9a8feffb3b4b2ca315546f038c3ae2' } + + async run (state) { + await super.run(state) + state.name = state.raw.attributes.CUSTOMSERVERNAME_s + state.map = state.raw.attributes.MAPNAME_s + state.password = state.raw.attributes.SERVERPASSWORD_b + } } diff --git a/protocols/epic.js b/protocols/epic.js index 5fc5960..4a91647 100644 --- a/protocols/epic.js +++ b/protocols/epic.js @@ -126,9 +126,6 @@ export default class Epic extends Core { throw new Error('Server not found') } - state.name = desiredServer.attributes.CUSTOMSERVERNAME_s - state.map = desiredServer.attributes.MAPNAME_s - state.password = desiredServer.attributes.SERVERPASSWORD_b state.numplayers = desiredServer.totalPlayers state.maxplayers = desiredServer.settings.maxPublicPlayers