Jump to content

[1.8 (Does it really matter?)] Checking for available updates


Recommended Posts

Posted

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!

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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.

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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...

Posted

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?

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

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?

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

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.

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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...

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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.

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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.

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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?

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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?

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

Posted

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.

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.

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have been trying to solve a consistent crashing issue on my brother's computer where it will crash during the "Scanning Mod Candidates" phase of the loading process that starts when you click the play button on the Minecraft launcher. The issue seems to stem from a missing library that it mentions in the log file I provide below. I might I'm missing the bigger issue here for a smaller one but hopefully someone can find what I'm missing. Here's all of the stuff that I've been able to figure out so far: 1. It has nothing to do with mods, the crash happened with a real modpack, and even when I made a custom modpack and launched it without putting ANY mods into it (That is where the log file comes from by the way). 2. I have tried to find this class like a file in the Minecraft folders, but I've had no luck finding it (I don't think it works like that, but since I really don't understand how it works, I just figured I'd try). 3. I haven't seen anyone else have this issue before. 4. I know that my modpack (with mods) does work since I've run it on my computer, and it works fantastic. For some reason my brother's computer can't seem to run anything through curseforge. 5. This is for Minecraft version 1.20.1, Minecraft launcher version 3.4.50-2.1.3, forge 47.3.0, and curseforge app version 1.256.0.21056 6. My brother is using a Dell laptop from 6 years ago running Windows 10 (If you think more info on this would help, please ask as I do have it. I'm just choosing not to put it here for now). 7. I have reinstalled the curseforge app and installed Minecraft version 1.20.1. I have not reinstalled Minecraft or forge 47.3.0 but I didn't know if that would help. 8. I had an error code of 1 Please let me know if there is anything else that I am missing that you would like me to add to this post/add in a comment! Lastly, many thanks in advance to whoever can help! ------------- LOG FILE (latest.log) ------------- (from /Users/<NAME OF USER>/cursforge/minecraft/Instances/<THE NAME OF MY EMPTY MODPACK>/logs/latest.log) (This was made after running an empty modpack with same versions for all apps) ("[REDACTED]" is not the actual text from the log, it is me replacing text I figured wouldn't be necessary for fixing and would hurt my privacy) https://pastebin.com/hxXvGGEK ------------- DEBUG.LOG (I realized that I should have put this here first after I had done all of the work on putting latest.log in) -------------------- (again, "[REDACTED]" is not the actual text from the log, it is me replacing text I figured wouldn't be necessary for fixing and would hurt my privacy) https://pastebin.com/Fmh8GHYs
    • Pastebin... https://pastebin.com/Y3iZ85L5   Brand new profile, does not point to a mod as far as I can tell, my fatal message just has something about mixins. Don't know much about reading logs like this, but am genuinely stuck, please help. Java updated, pc restarted.
    • Fastfund recovery helps an individual to get back their scammed funds irrespective of nationality, Romance scam funds and Broker's scam, all kinds of scam funds are 100% accurately recovered without disappointment, their goal is to give all those who seek help to recover lost satisfaction of funds recovery within 72 hours After countless hours of research and desperate attempts to find a solution, I stumbled upon FASTFUND RECOVERY. It was like finding an oasis in the middle of a desert. Their website promised to help victims of scams reclaim what was rightfully theirs, and I instantly knew I had to give them a shot. Before diving headfirst into the recovery process, I wanted to make sure that FASTFUND RECOVERY was the real deal. So, I did my due diligence and looked into their expertise and reputation. To my relief, I found that they had an impeccable track record, successfully assisting countless individuals in recovering their lost funds. Their team consisted of experts in cybersecurity and financial fraud, armed with the knowledge and tools needed to tackle even the most intricate scams. With their reputation preceding them, I felt a renewed sense of hope. FASTFUND RECOVERY successfully came to my aid and got back the amount I lost to these scammers and for this, I am sending this article for clarification. The info of FASTFUND RECOVERY is email: Fastfundrecovery8 (@)Gmail (.) com. Web fastfundrecovery(.)com. (W/A 1 807/500/7554)
    • I was playing minecraft, forge 47.3.0 and 1.20.1, but when i tried to play minecraft now only crashes, i need help please. here is the crash report: https://securelogger.net/files/e6640a4f-9ed0-4acc-8d06-2e500c77aaaf.txt
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.