y tho
This commit is contained in:
parent
35c2a5be31
commit
f44b6cd7dc
@ -128,15 +128,18 @@ int Server::Ready() {
|
|||||||
|
|
||||||
if (recv(sock, m_buf.ptr, m_buf.len, 0) > 0) {
|
if (recv(sock, m_buf.ptr, m_buf.len, 0) > 0) {
|
||||||
PlayerInfo play;
|
PlayerInfo play;
|
||||||
|
/*
|
||||||
Packet pck = getPack(&m_buf);
|
Packet pck = getPack(&m_buf);
|
||||||
if (pck.type != PACKET_TYPE::LOGINF) {
|
if (pck.type != PACKET_TYPE::LOGINF) {
|
||||||
Log("Paquet invalide.", true, false);
|
Log("Paquet invalide.", true, false);
|
||||||
if (pck.type != PACKET_TYPE::ERR)
|
if (pck.type != PACKET_TYPE::ERR)
|
||||||
netprot::emptyPack(pck);
|
netprot::emptyPack(pck);
|
||||||
continue; // Passer au prochain appel si c'est pas un LoginInfo ou un LoginInfo invalide qui rentre.
|
continue; // Passer au prochain appel si c'est pas un LoginInfo ou un LoginInfo invalide qui rentre.
|
||||||
}
|
}*/
|
||||||
LoginInfo* log = (LoginInfo*)pck.ptr;
|
LoginInfo* log = new LoginInfo();
|
||||||
|
|
||||||
|
m_buf.len = BUFFER_LENGTH;
|
||||||
|
netprot::Deserialize(log, m_buf.ptr, m_buf.len);//(LoginInfo*)pck.ptr;
|
||||||
|
|
||||||
log->sid = getUniqueId();
|
log->sid = getUniqueId();
|
||||||
log->tid = 0; // TODO: À changer si on implemente un mode en equipe.
|
log->tid = 0; // TODO: À changer si on implemente un mode en equipe.
|
||||||
@ -164,6 +167,7 @@ int Server::Ready() {
|
|||||||
m_players[log->sid] = std::move(conn);
|
m_players[log->sid] = std::move(conn);
|
||||||
|
|
||||||
delete log;
|
delete log;
|
||||||
|
log = nullptr;
|
||||||
|
|
||||||
if (++nbrconn >= nbrjoueurs)
|
if (++nbrconn >= nbrjoueurs)
|
||||||
readystart = true;
|
readystart = true;
|
||||||
|
@ -325,7 +325,6 @@ void Engine::Init() {
|
|||||||
|
|
||||||
while (playname.size() < 1) {
|
while (playname.size() < 1) {
|
||||||
std::cout << "Veuillez entrer un nom de joueur: ";
|
std::cout << "Veuillez entrer un nom de joueur: ";
|
||||||
std::cin.ignore();
|
|
||||||
std::cin.getline(input, 32);
|
std::cin.getline(input, 32);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
playname = input;
|
playname = input;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user