Hello,
I'm trying to make a wi-fi LAN game for mobile.
Basically what I'm trying to do is :
- The user can decide to play the game alone or versus other players connected to the same LAN.
- If the user choose to play alone, I start a local gameserver on his device visible to other players.
- The other users now can connect to his server and play against him.
So the idea behind is that each player that is playing alone is a game server to join for other players.
All is working good if I've have only 1 server at a time. I can connect to the server and play and all, but if I have 2 different servers on 2 different devices the TNLobbyClient.knownServer list always returns me 1.
The strange thing is that in the log I can see for just a fraction of time one server than the other and so on. Seems they are fighting for the single element that the TNLobbyClient.knownServer list returns.
Also if I try to start servers from your menu sample on multiple devices only one get showed in the list.
Did you have any suggestion on how to start multiple game servers on the LAN and be correctly discovered by all the players in the network?
If the problem is that there's multiple LobbyServer in the net, how can I make it unique for all the players connected to the LAN?
Edit: I want to add another problem I'm facing.
Very often on iOS when I'm creating the local server the TNet.Tools.localAddress and also the internalAddress are 255.255.255.255. When I try to connect to the created server the OnNetworkConnect throw a Connection refused message.
I know there was trouble few months ago about localAddress on ios, is it still there?
I'm using TNet 1.9.5c .
Thanks for the support.