CheckUpdates¶
Notice
This is a new function added in RSDKv4+, and requires cURL to use.
Note
This isn't an automatic update checker, so whenever you update something that uses this function the GitHub page you're pulling from will automatically need to be updated
Checks for any differences between a number in the script and a number from the GitHub page you're pulling from.
How to set-up:
-
Make a new public GitHub repository.
-
Allow GitHub pages and auto-builds for your website containing the number to be built automatically.
-
Create a new
index.htmlfile, and in it type the number you want to use. For this example we'll go with10. -
In the engine, go to where you want to check for updates and add this: CheckUpdates("
link"). -
Where the word "link" is above, you put the link to your GitHub page.
-
The engine will get the value and store it in
checkResult. If there was an error/you don't have internet it'll return as-1. -
Add a checking for whether you need to update now, please look at the examples below for a better idea.
Parameters¶
link-
The link to your GitHub page, containing your version number.
Return Value¶
Sets checkResult to the result.
Syntax¶
Example¶
private alias 5 : CURRENT_VERSION
switch object.state
case 0
CheckUpdates("https://prodnw.github.io/DoF-version-number/")
temp7 = checkResult
object.state++
break
case 1
if CURRENT_VERSION != temp7
object.versionCheck = true
end if
object.state++
break
case 2
if object.versionCheck == true
// update notify menu
else
// continue as normal
end if
end switch