mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 23:48:45 -07:00
Refactor room data blob handling and permissions
- Updated the RoomsController to utilize synthetic CDN keys for data blobs. - Introduced methods for determining current or synthetic data blob names. - Adjusted room role permissions to align with new game role definitions. - Enhanced the SanitizeController with a new endpoint for purity checks. - Modified Match and PlayerPresence services to handle deferred presence commits. - Improved RoomDataBlobService to support new game role and tool tag settings. - Added support for boot dorm grace period in PlayerPresenceService. - Updated protobuf definitions to reflect new room role and game role structures. You are now able to go into dorm and the rec center!
This commit is contained in:
@@ -577,7 +577,7 @@ public class RoomService(DorkNetDbContext db)
|
||||
/// Resolve the saved room-data blob for a personal dorm and repair stale
|
||||
/// pointers left by older builds. Some existing dorm rows only have the
|
||||
/// real save in RoomDataBlobs or RoomScenes while DormStates/Rooms still
|
||||
/// point at the synthetic room_{id}_v1.dat fallback.
|
||||
/// point at an old synthetic fallback blob.
|
||||
/// </summary>
|
||||
public async Task<string> ResolveDormDataBlobNameAsync(long playerId, long dormRoomId)
|
||||
{
|
||||
@@ -627,9 +627,20 @@ public class RoomService(DorkNetDbContext db)
|
||||
return latestDormBlob;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
return SyntheticDefaultRoomDataBlobName(dormRoomId);
|
||||
}
|
||||
|
||||
public static string SyntheticDefaultRoomDataBlobName(long roomId) =>
|
||||
$"room_{roomId}_dorknet_v8.dat";
|
||||
|
||||
public static bool IsLegacySyntheticDefaultRoomDataBlobName(long roomId, string? blobName) =>
|
||||
string.Equals(blobName, $"room_{roomId}_v1.dat", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public static string ResolveWireRoomDataBlobName(long roomId, string? blobName) =>
|
||||
!string.IsNullOrWhiteSpace(blobName) && !IsLegacySyntheticDefaultRoomDataBlobName(roomId, blobName)
|
||||
? blobName
|
||||
: SyntheticDefaultRoomDataBlobName(roomId);
|
||||
|
||||
private async Task<bool> IsUsableDormBlobNameAsync(string? blobName, long dormRoomId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(blobName)) return false;
|
||||
|
||||
Reference in New Issue
Block a user