uint16_t port,
uint16_t localPort,
int to)
- : running(false),
- stopped(true),
- timeout(to)
+ : timeout(to),
+ running(false),
+ stopped(true)
{
uint32_t ip = inet_addr(server.c_str());
if (ip == INADDR_NONE)
{
PROTO * protoPtr = static_cast<PROTO *>(data);
protoPtr->Run();
+return NULL;
}
bool PROTO::Start()
if (it != processors.end())
return (this->*it->second)(buffer, user);
+printfd(__FILE__, "PROTO::HandlePacket() - invalid packet signature: '%s'\n", packetName.c_str());
+
return false;
}
const ERR_8 * packet = static_cast<const ERR_8 *>(buffer);
const char * ptr = static_cast<const char *>(buffer);
-for (int i = 0; i < sizeof(packet) / 8; i++)
+for (size_t i = 0; i < sizeof(ERR_8) / 8; i++)
Blowfish_Decrypt(user->GetCtx(), (uint32_t *)(ptr + i * 8), (uint32_t *)(ptr + i * 8 + 4));
//uint32_t len = packet->len;
bool Connect(uint32_t ip);
bool Disconnect(uint32_t ip);
+
+ size_t UserCount() const { return users.size(); }
private:
BLOWFISH_CTX ctx;
struct sockaddr_in localAddr;