Update server.cpp

This commit is contained in:
MarcEricMartel 2023-10-23 16:54:09 -04:00
parent ecfe5b893b
commit fc4aa20005

View File

@ -162,13 +162,17 @@ int Server::Ready() {
void Server::Run() {
char* buf = new char[BUFFER_LENGTH];
uint32_t buflen = BUFFER_LENGTH;
netprot::Input in;
Log("Partie en cours...", false, false);
while (true) {
if (recv(m_sock_udp, buf, BUFFER_LENGTH, 0) > 0) {
Deserialize(&in, buf, buflen);
std::cout << "Id: " << in.sid << "\r\n"
<< "Direction: { " << in.direction.x << ", " << in.direction.y << ", " << in.direction.z << " }" << "\r\n";
}
std::cout << "!" << std::endl;
}
}