mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 01:52:11 +00:00
use git commit hash verification when replaying archived games (#204)
This commit is contained in:
@@ -395,4 +395,5 @@ export const GameRecordSchema = z.object({
|
||||
winner: ID.nullable(),
|
||||
allPlayersStats: z.record(ID, PlayerStatsSchema),
|
||||
version: z.enum(["v0.0.1"]),
|
||||
gitCommit: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
@@ -100,6 +100,8 @@ export interface ServerConfig {
|
||||
env(): GameEnv;
|
||||
adminToken(): string;
|
||||
adminHeader(): string;
|
||||
// Only available on the server
|
||||
gitCommit(): string;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
|
||||
@@ -22,6 +22,9 @@ import { pastelTheme } from "./PastelTheme";
|
||||
import { pastelThemeDark } from "./PastelThemeDark";
|
||||
|
||||
export abstract class DefaultServerConfig implements ServerConfig {
|
||||
gitCommit(): string {
|
||||
return process.env.GIT_COMMIT;
|
||||
}
|
||||
adminHeader(): string {
|
||||
return "x-admin-key";
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ export class DevServerConfig extends DefaultServerConfig {
|
||||
numWorkers(): number {
|
||||
return 2;
|
||||
}
|
||||
gitCommit(): string {
|
||||
return "DEV";
|
||||
}
|
||||
}
|
||||
|
||||
export class DevConfig extends DefaultConfig {
|
||||
|
||||
Reference in New Issue
Block a user