Skip to content

Commit 204b1cd

Browse files
PUDGE133PUDGElouis1706
authored
fix: group(rank) and renaming of some properties (#676)
* Bug fixes and renaming of some properties to more understandable ones. We need to test this to make sure it doesn't cause problems, because God only knows how it all works internally. https://discord.com/channels/656673194693885975/1002713309876854924/1432873468285948055 * Revert "Bug fixes and renaming of some properties to more understandable ones. We need to test this to make sure it doesn't cause problems, because God only knows how it all works internally." This reverts commit c72eabf. * Fix a fix * Update EXILED/Exiled.API/Features/Player.cs * Fix RemoteAdminPermissions property --------- Co-authored-by: PUDGE <PUDGE@PUDGE> Co-authored-by: Yamato <[email protected]>
1 parent a768664 commit 204b1cd

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

EXILED/Exiled.API/Features/Player.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,11 @@ public Quaternion Rotation
564564
public PlayerPermissions RemoteAdminPermissions
565565
{
566566
get => (PlayerPermissions)ReferenceHub.serverRoles.Permissions;
567-
set => ReferenceHub.serverRoles.Permissions = (ulong)value;
567+
set
568+
{
569+
ReferenceHub.serverRoles.Permissions = (ulong)value;
570+
ReferenceHub.serverRoles.FinalizeSetGroup();
571+
}
568572
}
569573

570574
/// <summary>
@@ -1915,25 +1919,19 @@ public bool TryGetItem(ushort serial, out Item item)
19151919
}
19161920

19171921
/// <summary>
1918-
/// Sets the player's rank.
1922+
/// Receives an existing rank(group) or, if it doesn't exist, creates a new one and assigns it to this player.
19191923
/// </summary>
19201924
/// <param name="name">The rank name to be set.</param>
19211925
/// <param name="group">The group to be set.</param>
19221926
public void SetRank(string name, UserGroup group)
19231927
{
19241928
if (ServerStatic.PermissionsHandler.Groups.TryGetValue(name, out UserGroup userGroup))
19251929
{
1926-
userGroup.BadgeColor = group.BadgeColor;
1927-
userGroup.BadgeText = name;
1928-
userGroup.HiddenByDefault = !group.Cover;
1929-
userGroup.Cover = group.Cover;
1930-
19311930
ReferenceHub.serverRoles.SetGroup(userGroup, false, false);
19321931
}
19331932
else
19341933
{
19351934
ServerStatic.PermissionsHandler.Groups.Add(name, group);
1936-
19371935
ReferenceHub.serverRoles.SetGroup(group, false, false);
19381936
}
19391937

0 commit comments

Comments
 (0)