begin player auth
This commit is contained in:
@@ -13,7 +13,7 @@ class Client : public StateMachine<Client, void, float> {
|
||||
std::shared_ptr<IClientSocket> m_Socket;
|
||||
|
||||
public:
|
||||
Client(const std::shared_ptr<IClientSocket>& a_Socket) : m_Socket(a_Socket) {}
|
||||
Client(const std::shared_ptr<IClientSocket>& a_Socket, const std::string& a_PlayerName);
|
||||
|
||||
void SendPacket(const protocol::PacketBase& a_Packet);
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
namespace td {
|
||||
namespace client {
|
||||
|
||||
class ClientState : public Client::State, private utils::SlotGuard {
|
||||
class ClientState : public Client::State, public protocol::PacketHandler, private utils::SlotGuard {
|
||||
public:
|
||||
ClientState(Client& a_Client);
|
||||
virtual ~ClientState() {}
|
||||
|
||||
protected:
|
||||
void SendPacket(const protocol::PacketBase& a_Packet);
|
||||
virtual void HandlePacket(const protocol::PacketBase& a_Packet) {}
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
|
||||
@@ -23,8 +23,8 @@ class GameState : public ClientState {
|
||||
return m_CurrentLerp;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void HandlePacket(const protocol::PacketBase& a_Packet) override;
|
||||
virtual void Handle(const protocol::packets::LockStepsPacket& a_LockStep) override;
|
||||
virtual void Handle(const protocol::packets::LockStepResponsePacket& a_LockStep) override;
|
||||
};
|
||||
|
||||
} // namespace client
|
||||
|
||||
21
include/client/state/LoggingState.h
Normal file
21
include/client/state/LoggingState.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <client/ClientState.h>
|
||||
#include <td/game/World.h>
|
||||
#include <td/simulation/ClientSimulation.h>
|
||||
|
||||
namespace td {
|
||||
namespace client {
|
||||
|
||||
class LoggingState : public ClientState {
|
||||
public:
|
||||
LoggingState(Client& a_Client, const std::string& a_PlayerName);
|
||||
~LoggingState();
|
||||
|
||||
virtual void Update(float a_Delta) override {}
|
||||
|
||||
virtual void Handle(const protocol::packets::PlayerJoinPacket& a_Packet) override;
|
||||
};
|
||||
|
||||
} // namespace client
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user