WIP: Fixes #7 - Game should be able to update itself #21

Closed
MichaelYick wants to merge 5 commits from updates into Patchy-Patch5
Member

This PR should address issue #7 and all work on it should be done on the 'updates' branch or forks.

Goals:

  • Menu Option for updating the game
  • Back-end support confirmed to be functional

Non-essential features:
(ordered in top-to-bottom in levels of importance)

  • opt-in auto-update preference
  • Ability to set a prefered update server (i.e if snootgame.xyz ever goes down or moves domain, someone can still update)
  • Integration with torrents
  • support for update via Tor
  • seeding IPFS support
This PR should address issue #7 and all work on it should be done on the 'updates' branch or forks. Goals: - [ ] Menu Option for updating the game - [ ] Back-end support confirmed to be functional Non-essential features: (ordered in top-to-bottom in levels of importance) - [ ] opt-in auto-update preference - [ ] Ability to set a prefered update server (i.e if snootgame.xyz ever goes down or moves domain, someone can still update) - [ ] Integration with torrents - [ ] support for update via Tor - [ ] seeding IPFS support
MichaelYick added 1 commit 2021-06-15 10:01:40 +00:00
MichaelYick added 1 commit 2021-06-15 10:52:29 +00:00
Author
Member

Having trouble getting the python to meld well with the script stuff. Idealy, there should be a loading text, text if there is no update, and text if there is an update depending on what the return of updater.UpdateVersion. Can't really figure this out, so for now its just renpy.notify (and it works as intended). If someone can look into this, offer some advice, or outright do it, that'd be great.

Having trouble getting the python to meld well with the script stuff. Idealy, there should be a loading text, text if there is no update, and text if there is an update depending on what the return of updater.UpdateVersion. Can't really figure this out, so for now its just renpy.notify (and it works as intended). If someone can look into this, offer some advice, or outright do it, that'd be great.
Author
Member

https://f95zone.to/threads/how-to-display-values-on-the-screen.39289/
found a little documentation on what I was working on, would work right now, but its 6 am and these bones need rest. If no one picks up implementing it, i'll get back to it.

https://f95zone.to/threads/how-to-display-values-on-the-screen.39289/ found a little documentation on what I was working on, would work right now, but its 6 am and these bones need rest. If no one picks up implementing it, i'll get back to it.
MichaelYick added a new dependency 2021-06-16 09:26:04 +00:00
MichaelYick changed title from WIP: Game should be able to update itself to WIP: Fixes #7 - Game should be able to update itself 2021-06-18 01:57:57 +00:00
MichaelYick added this to the Patchy-Patch5 Release milestone 2021-06-20 04:28:53 +00:00
Author
Member

Been working on this for awhile, mostly waiting UI to be done. Got the functions done and updates.snootgame.xyz is the update server. Still need to test it.

Been working on this for awhile, mostly waiting UI to be done. Got the functions done and updates.snootgame.xyz is the update server. Still need to test it.
MichaelYick force-pushed updates from dffbb9718f to 397de2b950 2021-06-24 01:14:33 +00:00 Compare
Author
Member

Can someone help me out with this PR? For some reason UpdateCheck() runs every damn frame the extra menus is open and crashes the game with an error whenever you click on any button (update has a special error). It is by far one of the werdiest and most frustrating errors. It only occours when the button to call UpdateCheck exists. When commented out, everything just werks.

Can someone help me out with this PR? For some reason UpdateCheck() runs every damn frame the extra menus is open and crashes the game with an error whenever you click on any button (update has a special error). It is by far one of the werdiest and most frustrating errors. It only occours when the button to call UpdateCheck exists. When commented out, everything just werks.

pm'd you the fix ;)

pm'd you the fix ;)
coolestskinnieinthejungle requested changes 2021-06-24 02:43:04 +00:00
coolestskinnieinthejungle reviewed 2021-06-24 02:52:54 +00:00
game/screens.rpy Outdated
@ -726,2 +726,2 @@
textbutton _("Enable Automatic Updates") action ToggleVariable("persistent.autoup", True, False)
textbutton _("Update Now!") ##action ("persistent.autoup", True, False) This should also set the value of updateresults
#textbutton _("Enable Automatic Updates") action ToggleVariable("persistent.autoup", True, False)
textbutton _("Update Now!") action UpdateCheck()
- 727 textbutton _("Update Now!") action UpdateCheck()
+ 727 textbutton _("Update Now!") action Function(UpdateCheck)

there's a way to automagically make this a commit that can edit it with the push of a button but i cant fucking remember how

```diff - 727 textbutton _("Update Now!") action UpdateCheck() + 727 textbutton _("Update Now!") action Function(UpdateCheck) ``` there's a way to automagically make this a commit that can edit it with the push of a button but i cant fucking remember how
coolestskinnieinthejungle marked this conversation as resolved
MichaelYick added 1 commit 2021-06-24 23:53:22 +00:00
Author
Member

OKAY SO IT BROKE AGAIN.

I have 2 ways of calling the update implemented, both with their own special snowflake error. Function just has a stroke because of ui context (https://lemmasoft.renai.us/forums/viewtopic.php?t=48945) and Invoke has a stroke because a stack isn't empty and has no way to become empty. It suggest ui.close(), an undocumented, deprecated "fix" that I can't find anything on. I tried manually emptying the stack (probably not a good idea) and it didn't do anything. Renpy's UI work is absolute trash pls halp.

OKAY SO IT BROKE AGAIN. I have 2 ways of calling the update implemented, both with their own special snowflake error. Function just has a stroke because of ui context (https://lemmasoft.renai.us/forums/viewtopic.php?t=48945) and Invoke has a stroke because a stack isn't empty and has no way to become empty. It suggest ui.close(), an undocumented, deprecated "fix" that I can't find anything on. I tried manually emptying the stack (probably not a good idea) and it didn't do anything. Renpy's UI work is absolute trash pls halp.
MichaelYick requested review from coolestskinnieinthejungle 2021-06-24 23:55:36 +00:00
Member

It is interesting, apparently updater.update and updater.Update are both existing and somewhat different functions/actions in renpy. https://www.renpy.org/doc/html/updater.html

It is interesting, apparently updater.update and updater.Update are both existing and somewhat different functions/actions in renpy. https://www.renpy.org/doc/html/updater.html
MichaelYick force-pushed updates from f77a2dc953 to e02118180e 2021-06-28 00:44:48 +00:00 Compare
Author
Member

Got everything set up back-end side. Need some people to help me debug it.

Got everything set up back-end side. Need some people to help me debug it.
Author
Member

Okay, im going to leave this feature for now. Stuff is mega broken and im at my wits end about whats wrong. If someone doesn't mind picking it up and helping me out with this, that'd be great. For now, i'll start working on something else.

Okay, im going to leave this feature for now. Stuff is mega broken and im at my wits end about whats wrong. If someone doesn't mind picking it up and helping me out with this, that'd be great. For now, i'll start working on something else.
Member

Use update() because updater.update(url, base=None, ..)
is different from updater.Update(*args, **kwargs).
The * star is pretty damn important because the game reads the url as this:

>>> url = 'https://updates.snootgame.xyz/update.json'
>>> url[0]
'h'
Use update() because `updater.update(url, base=None, ..)` is different from `updater.Update(*args, **kwargs)`. The * star is pretty damn important because the game reads the url as this: ``` >>> url = 'https://updates.snootgame.xyz/update.json' >>> url[0] 'h' ```
Author
Member

Use update() because updater.update(url, base=None, ..)

more confusion about the updater fucntions

Pain.

Even with this fix, it's still not detecting a new version being able to be downloaded. I don't know if I did something horribly wrong

The directory structure for the site is as follows:
image

Is something else needed? Does anyone know any free software ren'py projects with updates that we can reference?

>Use update() because updater.update(url, base=None, ..) >more confusion about the updater fucntions Pain. Even with this fix, it's still not detecting a new version being able to be downloaded. I don't know if I did something horribly wrong The directory structure for the site is as follows: ![image]() Is something else needed? Does anyone know any free software ren'py projects with updates that we can reference?
coolestskinnieinthejungle refused to review 2021-07-01 18:59:47 +00:00

coolestskinnieinthejungle refused to review 1 second ago

shit wrong button

> coolestskinnieinthejungle refused to review 1 second ago shit wrong button

relaying some revalations from convo with Spears to gitea:

so looking at renpy's source code rabbit hole these two methods are called
updater.can_update() and updater.get_installed_packages()
they were calling False and [] respectively causing updater.UpdateVersion("http://updates.snootgame.xyz/updates.json") to return None

so i had to basically generate an "update" directory by building distros & updates from the renpy dev tool, and then stick that directory and it's contents to my build dir

after that those methods were returning True and [u'pc'] so things should be good there now but i'm testing on my wangblows VM and the remote server only has a nix build

tl;dr the workflow is:
build distro + updates
move the updates/current.json dir and contents to ur build/dev project dir

going to get a windongs build on the server in a bit and test to see if i can now pull an update probably on my shitbox. we'll also have to have this shit documented.

relaying some revalations from convo with Spears to gitea: > so looking at renpy's source code rabbit hole these two methods are called > `updater.can_update()` and `updater.get_installed_packages()` > they were calling `False` and `[]` respectively causing updater.UpdateVersion("http://updates.snootgame.xyz/updates.json") to return None > > so i had to basically generate an "update" directory by building distros & updates from the renpy dev tool, and then stick that directory and it's contents to my build dir > >after that those methods were returning `True` and `[u'pc']` so things should be good there now but i'm testing on my wangblows VM and the remote server only has a nix build > >tl;dr the workflow is: >build distro + updates >move the `updates/current.json` dir and contents to ur build/dev project dir going to get a windongs build on the server in a bit and test to see if i can now pull an update probably on my shitbox. we'll also have to have this shit documented.
Author
Member

moving this to https://git.snootgame.xyz/Cavemanon/SnootGame/pulls/48 as this has turned into a hellfire of undocumented renpy

moving this to https://git.snootgame.xyz/Cavemanon/SnootGame/pulls/48 as this has turned into a hellfire of undocumented renpy
MichaelYick closed this pull request 2021-07-04 01:22:48 +00:00

Pull request closed

Sign in to join this conversation.
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
#29 Fixes #19 - Extras menu
Cavemanon/SnootGame
Reference: Cavemanon/SnootGame#21
No description provided.