Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Patcher (by Roaming Gamer) Released
Started by roaminggamer Oct 16 2017 09:15 AM

6 replies to this topic
release
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,562 posts
  • Corona SDK

Have you ever wondered, "Is there a drop-dead easy way to download and execute scripts in my released app/game?"

If so, the answer is, "Yes!".

With patcher you can download scripts to effectively supersede scripts bundled with your app. You can also download new code and execute it.
 

 
With Patcher (docs) fixing a bug or tweaking a feature can be this simple:

-- Top of main.lua
--
local patcher = require "plugin.patcher"
patcher.export()


-- Then, elsewhere in your patching management code (write it as you wish) ...
--
local function onSuccess( event )
   patcher.purge("scripts.myModule")
   require("scripts.myModule")
end

patcher.mkFolder( "scripts" )

local myPatch = "https://raw.githubusercontent.com/roaminggamer/RG_FreeStuff/master/myPluginSamples/patcher/myModule.lua"

patcher.get( myPatch, "scripts.myModule", onSuccess )


 
Marketplace: https://marketplace.coronalabs.com/plugin/patcher 
Complete Example: patcher-example.zip
Docs: https://roaminggamer.github.io/RGDocs/pages/Plugins/patcher/#patcher
 
 
Disclaimer: You must still follow the guidelines outlined by individual app stores with regards to downloaded  scripts.

 

You must read these guidelines on your own and decide on your own.  I am not an expert on the current guidelines for every store and I don't constantly read them to stay up-to-date.


Edited by roaminggamer, 17 October 2017 - 07:40 AM.


[TOPIC: post.html]
#2

Odisej

[GLOBAL: userInfoPane.html]
Odisej
  • Enthusiast

  • 78 posts
  • Corona SDK

can you do that on iOS - I mean is it ok with App Store policies?



[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,562 posts
  • Corona SDK

This is a grey area.

 

Please read the Apple guidelines and make that decision for yourself.  I can't give you legal advise or anything approximating it.

 

I will say, the guidelines are significantly loosened from the original situation where this was not allowed at all.  Also, we see this done in many apps today.  So, you need to make the call based on the guidelines, your own research, and the your best understanding of the current Apple landscape.

 

Tip: When reading the guidelines, I don't mean the summarized ones on their web docs.  Read the full guidelines document which is a little harder to find.



[TOPIC: post.html]
#4

Odisej

[GLOBAL: userInfoPane.html]
Odisej
  • Enthusiast

  • 78 posts
  • Corona SDK

Thanks. I've tried your demo and it looks awesome.

 

Maybe one possible bug - I changed your url for a little error trial from this: 

"https://raw.githubusercontent.com/roaminggamer/RG_FreeStuff/master/myPluginSamples/patcher/myModule.lua"

to this:


"https://raw.githubusercontent.com/roaminggamer/RG_FreeStuff/myModule.lua"

and I get a success note with no script downloaded. 



[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,562 posts
  • Corona SDK

Looks like the download helper is detecting a failed download as a success?

 

I'll check on that. 

 

Thanks!



[TOPIC: post.html]
#6

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,780 posts
  • Corona SDK

Very clever, I wish this was around a year ago!

 

The only issue I can see is that on devices where the user has free access to the documents folder, they can see all the code. And potentially mess around with it?



[TOPIC: post.html]
#7

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,562 posts
  • Corona SDK

I had considered adding an encryption feature which is completely possible, but held off. 

 

If demand were high enough I could do this.




[topic_controls]
[/topic_controls]