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

Author Topic: client floods the server  (Read 3926 times)

0 Members and 1 Guest are viewing this topic.

s1and1

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
client floods the server
« on: December 20, 2021, 03:43:07 pm »
sorry for my english.

Hello, creating a multiplayer game faced a problem. The client is flooding with udp requests and the server is working too slow, so the position of the player in the screen of another player is very different from the real ones.

The client sends requests via while(true) and the server runs in the same cycle.


is it possible to somehow reduce the load?


Thank you in advance!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: client floods the server
« Reply #1 on: December 21, 2021, 07:56:50 am »
You'd most likely have to change your server architecture, so that you can handle more inputs.
Additionally, from a client perspective you only really want to send out actual updates and may also decide to limit it to some fixed time, so you're not sending 60 updates per second...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

s1and1

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: client floods the server
« Reply #2 on: December 21, 2021, 12:14:20 pm »
that is, to send, for example, 20 data per second?