TotalFreedomMod Electrum

Version 5.0

This TotalFreedomMod release implements many changes. Most notably, the
internals have been completely revamped. TotalFreedomMod now relies on the
Aero library for core mechanics such as command handling and services.

Another important change is the UUID system. In TotalFreedomMod Electrum,
it has been completely removed. The core reason for this is that the
system as a whole was very bugged. Additionally, it did not solve the
primary reason for its conception: preserving player data when the player
changes their username. This is because TotalFreedomMod servers usually
run in offline-mode. This meaning that some of the players joining do not
have a registerd Mojang UUID whatsoever. All in all, the UUID system was
buggy, and it did not fix the reason it was implemented, so it has been
completely removed. The admin list and the ban list now use usernames and
IPs again.

Lastly, many smaller changes have been implemented. Due to the amount of
changes, they have not been named individualy. Please refer to the issues
below for more details.

Fixes #342
Fixes #350
Fixes #380
Fixes #684
Fixes #704
Fixes #716
Fixes #735
Fixes #745
Fixes #784
Fixes #765
Fixes #791
Fixes #805
Fixes #826
Fixes #883
Fixes #1524
Fixes #1534
Fixes #1536
Fixes #1538
Fixes #1545
Fixes #1546
Fixes #1568
Fixes #1627
Resolves #403
Resolves #435
Resolves #597
Resolves #603
Resolves #628
Resolves #690
Resolves #708
Resolves #747
Resolves #748
Resolves #749
Resolves #764
Resolves #767
Resolves #782
Resolves #809
Resolves #803
Resolves #811
Resolves #813
Resolves #830
Resolves #848
Resolves #856
Resolves #876
Resolves #908
Resolves #992
Resolves #1018
Resolves #1432
Resolves #1446
Resolves #1494
Resolves #1501
Resolves #1526
Resolves #1540
Resolves #1550
Resolves #1560
Resolves #1561
Resolves #1578
Resolves #1613
This commit is contained in:
Jerom van der Sar
2016-05-12 21:40:39 +02:00
parent 924f718d5a
commit aca3398d21
109 changed files with 2112 additions and 2036 deletions

View File

@ -24,6 +24,8 @@ public class FPlayer
public static final long AUTO_PURGE_TICKS = 5L * 60L * 20L;
@Getter
private final TotalFreedomMod plugin;
@Getter
private final String name;
@Getter
@ -33,7 +35,6 @@ public class FPlayer
private Player player;
//
private BukkitTask unmuteTask;
private BukkitTask unfreezeTask;
@Getter
private final FreezeData freezeData = new FreezeData(this);
@Getter
@ -58,19 +59,22 @@ public class FPlayer
private String lastMessage = "";
private boolean inAdminchat = false;
private boolean allCommandsBlocked = false;
private boolean verifiedSuperadminId = false;
@Getter
@Setter
private boolean superadminIdVerified = false;
private String lastCommand = "";
private boolean cmdspyEnabled = false;
private String tag = null;
private int warningCount = 0;
public FPlayer(Player player)
public FPlayer(TotalFreedomMod plugin, Player player)
{
this(player.getName(), Ips.getIp(player));
this(plugin, player.getName(), Ips.getIp(player));
}
private FPlayer(String name, String ip)
private FPlayer(TotalFreedomMod plugin, String name, String ip)
{
this.plugin = plugin;
this.name = name;
this.ip = ip;
}
@ -278,15 +282,19 @@ public class FPlayer
return;
}
if (getPlayer() == null)
{
return;
}
unmuteTask = new BukkitRunnable()
{
@Override
public void run()
{
FUtil.adminAction("TotalFreedom", "Unmuting " + player.getName(), false);
FUtil.adminAction("TotalFreedom", "Unmuting " + getPlayer().getName(), false);
setMuted(false);
}
}.runTaskLater(TotalFreedomMod.plugin, AUTO_PURGE_TICKS);
}.runTaskLater(plugin, AUTO_PURGE_TICKS);
}
public BukkitTask getLockupScheduleID()
@ -329,20 +337,6 @@ public class FPlayer
this.allCommandsBlocked = commandsBlocked;
}
// If someone logs in to telnet or minecraft, and they are an admin, make sure that they are using a username that is associated with their IP.
// After the check for this is done in TFM_PlayerListener, never change it elsewhere.
public boolean isSuperadminIdVerified()
{
return this.verifiedSuperadminId;
}
// If someone logs in to telnet or minecraft, and they are an admin, make sure that they are using a username that is associated with their IP.
// After the check for this is done in TFM_PlayerListener, never change it elsewhere.
public void setSuperadminIdVerified(boolean verifiedSuperadminId)
{
this.verifiedSuperadminId = verifiedSuperadminId;
}
public String getLastCommand()
{
return lastCommand;
@ -391,8 +385,9 @@ public class FPlayer
if (this.warningCount % 2 == 0)
{
this.player.getWorld().strikeLightning(this.player.getLocation());
FUtil.playerMsg(this.player, ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at " + ConfigEntry.SERVER_BAN_URL.getString());
Player p = getPlayer();
p.getWorld().strikeLightning(p.getLocation());
FUtil.playerMsg(p, ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at " + ConfigEntry.SERVER_BAN_URL.getString());
}
}

View File

@ -95,7 +95,7 @@ public class PlayerList extends FreedomService
return tPlayer;
}
tPlayer = new FPlayer(player);
tPlayer = new FPlayer(plugin, player);
playerMap.put(Ips.getIp(player), tPlayer);
return tPlayer;
@ -214,7 +214,7 @@ public class PlayerList extends FreedomService
protected YamlConfig getConfig(PlayerData data)
{
final YamlConfig config = new YamlConfig(TotalFreedomMod.plugin, getConfigFile(data.getUsername().toLowerCase()), false);
final YamlConfig config = new YamlConfig(plugin, getConfigFile(data.getUsername().toLowerCase()), false);
config.load();
return config;
}