Sync ees almöss de voork!

This commit is contained in:
MarcEricMartel
2023-11-27 17:44:52 -05:00
parent 10b8d77734
commit e89b5914fb
4 changed files with 64 additions and 51 deletions

View File

@@ -81,7 +81,7 @@ void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*
if (m_playinfo.id == conn->GetHash(false))
continue;
//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());
}
@@ -124,6 +124,7 @@ void Connection::Run(World* world) {
el = (double)(in.timestamp - last.timestamp) / 1000.;
std::cout << 1. / el << std::endl;
player.get()->SetDirection(in.direction);
std::cout << in.direction << std::endl;
player.get()->ApplyPhysics(player.get()->GetInput(in.keys.forward,
in.keys.backward,
in.keys.left,