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
  On 8/30/2015 at 3:28 PM, diesieben07 said:

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
  On 8/30/2015 at 3:28 PM, diesieben07 said:

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
  On 8/30/2015 at 5:22 PM, Hlaaftana said:

  Quote

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
  On 8/30/2015 at 5:03 PM, LordMastodon said:

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
  On 8/30/2015 at 8:14 PM, shadowfacts said:

  Quote

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

    • Recovering stolen Bitcoin can feel like an insurmountable challenge, especially after falling victim to scams that promise high returns with little investment. My journey began with excitement when I first learned about Bitcoin mining pools. The idea of earning substantial profits from a modest investment was enticing. I was encouraged to invest $5,200, and soon found myself caught in a web of endless demands for more money to access my funds. As time went on, I paid out hundreds of thousands of dollars, believing that each payment would finally unlock my investments. However, the requests never ceased, and I soon realized I was trapped in a scam. The weight of losing $826,000 worth of Bitcoin was unbearable, and I felt utterly helpless. I reached out to authorities, but their responses were disheartening, leaving me feeling even more isolated in my struggle. In my desperation, I even went to pray, seeking guidance and hope in what felt like a hopeless situation. I poured my heart out, asking for a sign or a way to recover my lost funds. It was during this time of reflection that I began searching for solutions online, hoping to find a way to recover my investments. That’s when I stumbled upon RAPID DIGITAL RECOVERY. At first, I was cynical after all, I had already been deceived so many times. However, I decided to reach out and share my story. The team at RAPID DIGITAL RECOVERY was understanding and compassionate, assuring me they had the expertise to help me recover my stolen Bitcoin. Within hours of providing them with the necessary information, I began to see progress. They guided me through the recovery process, keeping me informed every step of the way. It was surreal to watch as they worked diligently to trace my funds and navigate the complexities of the blockchain. To my astonishment, I received confirmation that my Bitcoin had been successfully recovered. The relief and joy I felt were indescribable. I had almost given up hope, but RAPID DIGITAL RECOVERY proved to be the lifeline I desperately needed. If you find yourself in a similar situation, I urge you to seek help from Reputable team at RAPID DIGITAL RECOVERY.  
    • https://mclo.gs/9Byd16j Hi, I've had my BetterMC world for a couple days now (1.19.2 vers & Fabric loader) but recently whenever I try to open the profile the minecraft launcher crashes and provides this error code. I've checked both this forum and google and haven't found any similar problems or solution to my problem. I'm not the best at reading crash logs but I gathered that there's an issue with fabric possibly, so I re-downloaded the same one on the modpack, then the latest version for 1.19.2 fabric and the issue still occurred. What can I do now?
    • it works now but idk why lmao. i removed terrablender and it didnt work. i then left it for a couple of days and, when i came back, updated the mods that needed updating because "what's the worst that could happen". i then tried launching it and now it works. i genuenly have no clue what i did to make it work, othen than updating the mods. so, thanks for your help
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
  • Topics

×
×
  • Create New...

Important Information

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