Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Growtopia game #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lionirdeadman
Copy link

Everything should be working except a pop-up because (I assumed) touch emulation is not a thing in WINE, once that's dismissed, everything works.

Things to note :

  • I changed the README slightly because we use YAML now instead of JSON and --user doesn't go there.
  • I specified where to point the installer since the default is in the user folders and didn't know how I could handle that without hard-coding it.

@lionirdeadman
Copy link
Author

Actually, I noticed two more issues. Really unsure how I can fix either...

  • If you alt-tab, ENTER doesn't work anymore.
  • In the current model, updates will never be downloaded.

Any ideas would be appreciated.

@user5145
Copy link

you can install it into /var/data that's the only possible way i can think of.

@lionirdeadman
Copy link
Author

I already install it there, the problem is the game requires you to install new .exes for updates.

@user5145
Copy link

user5145 commented Sep 28, 2018

I've never played this game, don't know how it updates and maybe it's a very stupid idea but can't you put something like this into /app/bin/growtopia?

...
if [[ /app/bin/updater.exe -nt /var/data/some/file/that/always/updates ]]; then
wine /app/bin/updater.exe
fi

wine /var/data/...

and add the updater's url to sources or extra-data.
Someone should change that url every update and /app/bin/growtopia would check it at startup.

edit: nvm, i get it, you have to reinstall the game every update
edit2: I think that the only way is to use the real url (http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe) and constantly update that url and check if the url changed
or maybe if the game returns something different than 0 (echo "$?") when it has to be updated but doesn't do it normally than it is possible to use that number, but only if it does.

@lionirdeadman
Copy link
Author

From my understanding, the game only knows there's an update when it connects to the servers so that wouldn't work :(

I'm almost thinking about checking the hashes of https://growtopiagame.com/Growtopia-Installer.exe each time you want to start the game and comparing it to the last known hash but that's 90MB each time.. Idk how else it could be done :/

@user5145
Copy link

user5145 commented Sep 29, 2018

:( i thought rather to download only the headers
wget --server-response --spider http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe 2>&1 | grep -i Last-Modified

it's from (https://superuser.com/questions/619592/get-modification-time-of-remote-file-over-http-in-bash-script)

but Last-Modified isn't reliable and it doesn't work if it was redirected so (https://growtopiagame.com/Growtopia-Installer.exe) doesn't work. it's for sure possible to make it to work but who knows how.

I found out that
curl -L -v https://growtopiagame.com/Growtopia-Installer.exe does it well in a terminal
(it's possible to get the date from this line "Issue another request to this URL: http://ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe" it's that 20180921 number ) but it's because it's failing so probably it shouldn't be used

edit: I think /dosdevices/c:/Program Files (x86)/Growtopia should be changed to something like /dosdevices/c:/users/$USER/Local Settings/Application Data/Growtopia
and i'm not able to force it to install an old version so i can't really try anything
funny is that http://ubistatic-a.akamaihd.net/0098/20180909/GrowtopiaInstaller.exe and ubistatic-a.akamaihd.net/0098/20180921/GrowtopiaInstaller.exe are the same file and there is nothing before 20180909

@lionirdeadman
Copy link
Author

I didn't know how to do $USER because I'm a big noob but yes, that'd be much better than telling users to put it somewhere else than the default location.

That curl command could be used although I don't know how to implement that in the script. Even if the file is the same, if the date changed, it might be a new executable so it's worth trying.

@user5145
Copy link

user5145 commented Nov 2, 2018

don't worry about being noob. Everybody is like that We have to destroy something to learn how it works. And my English is noobish so no one is perfect :). Maybe i'm not too helpful to you but i don't want to leave you with this problem alone.

I've been thinking about it for a while and It seems that the best way to do it is to add it as a source file as i said in my second comment. Most projects work in this way and it seems that people don't care to automate it. When there is an update then someone updates the url to keep it working. You can see it in flathub's repositories. They are on github (though you probably know it).

I've had the same problem with homm3 and that's how i resolved it (I still have to manually force it to update though). No one has reviewed it so I don't know if it's the way it's supposed to be done, but that's the way I think is the best.

you can see it at user5145/applications in this file
/com.gog.HeroesofMightandMagic/com.gog.HeroesofMightandMagic.hd.yml

I hope it's at least a bit helpful to you.

Edit:
If you don't want to do it that way then maybe try to create 2 icons (i'm not sure if that's possible, but libreoffice somehow does it) one for the game and one for the updates and then let users download the latest installer and use zenity to get it.
FILE="$(zenity --file-selection --title='Select a File')"
echo $FILE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants