mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Merge pull request #227 from allinkdev/FS-222
Merge allinkdev:FS-222 into AtlasMediaGroup:FS-222
This commit is contained in:
commit
d298e923b8
@ -6,11 +6,13 @@ import java.util.*;
|
|||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.LogViewer.LogsRegistrationMode;
|
import me.totalfreedom.totalfreedommod.LogViewer.LogsRegistrationMode;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Admin
|
public class Admin
|
||||||
@ -157,6 +159,34 @@ public class Admin
|
|||||||
{
|
{
|
||||||
plugin.btb.killTelnetSessions(getName());
|
plugin.btb.killTelnetSessions(getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure admins don't have admin functionality when removed (FS-222)
|
||||||
|
AdminList.vanished.remove(getName());
|
||||||
|
|
||||||
|
if (plugin.esb != null)
|
||||||
|
{
|
||||||
|
plugin.esb.setVanished(getName(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
setCommandSpy(false);
|
||||||
|
setPotionSpy(false);
|
||||||
|
|
||||||
|
Server server = Bukkit.getServer();
|
||||||
|
Player player = server.getPlayer(getName());
|
||||||
|
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
// Update chats
|
||||||
|
FPlayer freedomPlayer = plugin.pl.getPlayer(player);
|
||||||
|
freedomPlayer.removeAdminFunctionality();
|
||||||
|
|
||||||
|
// Disable vanish
|
||||||
|
for (Player player1 : server.getOnlinePlayers())
|
||||||
|
{
|
||||||
|
player1.showPlayer(plugin, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.lv.updateLogsRegistration(null, getName(), LogsRegistrationMode.DELETE);
|
plugin.lv.updateLogsRegistration(null, getName(), LogsRegistrationMode.DELETE);
|
||||||
|
@ -240,7 +240,9 @@ public class Command_saconfig extends FreedomCommand
|
|||||||
checkRank(Rank.ADMIN);
|
checkRank(Rank.ADMIN);
|
||||||
|
|
||||||
Player player = getPlayer(args[1]);
|
Player player = getPlayer(args[1]);
|
||||||
|
|
||||||
Admin admin = player != null ? plugin.al.getAdmin(player) : plugin.al.getEntryByName(args[1]);
|
Admin admin = player != null ? plugin.al.getAdmin(player) : plugin.al.getEntryByName(args[1]);
|
||||||
|
String adminName = admin.getName();
|
||||||
|
|
||||||
if (admin == null)
|
if (admin == null)
|
||||||
{
|
{
|
||||||
@ -253,15 +255,15 @@ public class Command_saconfig extends FreedomCommand
|
|||||||
|
|
||||||
plugin.al.save(admin);
|
plugin.al.save(admin);
|
||||||
plugin.al.updateTables();
|
plugin.al.updateTables();
|
||||||
|
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
plugin.rm.updateDisplay(player);
|
plugin.rm.updateDisplay(player);
|
||||||
plugin.pl.getPlayer(player).setAdminChat(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||||
{
|
{
|
||||||
Discord.syncRoles(admin, plugin.pl.getData(admin.getName()).getDiscordID());
|
Discord.syncRoles(admin, plugin.pl.getData(adminName).getDiscordID());
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.ptero.updateAccountStatus(admin);
|
plugin.ptero.updateAccountStatus(admin);
|
||||||
|
@ -112,6 +112,14 @@ public class FPlayer
|
|||||||
this.player = player;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure admins don't have admin functionality when removed (FS-222)
|
||||||
|
public void removeAdminFunctionality()
|
||||||
|
{
|
||||||
|
this.setCommandSpy(false);
|
||||||
|
this.setAdminChat(false);
|
||||||
|
this.setFuckoffRadius(0);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOrbiting()
|
public boolean isOrbiting()
|
||||||
{
|
{
|
||||||
return isOrbiting;
|
return isOrbiting;
|
||||||
|
@ -9,7 +9,6 @@ import me.totalfreedom.totalfreedommod.player.PlayerData;
|
|||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -185,6 +184,12 @@ public class RankManager extends FreedomService
|
|||||||
if (isAdmin)
|
if (isAdmin)
|
||||||
{
|
{
|
||||||
plugin.al.updateLastLogin(player);
|
plugin.al.updateLastLogin(player);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
// Ensure admins don't have admin functionality when removed (FS-222)
|
||||||
|
FPlayer freedomPlayer = plugin.pl.getPlayer(player);
|
||||||
|
|
||||||
|
freedomPlayer.removeAdminFunctionality();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast login message
|
// Broadcast login message
|
||||||
|
Loading…
Reference in New Issue
Block a user