Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
loginstartend.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_LOGINSTARTEND_H
13#define MINESERVER_LOGINSTARTEND_H
14
15#include <net/packet.h>
16#include <plugins/luaheaders.h>
17#include <types/uuid.h>
18
19#include <utility>
20
28class LoginStart : public IPacket
29{
30private:
37 void write(IMCStream *stream) override;
38
39public:
44 LoginStart() : IPacket(0x00) {}
45
52 std::string name;
53
59 void read(IMCStream *stream) override;
60
67 static void loadLua(lua_State *state, const char *baseNamespaceName);
68};
69
77class LoginSuccess : public IPacket
78{
79private:
85 void write(IMCStream *stream) override;
86
87public:
94 LoginSuccess(std::string username, const MinecraftUUID &uuid) : IPacket(0x02), username(std::move(username)), uuid(uuid) {}
95
102 std::string username;
109
116 void read(IMCStream *stream) override;
117
124 static void loadLua(lua_State *state, const char *baseNamespaceName);
125};
126
127#endif // MINESERVER_LOGINSTARTEND_H
Stream interface.
Definition stream.h:32
Interface for all Packets.
Definition packet.h:25
Login Start Packet.
Definition loginstartend.h:29
void read(IMCStream *stream) override
Reads Packet data.
Definition loginstartend.cpp:21
static void loadLua(lua_State *state, const char *baseNamespaceName)
Loads Packet to lua.
Definition loginstartend.cpp:26
LoginStart()
Construct a new Login Start object.
Definition loginstartend.h:44
std::string name
Name of the player.
Definition loginstartend.h:52
Login Success Packet.
Definition loginstartend.h:78
std::string username
Username of the player.
Definition loginstartend.h:102
void read(IMCStream *stream) override
Reads Packet Data.
Definition loginstartend.cpp:43
static void loadLua(lua_State *state, const char *baseNamespaceName)
Loads Packet to lua state.
Definition loginstartend.cpp:50
MinecraftUUID uuid
MinecraftUUID of the player.
Definition loginstartend.h:108
LoginSuccess(std::string username, const MinecraftUUID &uuid)
Construct a new Login Success object.
Definition loginstartend.h:94
MinecraftUUID compliant data holder.
Definition uuid.h:27
Utility header file for lua things.
The file containing the packet data.
The file containing MinecraftUUID logic.