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:
Lemongrass3110
2018-12-21 00:02:19 +01:00
committed by GitHub
parent 0d816975f7
commit 01f61cfa4f
46 changed files with 495 additions and 424 deletions

View File

@@ -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;