This repository has been archived by the owner on Feb 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version checking now connects to wordpress website, to get latest download info and comparing the dates of the Reference.VERSION_DATE to the download post's date. * Versions.txt is now obsolete. Left it for older mod versions. * Added date of update in Reference that needs to be changed for version checking. * Fixed romulan ale name. * Moved the Version Checking Thread in separate class.
- Loading branch information
1 parent
c01dd47
commit 07e0e88
Showing
5 changed files
with
151 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{"versions":[ | ||
{"version": "0.4.0-RC2", "changes": "Server Crashes, Computercraft compatibility and more", "type": "beta", "date": "13.07,2015", "url": "http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version": "0.4.0-RC1", "changes": "More Star Map work, fix crash when opening the Matter Scanner GUI", "type": "beta", "date": "3.07,2015", "url": "http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.5", "changes":"New Star Map, bugfixes and more configurations", "type":"beta","date":"27.06,2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.4.1", "changes":"Mad Scientist Server Crash Bugfix", "type":"beta","date":"16.06,2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.4", "changes":"New Shield Ability and various fixes", "type":"beta","date":"12.06,2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"} | ||
{"version": "0.4.0-RC2", "changes": "Server Crashes, Computercraft compatibility and more", "type": "beta", "date": "13.07.2015", "url": "http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version": "0.4.0-RC1", "changes": "More Star Map work, fix crash when opening the Matter Scanner GUI", "type": "beta", "date": "3.07.2015", "url": "http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.5", "changes":"New Star Map, bugfixes and more configurations", "type":"beta","date":"27.06.2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.4.1", "changes":"Mad Scientist Server Crash Bugfix", "type":"beta","date":"16.06.2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"}, | ||
{"version":"0.3.4", "changes":"New Shield Ability and various fixes", "type":"beta","date":"12.06.2015","url":"http://simeon.co.vu/Mods/MatterOverdrive/download_category/downloads/"} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/matteroverdrive/handler/thread/VersionCheckThread.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* This file is part of Matter Overdrive | ||
* Copyright (c) 2015., Simeon Radivoev, All rights reserved. | ||
* | ||
* Matter Overdrive is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Matter Overdrive is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Matter Overdrive. If not, see <http://www.gnu.org/licenses>. | ||
*/ | ||
|
||
package matteroverdrive.handler.thread; | ||
|
||
import java.io.*; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
import java.util.concurrent.Callable; | ||
|
||
/** | ||
* Created by Simeon on 7/13/2015. | ||
*/ | ||
public class VersionCheckThread implements Callable<String> | ||
{ | ||
String url; | ||
|
||
public VersionCheckThread(String url) | ||
{ | ||
this.url = url; | ||
} | ||
|
||
@Override | ||
public String call() throws Exception | ||
{ | ||
return readFromUrl(url); | ||
} | ||
|
||
private String readFromUrl(String urlPath) throws IOException { | ||
URL url = new URL(urlPath); | ||
HttpURLConnection connection = (HttpURLConnection)url.openConnection(); | ||
connection.setRequestMethod("GET"); | ||
BufferedReader in = new BufferedReader( | ||
new InputStreamReader(connection.getInputStream())); | ||
String inputLine; | ||
StringBuffer response = new StringBuffer(); | ||
|
||
while ((inputLine = in.readLine()) != null) { | ||
response.append(inputLine); | ||
} | ||
in.close(); | ||
return response.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters