Skip to content

Commit f912794

Browse files
committed
add todo
1 parent 6331d7d commit f912794

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

server/src/main.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ void CMain::OnDelClient(int ClientNetID)
110110
{
111111
int ClientID = ClientNetToClient(ClientNetID);
112112
dbg_msg("main", "OnDelClient(ncid=%d, cid=%d)", ClientNetID, ClientID);
113-
//copy offline message for watchdog
114-
WatchdogMessage(ClientNetID,
115-
0, 0, 0, 0, 0, 0,
116-
0, 0, 0,0, 0, 0,
117-
0, 0, 0, 0, 0, 0,
118-
0, 0, 0,0, 0, 0,
119-
0, 0, 0, 0);
120113
if(ClientID >= 0 && ClientID < NET_MAX_CLIENTS)
121114
{
122115
Client(ClientID)->m_Connected = false;
123116
Client(ClientID)->m_ClientNetID = -1;
124117
Client(ClientID)->m_ClientNetType = NETTYPE_INVALID;
125118
mem_zero(&Client(ClientID)->m_Stats, sizeof(CClient::CStats));
126119
}
120+
//copy offline message for watchdog
121+
WatchdogMessage(ClientNetID,
122+
0, 0, 0, 0, 0, 0,
123+
0, 0, 0,0, 0, 0,
124+
0, 0, 0, 0, 0, 0,
125+
0, 0, 0,0, 0, 0,
126+
0, 0, 0, 0);
127127
}
128128

129129
int CMain::HandleMessage(int ClientNetID, char *pMessage)
@@ -353,6 +353,11 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
353353
time_t currentStamp = (long long)time(/*ago*/0);
354354
if ((currentStamp-Client(ClientID)->m_AlarmLastTime) > Watchdog(ID)->m_aInterval)
355355
{
356+
if (!Client(ClientID)->m_Stats.m_Online4 && !Client(ClientID)->m_Stats.m_Online6)
357+
{
358+
//休眠5分钟如果5分钟后状态发生了变更,消息不发出。
359+
printf("download\n");
360+
}
356361
Client(ClientID)->m_AlarmLastTime = currentStamp;
357362
CURL *curl;
358363
CURLcode res;

0 commit comments

Comments
 (0)