클라이언트 리프레쉬 골자 추가.

서버는 단순 브로드캐스트 에코 서버로 해야 할 듯..
This commit is contained in:
2025-06-11 20:27:41 +09:00
parent 50c9bd68fc
commit 13ea246990
4 changed files with 17 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
namespace Packet {
enum class Opcode {
enum class Opcode : std::uint16_t {
NOP,
SPAWNMODEL,
DESPAWNMODEL,

View File

@@ -4,14 +4,15 @@
#include "graphics.h"
#include "physics.h"
#include "utils/thread_pool.h"
#include "socket/iocp.h"
namespace veng {
class Engine {
public:
Engine(gsl::not_null<Graphics*> vulkan_graphics,
utils::ThreadPool* thread_pool)
: vulkan_graphics(vulkan_graphics), thread_pool_(thread_pool) {}
utils::ThreadPool* thread_pool, Network::IOCP* iocp)
: vulkan_graphics(vulkan_graphics), thread_pool_(thread_pool), iocp_(iocp) {}
void init();
@@ -25,6 +26,9 @@ class Engine {
void Update();
void NetworkUpload();
void RefreshFromServer();
std::function<void(Engine&)> BeginPlay = [](Engine& engine) {};
std::function<void(Engine&, std::float_t delta_time)> Tick =
[](Engine& engine, std::float_t delta_time) {};
@@ -41,6 +45,7 @@ class Engine {
Loader asset_loader_;
Physics physics_controller_;
utils::ThreadPool* thread_pool_;
Network::IOCP* iocp_;
glm::ivec2 window_size_ = {0, 0};
std::double_t last_frame_time_ = 0.0;