Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

multiplayer server/client basic structure?

$
0
0
Im wondering what the best way to set up my UDP server/client program is. Here is what I am currently trying to do.

-client sends key input to server
-Server receives key input. Checks for collisions and updates this client's position. 
-Server sends this client a list of all the client's information(position, HP, etc) including the client's own information
-client receives this list, updates his own information, and updates the list of connected players the client is keeping.



The problem im having with this, is getting sending the list of client's information from the server to the client. Im using SFML and only have a very basic understanding of networking.

My question is: Is my approach to this okay, and if it is how can i get the list( im using an std::map<std::string, Client> ) sent to the client though an sf::Packet. If my approach is not okay, what is a better approach?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>