Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_CLIENT_H
13#define MINESERVER_CLIENT_H
14
15#include <net/stream.h>
16#include <types/clientstate.h>
17#include <entities/player.h>
18#include <types/uuid.h>
19
26class Client
27{
28private:
29 ClientSocket sock;
30 IMCStream *stream;
31 bool isRunning;
32 ClientState state;
33 std::unique_ptr<std::byte[]> verifyToken;
34 Player player;
35
40 void loop();
41
47 void initiatePlayerJoin();
48
49public:
56 Client(const ClientSocket& sock);
61 ~Client();
62
67 void start();
76 void close(const std::string &reason = "");
77};
78
79#endif // MINESERVER_CLIENT_H
Network POSIX Client.
Definition network.h:42
Client class.
Definition client.h:27
void close(const std::string &reason="")
Stops the client.
Definition client.cpp:224
Client(const ClientSocket &sock)
Construct a new Client object.
Definition client.cpp:24
void start()
Starts the client, blocking.
Definition client.cpp:201
~Client()
Destroy the Client object.
Definition client.cpp:30
Stream interface.
Definition stream.h:32
Player object.
Definition player.h:25
The file containing just the enum of client state.
ClientState
Client State.
Definition clientstate.h:31
The file for handling player logic.
The file containing data for all of the streams.
The file containing MinecraftUUID logic.