This commit is contained in:
ttewrrr committed 2026-03-08 17:30:00 +01:00
1 parent f8ef076e70
commit 27532eb206
3025 files changed
-670604

No files matched your search

-48
View File
@@ -1,48 +0,0 @@
#include "stdafx.h"
#include <iostream>
#include "InputOutputStream.h"
#include "SharedConstants.h"
#include "PacketListener.h"
#include "DisconnectPacket.h"
DisconnectPacket::DisconnectPacket()
{
reason = eDisconnect_None;
}
DisconnectPacket::DisconnectPacket(eDisconnectReason reason)
{
this->reason = reason;
}
void DisconnectPacket::read(DataInputStream *dis) //throws IOException
{
reason = (eDisconnectReason)dis->readInt();
}
void DisconnectPacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeInt((int)reason);
}
void DisconnectPacket::handle(PacketListener *listener)
{
listener->handleDisconnect(shared_from_this());
}
int DisconnectPacket::getEstimatedSize()
{
return sizeof(eDisconnectReason);
}
bool DisconnectPacket::canBeInvalidated()
{
return true;
}
bool DisconnectPacket::isInvalidatedBy(shared_ptr<Packet> packet)
{
return true;
}