From cd50091bf6dc13040d0766a8d83faac4f9a6ea60 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 20 Dec 2016 01:47:11 -0600 Subject: [PATCH] Initial Commit. Auto Plugin Updater Project initialized. --- AutoPluginUpdate.jar | Bin 0 -> 12345 bytes projectBuilder.xml | 8 ++ src/plugin.yml | 4 + src/sig/plugin/AutoPluginUpdate/API.java | 9 ++ .../AutoPluginUpdate/AnnounceUpdateEvent.java | 23 ++++ .../AutoPluginUpdate/AutoPluginUpdate.java | 128 ++++++++++++++++++ 6 files changed, 172 insertions(+) create mode 100644 AutoPluginUpdate.jar create mode 100644 projectBuilder.xml create mode 100644 src/plugin.yml create mode 100644 src/sig/plugin/AutoPluginUpdate/API.java create mode 100644 src/sig/plugin/AutoPluginUpdate/AnnounceUpdateEvent.java create mode 100644 src/sig/plugin/AutoPluginUpdate/AutoPluginUpdate.java diff --git a/AutoPluginUpdate.jar b/AutoPluginUpdate.jar new file mode 100644 index 0000000000000000000000000000000000000000..e2b2e1e0d34927993a952ca9899cc711a9710f7c GIT binary patch literal 12345 zcmbVy1yo$gwszwl++BlPLvU>%SmPetJvfa73p5TvgS!(TxF@(f!QCyvgN2ZvxifQf zC-=U0-~83N1z4y0It@=(??fO&{;NVdK0Av6Fh><7<_?LzPfCqr3H6+;Nlw>#_ zh5!JSKTMGU+>fT7LR9#AkLFg77vAIbPgAgjlAMgRx&}K~<^nu2tf;`oK8c~g#ymDM zUaQ9W3An!FG6KSJW|dVOlhp)7z|gaO9f34wM5^H`sHwYUGD{q?U7~NYVYnxtgYkLp zBXJU3)$lVeB2mvHaTEgXc)gk-&Hs`MHFBa{86nny)ME~2kJsbN0G#aIt!y0Gy&UX^ z6-L1IYEGYDK!hh}I24S6imN~_Ey%hD$?Sw_|UJAfC** zL&cUN<~IMm8$*3*&cH-O!kg>b1YC=zIz~?c=wbClw=4rwxBO{=wPyyphV3fwhDKYA zq>#E>@f4haLV-el4wt}4t_F6u!(yr!L4r!QPMb0M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^AMXE%(D-=&sg3>V_wTyZ-;}Mtx8IVceUzI1u5rY3=zdHU09qgZx{<9MH&m;;0Oa4ow|4|qFvtRzR!ty6X?W0!aw|@EKE&naq zU;p@XOZ_Xtud1}42pf-eufK)xheqvJgkP0CKM{UBo_PK(gg + + + + + + + \ No newline at end of file diff --git a/src/plugin.yml b/src/plugin.yml new file mode 100644 index 0000000..97734d3 --- /dev/null +++ b/src/plugin.yml @@ -0,0 +1,4 @@ +name: AutoPluginUpdate +main: sig.plugin.AutoPluginUpdate.AutoPluginUpdate +version: 001 +commands: \ No newline at end of file diff --git a/src/sig/plugin/AutoPluginUpdate/API.java b/src/sig/plugin/AutoPluginUpdate/API.java new file mode 100644 index 0000000..bb116a7 --- /dev/null +++ b/src/sig/plugin/AutoPluginUpdate/API.java @@ -0,0 +1,9 @@ +package sig.plugin.AutoPluginUpdate; + +import org.bukkit.entity.Player; + +public final class API { + public static void FetchPlugins() { + AutoPluginUpdate.pluginupdater.FetchPlugins(); + } +} diff --git a/src/sig/plugin/AutoPluginUpdate/AnnounceUpdateEvent.java b/src/sig/plugin/AutoPluginUpdate/AnnounceUpdateEvent.java new file mode 100644 index 0000000..742d8fa --- /dev/null +++ b/src/sig/plugin/AutoPluginUpdate/AnnounceUpdateEvent.java @@ -0,0 +1,23 @@ +package sig.plugin.AutoPluginUpdate; + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class AnnounceUpdateEvent extends Event{ + private static final HandlerList handlers = new HandlerList(); + private String announce_msg; + + public AnnounceUpdateEvent(String announce_msg) { + this.announce_msg=announce_msg; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public String getAnnouncementMessage() { + return announce_msg; + } + +} diff --git a/src/sig/plugin/AutoPluginUpdate/AutoPluginUpdate.java b/src/sig/plugin/AutoPluginUpdate/AutoPluginUpdate.java new file mode 100644 index 0000000..c23da89 --- /dev/null +++ b/src/sig/plugin/AutoPluginUpdate/AutoPluginUpdate.java @@ -0,0 +1,128 @@ +package sig.plugin.AutoPluginUpdate; + +import java.io.File; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.plugin.java.JavaPlugin; + +public class AutoPluginUpdate extends JavaPlugin implements Listener{ + + public final String LOG_PREFIX = "[AutoPluginUpdate]"; + + public AutoPluginUpdate plugin = this; + public static File datafolder; + public static boolean restarting_server=false; + + public final int LOG_ERROR=0; + public final int LOG_WARNING=1; + public final int LOG_NORMAL=2; + public final int LOG_DETAIL=3; + public final int LOG_VERBOSE=4; + public final int LOG_DEBUG=5; + + public static PluginManager pluginupdater; + + @Override + public void onEnable() { + log("Booting up...",LOG_NORMAL); + datafolder = getDataFolder(); + log("Data folder is located at "+datafolder,LOG_DETAIL); + + pluginupdater = new PluginManager(plugin); + pluginupdater.AddPlugin("TwosideKeeper", "https://dl.dropboxusercontent.com/s/z5ram6vi3jipiit/TwosideKeeper.jar"); + pluginupdater.AddPlugin("aPlugin", "https://dl.dropboxusercontent.com/u/62434995/aPlugin.jar"); + + Bukkit.getPluginManager().registerEvents(this, this); + + if (!restarting_server) { + Bukkit.getScheduler().runTaskTimerAsynchronously(this, pluginupdater, 6000l, 6000l); + } + } + + @Override + public void onDisable() { + + } + + @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) + public void onPlayerJoin(PlayerJoinEvent ev) { + if (!restarting_server) { + Bukkit.getScheduler().runTaskAsynchronously(this, pluginupdater); + } + } + + @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) + public void onPlayerLeave(PlayerQuitEvent ev) { + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new ShutdownServerForUpdate(),5); + } + + private void log(String msg, int loglv) { + switch (loglv) { + case LOG_ERROR:{ + Bukkit.getConsoleSender().sendMessage(LOG_PREFIX+" "+ChatColor.RED+"[ERROR]"+ChatColor.RESET+msg+ChatColor.RESET); + }break; + case LOG_WARNING:{ + Bukkit.getConsoleSender().sendMessage(LOG_PREFIX+" "+ChatColor.YELLOW+"[WARNING]"+ChatColor.RESET+msg+ChatColor.RESET); + }break; + default:{ + Bukkit.getConsoleSender().sendMessage(LOG_PREFIX+" "+ChatColor.RESET+msg+ChatColor.RESET); + }break; + } + } + + private final class ShutdownServerForUpdate implements Runnable { + @Override + public void run() { + if (Bukkit.getOnlinePlayers().size()==0 && restarting_server) { + Bukkit.savePlayers(); + for (int i=0;i