From 702a65c5b0e957cd13340ce6e9b1e5b7c7a8cc3d Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Mon, 27 Nov 2023 14:24:11 -0500 Subject: [PATCH] EEEEEEEH BO DEREK, EH --- SQCSim-srv/connection.cpp | 4 +++- SQCSim-srv/server.cpp | 2 +- SQCSim2021/engine.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SQCSim-srv/connection.cpp b/SQCSim-srv/connection.cpp index 33d970c..917a659 100644 --- a/SQCSim-srv/connection.cpp +++ b/SQCSim-srv/connection.cpp @@ -80,6 +80,7 @@ void Connection::sendPacks(SOCKET sock, std::unordered_mapGetName() << std::endl; std::cout << out.id << ": " << out.position << std::endl; + sendPackTo(sock, &out, &m_bufout, conn->getAddr()); } m_output_vector.pop_front(); @@ -107,13 +108,14 @@ void Connection::Run(World* world) { in.keys.jump, false, el), world, el); out.position = player.get()->GetPositionAbs(); + player.get()->GetPositionAbs().Afficher(); out.direction = in.direction; out.timestamp = in.timestamp; out.id = m_playinfo.id; m_output_manifest[out.timestamp] = out; m_output_vector.push_back(out); - + ++m_last_in; } } diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 6020e0f..0f485c1 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -200,7 +200,7 @@ void Server::Run() { for (auto& [key, conn] : m_players) { // Creation des instances de joueurs et premier sync. conn->player = std::make_unique(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f)); Sync sync; - sync.position = conn->player->GetPosition(); + sync.position = conn->player->GetPositionAbs(); sync.hp = conn->player->GetHP(); sync.sid = key; sync.ammo = 0; diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 6a565c3..0cbbc8a 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1358,7 +1358,7 @@ void Engine::Render(float elapsedTime) { for (auto& [key, player] : m_players) { RemotePlayer* rt = static_cast(player); - std::cout << key << ": "; rt->GetPosition().Afficher(); + //std::cout << key << ": "; rt->GetPosition().Afficher(); rt->Render(m_animeAtlas, m_shader01, all, elapsedTime); m_otherplayerpos = player->GetPosition(); // Aller chercher GetPosition des deux façon, voir si ça chie. }