fix permissions for pairs rejoining on syncshells w/ prior pairing but no current connection

This commit is contained in:
Stanley Dimant
2024-11-20 11:55:05 +01:00
parent 67ce608853
commit d26546cf7c

View File

@@ -417,7 +417,7 @@ public partial class MareHub
DisableAnimations = preferredPermissions.DisableAnimations, DisableAnimations = preferredPermissions.DisableAnimations,
DisableSounds = preferredPermissions.DisableSounds, DisableSounds = preferredPermissions.DisableSounds,
DisableVFX = preferredPermissions.DisableVFX, DisableVFX = preferredPermissions.DisableVFX,
IsPaused = false, IsPaused = preferredPermissions.IsPaused,
Sticky = false Sticky = false
}; };
@@ -471,6 +471,16 @@ public partial class MareHub
await DbContext.AddAsync(existingPermissionsOnDb).ConfigureAwait(false); await DbContext.AddAsync(existingPermissionsOnDb).ConfigureAwait(false);
} }
else if (!allUserPairs.ContainsKey(pair.GroupUserUID))
{
var otherPreferred = await DbContext.GroupPairPreferredPermissions.SingleAsync(u => u.GroupGID == group.GID && u.UserUID == pair.GroupUserUID).ConfigureAwait(false);
existingPermissionsOnDb.DisableAnimations = otherPreferred.DisableAnimations;
existingPermissionsOnDb.DisableSounds = otherPreferred.DisableSounds;
existingPermissionsOnDb.DisableVFX = otherPreferred.DisableVFX;
existingPermissionsOnDb.IsPaused = otherPreferred.IsPaused;
DbContext.Update(existingPermissionsOnDb);
}
otherPermissionToSelf = existingPermissionsOnDb; otherPermissionToSelf = existingPermissionsOnDb;
} }