| 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 */ |
| 14 |
|
|
| 15 |
#include "StdAfx.h" |
#include "StdAfx.h" |
| 16 |
#include ".\bbsd.h" |
#include ".\bbsd.h" |
| 17 |
#include ".\nntp_active.h" |
#include ".\base_active.h" |
| 18 |
|
|
| 19 |
using namespace std; |
using namespace std; |
| 20 |
|
|
| 39 |
try |
try |
| 40 |
{ |
{ |
| 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 where current_action not in" |
| 43 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')" |
| 44 |
|
" group by SID"; |
| 45 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 46 |
while(!RS.IsEOF()) |
while(!RS.IsEOF()) |
| 47 |
{ |
{ |
| 51 |
RS.Close(); |
RS.Close(); |
| 52 |
|
|
| 53 |
u_anonymous = 0; |
u_anonymous = 0; |
| 54 |
sql = "select SID as cc from user_online where UID=0 group by SID"; |
sql = "select SID as cc from user_online where UID=0 and current_action not in" |
| 55 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')" |
| 56 |
|
" group by SID"; |
| 57 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 58 |
while(!RS.IsEOF()) |
while(!RS.IsEOF()) |
| 59 |
{ |
{ |
| 82 |
"注册用户数[\033[36m%ld\033[32m]\r\n" |
"注册用户数[\033[36m%ld\033[32m]\r\n" |
| 83 |
"\033[1;37m本站目前尚未开设telnet服务 请使用Web方式访问\r\n\r\n" |
"\033[1;37m本站目前尚未开设telnet服务 请使用Web方式访问\r\n\r\n" |
| 84 |
"\033[1;32m http://%s \033[m\r\n", |
"\033[1;32m http://%s \033[m\r\n", |
| 85 |
this->innd_name,u_online,MAX_THREAD,u_anonymous,u_total, |
this->innd_name,u_online,MAX_CLIENT,u_anonymous,u_total, |
| 86 |
this->innd_server,this->innd_server); |
this->innd_server,this->innd_server); |
| 87 |
|
|
| 88 |
this->s_send(out); |
this->s_send(out); |
| 89 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 90 |
{ |
{ |
| 91 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); |
| 92 |
|
|
| 93 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 94 |
break; |
break; |
| 95 |
out.Trim(); |
out.Trim(); |
| 96 |
|
|
| 97 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); |
| 98 |
|
|
| 99 |
if (sscanf(out,"%20s",temp) ==1) |
if (sscanf(out,"%20s",temp) ==1) |
| 100 |
cmd = strupr(temp); |
cmd = strupr(temp); |
| 101 |
else |
else |
| 136 |
|
|
| 137 |
int bbsd::Shutdown(void) |
int bbsd::Shutdown(void) |
| 138 |
{ |
{ |
| 139 |
nntp_active nntpClient; |
base_active nntpClient; |
| 140 |
|
|
| 141 |
if (this->thread_terminate) |
if (this->thread_terminate) |
| 142 |
return 1; |
return 1; |