Reliable message should now be working, further testing is to be done.
This commit is contained in:
@@ -70,7 +70,8 @@ protected:
|
||||
void disconnect();
|
||||
void parseMessageType(Packet& packet);
|
||||
void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID, const std::string& componentType);
|
||||
void parseConnect(Packet& packet);
|
||||
void parseUDPConnect(Packet& packet);
|
||||
void parseTCPConnect(Packet& packet);
|
||||
void parsePlayerConnected(Packet& packet);
|
||||
void parsePing();
|
||||
void parseKick();
|
||||
@@ -103,9 +104,8 @@ protected:
|
||||
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
|
||||
|
||||
private:
|
||||
UDPClient m_UDPClient;
|
||||
//TCPClient m_TCPClient;
|
||||
//TCPClient m_UDPClient;
|
||||
UDPClient m_Unreliable;
|
||||
TCPClient m_Reliable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,8 +10,8 @@ struct PlayerDefinition {
|
||||
boost::asio::ip::udp::endpoint Endpoint;
|
||||
unsigned int PacketID;
|
||||
std::clock_t StopTime;
|
||||
boost::asio::ip::address Address;
|
||||
unsigned short Port;
|
||||
boost::asio::ip::address TCPAddress;
|
||||
unsigned short TCPPort;
|
||||
// use for tcp connections
|
||||
boost::shared_ptr<boost::asio::ip::tcp::socket> TCPSocket;
|
||||
};
|
||||
|
||||
@@ -59,7 +59,8 @@ protected:
|
||||
|
||||
// Private member functions
|
||||
//int receive(char* data);
|
||||
void broadcast(Packet& packet);
|
||||
void reliableBroadcast(Packet& packet);
|
||||
void unreliableBroadcast(Packet& packet);
|
||||
void sendSnapshot();
|
||||
void addChildrenToPacket(Packet& packet, EntityID entityID);
|
||||
void sendPing();
|
||||
@@ -74,13 +75,9 @@ protected:
|
||||
void parseOnInputCommand(Packet& packet);
|
||||
void parseClientPing();
|
||||
void parsePing();
|
||||
void parseConnect(Packet & packet, PlayerDefinition & pd);
|
||||
void parseUDPConnect(Packet & packet);
|
||||
void parseTCPConnect(Packet & packet);
|
||||
void parseDisconnect();
|
||||
//// Pure virtual functions
|
||||
//virtual void readFromClients() = 0;
|
||||
//virtual void send(Packet& packet, PlayerDefinition & playerDefinition) = 0;
|
||||
//virtual void send(Packet& packet) = 0;
|
||||
|
||||
// Debug event
|
||||
EventRelay<Server, Events::InputCommand> m_EInputCommand;
|
||||
@@ -92,8 +89,8 @@ protected:
|
||||
EventRelay<Server, Events::ComponentDeleted> m_EComponentDeleted;
|
||||
bool OnComponentDeleted(const Events::ComponentDeleted& e);
|
||||
private:
|
||||
//TCPServer m_TCPServer;
|
||||
UDPServer m_UDPServer;
|
||||
TCPServer m_Reliable;
|
||||
UDPServer m_Unreliable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user