diff --git a/.travis.yml b/.travis.yml index 0079b649..41909c29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,11 @@ language: java jdk: - oraclejdk8 notifications: - email: false \ No newline at end of file + email: false +addons: + apt: + packages: + - sshpass +script: mvn clean install +after_success: + - ./travis-upload.sh diff --git a/README.md b/README.md index 9d2a52ea..79e6b3b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # TotalFreedomMod # +<<<<<<< HEAD [![Build Status](https://travis-ci.org/TotalFreedom/TotalFreedomMod.svg?branch=TFM1.12-Alpha)](https://travis-ci.org/TotalFreedom/TotalFreedomMod) +======= +[![Build Status](https://travis-ci.org/TotalFreedom/TotalFreedomMod.svg?branch=devel)](https://travis-ci.org/TotalFreedom/TotalFreedomMod) +>>>>>>> devel TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server. @@ -9,5 +13,11 @@ This plugin was originally coded by StevenLawson (Madgeek1450), with Jerom van d ### Download ### You may download official binaries from the [releases page](https://github.com/TotalFreedom/TotalFreedomMod/releases). +Additionally, Travis CI generates a binary for each commit to the repository. While they might not be stable or 100% functional, these binaries are accessible at [tfmbuilds.win](https://tfmbuilds.win/). + ### Contributing ### -Please see [CONTRIBUTING.md](CONTRIBUTING.md) if you are interested in developing TotalFreedomMod. For information on how TotalFreedomMod is licensed, please see [LICENSE.md](LICENSE.md). +Please see [CONTRIBUTING.md](CONTRIBUTING.md) if you are interested in developing TotalFreedomMod. + +For information on how TotalFreedomMod is licensed, please see [LICENSE.md](LICENSE.md). + +Please [join our Discord server](https://discord.gg/fb9J2TD) for any discussion on TFM development and other TotalFreedom Organization projects. diff --git a/pom.xml b/pom.xml index b07aaaca..2b392006 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ UTF-8 ${project.version} Electrum - + ${maven.build.timestamp} ${buildAuthor} ${buildHead} @@ -54,10 +54,10 @@ spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - + sk89q-snapshots http://maven.sk89q.com/artifactory/repo @@ -65,6 +65,17 @@ + + org.apache.commons + commons-lang3 + 3.6 + + + + commons-io + commons-io + 2.5 + org.projectlombok @@ -74,8 +85,9 @@ org.spigotmc - spigot - 1.12-R0.1-SNAPSHOT + spigot-api + 1.12-pre5-SNAPSHOT + compile @@ -90,6 +102,12 @@ 4.5-pre1 + + net.ess3 + Essentials + 2.13.1 + + com.github.TotalFreedom.TF-WorldEdit worldedit-bukkit @@ -102,23 +120,6 @@ 6.1.0-TF - - org.bukkit - craftbukkit - 1.12-R0.1-SNAPSHOT - - - - net.ess3 - Essentials - 2.13.1 - - - diff --git a/src/main/java/me/totalfreedom/totalfreedommod/LogViewer.java b/src/main/java/me/totalfreedom/totalfreedommod/LogViewer.java index 018299a3..161f7bf9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/LogViewer.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/LogViewer.java @@ -1,15 +1,13 @@ package me.totalfreedom.totalfreedommod; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; +import java.io.UnsupportedEncodingException; +import java.net.*; +import java.security.*; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import me.totalfreedom.totalfreedommod.admin.Admin; -import me.totalfreedom.totalfreedommod.command.Command_logs; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.util.FLog; import org.apache.commons.lang3.StringUtils; @@ -38,10 +36,10 @@ public class LogViewer extends FreedomService public void updateLogsRegistration(final CommandSender sender, final Player target, final LogsRegistrationMode mode) { - updateLogsRegistration(sender, target.getName(), target.getAddress().getAddress().getHostAddress().trim(), mode); + updateLogsRegistration(sender, target.getName(), mode); } - public void updateLogsRegistration(final CommandSender sender, final String targetName, final String targetIP, final LogsRegistrationMode mode) + public void updateLogsRegistration(final CommandSender sender, final String targetName, final LogsRegistrationMode mode) { final String logsRegisterUrl = ConfigEntry.LOGS_URL.getString(); final String logsRegisterPassword = ConfigEntry.LOGS_SECRET.getString(); @@ -63,14 +61,16 @@ public class LogViewer extends FreedomService sender.sendMessage(ChatColor.YELLOW + "Connecting..."); } - URL url = new URLBuilder(logsRegisterUrl) - .addQueryParameter("mode", mode.toString()) + final String key = SecureCodeGenerator.generateCode(20); + + final URL urlAdd = new URLBuilder(logsRegisterUrl) + .addQueryParameter("mode", mode.name()) .addQueryParameter("password", logsRegisterPassword) .addQueryParameter("name", targetName) - .addQueryParameter("ip", targetIP) + .addQueryParameter("key", key) .getURL(); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + final HttpURLConnection connection = (HttpURLConnection) urlAdd.openConnection(); connection.setConnectTimeout(1000 * 5); connection.setReadTimeout(1000 * 5); connection.setUseCaches(false); @@ -92,7 +92,29 @@ public class LogViewer extends FreedomService { if (responseCode == 200) { - sender.sendMessage(ChatColor.GREEN + "Registration " + mode.toString() + "d."); + if (mode == LogsRegistrationMode.ADD) + { + String link = null; + try + { + final URL urlVerify = new URLBuilder(logsRegisterUrl) + .addQueryParameter("mode", LogsRegistrationMode.VERIFY.name()) + .addQueryParameter("name", targetName) + .addQueryParameter("key", key) + .getURL(); + link = urlVerify.toString(); + } + catch (Exception ex) + { + FLog.severe(ex); + } + + sender.sendMessage(ChatColor.GREEN + "Open this link to verify your logviewer registration:\n" + ChatColor.DARK_GREEN + link); + } + else + { + sender.sendMessage(ChatColor.GREEN + "Logviewer access revoked successfully."); + } } else { @@ -110,30 +132,10 @@ public class LogViewer extends FreedomService }.runTaskAsynchronously(plugin); } - public void deactivateSuperadmin(Admin superadmin) - { - for (String ip : superadmin.getIps()) - { - updateLogsRegistration(null, superadmin.getName(), ip, LogsRegistrationMode.DELETE); - } - } - public static enum LogsRegistrationMode { - UPDATE("update"), DELETE("delete"); - private final String mode; - - private LogsRegistrationMode(String mode) - { - this.mode = mode; - } - - @Override - public String toString() - { - return mode; - } + ADD, DELETE, VERIFY; } private static class URLBuilder @@ -160,11 +162,44 @@ public class LogViewer extends FreedomService while (it.hasNext()) { Map.Entry pair = it.next(); - pairs.add(pair.getKey() + "=" + pair.getValue()); + try + { + pairs.add(URLEncoder.encode(pair.getKey(), "UTF-8") + "=" + URLEncoder.encode(pair.getValue(), "UTF-8")); + } + catch (UnsupportedEncodingException ex) + { + FLog.severe(ex); + } } return new URL(requestPath + "?" + StringUtils.join(pairs, "&")); } } + private static class SecureCodeGenerator + { + + private static final String CHARACTER_SET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + public static String generateCode(final int length) + { + SecureRandom random; + try + { + random = SecureRandom.getInstance("SHA1PRNG", "SUN"); + } + catch (NoSuchAlgorithmException | NoSuchProviderException ex) + { + random = new SecureRandom(); + FLog.severe(ex); + } + + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < length; i++) + { + sb.append(CHARACTER_SET.charAt(random.nextInt(CHARACTER_SET.length()))); + } + return sb.toString(); + } + } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java index 9efa98e3..67469bdf 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java @@ -168,15 +168,15 @@ public class LoginProcess extends FreedomService return; } - // Whitelist - if (plugin.si.isWhitelisted()) - { - if (!plugin.si.getWhitelisted().contains(username.toLowerCase())) - { - event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server."); - return; - } - } +// // Whitelist +// if (plugin.si.isWhitelisted()) +// { +// if (!plugin.si.getWhitelisted().contains(username.toLowerCase())) +// { +// event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server."); +// return; +// } +// } } @EventHandler(priority = EventPriority.MONITOR) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java index d050790c..90df9edf 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ServerInterface.java @@ -1,14 +1,7 @@ package me.totalfreedom.totalfreedommod; -import java.util.Arrays; -import java.util.List; import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; -import net.minecraft.server.v1_12_R1.EntityPlayer; -import net.minecraft.server.v1_12_R1.MinecraftServer; -import net.minecraft.server.v1_12_R1.PropertyManager; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_12_R1.CraftServer; public class ServerInterface extends FreedomService { @@ -41,52 +34,52 @@ public class ServerInterface extends FreedomService } } - public void setOnlineMode(boolean mode) - { - final PropertyManager manager = getServer().getPropertyManager(); - manager.setProperty("online-mode", mode); - manager.savePropertiesFile(); - } - - public int purgeWhitelist() - { - String[] whitelisted = getServer().getPlayerList().getWhitelisted(); - int size = whitelisted.length; - for (EntityPlayer player : getServer().getPlayerList().players) - { - getServer().getPlayerList().getWhitelist().remove(player.getProfile()); - } - - try - { - getServer().getPlayerList().getWhitelist().save(); - } - catch (Exception ex) - { - FLog.warning("Could not purge the whitelist!"); - FLog.warning(ex); - } - return size; - } - - public boolean isWhitelisted() - { - return getServer().getPlayerList().getHasWhitelist(); - } - - public List getWhitelisted() - { - return Arrays.asList(getServer().getPlayerList().getWhitelisted()); - } - - public String getVersion() - { - return getServer().getVersion(); - } - - private MinecraftServer getServer() - { - return ((CraftServer) Bukkit.getServer()).getServer(); - } +// public void setOnlineMode(boolean mode) +// { +// final PropertyManager manager = getServer().getPropertyManager(); +// manager.setProperty("online-mode", mode); +// manager.savePropertiesFile(); +// } +// +// public int purgeWhitelist() +// { +// String[] whitelisted = getServer().getPlayerList().getWhitelisted(); +// int size = whitelisted.length; +// for (EntityPlayer player : getServer().getPlayerList().players) +// { +// getServer().getPlayerList().getWhitelist().remove(player.getProfile()); +// } +// +// try +// { +// getServer().getPlayerList().getWhitelist().save(); +// } +// catch (Exception ex) +// { +// FLog.warning("Could not purge the whitelist!"); +// FLog.warning(ex); +// } +// return size; +// } +// +// public boolean isWhitelisted() +// { +// return getServer().getPlayerList().getHasWhitelist(); +// } +// +// public List getWhitelisted() +// { +// return Arrays.asList(getServer().getPlayerList().getWhitelisted()); +// } +// +// public String getVersion() +// { +// return getServer().getVersion(); +// } +// +// private MinecraftServer getServer() +// { +// return ((CraftServer) Bukkit.getServer()).getServer(); +// } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ServerPing.java b/src/main/java/me/totalfreedom/totalfreedommod/ServerPing.java index 1c500838..8bd6748f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ServerPing.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ServerPing.java @@ -55,7 +55,8 @@ public class ServerPing extends FreedomService return; } - String baseMotd = ConfigEntry.SERVER_MOTD.getString().replace("%mcversion%", plugin.si.getVersion()); +// String baseMotd = ConfigEntry.SERVER_MOTD.getString().replace("%mcversion%", plugin.si.getVersion()); + String baseMotd = ConfigEntry.SERVER_MOTD.getString(); baseMotd = baseMotd.replace("\\n", "\n"); baseMotd = FUtil.colorize(baseMotd); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/admin/Admin.java b/src/main/java/me/totalfreedom/totalfreedommod/admin/Admin.java index b27625b4..35b61d63 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/admin/Admin.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/admin/Admin.java @@ -5,6 +5,8 @@ import java.util.Date; import java.util.List; import lombok.Getter; import lombok.Setter; +import me.totalfreedom.totalfreedommod.LogViewer.LogsRegistrationMode; +import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; import net.pravian.aero.base.ConfigLoadable; @@ -25,7 +27,6 @@ public class Admin implements ConfigLoadable, ConfigSavable, Validatable @Setter private String name; @Getter - @Setter private boolean active = true; @Getter @Setter @@ -138,6 +139,26 @@ public class Admin implements ConfigLoadable, ConfigSavable, Validatable ips.clear(); } + public void setActive(boolean active) + { + this.active = active; + + final TotalFreedomMod plugin = TotalFreedomMod.plugin(); + + if (!active) + { + if (getRank().isAtLeast(Rank.TELNET_ADMIN)) + { + if (plugin.btb != null) + { + plugin.btb.killTelnetSessions(getName()); + } + } + + plugin.lv.updateLogsRegistration(null, getName(), LogsRegistrationMode.DELETE); + } + } + @Override public boolean isValid() { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java b/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java index b40bca8e..95872050 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java @@ -10,7 +10,6 @@ import java.util.concurrent.TimeUnit; import lombok.Getter; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.command.Command_logs; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FLog; @@ -272,6 +271,14 @@ public class AdminList extends FreedomService public boolean removeAdmin(Admin admin) { + if (admin.getRank().isAtLeast(Rank.TELNET_ADMIN)) + { + if (plugin.btb != null) + { + plugin.btb.killTelnetSessions(admin.getName()); + } + } + // Remove admin, update views if (allAdmins.remove(admin.getConfigKey()) == null) { @@ -345,7 +352,6 @@ public class AdminList extends FreedomService } admin.setActive(false); - plugin.lv.deactivateSuperadmin(admin); } save(); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java index 894c4789..0293ad5a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/BukkitTelnetBridge.java @@ -1,21 +1,29 @@ package me.totalfreedom.totalfreedommod.bridge; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import java.util.Map; +import me.totalfreedom.bukkittelnet.BukkitTelnet; import me.totalfreedom.bukkittelnet.api.TelnetCommandEvent; import me.totalfreedom.bukkittelnet.api.TelnetPreLoginEvent; import me.totalfreedom.bukkittelnet.api.TelnetRequestDataTagsEvent; +import me.totalfreedom.bukkittelnet.session.ClientSession; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.rank.Rank; +import me.totalfreedom.totalfreedommod.util.FLog; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.plugin.Plugin; public class BukkitTelnetBridge extends FreedomService { + private BukkitTelnet bukkitTelnetPlugin = null; + public BukkitTelnetBridge(TotalFreedomMod plugin) { super(plugin); @@ -94,4 +102,69 @@ public class BukkitTelnetBridge extends FreedomService playerTags.put("tfm.essentialsBridge.getNickname", plugin.esb.getNickname(player.getName())); } } + + public BukkitTelnet getBukkitTelnetPlugin() + { + if (bukkitTelnetPlugin == null) + { + try + { + final Plugin bukkitTelnet = server.getPluginManager().getPlugin("BukkitTelnet"); + if (bukkitTelnet != null) + { + if (bukkitTelnet instanceof BukkitTelnet) + { + bukkitTelnetPlugin = (BukkitTelnet) bukkitTelnet; + } + } + } + catch (Exception ex) + { + FLog.severe(ex); + } + } + + return bukkitTelnetPlugin; + } + + public void killTelnetSessions(final String name) + { + try + { + final List sessionsToRemove = new ArrayList<>(); + + final BukkitTelnet telnet = getBukkitTelnetPlugin(); + if (telnet != null) + { + final Iterator it = telnet.appender.getSessions().iterator(); + while (it.hasNext()) + { + final ClientSession session = it.next(); + if (name != null && name.equalsIgnoreCase(session.getUserName())) + { + sessionsToRemove.add(session); + } + } + + for (final ClientSession session : sessionsToRemove) + { + try + { + telnet.appender.removeSession(session); + session.syncTerminateSession(); + } + catch (Exception ex) + { + FLog.severe("Error removing single telnet session: " + ex.getMessage()); + } + } + + FLog.info(sessionsToRemove.size() + " telnet session(s) removed."); + } + } + catch (Exception ex) + { + FLog.severe("Error removing telnet sessions: " + ex.getMessage()); + } + } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_logs.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_logs.java index a2056297..5fae0ac8 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_logs.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_logs.java @@ -1,26 +1,10 @@ package me.totalfreedom.totalfreedommod.command; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import me.totalfreedom.totalfreedommod.LogViewer.LogsRegistrationMode; -import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import me.totalfreedom.totalfreedommod.admin.Admin; -import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; -import me.totalfreedom.totalfreedommod.util.FLog; -import org.apache.commons.lang3.StringUtils; -import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; @CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME) @CommandParameters(description = "Register your connection with the TFM logviewer.", usage = "/ [off]") @@ -30,16 +14,13 @@ public class Command_logs extends FreedomCommand @Override public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - LogsRegistrationMode mode = LogsRegistrationMode.UPDATE; - - if (args.length == 1) + LogsRegistrationMode mode = LogsRegistrationMode.ADD; + if (args.length == 1 && "off".equalsIgnoreCase(args[0])) { - mode = ("off".equals(args[0]) ? LogsRegistrationMode.DELETE : LogsRegistrationMode.UPDATE); + mode = LogsRegistrationMode.DELETE; } - plugin.lv.updateLogsRegistration(sender, playerSender, mode); return true; } - } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_onlinemode.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_onlinemode.java index df6884e1..199f8e8f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_onlinemode.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_onlinemode.java @@ -1,7 +1,6 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; -import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -44,26 +43,27 @@ public class Command_onlinemode extends FreedomCommand return false; } - try - { - plugin.si.setOnlineMode(onlineMode); - - if (onlineMode) - { - for (Player player : server.getOnlinePlayers()) - { - player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect."); - } - } - - FUtil.adminAction(sender.getName(), "Turning player validation " + (onlineMode ? "on" : "off") + ".", true); - - server.reload(); - } - catch (Exception ex) - { - FLog.severe(ex); - } +// try +// { +// plugin.si.setOnlineMode(onlineMode); +// +// if (onlineMode) +// { +// for (Player player : server.getOnlinePlayers()) +// { +// player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect."); +// } +// } +// +// FUtil.adminAction(sender.getName(), "Turning player validation " + (onlineMode ? "on" : "off") + ".", true); +// +// server.reload(); +// } +// catch (Exception ex) +// { +// FLog.severe(ex); +// } + FUtil.adminAction(sender.getName(), "Online-Mode toggling is temporarily disabled.", true); } return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whitelist.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whitelist.java index e8cc7dc2..fe8cc084 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whitelist.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_whitelist.java @@ -158,8 +158,10 @@ public class Command_whitelist extends FreedomCommand //purge if (args[0].equalsIgnoreCase("purge")) { - FUtil.adminAction(sender.getName(), "Removing all players from the whitelist.", false); - msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist."); +// FUtil.adminAction(sender.getName(), "Removing all players from the whitelist.", false); +// msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist."); + + FUtil.adminAction(sender.getName(), "Whitelist purging is temporarily disabled.", true); return true; } diff --git a/travis-upload.sh b/travis-upload.sh new file mode 100755 index 00000000..e0ed56cb --- /dev/null +++ b/travis-upload.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then + mv target/TotalFreedomMod.jar target/TotalFreedomMod-${TRAVIS_COMMIT}.jar + export SSHPASS=${SFTP_PASSWORD} + sshpass -e sftp -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR -oBatchMode=no -b - ${SFTP_USER}@${SFTP_HOST}:${SFTP_PATH} << ! + put target/TotalFreedomMod-${TRAVIS_COMMIT}.jar + bye +! + echo "Artifact upload status: "$? +else + echo "Skipping artifact upload for pull request build." +fi