RiptideNetworking / Riptide

Lightweight C# networking solution for multiplayer games.
https://riptide.tomweiland.net
MIT License
1.06k stars 141 forks source link

Handling player servers inside Master Server #117

Closed CrossV4 closed 8 months ago

CrossV4 commented 8 months ago

Hello i am trying to make a multiplayer game which is 1v1 footbal game. I have to make one master server then client-hosted servers.

The question is how can i make the client connect each others ? (room owner client starting a server on inside)

All clients will be connect first master server for handling room code etc. Then some players will create a room or will be connect a room. Players, will create a lobby if there is no created lobby. Player must be start a server for handling physics and lobby. So the other player have to connect lobby server which is other player's created. So here is the question begins here. How we can make the master server can handle this ? Master server should provide hostname and port number the created lobby to other player which is want to connect.

tom-weiland commented 8 months ago

If you intend to release on Steam, you could just use their lobby & server list features and not worry about setting up a master server. The Steam transport's demo shows how to do this.

The question is how can i make the client connect each others ? (room owner client starting a server on inside)

The player-hosted demo does exactly this, have you looked at it? Keep in mind that in order to connect to a server over the internet, its ports need to be open in the router settings (portforwarding). If you don't want players to have to do that, you'll need a relay server to act as the middleman—Steam's relay is free to use but if you can't/don't want to use Steam for whatever reason you'll need to build your own relay system.

For future reference, this has nothing to do with Riptide itself and would have probably been better to ask on Discord.

CrossV4 commented 8 months ago

Sorry, i saw your reply today i was offline. No i will not publish it on Steam. Its a mobile game.

In example it will like a payday series. Players connecting to master server, then they can search lobies or creates loby etc. If lobby master leaves game all the other players disconnects game and returning main menu. This multiplayer strategy pure simple and very cheap i think. I should make this system.

Also no, i did not looked up player-hosted demo because i watched your videos on youtube then i thought it's a just lobby server.