But there wont be a centralized server, it will be peers, looking for other unknown peers to connect to. So say three people run the game ( each game application wont know the other two users ip numbers) and they click on "play lan game" it will run code which will accpet on coming connections (if a peer frind them) and code to look for other unkown players( so if they find the other two players before they are found they will connect to them).
Once connected they will be able to talk to each other, see if some one has hosted a game, and if some one has hosted a they will be able to see who is in that game.
Say if a 4th person runs the game and clicks on "play lan game" they will do also do the same searching proccess and connect to the other players.
The reason why im coding the lan lobby like that is because I have seen games (starcraft, C&C Generals, WarCraft wtc) where you click on "play lan game" then you enter a lobby and you can see other people who are in this lobby and see if any one has hosted a game.
Is that not how they go about coding such a situation?
You can't have a centrlized server in this case (so i think) because every network has a diffrent ip formats and pool sizes from each other. One might be from 192.168.1.66 to 192.168.1.125 and another like 192.168.1.1 to 192.168.1.255. And seeing that no two networks have the same ip format the central server will have keep changing its ip and how will the other apllications know what it is if it has to keep on compansating on diffrent lan networks?
Also you will require one machine be a cental server is this not a bit pointless in th lan case becuase say if you have two people who want to play agaisnt each other on lan you will need a 3rd machine to be a central server, what happens if there is not 3rd machine?
Once again im trying to look for unknown peers who are also running the application and once found they are connected to each other. Im just stuck on that bit i pretty much have an idea on what to do after searching and connecting peers on the lan lobby.
Quote:
Q21) and Q24) in the Forum FAQ answer your question.
I have looked at those questions but they dont really help in my situation I think. Ill be using TCP/IP so i wont be able to do the UDP broadcasting and there will be no Central/local/master server it will be just peers looking for other peers to connect to form a peer to peer network with out a server just in the lobby stage.
Quote:
Lobby works like this:
1) centralized server to act as matchmaker
2) client hosts game
3) in hosting a game, the engine contacts the central server which throws your IP and game into the shared lobby space (database)
4) now connecting clients, entering the lobby have access to the hosted games.
You can't do a lobby without a centralized, known server.
I have seen games where if you click on "play lan game" you enter the lobby and you can see other peers in the network (if they have click on "play lan game". From what i think after the user clicks on "play lan game" there will be code that will accept on coming conenctions and code to search for unknown peers who are also in this lobby stage. I dont think there is a cental server in this case becuase when you play lan games no one sets one machine to become a central server in thse games.
But when a person hosts a room the hosting peer will become the server (for the game) and the other peers will be clients to the hosting peer. The clients will only talk to the host and the host will do the job of sending packets about the place.
Quote:
whoever initiates the connection with host (the machine responsible for accepting new players) gets his public address (address behind his NAT, local IP address for LAN, ...) sent to other peers by the host. Then the peers can talk to each other.
That's pretty much it. Why cant you have a dedicated server anyway?
If look above you will see why i want to have a dedicated/central server for the lobby stage. If can't get round my problem ill just have a dedicated server.