File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Resources/Callbacks/Others Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ class PlayerEvents <playerId (MAX_PLAYERS)> {
58
58
// between both connections. When the two IPs connect in rapid order, temporary block the IP.
59
59
// This will result in closed connections for ingame players using the same IP address.
60
60
if (! strcmp (ipAddress, m_lastConnectionAddress, true )
61
- && (Time- > currentHighResolutionTime () - m_lastConnectionTimestamp) < DefaultDelayConnection) {
61
+ && (Time- > currentHighResolutionTime () - m_lastConnectionTimestamp) < DefaultDelayConnection
62
+ && GetServerUptimeMs () > 60 * 1000 /* Ignore the first minute after start **/ ) {
62
63
printf (" Blocking [%s ] for 30 minutes due to flooding." , ipAddress);
63
64
BlockIpAddress (ipAddress, BlockageDuration); // block the IP address
64
65
}
Original file line number Diff line number Diff line change 14
14
// Keep track of whether the main() method has finished executing.
15
15
new bool: g_mainFinishedExecuting = false ;
16
16
17
+ // Time (in milliseconds) at which the server started.
18
+ new g_serverStartTime;
19
+
20
+ GetServerUptimeMs () { return GetTickCount () - g_serverStartTime; }
21
+
17
22
public OnGameModeInit () {
18
23
// Block until the main() method has finished executing completely. Race conditions can occur in
19
24
// which certain information or classes are not yet initialized when we don't do this. Pawn
@@ -23,6 +28,8 @@ public OnGameModeInit() {
23
28
return 1 ;
24
29
}
25
30
31
+ g_serverStartTime = GetTickCount ();
32
+
26
33
// Part of Driver.
27
34
SetTimer (" UpdateVehicleTrailerStatus" , 1000 , 1 );
28
35
InitializeDriftTextDraws ();
You can’t perform that action at this time.
0 commit comments