@roaminggamer thank you and sorry if I misunderstood the question
I’m not asking directly to @sgs. I’d like an answer from him but I do not know if he can share some of his code so I “asked to everyone”.
In my game I often ask for database rankings and I share things between users.
At the moment I have set some code in every network request that shows an error text if the request fails…
But it is a bit boring to do this for every request, I also have to wait for the negative answer or check the connection every time first.
So I thought to create a graphic signal that indicates in real time if it is connected or not (example attached).
So I would save a global flag(bool) indicating whether or not there is conection
My current code is something like this:
internetConnection = false local function checksInternetConnection() local socket = require("socket") local test = socket.tcp() test:settimeout(1, 't') -- Set timeout to 1 second local testResult = test:connect("www.google.com", 80) local thereIs if not(testResult == nil) then thereIs = true else thereIs = false end test:close() test = nil internetConnection = thereIs end timer.performWithDelay( 1000, checksInternetConnection, -1 )