mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Auto-update fix for linux. Also, if the user is using a DEV or PRE build ignore the auto-updater until that version is officially released.
This commit is contained in:
1 parent
9d7d9235fa
commit
6aa10fca11
1 file changed
+29
-6
@@ -65,7 +65,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
plugin = this;
|
plugin = this;
|
||||||
if(!new File(this.getDataFolder()+"\\config.yml").exists())
|
if(!new File(this.getDataFolder()+"/config.yml").exists())
|
||||||
{
|
{
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
if(verbose)
|
if(verbose)
|
||||||
@@ -129,7 +129,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
{
|
{
|
||||||
logger.log(Level.INFO,"[AC] Downloading the new update...");
|
logger.log(Level.INFO,"[AC] Downloading the new update...");
|
||||||
}
|
}
|
||||||
File file = new File("plugins\\"+updateFolder);
|
File file = new File("plugins/"+updateFolder);
|
||||||
if(!file.exists())
|
if(!file.exists())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -142,7 +142,7 @@ public class Anticheat extends JavaPlugin
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
saveFile(file.getCanonicalPath()+"\\AntiCheat.jar", "http://dl.dropbox.com/u/38228324/AntiCheat.jar");
|
saveFile(file.getCanonicalPath()+"/AntiCheat.jar", "http://dl.dropbox.com/u/38228324/AntiCheat.jar");
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
@@ -251,10 +251,33 @@ public class Anticheat extends JavaPlugin
|
|||||||
}
|
}
|
||||||
if (!this.getDescription().getVersion().equalsIgnoreCase(v))
|
if (!this.getDescription().getVersion().equalsIgnoreCase(v))
|
||||||
{
|
{
|
||||||
update = true;
|
String version = this.getDescription().getVersion();
|
||||||
if(verbose)
|
if(version.endsWith("-PRE") || version.endsWith("-DEV"))
|
||||||
{
|
{
|
||||||
logger.log(Level.INFO,"[AC] An update was found.");
|
if(version.replaceAll("-PRE", "").replaceAll("-DEV", "").equalsIgnoreCase(v))
|
||||||
|
{
|
||||||
|
update = true;
|
||||||
|
if(verbose)
|
||||||
|
{
|
||||||
|
logger.log(Level.INFO,"[AC] Your dev build has been promoted to release. Downloading the update.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
update = false;
|
||||||
|
if(verbose)
|
||||||
|
{
|
||||||
|
logger.log(Level.INFO,"[AC] Dev build detected, so skipping update checking until this version is released.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
update = true;
|
||||||
|
if(verbose)
|
||||||
|
{
|
||||||
|
logger.log(Level.INFO,"[AC] An update was found.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user