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 "ContainerAckPacket.h"
6
7
8
9ContainerAckPacket::ContainerAckPacket()
10{
11 containerId = 0;
12 uid = 0;
13 accepted = 0;
14}
15
16ContainerAckPacket::ContainerAckPacket(int containerId, short uid, bool accepted)
17{
18 this->containerId = containerId;
19 this->uid = uid;
20 this->accepted = accepted;
21}
22
23void ContainerAckPacket::handle(PacketListener *listener)
24{
25 listener->handleContainerAck(shared_from_this());
26}
27
28void ContainerAckPacket::read(DataInputStream *dis) //throws IOException
29{
30 containerId = dis->readByte();
31 uid = dis->readShort();
32 accepted = dis->readByte() != 0;
33}
34
35void ContainerAckPacket::write(DataOutputStream *dos) //throws IOException
36{
37 dos->writeByte(containerId);
38 dos->writeShort(uid);
39 dos->writeByte(accepted ? 1 : 0);
40}
41
42int ContainerAckPacket::getEstimatedSize()
43{
44 return 4;
45}