Fix initial connection state
This commit is contained in:
parent
1517005793
commit
1679c6dacd
@ -83,10 +83,13 @@ namespace network
|
||||
server_addr.sin_addr.s_addr = address;
|
||||
server_addr.sin_port = port;
|
||||
|
||||
if (bind(s, reinterpret_cast<sockaddr*>(&server_addr), sizeof(server_addr)) ==
|
||||
int retries = 0;
|
||||
while (bind(s, reinterpret_cast<sockaddr*>(&server_addr), sizeof(server_addr)) ==
|
||||
SOCKET_ERROR)
|
||||
{
|
||||
throw std::runtime_error("Failed to bind socket");
|
||||
if (++retries > 10) return;
|
||||
server_addr.sin_port = htons(ntohs(server_addr.sin_port) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,6 +134,8 @@ namespace network
|
||||
utils::hook::set<uint8_t>(0x142332E55_g, 0); // clear local net id
|
||||
utils::hook::jump(0x142332E72_g, 0x142332E8E_g); // skip checksum parsing
|
||||
|
||||
utils::hook::set<uint32_t>(0x14134C6E0_g, 4); // set initial connection state to "connecting"
|
||||
|
||||
// Fix netadr types
|
||||
//utils::hook::set<uint32_t>(0x142332DE5_g, game::NA_RAWIP); // raw socket type
|
||||
//utils::hook::set<uint32_t>(0x142332E00_g, game::NA_IP); // dw socket type
|
||||
|
Loading…
Reference in New Issue
Block a user