shooter/engine/network/ReliableMsg.h

28 lines
506 B
C
Raw Normal View History

2021-09-13 15:53:43 +03:00
//
// Created by Neirokan on 30.04.2020
//
#ifndef ENGINE_RELIABLEMSG_H
#define ENGINE_RELIABLEMSG_H
#include <SFML/Network.hpp>
2021-10-28 16:58:02 +03:00
class ReliableMsg final {
2021-09-13 15:53:43 +03:00
private:
sf::Packet packet;
2021-10-28 16:58:02 +03:00
const sf::IpAddress address;
const sf::Uint16 port;
const double firstTry;
2021-09-13 15:53:43 +03:00
double lastTry;
public:
2021-10-31 11:39:08 +03:00
ReliableMsg(sf::Packet &packet, sf::IpAddress address, sf::Uint16 port);
2021-09-13 15:53:43 +03:00
2021-10-31 11:39:08 +03:00
ReliableMsg(const ReliableMsg &msg);
bool trySend(sf::UdpSocket &socket);
2021-09-13 15:53:43 +03:00
};
#endif //INC_3DZAVR_RELIABLEMSG_H