| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innd */ |
/* LeafOK Innbbsd */ |
| 4 |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
| 5 |
/* */ |
/* */ |
| 6 |
/* Programmed by Leaf */ |
/* Programmed by Leaf */ |
| 7 |
/* E-mail:leaf@leafok.com QQ:6049044 */ |
/* E-mail:leaflet@leafok.com QQ:6049044 */ |
| 8 |
/* */ |
/* */ |
| 9 |
/* http://bbs.leafok.com */ |
/* http://bbs.leafok.com */ |
| 10 |
/* http://bbs.leafok.net */ |
/* http://bbs.leafok.net */ |
| 34 |
CDBVariant dbVar; |
CDBVariant dbVar; |
| 35 |
CString sql,out,cmd; |
CString sql,out,cmd; |
| 36 |
char temp[256]; |
char temp[256]; |
|
HANDLE hThreadCurrent; |
|
| 37 |
long u_online,u_anonymous,u_total; |
long u_online,u_anonymous,u_total; |
| 38 |
|
|
| 39 |
try |
try |
| 40 |
{ |
{ |
|
hThreadCurrent = GetCurrentThread(); |
|
|
|
|
| 41 |
u_online = 0; |
u_online = 0; |
| 42 |
sql = "select SID as cc from user_online group by SID"; |
sql = "select SID as cc from user_online group by SID"; |
| 43 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 84 |
this->s_send(out); |
this->s_send(out); |
| 85 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 86 |
{ |
{ |
| 87 |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); |
| 88 |
|
|
| 89 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 90 |
break; |
break; |
| 91 |
out.Trim(); |
out.Trim(); |
| 92 |
|
|
| 93 |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); |
| 94 |
|
|
| 95 |
if (sscanf(out,"%20s",temp) ==1) |
if (sscanf(out,"%20s",temp) ==1) |
| 96 |
cmd = strupr(temp); |
cmd = strupr(temp); |