summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.h
blob: 11a376b17da087028088074a456b6575c3ff99a0 (plain) (blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

// Protocol18x.h

/*
Declares the 1.8.x protocol classes:
	- cProtocol180
		- release 1.8 protocol (#47)
(others may be added later in the future for the 1.8 release series)
*/





#pragma once

#include "Protocol.h"
#include "Protocol17x.h"
#include "../ByteBuffer.h"

#ifdef _MSC_VER
	#pragma warning(push)
	#pragma warning(disable:4127)
	#pragma warning(disable:4244)
	#pragma warning(disable:4231)
	#pragma warning(disable:4189)
	#pragma warning(disable:4702)
#endif

#ifdef _MSC_VER
	#pragma warning(pop)
#endif





// fwd:
namespace Json
{
	class Value;
}





class cProtocol180 :
	public cProtocol176
{
	typedef cProtocol176 super;
	
public:

	cProtocol180(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);

	virtual void SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
	virtual void SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override;
	virtual void SendChat(const AString & a_Message) override;
	virtual void SendChat(const cCompositeChat & a_Message) override;
	virtual void SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline) override {}
	virtual void SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override;
	virtual void SendLogin(const cPlayer & a_Player, const cWorld & a_World) override;

protected:

	virtual void HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer) override;

	// Packet handlers while in the Login state (m_State == 2):
	virtual void HandlePacketLoginStart(cByteBuffer & a_ByteBuffer) override;
	virtual void HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBuffer) override;
} ;