Update checker?

Is there a way to make a update checker? I’ve seen somewhere in a addon one, it used net library(which I dont understand yet :x) I dont remember which it was, nor did I understand the check function…?

The net library is a library that allows you to send data to the client from the server and vice versa. I think you could do an update check with http.post/fetch and your webserver could then intruct the server that there is an update avaiable.

Yeah. Most people http.Fetch a version.txt file in their github repo and compare it to a local version.txt file.

My addons have an update checker… I also released the .bat file which updates the version.txt

Feel free to use it them: https://bitbucket.org/Acecool/acecooldev_base/src/
https://bitbucket.org/Acecool/acecooldev_networking/src/

or

Version Control System… You may need to update some of the paths but this’ll help manage the version.txt…
https://bitbucket.org/Acecool/version-updater-tool/src

I experiemented a bit with http.fetch, and found a easier way, which is just 4-5 lines of code ;-; #CaseClosed

For everybody who wants the small code:



AddCSLuaFile()
include("cl_config.lua")
http.Fetch(settings.verurl, function(body, len, headers, code) -- replace settings.verurl with your file url
	version 	= 	{}
	version.l 	=	"0.0.0" -- set your local version
	version.o 	=	body -- sets official version to the file content
	
end)


You can do the checkers on your own, I got like this:



if version.l != version.o then
		-- Code here
	end