2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Remove some eap stupid

This commit is contained in:
2012-02-25 22:56:30 -05:00
parent 29f2bc2547
commit bd6300d6c7
3 changed files with 33 additions and 69 deletions

View File

@ -1698,9 +1698,9 @@ void CliAuConn::AutoPing () {
void CliAuConn::StopAutoPing () { void CliAuConn::StopAutoPing () {
critsect.Enter(); critsect.Enter();
{ {
if (AsyncTimer * timer = pingTimer) { if (pingTimer) {
AsyncTimerDeleteCallback(pingTimer, CliAuConnTimerDestroyed);
pingTimer = nil; pingTimer = nil;
AsyncTimerDeleteCallback(timer, CliAuConnTimerDestroyed);
} }
} }
critsect.Leave(); critsect.Leave();
@ -1708,30 +1708,18 @@ void CliAuConn::StopAutoPing () {
//============================================================================ //============================================================================
void CliAuConn::TimerPing () { void CliAuConn::TimerPing () {
// Send a ping request
#if 0 pingSendTimeMs = GetNonZeroTimeMs();
// if the time difference between when we last sent a ping and when we last
// heard from the server is >= 3x the ping interval, the socket is stale.
if (pingSendTimeMs && abs(int(pingSendTimeMs - lastHeardTimeMs)) >= kPingTimeoutMs) {
// ping timed out, disconnect the socket
AsyncSocketDisconnect(sock, true);
}
else
#endif
{
// Send a ping request
pingSendTimeMs = GetNonZeroTimeMs();
const uintptr_t msg[] = { const uintptr_t msg[] = {
kCli2Auth_PingRequest, kCli2Auth_PingRequest,
pingSendTimeMs, pingSendTimeMs,
0, // not a transaction 0, // not a transaction
0, // no payload 0, // no payload
nil nil
}; };
Send(msg, arrsize(msg)); Send(msg, arrsize(msg));
}
} }
//============================================================================ //============================================================================

View File

@ -445,9 +445,9 @@ void CliGmConn::AutoPing () {
void CliGmConn::StopAutoPing () { void CliGmConn::StopAutoPing () {
critsect.Enter(); critsect.Enter();
{ {
if (AsyncTimer * timer = pingTimer) { if (pingTimer) {
AsyncTimerDeleteCallback(pingTimer, CliGmConnTimerDestroyed);
pingTimer = nil; pingTimer = nil;
AsyncTimerDeleteCallback(timer, CliGmConnTimerDestroyed);
} }
} }
critsect.Leave(); critsect.Leave();
@ -455,27 +455,15 @@ void CliGmConn::StopAutoPing () {
//============================================================================ //============================================================================
void CliGmConn::TimerPing () { void CliGmConn::TimerPing () {
// Send a ping request
pingSendTimeMs = GetNonZeroTimeMs();
#if 0 const uintptr_t msg[] = {
// if the time difference between when we last sent a ping and when we last kCli2Game_PingRequest,
// heard from the server is >= 3x the ping interval, the socket is stale. pingSendTimeMs
if (pingSendTimeMs && abs(int(pingSendTimeMs - lastHeardTimeMs)) >= kPingTimeoutMs) { };
// ping timed out, disconnect the socket
AsyncSocketDisconnect(sock, true);
}
else
#endif
{
// Send a ping request
pingSendTimeMs = GetNonZeroTimeMs();
const uintptr_t msg[] = { Send(msg, arrsize(msg));
kCli2Game_PingRequest,
pingSendTimeMs
};
Send(msg, arrsize(msg));
}
} }
//============================================================================ //============================================================================

View File

@ -636,9 +636,9 @@ void CliGkConn::AutoPing () {
void CliGkConn::StopAutoPing () { void CliGkConn::StopAutoPing () {
critsect.Enter(); critsect.Enter();
{ {
if (AsyncTimer * timer = pingTimer) { if (pingTimer) {
AsyncTimerDeleteCallback(pingTimer, CliGkConnTimerDestroyed);
pingTimer = nil; pingTimer = nil;
AsyncTimerDeleteCallback(timer, CliGkConnTimerDestroyed);
} }
} }
critsect.Leave(); critsect.Leave();
@ -646,30 +646,18 @@ void CliGkConn::StopAutoPing () {
//============================================================================ //============================================================================
void CliGkConn::TimerPing () { void CliGkConn::TimerPing () {
// Send a ping request
#if 0 pingSendTimeMs = GetNonZeroTimeMs();
// if the time difference between when we last sent a ping and when we last
// heard from the server is >= 3x the ping interval, the socket is stale.
if (pingSendTimeMs && abs(int(pingSendTimeMs - lastHeardTimeMs)) >= kPingTimeoutMs) {
// ping timed out, disconnect the socket
AsyncSocketDisconnect(sock, true);
}
else
#endif
{
// Send a ping request
pingSendTimeMs = GetNonZeroTimeMs();
const uintptr_t msg[] = { const uintptr_t msg[] = {
kCli2GateKeeper_PingRequest, kCli2GateKeeper_PingRequest,
pingSendTimeMs, pingSendTimeMs,
0, // not a transaction 0, // not a transaction
0, // no payload 0, // no payload
nil nil
}; };
//Send(msg, arrsize(msg)); Send(msg, arrsize(msg));
}
} }
//============================================================================ //============================================================================