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.


Messages - s1and1

Pages: [1]
1
Network / Re: sf::Packet the packet data is mixed up
« on: December 30, 2021, 07:48:18 pm »
I'm going to make synchronization to a separate thread, but Dos attacks often occur, which leads to a stop

2
Network / sf::Packet the packet data is mixed up
« on: December 30, 2021, 09:35:21 am »
Hello, I'm trying to create a thread that takes an instance of the sf::Packet class as an argument, but everything is mixed up there.


sf::UdpSocket sock;

void server(sf::Packet pack, sf::Address addr, sf::Packet packet){
int a;
pack >> a;
std::cout<<a;
}

int main(){
sf::Address addr;
sf::Packet packet;
unsigned short port;
sock.bind(19132);
sock.receive(packet, addr, port);
std::thread thr(server, packet, addr, port);
thr.detach();
}

3
General discussions / Re: client floods the server
« on: December 21, 2021, 12:14:20 pm »
that is, to send, for example, 20 data per second?

4
General discussions / 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!

Pages: [1]