Jump to content

[HELP] callRemote - Timed Out Error


Recommended Posts

Now I have 2 servers. I want to send the current player count every time there is onPlayerJoin and onPlayerQuit from server 1 to server 2. However, I could send the data from the 1st server to the 2nd server, but the 2nd server could not send the data to the 1st server, now none of them can send it and it gives a TIMED OUT error. Port 22005 is open on both servers, I gave HTTP authorization from ACL and meta.xml, but it still does not work. I searched a lot and couldn't find a solution, please help.

 

server.lua file of the 1st server.

function getPlayerCount()
    return #getElementsByType("player")
end

function joinQuit()
    callRemote("http://185.136.206.116:22005/cdm_connection/call/getPlayerCount", function(responseData, errorID)
		responseData = tostring(responseData)
		if responseData == "ERROR" then
			outputDebugString("callRemote: ERROR #" .. errorID)
		elseif not tonumber(responseData) then
			outputDebugString("callRemote: Unexpected reply: " .. responseData)
		else
			print(tonumber(responseData))
			setElementData(root, "cdm", tonumber(responseData))
		end
	end)
end
addEventHandler("onPlayerJoin", root, joinQuit)
addEventHandler("onPlayerQuit", root, joinQuit)
addEventHandler("onResourceStart", resourceRoot, joinQuit)

 

 

server.lua file of the 2nd server.

function getPlayerCount()
    return #getElementsByType("player")
end

function joinQuit()
    callRemote("http://193.223.107.111:22005/cr_connection/call/getPlayerCount", function(responseData, errorID)
		responseData = tostring(responseData)
		if responseData == "ERROR" then
			outputDebugString("callRemote: ERROR #" .. errorID)
		elseif not tonumber(responseData) then
			outputDebugString("callRemote: Unexpected reply: " .. responseData)
		else
			print(tonumber(responseData))
			setElementData(root, "cdp", tonumber(responseData))
		end
	end)
end
addEventHandler("onPlayerJoin", root, joinQuit)
addEventHandler("onPlayerQuit", root, joinQuit)
addEventHandler("onResourceStart", resourceRoot, joinQuit)

 

And this is the TIMED OUT error: https://imgur.com/6wIOIEe

 

Please help.

Link to comment
  • Moderators
4 hours ago, FreezyMTA said:

I gave HTTP authorization from ACL and meta.xml, but it still does not work.

You probably already did the following, but just checking.
What happens if you visit those URL's manually? (maybe it is asking for a login authorisation)

Link to comment
  • 2 months later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...