This commit is contained in:
False.Genesis 2007-01-05 23:53:53 +00:00
parent 1f735744a6
commit a5c454d6dc

View File

@ -120,7 +120,7 @@ void RealmSocket::Start(void)
void RealmSocket::Stop(void) void RealmSocket::Stop(void)
{ {
_valid=false; _valid=false;
this->Close(); this->SetCloseAndDelete();
memset(_m2,0,20); memset(_m2,0,20);
_key=0; _key=0;
} }
@ -180,20 +180,25 @@ void RealmSocket::_HandleRealmList(void)
void RealmSocket::OnRead(void) void RealmSocket::OnRead(void)
{ {
TcpSocket::OnRead(); TcpSocket::OnRead();
bool known=false;
printf("RealmSocket::OnRead() %u bytes\n",ibuf.GetLength()); printf("RealmSocket::OnRead() %u bytes\n",ibuf.GetLength());
if(!ibuf.GetLength()) if(!ibuf.GetLength())
return; return;
uint8 cmd, i=0; uint8 cmd, i=0;
ibuf.SoftRead((char*)&cmd, 1); ibuf.SoftRead((char*)&cmd, 1);
while(table[i].handler!=NULL) for(uint8 i=0;table[i].handler!=NULL;i++)
{ {
if(table[i].cmd==cmd) if(table[i].cmd==cmd)
{ {
(*this.*table[i].handler)(); (*this.*table[i].handler)();
known=true;
break; break;
} }
} }
// unk packet if(!known)
{
printf("RealmSocket: Got unknown packet, cmd=%u\n",cmd);
}
} }
/* /*