Hi Everyone,
I have a network game and HostNetwork and JoinNetwork work as documented. The following is not the behaviour that I would have expected, and I am looking for someone who can explain why the following is occurs.
On computer 1, I run this code...
NetworkID = HostNetwork("MyAwesomeGame", "HostPlayer", 1025)
if NetworkID > 0
if IsNetworkActive(NetworkID) = 1
print("Life is good")
....loop to wait for clients
endif
endif
Code above works well, and client running JoinNetwork on computer 2 works perfectly.
But now if on computer 2, I run the same code to create a second host. I expect the NetworkID to be zero or the IsNetworkActive to fail, because I have two hosts with the same networkname, hostname, and port. I was then going to increase my port until I found an available port to host on. I am creating a simple two player game, and if a third player creates a hosted game I just want to bump him up to the next available port.
Instead, both computers are happily getting through my if statements and I seem to have two hosts with the same networkname, hostname, and port.
Tomorrow I will find a third computer to see which one a client will connect to... but I was hoping that someone who has experienced this can advise.
Thank you,
Chris