add disable vfx to server methods

This commit is contained in:
rootdarkarchon
2023-04-20 10:14:21 +02:00
parent 5d76553ff8
commit 17238aa059
3 changed files with 11 additions and 2 deletions

View File

@@ -119,6 +119,7 @@ public partial class MareHub
groupPair.DisableSounds = dto.GroupPairPermissions.IsDisableSounds();
groupPair.DisableAnimations = dto.GroupPairPermissions.IsDisableAnimations();
groupPair.IsPaused = dto.GroupPairPermissions.IsPaused();
groupPair.DisableVFX = dto.GroupPairPermissions.IsDisableVFX();
await _dbContext.SaveChangesAsync().ConfigureAwait(false);
@@ -214,7 +215,8 @@ public partial class MareHub
GroupGID = group.GID,
GroupUserUID = UserUID,
DisableAnimations = false,
DisableSounds = false
DisableSounds = false,
DisableVFX = false
};
await _dbContext.GroupPairs.AddAsync(newPair).ConfigureAwait(false);

View File

@@ -137,8 +137,10 @@ public partial class MareHub
IsSynced = otherEntry != null,
DisableOwnAnimations = userToOther.DisableAnimations,
DisableOwnSounds = userToOther.DisableSounds,
DisableOwnVFX = userToOther.DisableVFX,
DisableOtherAnimations = otherEntry == null ? false : otherEntry.DisableAnimations,
DisableOtherSounds = otherEntry == null ? false : otherEntry.DisableSounds
DisableOtherSounds = otherEntry == null ? false : otherEntry.DisableSounds,
DisableOtherVFX = otherEntry == null ? false : otherEntry.DisableVFX
};
var results = await query.AsNoTracking().ToListAsync().ConfigureAwait(false);
@@ -149,11 +151,13 @@ public partial class MareHub
ownPerm.SetPaused(c.IsPaused);
ownPerm.SetDisableAnimations(c.DisableOwnAnimations);
ownPerm.SetDisableSounds(c.DisableOwnSounds);
ownPerm.SetDisableVFX(c.DisableOwnVFX);
var otherPerm = UserPermissions.NoneSet;
otherPerm.SetPaired(c.IsSynced);
otherPerm.SetPaused(c.OtherIsPaused);
otherPerm.SetDisableAnimations(c.DisableOtherAnimations);
otherPerm.SetDisableSounds(c.DisableOtherSounds);
otherPerm.SetDisableVFX(c.DisableOtherVFX);
return new UserPairDto(new(c.OtherUserUID, c.Alias), ownPerm, otherPerm);
}).ToList();
}
@@ -345,6 +349,7 @@ public partial class MareHub
pair.IsPaused = dto.Permissions.IsPaused();
pair.DisableAnimations = dto.Permissions.IsDisableAnimations();
pair.DisableSounds = dto.Permissions.IsDisableSounds();
pair.DisableVFX = dto.Permissions.IsDisableVFX();
_dbContext.Update(pair);
await _dbContext.SaveChangesAsync().ConfigureAwait(false);

View File

@@ -28,6 +28,7 @@ namespace MareSynchronosServer.Utils
permissions.SetDisableAnimations(group.DisableAnimations);
permissions.SetDisableSounds(group.DisableSounds);
permissions.SetDisableInvites(!group.InvitesEnabled);
permissions.SetDisableVFX(group.DisableVFX);
return permissions;
}
@@ -37,6 +38,7 @@ namespace MareSynchronosServer.Utils
permissions.SetDisableAnimations(groupPair.DisableAnimations);
permissions.SetDisableSounds(groupPair.DisableSounds);
permissions.SetPaused(groupPair.IsPaused);
permissions.SetDisableVFX(groupPair.DisableVFX);
return permissions;
}