Jump to content

K0nan98
 Share

Recommended Posts

function Script:UpdateWorld()

	if(srvr == nil) then
	srvr = Server:Create(8888)
	srvr:Publish("GG2", "GoodGame",10)
	client = Client:Create()
	end
	cnt = client:CountServers("GG2",15)
	--print("Count of servers = ")
	--print(cnt)
	if window:KeyHit(Key.T) then
	aa = client:GetServer(0)
	bb = aa.addres
	print(bb)
	bb = "127.0.0.1"
	client:Connect(bb,8888)
	client:Send(1,"Connected")
	end
	msg = srvr:Update()
	if(msg ~= nil) then
	print("Msg =")
	print(msg)
	end

end

 

Hello! PLS help me. When writing such code and clicking on 'T', as a result, messages from the client do not come and the ip server is always equal to "nil". Please help me. Sorry in advance for maybe a stupid question.  Output: msg = absent; bb = nil; cnt(if enable) = 1;

Link to comment
Share on other sites

On 11/29/2017 at 7:44 AM, K0nan98 said:

function Script:UpdateWorld()

	if(srvr == nil) then
	srvr = Server:Create(8888)
	srvr:Publish("GG2", "GoodGame",10)
	client = Client:Create()
	end
	cnt = client:CountServers("GG2",15)
	--print("Count of servers = ")
	--print(cnt)
	if window:KeyHit(Key.T) then
	aa = client:GetServer(0)
	bb = aa.addres
	print(bb)
	bb = "127.0.0.1"
	client:Connect(bb,8888)
	client:Send(1,"Connected")
	end
	msg = srvr:Update()
	if(msg ~= nil) then
	print("Msg =")
	print(msg)
	end

end

 

Hello! PLS help me. When writing such code and clicking on 'T', as a result, messages from the client do not come and the ip server is always equal to "nil". Please help me. Sorry in advance for maybe a stupid question.  Output: msg = absent; bb = nil; cnt(if enable) = 1;

I'm not too experienced in this so i may be wrong (I havent done networking yet) but i believe you spelled "address" wrong on line 13. Don't know if that is the only problem

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...