SQC-15_online #1

Merged
memartel_loc merged 349 commits from SQC-15_online into master 2023-12-10 17:41:26 -05:00
2 changed files with 11 additions and 4 deletions
Showing only changes of commit 498fb7baf7 - Show all commits

View File

@ -33,7 +33,7 @@ private:
std::map<Timestamp, netprot::Output> m_output_manifest;
std::map<Timestamp, netprot::Chat> m_chatlog;
SOCKET m_sock_tcp, m_sock_udp;
SOCKET m_sock;
sockaddr_in m_addr;
netprot::LoginInfo m_loginfo;
netprot::PlayerInfo m_playinfo;

View File

@ -144,7 +144,7 @@ int Server::Ready() {
//netprot::Serialize(&log, &buf, &buflen);
//send(sock, buf, buflen, 0);
//buflen = 150;
sendPack<netprot::LoginInfo>(sock, &log, &buf, &buflen);
netprot::sendPack<netprot::LoginInfo>(sock, &log, &buf, &buflen);
play.id = getUniqueId();
memcpy(play.name, log.name, std::strlen(log.name) + 1);
@ -152,7 +152,7 @@ int Server::Ready() {
//netprot::Serialize(&m_game, &buf, &buflen);
//send(sock, buf, buflen, 0);
sendPack<netprot::GameInfo>(sock, &m_game, &buf, &buflen);
netprot::sendPack<netprot::GameInfo>(sock, &m_game, &buf, &buflen);
Connection* conn = new Connection(sock, sockad, log, play);
m_players[log.sid] = conn;
@ -166,8 +166,15 @@ int Server::Ready() {
}
void Server::Run() {
char* buf = new char[BUFFER_LENGTH];
Log("Partie en cours...", false, false);
while (true) {
if (recv(m_sock_udp, buf, BUFFER_LENGTH, 0) > 0) {
}
}
}
inline std::string Server::LogTimestamp() {