mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 10:42:13 +00:00
remove player id from Schemas, fix archive bug (#907)
## Description: Remove all references to playerID in the archive schema, since we reference players by client id. Also fixed the game not archiving bug, due to invalid reference. ## Please complete the following: - [x] I have added screenshots for all UI updates - [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 ## Please put your Discord username so you can be contacted if a bug or regression is found: <DISCORD USERNAME>
This commit is contained in:
@@ -78,18 +78,17 @@ async function archiveAnalyticsToR2(gameRecord: GameRecord) {
|
||||
|
||||
async function archiveFullGameToR2(gameRecord: GameRecord) {
|
||||
// Create a deep copy to avoid modifying the original
|
||||
const recordCopy = JSON.parse(JSON.stringify(gameRecord));
|
||||
const recordCopy: GameRecord = JSON.parse(JSON.stringify(gameRecord));
|
||||
|
||||
// Players may see this so make sure to clear PII
|
||||
recordCopy.info.players.forEach((p) => {
|
||||
p.ip = "REDACTED";
|
||||
p.persistentID = "REDACTED";
|
||||
});
|
||||
|
||||
try {
|
||||
await r2.putObject({
|
||||
Bucket: bucket,
|
||||
Key: `${gameFolder}/${recordCopy.id}`,
|
||||
Key: `${gameFolder}/${recordCopy.info.gameID}`,
|
||||
Body: JSON.stringify(recordCopy),
|
||||
ContentType: "application/json",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user