From a37ac2f31bc530901c2b56358795cfb3f0abb483 Mon Sep 17 00:00:00 2001 From: keshav2010 Date: Thu, 16 May 2024 03:15:36 +0530 Subject: [PATCH] for development env, spawn soldiers instantly --- gameserver/commands/OnSoldierCreateCommand.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gameserver/commands/OnSoldierCreateCommand.ts b/gameserver/commands/OnSoldierCreateCommand.ts index 8154d57..8e422e8 100644 --- a/gameserver/commands/OnSoldierCreateCommand.ts +++ b/gameserver/commands/OnSoldierCreateCommand.ts @@ -7,12 +7,13 @@ export class OnSoldierCreateCommand extends Command< CommandPayload > { execute({ client, message, gameManager }: CommandPayload) { - console.log("received soldier create request, queueing"); try { - this.state - .getPlayer(client.id) - ?.addNewSoldier("SPEARMAN", gameManager!.scene); - return; + if (process.env.NODE_ENV === "development") { + this.state + .getPlayer(client.id) + ?.addNewSoldier("SPEARMAN", gameManager!.scene); + return; + } let lengthBefore = this.state.getPlayer(client.id)?.spawnRequestDetailMap .size; this.state.getPlayer(client.id)?.queueSpawnRequest(message.soldierType);