Skip to content

Add sync log uploading to mapdb#972

Draft
11EJDE11 wants to merge 3 commits into
CnCNet:developfrom
11EJDE11:add-synclog-upload
Draft

Add sync log uploading to mapdb#972
11EJDE11 wants to merge 3 commits into
CnCNet:developfrom
11EJDE11:add-synclog-upload

Conversation

@11EJDE11
Copy link
Copy Markdown
Member

@11EJDE11 11EJDE11 commented Apr 5, 2026

  • Adds sync log uploading to mapdb.
  • Fixes an issue with sync logs not deleting when mpdebug is enabled (slightly different filename).
  • On by default. Can be turned off in settings.

Info that gets sent:
"game_hash",
"player_name",
"sync_file_index",
"map_sha1",
"map_name",
"game_mode",
"game_slug",

Currently a draft as I need to add an endpoint to the mapdb (have this mostly working locally, just need to give it more testing and review with YD).

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Nightly build for this pull request:

  • artifacts.zip
    This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.


private static void WriteFormField(Stream stream, string boundary, string name, string value)
{
byte[] bytes = Encoding.UTF8.GetBytes(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the BOM issue. Perhaps EncodingExt.UTF8NoBom

Same for other UTF8 usages

@@ -0,0 +1,203 @@
using System;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a new .cs file I suggest adding #nullable enable

$"Content-Type: text/plain\r\n\r\n");
requestStream.Write(header, 0, header.Length);

byte[] buffer = new byte[65536];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make 65536 a class constant

DisablePrivateMessagePopups = new BoolSetting(iniFile, MULTIPLAYER, "DisablePrivateMessagePopups", false);
AllowPrivateMessagesFromState = new IntSetting(iniFile, MULTIPLAYER, "AllowPrivateMessagesFromState", (int)AllowPrivateMessagesFromEnum.All);
EnableMapSharing = new BoolSetting(iniFile, MULTIPLAYER, "EnableMapSharing", true);
AutoUploadSyncLogs = new BoolSetting(iniFile, MULTIPLAYER, "AutoUploadSyncLogs", true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we need to revise the GDPR dialog in order to make this option default

… - Replace Encoding.UTF8 with EncodingExt.UTF8NoBOM throughout - Remove unused SyncLogUploadStarted/Complete/Failed event declarations - Broaden SYNC file search pattern from SYNC{i}_*.TXT to SYNC{i}*.TXT

  - Wire up sync log upload in the Ares branch of GameInProgressWindow
  - Fix ComputeGameHash doc comment to describe the actual hash format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants