EEEEEEEH BO DEREK, EH

This commit is contained in:
MarcEricMartel 2023-11-27 14:24:11 -05:00
parent b6d5975648
commit 702a65c5b0
3 changed files with 5 additions and 3 deletions

View File

@ -80,6 +80,7 @@ void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*
continue;
//std::cout << m_playinfo.id << ": " << m_playinfo.name << ": " << conn->GetName() << std::endl;
std::cout << out.id << ": " << out.position << std::endl;
sendPackTo<Output>(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;
}
}

View File

@ -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<Player>(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;

View File

@ -1358,7 +1358,7 @@ void Engine::Render(float elapsedTime) {
for (auto& [key, player] : m_players) {
RemotePlayer* rt = static_cast<RemotePlayer*>(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.
}