Update server.cpp
This commit is contained in:
parent
ecfe5b893b
commit
fc4aa20005
@ -162,13 +162,17 @@ int Server::Ready() {
|
|||||||
|
|
||||||
void Server::Run() {
|
void Server::Run() {
|
||||||
char* buf = new char[BUFFER_LENGTH];
|
char* buf = new char[BUFFER_LENGTH];
|
||||||
|
uint32_t buflen = BUFFER_LENGTH;
|
||||||
|
netprot::Input in;
|
||||||
Log("Partie en cours...", false, false);
|
Log("Partie en cours...", false, false);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (recv(m_sock_udp, buf, BUFFER_LENGTH, 0) > 0) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user