LordMastodon Posted August 30, 2015 Posted August 30, 2015 So I know there are mods that on startup check the internet for an updated version of the mod, and if they find one they tell the player. So basically I was wondering how they did that. I found this thing called Jenkins which lets you do internet stuff with Java plugins, but I'm not quite sure how that works either, and I don't know if that's what's being used... Thanks in advance! Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
Anon10W1z Posted August 30, 2015 Posted August 30, 2015 You can also integrate your mod with the Version Checker mod by Dynious. Quote Maker of the Craft++ mod.
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 What most of these mods do is just download a text file that is hosted somewhere. This file contains the latest version name, they then compare that to the installed version and display a warning if it's outdated. You can either maintain this file manually or use a Continous Integration software, like Jenkins. In the end though: Nobody really cares but the mod maker so they can say "look how fancy this is". For the end users these things are mostly annoying, because they are coded stupidly. I suppose that could be annoying for something like bug-fix updates, but it could be useful for major updates. For instance, if someone is doing a YouTube playthrough of a mod, and while they're playing a massive feature comes out such as Thermal Expansion integration or something like that. They're also playing with Thermal Expansion, and it's annoying that the two mods don't integrate. You start to see where something like that might be useful. Using that system, you could probably make a "version syntax" like 1.0.0, where the third number is minor bug-fix updates, the second number is major block-adding updates and the first number is a major mod overhaul. You could do a system that notifies the player about whether the update is bug-fix, major or overhaul, and a config system that lets them configure what version notifications they want to see. However, I am all ears to what you mean by "coded stupidly" and what could be done to make that different. I'd also be grateful if you could share with me how I could make a script that downloads that file from the internet, and how I could use Jenkins to do Continuous Integration, that would be greatly appreciated as I've not used something like that as of yet. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
Hlaaftana Posted August 30, 2015 Posted August 30, 2015 What most of these mods do is just download a text file that is hosted somewhere. This file contains the latest version name, they then compare that to the installed version and display a warning if it's outdated. You can either maintain this file manually or use a Continous Integration software, like Jenkins. In the end though: Nobody really cares but the mod maker so they can say "look how fancy this is". For the end users these things are mostly annoying, because they are coded stupidly. But it's annoying when you have to check for a new version every day... Quote
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 What most of these mods do is just download a text file that is hosted somewhere. This file contains the latest version name, they then compare that to the installed version and display a warning if it's outdated. You can either maintain this file manually or use a Continous Integration software, like Jenkins. In the end though: Nobody really cares but the mod maker so they can say "look how fancy this is". For the end users these things are mostly annoying, because they are coded stupidly. But it's annoying when you have to check for a new version every day... What do you mean? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 you could probably make a "version syntax" like 1.0.0, where the third number is minor bug-fix updates, the second number is major block-adding updates and the first number is a major mod overhaul. You've basically reinvented SemVer. While it would be amazing if all mods followed something even resembling SemVer (e.g. MCVERSION-MAJOR.MINOR.PATCH), it's never going to happen. To get text from the internet is extremely easy using Apache Commons IO which is already a dependency of Minecraft/Forge: String s; InputStream in = new URL( "http://jakarta.apache.org" ).openStream(); try { s = IOUtils.toString(in); } finally { IOUtils.closeQuietly(in); } You won't be able to use Jenkins for CI unless you already have a server. My personal suggestion if you don't is to use Drone, a fairly good, and free, CI server. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 you could probably make a "version syntax" like 1.0.0, where the third number is minor bug-fix updates, the second number is major block-adding updates and the first number is a major mod overhaul. You've basically reinvented SemVer. While it would be amazing if all mods followed something even resembling SemVer (e.g. MCVERSION-MAJOR.MINOR.PATCH), it's never going to happen. To get text from the internet is extremely easy using Apache Commons IO which is already a dependency of Minecraft/Forge: String s; InputStream in = new URL( "http://jakarta.apache.org" ).openStream(); try { s = IOUtils.toString(in); } finally { IOUtils.closeQuietly(in); } You won't be able to use Jenkins for CI unless you already have a server. My personal suggestion if you don't is to use Drone, a fairly good, and free, CI server. Thanks! Do you have any tutorials on how I could use Drone? As I said, I've never used a CI server, and I don't really know how they work. I'd also like to create an autoscript that updates the version file every build, any ideas? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 To automatically output the version to a txt file, you can create a custom task like so: task version() { File f = new File("$buildDir/libs/version.txt") if (!f.getParentFile().exists()) f.getParentFile().mkdirs() if (!f.exists()) f.createNewFile() FileOutputStream fos = new FileOutputStream(f) fos.write(project.version.getBytes()) fos.close() } Drone: (note, this assumes your mod is open source and hosted on GitHub) 1. Go to drone.io 2. Login with GitHub 3. Create a new GitHub project with your repository 4. Select Java as the project language 5. Replace the default buildscript with: chmod +x gradlew ./gradlew setupCIWorkspace build version 6. Open the artifacts tab and to the list add: build/libs/*.jar build/libs/version.txt 7. Press Save 8. Build your project 9. Use the aforementioned code to download the contents of your version.txt from this url: https://drone.io/github.com/{username}/{RepoName}/files/build/libs/version.txt Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 Thanks, that helps a lot. Just wondering though, where do I put this task? I don't think there's any event that gets fired when the thing is built... Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 Just add the task to the end of your build.gradle file Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 Not familiar with Gradle either, but I'm assuming buildscript is the task called when the thing is built, so I figure out how to implement that task you specified into the build.gradle. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 By "buildscript" do you mean the build.gradle file or the Drone build script? Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 build.gradle. Also, now it's telling me that Task 'version' not found in root project 'Miscal'. Which is intriguing, considering I told .gitignore to lift its limitations on anything gradle related and pushed, so Drone should now have both gradlew and build.gradle... Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 What is the URL of your GitHub repo? Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 30, 2015 Author Posted August 30, 2015 This. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
shadowfacts Posted August 30, 2015 Posted August 30, 2015 I've created a pull request explaining what your problem was. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 So now my Drone build is saying: Execution failed for task ':deobfMcMCP'. > Your Access Transformers be broke! I'm not quite sure how you're supposed to fix that. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 I'm not. I only have a rudimentary understanding of what those ARE. I'm pretty sure Forge uses them, but I don't. Here's the WHOLE crash report. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 I'm running Windows, and Drone runs Ubuntu, so I can't exactly replicate the situation, but running gradlew setupCIWorkspace build version returns the same error on my computer as it does on Drone. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 Should I post a bug report on the github? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 Alright, done. Here's the link to the bug report, tell me if that seems fine to you or whether I should change it up. Also, one question: how log does it normally take until someone responds to the bug report? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 Yeah moved it to the ForgeGradle repo as per the suggestion of luacs1998 on the MinecraftForge repo. What's the t2a (time to answer) for ForgeGradle (longer I assume)? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted August 31, 2015 Author Posted August 31, 2015 Good . It took luacs 2 hours to reply to the MinecraftForge bug report, so shorter than that would be awesome. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted September 1, 2015 Author Posted September 1, 2015 Got it. So considerably longer . Also, how do you think I could convert a version string that looks like this: "1.0.0" to 3 integers that I can use to compare to the internal version numbers? Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
LordMastodon Posted September 1, 2015 Author Posted September 1, 2015 Never mind, I've found a way using String.split(). How do you think a system like this sounds: First of all if there's an update available the mod tells you "There is a new update available for Miscal, version <new version number>." If it's a bug-fix update, it then tells you "Please note that this is only a bug-fixing update and is not completely necessary." If it's a content-adding update, it tells you "Please note that this is an update that adds new content, and it is recommended you update." If it's an overhaul update it says "This is an overhaul update and it is highly recommended you update as the new version is incompatible with old ones." Overhaul updates should be extremely rare, but they're probably going to happen at some point due to the existence of Minecraft updates. Finally, it says "Please visit https://drone.io/github.com/LordMastodon/Miscal/files to get the new update." So that you can get the new update. How does that sound? Need some feedback. Quote Who are you? Why have you brought me here? And why are there so many PewDiePie fanboys surrounding meeeeeeeee....... *falls into pit and dies*. Also this. Check it out. http://i.imgur.com/J4rrGt6.png[/img]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.