Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed kick, summon, kill, ban, tempban permissions not being checked …
…correctly (the induvidual permissions were being checked, but wildcard permissions such as vMenu.Everything or vMenu.OnlinePlayers.All weren't being checked)
  • Loading branch information
TomGrobbe committed Apr 14, 2018
1 parent fb31070 commit 619467d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vMenuServer/BanManager.cs
Expand Up @@ -155,7 +155,7 @@ private void CheckForBans([FromSource]Player source, string playerName, Callback
/// <param name="banReason">The reason why the player is getting banned.</param>
private void BanPlayer([FromSource] Player source, int targetPlayer, string banReason)
{
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.PermBan"))
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.PermBan") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
{
Player target = new PlayerList()[targetPlayer];
if (!IsPlayerAceAllowed(target.Handle, "vMenu.DontBanMe"))
Expand Down Expand Up @@ -198,7 +198,7 @@ private void BanPlayer([FromSource] Player source, int targetPlayer, string banR
/// <param name="banReason">Reason for the ban.</param>
private void BanPlayer([FromSource] Player source, int targetPlayer, double banDurationHours, string banReason)
{
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.TempBan"))
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.TempBan") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
{
Player target = new PlayerList()[targetPlayer];
if (!IsPlayerAceAllowed(target.Handle, "vMenu.DontBanMe"))
Expand Down
6 changes: 3 additions & 3 deletions vMenuServer/MainServer.cs
Expand Up @@ -440,7 +440,7 @@ private void UpdateTime(int newHours, int newMinutes, bool freezeTimeNew)
/// <param name="kickReason"></param>
private void KickPlayer([FromSource] Player source, int target, string kickReason = "You have been kicked from the server.")
{
if (IsPlayerAceAllowed(source.ToString(), "vMenu.OnlinePlayers.Kick"))
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kick") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
{
// If the player is allowed to be kicked.
var targetPlayer = new PlayerList()[target];
Expand Down Expand Up @@ -470,7 +470,7 @@ private void KickPlayer([FromSource] Player source, int target, string kickReaso
/// <param name="target"></param>
private void KillPlayer([FromSource] Player source, int target)
{
if (IsPlayerAceAllowed(source.ToString(), "vMenu.OnlinePlayers.Kill"))
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kill") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
{
var targetPlayer = new PlayerList()[target];
// Trigger the client event on the target player to make them kill themselves. R.I.P.
Expand All @@ -490,7 +490,7 @@ private void KillPlayer([FromSource] Player source, int target)
/// <param name="target"></param>
private void SummonPlayer([FromSource] Player source, int target)
{
if (IsPlayerAceAllowed(source.ToString(), "vMenu.OnlinePlayers.Summon"))
if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Summon") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
{
// Trigger the client event on the target player to make them teleport to the source player.
var targetPlayer = new PlayerList()[target];
Expand Down

0 comments on commit 619467d

Please sign in to comment.