Merge branch '2.3' into 2.4-pr
This commit is contained in:
commit
a0266c5e69
@ -490,9 +490,8 @@ namespace SharedLibraryCore.Commands
|
|||||||
|
|
||||||
public override Task ExecuteAsync(GameEvent E)
|
public override Task ExecuteAsync(GameEvent E)
|
||||||
{
|
{
|
||||||
|
Permission oldPerm = E.Target.Level;
|
||||||
EFClient.Permission oldPerm = E.Target.Level;
|
Permission newPerm = Utilities.MatchPermission(E.Data);
|
||||||
EFClient.Permission newPerm = Utilities.MatchPermission(E.Data);
|
|
||||||
|
|
||||||
if (E.Target == E.Origin)
|
if (E.Target == E.Origin)
|
||||||
{
|
{
|
||||||
@ -500,8 +499,7 @@ namespace SharedLibraryCore.Commands
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (newPerm == Permission.Owner &&
|
||||||
else if (newPerm == EFClient.Permission.Owner &&
|
|
||||||
!E.Owner.Manager.GetApplicationSettings().Configuration().EnableMultipleOwners)
|
!E.Owner.Manager.GetApplicationSettings().Configuration().EnableMultipleOwners)
|
||||||
{
|
{
|
||||||
// only one owner is allowed
|
// only one owner is allowed
|
||||||
@ -509,7 +507,7 @@ namespace SharedLibraryCore.Commands
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (E.Origin.Level < EFClient.Permission.Owner &&
|
else if (E.Origin.Level < Permission.Owner &&
|
||||||
!E.Owner.Manager.GetApplicationSettings().Configuration().EnableSteppedHierarchy)
|
!E.Owner.Manager.GetApplicationSettings().Configuration().EnableSteppedHierarchy)
|
||||||
{
|
{
|
||||||
// only the owner is allowed to set levels
|
// only the owner is allowed to set levels
|
||||||
@ -517,15 +515,17 @@ namespace SharedLibraryCore.Commands
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (E.Origin.Level <= newPerm &&
|
else if ((E.Origin.Level <= newPerm &&
|
||||||
E.Origin.Level < EFClient.Permission.Owner)
|
E.Origin.Level < Permission.Owner) ||
|
||||||
|
E.Origin.Level == newPerm)
|
||||||
{
|
{
|
||||||
// can't promote a client to higher than your current perms
|
// can't promote a client to higher than your current perms
|
||||||
|
// or your peer
|
||||||
E.Origin.Tell(string.Format(Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_SETLEVEL_LEVELTOOHIGH"], E.Target.Name, (E.Origin.Level - 1).ToString()));
|
E.Origin.Tell(string.Format(Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_SETLEVEL_LEVELTOOHIGH"], E.Target.Name, (E.Origin.Level - 1).ToString()));
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (newPerm > EFClient.Permission.Banned)
|
else if (newPerm > Permission.Banned)
|
||||||
{
|
{
|
||||||
var ActiveClient = E.Owner.Manager.GetActiveClients()
|
var ActiveClient = E.Owner.Manager.GetActiveClients()
|
||||||
.FirstOrDefault(p => p.NetworkId == E.Target.NetworkId);
|
.FirstOrDefault(p => p.NetworkId == E.Target.NetworkId);
|
||||||
|
Loading…
Reference in New Issue
Block a user