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; continue;
//std::cout << m_playinfo.id << ": " << m_playinfo.name << ": " << conn->GetName() << std::endl; //std::cout << m_playinfo.id << ": " << m_playinfo.name << ": " << conn->GetName() << std::endl;
std::cout << out.id << ": " << out.position << std::endl; std::cout << out.id << ": " << out.position << std::endl;
sendPackTo<Output>(sock, &out, &m_bufout, conn->getAddr()); sendPackTo<Output>(sock, &out, &m_bufout, conn->getAddr());
} }
m_output_vector.pop_front(); m_output_vector.pop_front();
@ -107,6 +108,7 @@ void Connection::Run(World* world) {
in.keys.jump, false, el), world, el); in.keys.jump, false, el), world, el);
out.position = player.get()->GetPositionAbs(); out.position = player.get()->GetPositionAbs();
player.get()->GetPositionAbs().Afficher();
out.direction = in.direction; out.direction = in.direction;
out.timestamp = in.timestamp; out.timestamp = in.timestamp;
out.id = m_playinfo.id; out.id = m_playinfo.id;

View File

@ -200,7 +200,7 @@ void Server::Run() {
for (auto& [key, conn] : m_players) { // Creation des instances de joueurs et premier sync. 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)); conn->player = std::make_unique<Player>(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f));
Sync sync; Sync sync;
sync.position = conn->player->GetPosition(); sync.position = conn->player->GetPositionAbs();
sync.hp = conn->player->GetHP(); sync.hp = conn->player->GetHP();
sync.sid = key; sync.sid = key;
sync.ammo = 0; sync.ammo = 0;

View File

@ -1358,7 +1358,7 @@ void Engine::Render(float elapsedTime) {
for (auto& [key, player] : m_players) { for (auto& [key, player] : m_players) {
RemotePlayer* rt = static_cast<RemotePlayer*>(player); 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); rt->Render(m_animeAtlas, m_shader01, all, elapsedTime);
m_otherplayerpos = player->GetPosition(); // Aller chercher GetPosition des deux façon, voir si ça chie. m_otherplayerpos = player->GetPosition(); // Aller chercher GetPosition des deux façon, voir si ça chie.
} }