Tazi0 / esx_invest

ESX invest, invest into companies
GNU General Public License v3.0
14 stars 20 forks source link

[Version] Nil version fetched from checkVersion method #8

Open Tyler-Durdon opened 4 years ago

Tyler-Durdon commented 4 years ago

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

Tazi0 commented 4 years ago

🤔 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"

Tyler-Durdon commented 4 years ago

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

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

Tyler-Durdon commented 4 years ago

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)

Tazi0 commented 4 years ago

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

Tyler-Durdon commented 4 years ago

(Sorry I edited my previous post)

Tazi0 commented 4 years ago

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)

Tyler-Durdon commented 4 years ago

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

Tazi0 commented 4 years ago

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