aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ClientCommandPacket.cpp
blob: 4245fc3fa289e6126d8c921ef91ac6daf8027591 (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(dynamic_pointer_cast<ClientCommandPacket>(shared_from_this()));
}

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