Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
HandshakePacket Class Reference

Handshake Packet. More...

#include <handshake.h>

Inheritance diagram for HandshakePacket:
IPacket

Public Member Functions

 HandshakePacket ()
 Construct a new Handshake Packet object.
 
 ~HandshakePacket () override=default
 Destroy the Handshake Packet object.
 
void read (IMCStream *stream) override
 Read Packet Data.
 
- Public Member Functions inherited from IPacket
virtual ~IPacket ()=default
 Destroy the IPacket object.
 
void send (IMCStream *stream)
 Sends a Packet in Minecraft format.
 

Static Public Member Functions

static void loadLua (lua_State *state, const char *baseNamespaceName)
 Loads packet as lua class.
 

Public Attributes

int protocolVersion {}
 Protocol Version.
 
std::string serverAddress
 Server Address.
 
unsigned short serverPort {}
 Server Port.
 
ClientState nextState = ClientState::HANDSHAKE
 Next State.
 
- Public Attributes inherited from IPacket
int id
 Packet Id.
 

Protected Member Functions

void write (IMCStream *stream) override
 Write Packet Data.
 
- Protected Member Functions inherited from IPacket
 IPacket (int id)
 Construct a new IPacket object.
 

Detailed Description

Handshake Packet.

First packet that is read by the server from the client. No writing should be involved.

Member Function Documentation

◆ loadLua()

void HandshakePacket::loadLua ( lua_State * state,
const char * baseNamespaceName )
static

Loads packet as lua class.

Parameters
statelua state to load to
baseNamespaceNamethe base namespace name to load to

◆ read()

void HandshakePacket::read ( IMCStream * stream)
overridevirtual

Read Packet Data.

Reads handshake data from the stream

Parameters
streamthe stream to read from

Implements IPacket.

◆ write()

void HandshakePacket::write ( IMCStream * stream)
overrideprotectedvirtual

Write Packet Data.

Should not be called ! Handshake packet should only be read, not written to !

Parameters
streamthe stream to write to
Deprecated
Do not call this function

Implements IPacket.

Member Data Documentation

◆ nextState

ClientState HandshakePacket::nextState = ClientState::HANDSHAKE

Next State.

The next state that the client is asking to do, 1 for status, 2 for login.

◆ protocolVersion

int HandshakePacket::protocolVersion {}

Protocol Version.

The protocol version of the client connecting to the server.

◆ serverAddress

std::string HandshakePacket::serverAddress

Server Address.

The server address that the client used to connect to the server.

◆ serverPort

unsigned short HandshakePacket::serverPort {}

Server Port.

The port that the client used to connect to the server.


The documentation for this class was generated from the following files: