This commit is contained in:
2025-02-16 21:36:05 +06:00
parent dce0272653
commit 133782b185
18 changed files with 698 additions and 409 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include "Abstract.hpp"
#include "Common/Abstract.hpp"
#include "Common/Async.hpp"
#include "Common/Lockable.hpp"
#include "Common/Net.hpp"
@@ -31,10 +32,6 @@ class ServerSession : public AsyncObject, public IServerSession, public ISurface
TOS::Logger LOG = "ServerSession";
struct {
glm::quat Quat;
} Camera;
boost::lockfree::spsc_queue<ParsedPacket*> NetInputPackets;
// PYR - поворот камеры по осям xyz в радианах, PYR_Offset для сглаживание поворота
@@ -43,6 +40,17 @@ class ServerSession : public AsyncObject, public IServerSession, public ISurface
static constexpr float PYR_TIME_DELTA = 30;
GlobalTime GTime;
struct {
bool W = false, A = false, S = false, D = false, SHIFT = false, SPACE = false;
bool CTRL = false;
void clear()
{
std::memset(this, 0, sizeof(*this));
}
} Keys;
Pos::Object Pos = Pos::Object(0), Speed = Pos::Object(0);
public:
// Нужен сокет, на котором только что был согласован игровой протокол (asyncInitGameProtocol)
ServerSession(asio::io_context &ioc, std::unique_ptr<Net::AsyncSocket> &&socket, IRenderSession *rs = nullptr)