mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 05:13:59 +02:00
- attempt to disable packet throttling on windows
- added some network packet debug code
This commit is contained in:
@@ -93,6 +93,8 @@ const char *GAME_ARGS[] = {
|
||||
"--disable-opengl-checks",
|
||||
"--disable-streflop-checks",
|
||||
"--debug-network-packets",
|
||||
"--debug-network-packet-sizes",
|
||||
"--debug-network-packet-stats",
|
||||
"--enable-new-protocol",
|
||||
|
||||
"--create-data-archives",
|
||||
@@ -175,6 +177,8 @@ enum GAME_ARG_TYPE {
|
||||
GAME_ARG_DISABLE_STREFLOP_CAPS_CHECK,
|
||||
|
||||
GAME_ARG_DEBUG_NETWORK_PACKETS,
|
||||
GAME_ARG_DEBUG_NETWORK_PACKET_SIZES,
|
||||
GAME_ARG_DEBUG_NETWORK_PACKET_STATS,
|
||||
GAME_ARG_ENABLE_NEW_PROTOCOL,
|
||||
|
||||
GAME_ARG_CREATE_DATA_ARCHIVES,
|
||||
|
@@ -89,6 +89,21 @@ Mutex UPNP_Tools::mutexUPNP;
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
void DisablePacketThrottling() {
|
||||
//Open the registry key.
|
||||
wstring subKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile";
|
||||
HKEY keyHandle;
|
||||
DWORD dwDisposition;
|
||||
RegCreateKeyEx(HKEY_CURRENT_USER,subKey.c_str(),0, NULL, 0, KEY_ALL_ACCESS, NULL, &keyHandle, &dwDisposition);
|
||||
//Set the value.
|
||||
|
||||
DWORD disableThrottle = 0xffffffff;
|
||||
DWORD len = sizeof(disableThrottle);
|
||||
RegSetValueEx(keyHandle, l"NetworkThrottlingIndex", 0, REG_DWORD, &disableThrottle, len);
|
||||
RegCloseKey(keyHandle);
|
||||
}
|
||||
|
||||
|
||||
#define socklen_t int
|
||||
#define MAXHOSTNAME 254
|
||||
|
||||
@@ -227,6 +242,7 @@ Mutex UPNP_Tools::mutexUPNP;
|
||||
SocketManager Socket::wsaManager;
|
||||
|
||||
SocketManager::SocketManager() {
|
||||
DisablePacketThrottling();
|
||||
WSADATA wsaData;
|
||||
WORD wVersionRequested = MAKEWORD(2, 0);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("SocketManager calling WSAStartup...\n");
|
||||
|
Reference in New Issue
Block a user