esx_invest icon indicating copy to clipboard operation
esx_invest copied to clipboard

[Version] Nil version fetched from checkVersion method

Open Tyler-Durdon opened this issue 4 years ago • 8 comments

Hi,

The PerformHttpRequest("https://raw.githubusercontent.com/"..updatePath.."/master/version", checkVersion, "GET") doesn't seem to fetch any version because at the following line we got an error.

if tonumber(curVersion) < tonumber(responseText) then got : 1.2.5 < nil

You can ask me more about it if needed. Respectfully

Tyler-Durdon avatar May 02 '20 12:05 Tyler-Durdon

🤔 well this is it what should fetch https://raw.githubusercontent.com/Tazi0/esx_invest/master/version

I have no idea why it wouldn't work... can you check if updatePatch is correct to "Tazi0/esx_invest"

Tazi0 avatar May 02 '20 13:05 Tazi0

Yup it is, I just took the latest version of Master

May be because I'm running actually on my Localhost server ?

Tyler-Durdon avatar May 02 '20 13:05 Tyler-Durdon

Update : The function on line 11 function checkVersion(err,responseText, headers) takes as a 1st parameter err which is actually the response code. I got 1.2 on 2nd param which is correct :)

However I misunderstood something, it's the tonumber(curVersion) So the problem is it tries to convert tonumber(1.2.5)

Tyler-Durdon avatar May 02 '20 13:05 Tyler-Durdon

May be because I'm running actually on my Localhost server?

my test server is local so I don't think

[...] takes as a 1st parameter err which is actually the response.

If the request was successful it would return 200 and response would be the version

Tazi0 avatar May 02 '20 13:05 Tazi0

(Sorry I edited my previous post)

Tyler-Durdon avatar May 02 '20 13:05 Tyler-Durdon

So the problem is it tries to convert tonumber(1.2.5)

I've done tests and your correct, apparently I can't do 2 dots... great (no more half updates ig)

Tazi0 avatar May 02 '20 13:05 Tazi0

Roger that, otherwise you could split your string with 3 variables with Major / Minor / patch and compare them ?

Tyler-Durdon avatar May 02 '20 13:05 Tyler-Durdon

i could but it isn't that important, ill put it on a low

Tazi0 avatar May 02 '20 13:05 Tazi0