File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,10 @@ bool NetworkManager::ShouldBlockConnection(const sf::IpAddress& ip)
279279 return true ;
280280 }
281281
282+ if (ip == sf::IpAddress::None) {
283+ return true ;
284+ }
285+
282286 if (this ->bannedIps .find (ip) != this ->bannedIps .end ()) {
283287 return true ;
284288 }
@@ -298,18 +302,18 @@ void NetworkManager::CheckConnection()
298302 client.IP = client.tcpSocket ->getRemoteAddress ();
299303
300304 if (this ->ShouldBlockConnection (client.IP )) {
301- GHOST_LOG (" Refused connection from " + client.IP .toString () + " - banned or IP already connected " );
305+ GHOST_LOG (" Refused connection from " + client.IP .toString () + " - blocked " );
302306 return ;
303307 }
304308
305- sf::Packet connection_packet;
306309 sf::SocketSelector conn_selector;
307310 conn_selector.add (*client.tcpSocket );
308311 if (!conn_selector.wait (sf::milliseconds (CONNECT_TIMEOUT))) {
309312 GHOST_LOG (" Connection timeout from " + client.IP .toString ());
310313 return ;
311314 }
312-
315+
316+ sf::Packet connection_packet;
313317 client.tcpSocket ->receive (connection_packet);
314318
315319 HEADER header;
You can’t perform that action at this time.
0 commit comments