mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
feat: Enhance UgcPurchasablesController to handle bulk requests with object arrays
- Updated Bulk method to parse incoming JSON object arrays for UGC item IDs. - Introduced ReadBulkIdsAsync to handle both object arrays and flat GUID lists. - Added synthetic placeholder responses for missing UGC items to prevent client errors. feat: Implement MatchmakeRoom and MatchmakeSubRoom endpoints in GoToController - Added MatchmakeRoom and MatchmakeSubRoom methods to facilitate joining public and sub-rooms by numeric ID. - Enhanced ApplySubRoomMutation to ensure proper state transitions for sub-rooms. - Improved logging for matchmaking actions. fix: Refactor PlayerSettingsController to handle database save exceptions - Introduced SaveSettingsChangesAsync to manage DbUpdateException for busy SQLite scenarios. - Updated methods to call SaveSettingsChangesAsync instead of direct SaveChangesAsync. chore: Update URL coverage documentation for new matchmaking endpoints - Documented new MatchmakeRoom and MatchmakeSubRoom endpoints in url-coverage.md. chore: Add default room data file for room loading - Included default_room.room to serve as a fallback for missing room data. fix: Improve SQLite concurrency handling in DatabaseBootstrap - Configured SQLite to use WAL mode and set a busy timeout for better concurrency. chore: Create SqliteErrors utility for handling SQLite exceptions - Added SqliteErrors class to encapsulate logic for detecting busy SQLite exceptions. refactor: Update RoomDataBlobService to serve default room data - Modified GetDefaultBlob to load and serve a default room blob with proper role data.
This commit is contained in:
@@ -17,14 +17,10 @@ public sealed class ImageSignatureService
|
||||
?? Environment.GetEnvironmentVariable("DORKNET_IMAGE_SIGNING_KEY_ID")
|
||||
?? "p1");
|
||||
|
||||
// `.rec.net` in the client's `KEY:RSA:p1.rec.net` literal gets byte-rewritten
|
||||
// by patch-client.ps1 to match the server domain (e.g. `.localhost`). The
|
||||
// header suffix we emit has to match that, or the client errors as
|
||||
// "Signature malformed". By default we derive the suffix from the request
|
||||
// Host, which works for the standard same-domain patcher setup. Override
|
||||
// with ImageSigning:KeyIdHostSuffix if your client metadata was patched to
|
||||
// a different value than the server's host (e.g. running the server at
|
||||
// `dorknet.example` while the client metadata still says `localhost`).
|
||||
// 2023 compares Content-Signature's key-id against the embedded
|
||||
// KEY:RSA:p1.rec.net / d1.rec.net literals. If a specific client build
|
||||
// is bytepatched to another suffix, ImageSigning:KeyIdHostSuffix can
|
||||
// override this default.
|
||||
configuredKeyIdHostSuffix =
|
||||
config["ImageSigning:KeyIdHostSuffix"]
|
||||
?? Environment.GetEnvironmentVariable("DORKNET_IMAGE_SIGNING_KEY_ID_SUFFIX");
|
||||
@@ -272,19 +268,12 @@ public sealed class ImageSignatureService
|
||||
|
||||
var suffix = configuredKeyIdHostSuffix is { Length: > 0 }
|
||||
? configuredKeyIdHostSuffix
|
||||
: ExtractParentDomain(response.HttpContext.Request.Host.Host);
|
||||
: "rec.net";
|
||||
|
||||
response.Headers["Content-Signature"] =
|
||||
$"key-id=KEY:RSA:{headerKeyId}.{suffix}; data={Convert.ToBase64String(signature)}";
|
||||
}
|
||||
|
||||
private static string ExtractParentDomain(string host)
|
||||
{
|
||||
if (string.IsNullOrEmpty(host)) return "rec.net";
|
||||
var dot = host.IndexOf('.');
|
||||
return dot > 0 && dot < host.Length - 1 ? host[(dot + 1)..] : host;
|
||||
}
|
||||
|
||||
private static byte[] PlaceholderSignature(byte[] bytes)
|
||||
{
|
||||
var signature = new byte[128];
|
||||
|
||||
Reference in New Issue
Block a user