Added support for 64bit ticks (#3768)
Fixes #3017 Thanks to Hercules for the idea and their implementation of it. This deprecates Windows XP support. If you want to use it to run your server on it, you have to forcefully enable it now. Since 64bit ticks do not exist on XP, you might encounter some issues that are already fixed on other OS.
This commit is contained in:
@@ -819,7 +819,7 @@ int WFIFOSET(int fd, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int do_sockets(int next)
|
||||
int do_sockets(t_tick next)
|
||||
{
|
||||
fd_set rfd;
|
||||
struct timeval timeout;
|
||||
@@ -841,8 +841,8 @@ int do_sockets(int next)
|
||||
#endif
|
||||
|
||||
// can timeout until the next tick
|
||||
timeout.tv_sec = next/1000;
|
||||
timeout.tv_usec = next%1000*1000;
|
||||
timeout.tv_sec = (long)(next/1000);
|
||||
timeout.tv_usec = (long)(next%1000*1000);
|
||||
|
||||
memcpy(&rfd, &readfds, sizeof(rfd));
|
||||
ret = sSelect(fd_max, &rfd, NULL, NULL, &timeout);
|
||||
@@ -955,7 +955,7 @@ int do_sockets(int next)
|
||||
typedef struct _connect_history {
|
||||
struct _connect_history* next;
|
||||
uint32 ip;
|
||||
uint32 tick;
|
||||
t_tick tick;
|
||||
int count;
|
||||
unsigned ddos : 1;
|
||||
} ConnectHistory;
|
||||
|
||||
Reference in New Issue
Block a user