diff --git a/buildnumber.properties b/buildnumber.properties index ff32cd2b..23a75c6c 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ -#Build Number for ANT. Do not edit! -#Sat Aug 30 16:14:15 CEST 2014 -build.number=949 +#Build Number for ANT. Do not edit! +#Sat Nov 01 15:34:44 GMT 2014 +build.number=961 diff --git a/src/config.yml b/src/config.yml index a0e1ef40..9a658d25 100644 --- a/src/config.yml +++ b/src/config.yml @@ -6,8 +6,8 @@ server: # You should change this to your server's name name: TotalFreedom - # The address your server is located at - address: 64.34.165.5:28965 + # The address your server is located at - Please include the port if required. + address: play.totalfreedom.me # Shown at the server list motd: TotalFreedom &8- Minecraft %mcversion% @@ -24,6 +24,16 @@ server: # URL players should appeal for permanent bans at permban_url: http://bit.ly/TF_PermBan + +# ForceIP Configuration +forceip: + + # Please state if you wish to enable the ForceIP system. + enabled: true + + # Please enter the kick message you wish for people to see if they are not connecting on the servers hostname + kickmsg: You have been kicked from the server - Please connect using %address% + # Blocking certain events allow: diff --git a/src/me/StevenLawson/TotalFreedomMod/Config/TFM_ConfigEntry.java b/src/me/StevenLawson/TotalFreedomMod/Config/TFM_ConfigEntry.java index d8dede36..7a69ee62 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Config/TFM_ConfigEntry.java +++ b/src/me/StevenLawson/TotalFreedomMod/Config/TFM_ConfigEntry.java @@ -4,6 +4,9 @@ import java.util.List; public enum TFM_ConfigEntry { + FORCE_IP_ENABLED(Boolean.class, "forceip.enabled"), + FORCE_IP_KICKMSG(String.class, "forceip.kickmsg"), + // ALLOW_EXPLOSIONS(Boolean.class, "allow.explosions"), ALLOW_FIRE_PLACE(Boolean.class, "allow.fire_place"), ALLOW_FIRE_SPREAD(Boolean.class, "allow.fire_spread"), diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java index a19e7023..ddc772e5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java @@ -766,6 +766,7 @@ public class TFM_PlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { + final Player player = event.getPlayer(); final String ip = TFM_Util.getIp(player); final TFM_Player playerEntry; @@ -853,6 +854,15 @@ public class TFM_PlayerListener implements Listener public void onPlayerLogin(PlayerLoginEvent event) { TFM_ServerInterface.handlePlayerLogin(event); + + // Force IP Setup + if(TFM_ConfigEntry.FORCE_IP_ENABLED.getBoolean()) + { + if(!event.getHostname().equalsIgnoreCase(TFM_ConfigEntry.SERVER_ADDRESS.getString())) + { + event.disallow(PlayerLoginEvent.Result.KICK_OTHER, TFM_ConfigEntry.FORCE_IP_KICKMSG.getString().replace("%address%", TFM_ConfigEntry.SERVER_ADDRESS.getString())); + } + } } // Player Tab and auto Tags