WIP Clients are working properly, servers are not.
This commit is contained in:
@@ -7,8 +7,7 @@ TCPServer::TCPServer()
|
||||
}
|
||||
|
||||
TCPServer::~TCPServer()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void TCPServer::readFromClients()
|
||||
{
|
||||
@@ -30,25 +29,6 @@ void TCPServer::readFromClients()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::clock_t currentTime = std::clock();
|
||||
// Send snapshot
|
||||
if (snapshotInterval < (1000 * (currentTime - previousSnapshotMessage) / (double)CLOCKS_PER_SEC)) {
|
||||
sendSnapshot();
|
||||
previousSnapshotMessage = currentTime;
|
||||
}
|
||||
|
||||
// Send pings each
|
||||
if (pingIntervalMs < (1000 * (currentTime - previousePingMessage) / (double)CLOCKS_PER_SEC)) {
|
||||
sendPing();
|
||||
previousePingMessage = currentTime;
|
||||
}
|
||||
|
||||
// Time out logic
|
||||
if (checkTimeOutInterval < (1000 * (currentTime - timOutTimer) / (double)CLOCKS_PER_SEC)) {
|
||||
checkForTimeOuts();
|
||||
timOutTimer = currentTime;
|
||||
}
|
||||
}
|
||||
|
||||
void TCPServer::acceptNewConnections()
|
||||
@@ -80,7 +60,7 @@ void TCPServer::parseConnect(Packet & packet)
|
||||
LOG_INFO("Parsing connections");
|
||||
// Check if player is already connected
|
||||
PlayerID playerID = GetPlayerIDFromEndpoint();
|
||||
if(playerID = -1){
|
||||
if (playerID = -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user