
|
ServidorSAM Class Reference#include <ServidorSAM.h>
Collaboration diagram for ServidorSAM:
[legend]List of all members.
Detailed Description
Definition at line 86 of file ServidorSAM.h.
Constructor & Destructor Documentation
ServidorSAM::ServidorSAM |
( |
SocketHandler & |
|
) |
|
|
ServidorSAM::~ServidorSAM |
( |
|
) |
|
|
|
Definition at line 30 of file ServidorSAM.cpp. 00031 {
00032 static_cast<MyEventHandler&>(Handler()).ClearEvents(this);
00033 this->SetFlushBeforeClose();
00034 this->Close();
00035 }
|
Member Function Documentation
static list<string> ServidorSAM::GetBaneados |
( |
void |
|
) |
[inline, static] |
|
static int ServidorSAM::GetCanales |
( |
void |
|
) |
[inline, static] |
|
static int ServidorSAM::GetClientes |
( |
void |
|
) |
[inline, static] |
|
static string ServidorSAM::GetEstado |
( |
void |
|
) |
[inline, static] |
|
static string ServidorSAM::GetIpEscucha |
( |
void |
|
) |
[inline, static] |
|
static string ServidorSAM::GetPass |
( |
void |
|
) |
[inline, static] |
|
static int ServidorSAM::GetPuerto |
( |
void |
|
) |
[inline, static] |
|
void ServidorSAM::OnConnectFailed |
( |
void |
|
) |
|
|
void ServidorSAM::OnDelete |
( |
void |
|
) |
|
|
|
Definition at line 74 of file ServidorSAM.cpp.
References c, Cliente::canal, canales, clientes, clt_socket, Cliente::ip, ips, and Cliente::nick.
Referenced by OnConnectFailed(), and OnException(). 00075 {
00076 if(c.nick.length()>0)
00077 {
00078 list<Cliente>::iterator r;
00079 list<Canal>::iterator c1;
00080 hash_map<string,int,stringhasher>::iterator ip=ServidorSAM::ips.find(c.ip);
00081
00082 if(ip!=ServidorSAM::ips.end())
00083 ip->second--;
00084
00085 r=find(ServidorSAM::clientes.begin(),ServidorSAM::clientes.end(),c.nick);
00086 c1=c.canal;
00087 ServidorSAM::clientes.erase(r);
00088
00089 if(c1!=ServidorSAM::canales.end())
00090 {
00091 for(r=c1->usuarios.begin();r!=c1->usuarios.end();r++)
00092 {
00093 hash_map<string,ServidorSAM*,stringhasher>::iterator m1;
00094 m1=ServidorSAM::clt_socket.find(r->nick);
00095 if(m1!=ServidorSAM::clt_socket.end())
00096 m1->second->Send("273:" + c.nick);
00097 }
00098 r=find(c1->usuarios.begin(),c1->usuarios.end(),c.nick);
00099 c1->usuarios.erase(r);
00100 if(c1->usuarios.size()==0)
00101 ServidorSAM::canales.erase(c1);
00102 }
00103 }
00104
00105 hash_map<string,ServidorSAM*,stringhasher>::iterator it=ServidorSAM::clt_socket.find(c.nick);
00106 if(it!=ServidorSAM::clt_socket.end())
00107 ServidorSAM::clt_socket.erase(it);
00108 static_cast<MyEventHandler&>(Handler()).ClearEvents(this);
00109 }
|
void ServidorSAM::OnEvent |
( |
int |
|
) |
|
|
|
Definition at line 37 of file ServidorSAM.cpp.
References Cliente::act, baneados, c, Cliente::canal, clt_socket, Cliente::ip, Cliente::nick, and Cliente::ping. 00038 {
00039 if(c.act>150)
00040 {
00041 list<Canal>::iterator c1;
00042 list<Cliente>::iterator u1;
00043
00044 c1=c.canal;
00045 for(u1=c1->usuarios.begin();u1!=c1->usuarios.end();u1++)
00046 {
00047 hash_map<string,ServidorSAM*,stringhasher>::iterator m1;
00048 m1=ServidorSAM::clt_socket.find(u1->nick);
00049 if(m1!=ServidorSAM::clt_socket.end())
00050 m1->second->Send("276:" + c.nick);
00051 }
00052 ServidorSAM::baneados.push_back(c.ip);
00053 Send("955:Demasiada actividad!!");
00054 SetCloseAndDelete();
00055 }
00056 else
00057 {
00058 if(c.ping==true)
00059 {
00060 Send("955:Desconectado por falta de respuesta");
00061 SetCloseAndDelete();
00062 }
00063 else
00064 if(c.act==0)
00065 {
00066 c.ping=true;
00067 Send("285");
00068 }
00069 c.act=0;
00070 static_cast<MyEventHandler&>(Handler()).AddEvent(this,180,0);
00071 }
00072 }
|
void ServidorSAM::OnException |
( |
void |
|
) |
|
|
void ServidorSAM::OnLine |
( |
const string & |
|
) |
|
|
static void ServidorSAM::PonerBan |
( |
string |
b |
) |
[inline, static] |
|
static void ServidorSAM::QuitarBan |
( |
string |
b |
) |
[inline, static] |
|
static void ServidorSAM::SetEstado |
( |
string |
est |
) |
[inline, static] |
|
static void ServidorSAM::SetIpEscucha |
( |
string |
i |
) |
[inline, static] |
|
static void ServidorSAM::SetPass |
( |
string |
p |
) |
[inline, static] |
|
static void ServidorSAM::SetPuerto |
( |
int |
p |
) |
[inline, static] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
|