the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include <iostream>
3#include "InputOutputStream.h"
4#include "PacketListener.h"
5#include "KeepAlivePacket.h"
6
7
8
9KeepAlivePacket::KeepAlivePacket()
10{
11 id = 0;
12}
13
14KeepAlivePacket::KeepAlivePacket(int id)
15{
16 this->id = id;
17}
18
19void KeepAlivePacket::handle(PacketListener *listener)
20{
21 listener->handleKeepAlive(shared_from_this());
22}
23
24void KeepAlivePacket::read(DataInputStream *dis) //throws IOException
25{
26 id = dis->readInt();
27}
28
29void KeepAlivePacket::write(DataOutputStream *dos) //throws IOException
30{
31 dos->writeInt(id);
32}
33
34int KeepAlivePacket::getEstimatedSize()
35{
36 return 4;
37}
38
39bool KeepAlivePacket::canBeInvalidated()
40{
41 return true;
42}
43
44bool KeepAlivePacket::isInvalidatedBy(shared_ptr<Packet> packet)
45{
46 return true;
47}
48
49bool KeepAlivePacket::isAync()
50{
51 return true;
52}