[Node] Limit servers to 10 per ip
This commit is contained in:
parent
d8ab3ab422
commit
488706c71d
@ -132,6 +132,17 @@ namespace Components
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int count = 0;
|
||||||
|
for(auto entry : Node::Nodes)
|
||||||
|
{
|
||||||
|
if(entry.state != Node::STATE_INVALID && entry.address.getIP().full == address.getIP().full)
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count >= NODE_IP_LIMIT) return;
|
||||||
|
}
|
||||||
|
|
||||||
Node::NodeEntry entry;
|
Node::NodeEntry entry;
|
||||||
|
|
||||||
entry.lastHeard = Game::Sys_Milliseconds();
|
entry.lastHeard = Game::Sys_Milliseconds();
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
#define NODE_STORE_INTERVAL 1000 * 60* 1 // Store nodes every minute
|
#define NODE_STORE_INTERVAL 1000 * 60* 1 // Store nodes every minute
|
||||||
#define SESSION_TIMEOUT 1000 * 10 // 10 seconds session timeout
|
#define SESSION_TIMEOUT 1000 * 10 // 10 seconds session timeout
|
||||||
|
|
||||||
|
#define NODE_IP_LIMIT 15
|
||||||
|
|
||||||
#define NODE_VERSION 4
|
#define NODE_VERSION 4
|
||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
|
Loading…
Reference in New Issue
Block a user