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

Author Topic: [SOLVE] Multi-clients problems  (Read 2709 times)

0 Members and 1 Guest are viewing this topic.

Axenntio

  • Newbie
  • *
  • Posts: 8
    • View Profile
[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
« Last Edit: July 11, 2016, 11:15:03 pm by Axenntio »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Multi-clients problems
« Reply #1 on: July 09, 2016, 01:29:45 pm »
You first need to narrow down the problem yourself a bit. Nobody will just go through all of your code and search for bugs. Run a debugger, use debug output strings and see where things go wrong.

Also provide a proper problem description. "the moves ... are crazy" is really not a useful description...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Axenntio

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Multi-clients problems
« Reply #2 on: July 10, 2016, 05:53:28 pm »
Ok, I've fix the bug.

I write
selector.add(*client);
instead of
selector.remove(*client);
when a client is disconnected.