SQC-15_online #1
@ -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;
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user