aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ClientCommandPacket.cpp
blob: 15aaefd0e48933727e35855270b8dfb008b1b19f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "stdafx.h"
#include "PacketListener.h"
#include "ClientCommandPacket.h"

ClientCommandPacket::ClientCommandPacket()
{
	action = 0;
}

ClientCommandPacket::ClientCommandPacket(int action)
{
	this->action = action;
}

void ClientCommandPacket::read(DataInputStream *dis)
{
	action = dis->readByte();
}

void ClientCommandPacket::write(DataOutputStream *dos)
{
	dos->writeByte(action & 0xff);
}

void ClientCommandPacket::handle(PacketListener *listener)
{
	listener->handleClientCommand(std::dynamic_pointer_cast<ClientCommandPacket>(shared_from_this()));
}

int ClientCommandPacket::getEstimatedSize()
{
	return 1;
}