mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 23:20:09 +00:00
Set singleplayer gitCommit in the client (#945)
## Description: Set singleplayer gitCommit in the client ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
committed by
evanpelle
co-authored by
Scott Anderson
coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent
42f94659f6
commit
f58a10b49f
+3
-1
@@ -446,10 +446,12 @@ export const GameEndInfoSchema = GameStartInfoSchema.extend({
|
||||
});
|
||||
export type GameEndInfo = z.infer<typeof GameEndInfoSchema>;
|
||||
|
||||
const GitCommitSchema = z.string().regex(/^[0-9a-fA-F]{40}$/);
|
||||
|
||||
export const AnalyticsRecordSchema = z.object({
|
||||
info: GameEndInfoSchema,
|
||||
version: z.literal("v0.0.2"),
|
||||
gitCommit: z.string(),
|
||||
gitCommit: GitCommitSchema,
|
||||
});
|
||||
export type AnalyticsRecord = z.infer<typeof AnalyticsRecordSchema>;
|
||||
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ export function createGameRecord(
|
||||
): GameRecord {
|
||||
const duration = Math.floor((end - start) / 1000);
|
||||
const version = "v0.0.2";
|
||||
const gitCommit = "";
|
||||
const gitCommit = process.env.GIT_COMMIT ?? "unknown";
|
||||
const num_turns = allTurns.length;
|
||||
const turns = allTurns.filter(
|
||||
(t) => t.intents.length !== 0 || t.hash !== undefined,
|
||||
|
||||
Reference in New Issue
Block a user