클라이언트 리프레쉬 골자 추가.
서버는 단순 브로드캐스트 에코 서버로 해야 할 듯..
This commit is contained in:
@@ -71,7 +71,7 @@ std::int32_t main(std::int32_t argc, gsl::zstring* argv) {
|
|||||||
window.TryMoveToMonitor(0);
|
window.TryMoveToMonitor(0);
|
||||||
|
|
||||||
veng::Graphics graphics(&window);
|
veng::Graphics graphics(&window);
|
||||||
veng::Engine engine(&graphics, &tp);
|
veng::Engine engine(&graphics, &tp, &iocp);
|
||||||
|
|
||||||
engine.LoadModelAsset("assets/player.fbx", "player");
|
engine.LoadModelAsset("assets/player.fbx", "player");
|
||||||
engine.LoadModelAsset("assets/player_flame.fbx", "player_flame");
|
engine.LoadModelAsset("assets/player_flame.fbx", "player_flame");
|
||||||
|
|||||||
@@ -174,4 +174,12 @@ void Engine::Update() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Engine::NetworkUpload() {
|
||||||
|
//TODO: 작성하기
|
||||||
|
}
|
||||||
|
|
||||||
|
void Engine::RefreshFromServer() {
|
||||||
|
// TODO: 작성하기
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace veng
|
} // namespace veng
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Packet {
|
namespace Packet {
|
||||||
|
|
||||||
enum class Opcode {
|
enum class Opcode : std::uint16_t {
|
||||||
NOP,
|
NOP,
|
||||||
SPAWNMODEL,
|
SPAWNMODEL,
|
||||||
DESPAWNMODEL,
|
DESPAWNMODEL,
|
||||||
|
|||||||
@@ -4,14 +4,15 @@
|
|||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "physics.h"
|
#include "physics.h"
|
||||||
#include "utils/thread_pool.h"
|
#include "utils/thread_pool.h"
|
||||||
|
#include "socket/iocp.h"
|
||||||
|
|
||||||
namespace veng {
|
namespace veng {
|
||||||
|
|
||||||
class Engine {
|
class Engine {
|
||||||
public:
|
public:
|
||||||
Engine(gsl::not_null<Graphics*> vulkan_graphics,
|
Engine(gsl::not_null<Graphics*> vulkan_graphics,
|
||||||
utils::ThreadPool* thread_pool)
|
utils::ThreadPool* thread_pool, Network::IOCP* iocp)
|
||||||
: vulkan_graphics(vulkan_graphics), thread_pool_(thread_pool) {}
|
: vulkan_graphics(vulkan_graphics), thread_pool_(thread_pool), iocp_(iocp) {}
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
@@ -25,6 +26,9 @@ class Engine {
|
|||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
|
void NetworkUpload();
|
||||||
|
void RefreshFromServer();
|
||||||
|
|
||||||
std::function<void(Engine&)> BeginPlay = [](Engine& engine) {};
|
std::function<void(Engine&)> BeginPlay = [](Engine& engine) {};
|
||||||
std::function<void(Engine&, std::float_t delta_time)> Tick =
|
std::function<void(Engine&, std::float_t delta_time)> Tick =
|
||||||
[](Engine& engine, std::float_t delta_time) {};
|
[](Engine& engine, std::float_t delta_time) {};
|
||||||
@@ -41,6 +45,7 @@ class Engine {
|
|||||||
Loader asset_loader_;
|
Loader asset_loader_;
|
||||||
Physics physics_controller_;
|
Physics physics_controller_;
|
||||||
utils::ThreadPool* thread_pool_;
|
utils::ThreadPool* thread_pool_;
|
||||||
|
Network::IOCP* iocp_;
|
||||||
|
|
||||||
glm::ivec2 window_size_ = {0, 0};
|
glm::ivec2 window_size_ = {0, 0};
|
||||||
std::double_t last_frame_time_ = 0.0;
|
std::double_t last_frame_time_ = 0.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user