From 3fa7b9f5e501ca99cc646e6789440dcf3a035060 Mon Sep 17 00:00:00 2001 From: Niek Candaele Date: Tue, 25 Jun 2024 19:11:35 +0200 Subject: [PATCH] fix: 7d2d V1 support --- .../lib-gameserver/src/gameservers/7d2d/connectionInfo.ts | 6 ++++++ packages/lib-gameserver/src/gameservers/7d2d/emitter.ts | 3 +++ .../_global/-gameservers/connectionInfoFieldsMap.tsx | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/packages/lib-gameserver/src/gameservers/7d2d/connectionInfo.ts b/packages/lib-gameserver/src/gameservers/7d2d/connectionInfo.ts index d9b5a67d48..ca921e7a2b 100644 --- a/packages/lib-gameserver/src/gameservers/7d2d/connectionInfo.ts +++ b/packages/lib-gameserver/src/gameservers/7d2d/connectionInfo.ts @@ -12,6 +12,8 @@ export class SdtdConnectionInfo extends TakaroDTO { public readonly useTls!: boolean; @IsBoolean() public readonly useCPM!: boolean; + @IsBoolean() + public readonly useV1!: boolean; } export const sdtdJsonSchema = { @@ -35,6 +37,10 @@ export const sdtdJsonSchema = { type: 'boolean', default: false, }, + useV1: { + type: 'boolean', + default: false, + }, }, required: ['host', 'adminUser', 'adminToken', 'useTls'], }; diff --git a/packages/lib-gameserver/src/gameservers/7d2d/emitter.ts b/packages/lib-gameserver/src/gameservers/7d2d/emitter.ts index 5d41b2e47b..105d94c306 100644 --- a/packages/lib-gameserver/src/gameservers/7d2d/emitter.ts +++ b/packages/lib-gameserver/src/gameservers/7d2d/emitter.ts @@ -65,6 +65,9 @@ export class SevenDaysToDieEmitter extends TakaroEmitter { } get url() { + if (this.config.useV1) { + return `${this.config.useTls ? 'https' : 'http'}://${this.config.host}/sse/?events=log`; + } return `${this.config.useTls ? 'https' : 'http'}://${this.config.host}/sse/log`; } diff --git a/packages/web-main/src/routes/_auth/_global/-gameservers/connectionInfoFieldsMap.tsx b/packages/web-main/src/routes/_auth/_global/-gameservers/connectionInfoFieldsMap.tsx index 0446cc0da5..e9cd0f3c2b 100644 --- a/packages/web-main/src/routes/_auth/_global/-gameservers/connectionInfoFieldsMap.tsx +++ b/packages/web-main/src/routes/_auth/_global/-gameservers/connectionInfoFieldsMap.tsx @@ -47,6 +47,14 @@ export const connectionInfoFieldsMap = (isLoading: boolean, control: Control, + , ], [GameServerCreateDTOTypeEnum.Mock]: [