SFML community forums

Help => Network => Topic started by: Axenntio on December 06, 2015, 06:32:30 pm

Title: Manage Client on the server
Post by: Axenntio on December 06, 2015, 06:32:30 pm
HI everyone, I continue my projet to make a multiplayer game, but i've got a problem:
How can I manage each client on the server ?
Because, All the clients give their X and Y position to the server, but how can I give X and Y position of all the clients to each other ?

I've actually these codes:

Client:
(click to show/hide)

Server:
(click to show/hide)

And with this, how can I give a ID link to the IP
with a array like this:
Id ArrayAxenntioEnadrixRuhtrax
Ip ArrayIp1Ip2Ip3

To use this with a function like
message("You are Axenntio","Axenntio");
void message(std::string text,std::string id){
        // Loop that link the Id with the Ip array
        //Then send the message to the client Axenntio
}
 
Title: Re: Manage Client on the server
Post by: Turbine on December 09, 2015, 10:38:01 am
Well generally you'd create a unique client ID, then you'll probably be wanting to relay the positions along with the identifying client ID. Of course this would only give you client sided movements.