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 "TradeItemPacket.h"
6
7
8
9TradeItemPacket::TradeItemPacket()
10{
11 containerId = 0;
12 offer = 0;
13}
14
15TradeItemPacket::TradeItemPacket(int containerId, int offer)
16{
17 this->containerId = containerId;
18 this->offer = offer;
19}
20
21void TradeItemPacket::handle(PacketListener *listener)
22{
23 listener->handleTradeItem(shared_from_this());
24}
25
26void TradeItemPacket::read(DataInputStream *dis) //throws IOException
27{
28 containerId = dis->readInt();
29 offer = dis->readInt();
30}
31
32void TradeItemPacket::write(DataOutputStream *dos) //throws IOException
33{
34 dos->writeInt(containerId);
35 dos->writeInt(offer);
36}
37
38int TradeItemPacket::getEstimatedSize()
39{
40 return 8;
41}