Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
885 B · 48 lines
C++
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#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;}