Skip to content

Commit

Permalink
fix: 7d2d V1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Jun 25, 2024
1 parent 5afa842 commit 3fa7b9f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class SdtdConnectionInfo extends TakaroDTO<SdtdConnectionInfo> {
public readonly useTls!: boolean;
@IsBoolean()
public readonly useCPM!: boolean;
@IsBoolean()
public readonly useV1!: boolean;
}

export const sdtdJsonSchema = {
Expand All @@ -35,6 +37,10 @@ export const sdtdJsonSchema = {
type: 'boolean',
default: false,
},
useV1: {
type: 'boolean',
default: false,
},
},
required: ['host', 'adminUser', 'adminToken', 'useTls'],
};
3 changes: 3 additions & 0 deletions packages/lib-gameserver/src/gameservers/7d2d/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ export const connectionInfoFieldsMap = (isLoading: boolean, control: Control<any
loading={isLoading}
description="CPM is a helper mod for 7 Days to Die. Download at https://cpm.7d2d.download"
/>,
<Switch
label="Use V1"
name="connectionInfo.useV1"
key="seven-days-to-die-use-v1"
control={control}
loading={isLoading}
description="Use the experimental 7D2D V1 connection method"
/>,
],
[GameServerCreateDTOTypeEnum.Mock]: [
<TextField
Expand Down

0 comments on commit 3fa7b9f

Please sign in to comment.