From a0a8dc85c8a88784826418801f181a05fa8a65ca Mon Sep 17 00:00:00 2001 From: shayan Date: Fri, 2 Sep 2022 13:12:20 +0430 Subject: [PATCH] refactor: change joker default node id in GameConfigInjector version: update to version 0.2.6 --- pom.xml | 2 +- .../sharif/aic/hideandseek/config/GameConfigInjector.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fd02624..fd64e27 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ ir.sharif.aic hideandseek - 0.2.4 + 0.2.6 HideAndSeek the implementation of aic 2022 game server diff --git a/src/main/java/ir/sharif/aic/hideandseek/config/GameConfigInjector.java b/src/main/java/ir/sharif/aic/hideandseek/config/GameConfigInjector.java index 020d2b2..cb08878 100644 --- a/src/main/java/ir/sharif/aic/hideandseek/config/GameConfigInjector.java +++ b/src/main/java/ir/sharif/aic/hideandseek/config/GameConfigInjector.java @@ -122,7 +122,11 @@ public GameConfig createGameConfig() throws IOException { clientReadinessThresholdTimeMillisecond, magicTurnTime); log.info("clientReadinessThresholdTimeMillisecond is set to {}", clientReadinessThresholdTimeMillisecond); log.info("magicTurnTime is set to {}", magicTurnTime); - settings.agents.forEach(config::addAgent); + settings.agents.forEach(e -> { + if(e.is(AgentType.JOKER)) + e.setNodeId(config.getAllNodes().size() - 1); + config.addAgent(e); + }); var firstTeamRunCMD = createRunCMD(FIRST_TEAM_PATH); var secondTeamRunCMD = createRunCMD(SECOND_TEAM_PATH); settings.agents.forEach(agent -> {