Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Axenntio

Pages: [1]
1
Network / [SOLVE] Multi-clients problems
« on: July 08, 2016, 11:50:34 pm »
Hi there !

I've make an simple multiplayer game, but... when I want to make a login system, there are some issues.
Indeed, When the client one  connect to the server and log in, not probleme, his move are good, but when I connect a second client and log in, the moves of the two players are crazy.
Can someone explain me what are the error ?
Because all the physic of the game are managed by the server, and the move should be one pixel by pixel, to be aligned to a 16x16 grid...

Thanks you for your help.

https://github.com/Axenntio/NetworkingSFML

2
Network / Manage Client on the server
« 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
}
 

3
Network / Trying to make a server with multiple connections
« on: May 02, 2015, 11:27:31 pm »
Hi everyone ! I've got some weird problem with my code...
The first time, I've make an array and if a client disconnected, I push the last elements to overwrite the client disconnected
for(int i=0;i<coNumber /*Number of connected clients*/;i++){
    if(socket[i].receive(packet)!=sf::Socket::Done){
        coNumber--; //Remove one client
        for(int j=i;j<coNumber;j++){
            socket[i]=socket[i+1];
        }
    }
}
 

But got the awesome
NonCopyable error

So I've ask to Lukas/eXpl0it3r (Thanks to him !)
And suggest me to use
std::vector<std::unique_ptr<sf::TcpSocket>> socket;
 

instead of
sf::TcpSocketsocket[MAXCONNECTIONS];
 

play with somes pointers, and then get stuck...
An error occured with this line:
if(listener.accept(*socket[coNumber])==sf::Socket::Done && coNumber<MAXCONNEXIONS){
 

No error during compiling, but during the execution (Application not responding)
Error 255

So there is my actual code:

(click to show/hide)

Thanks for your help !

Pages: [1]