direction fonctionnelle!

This commit is contained in:
MarcEricMartel
2023-10-24 07:32:16 -04:00
parent 2c3abff96f
commit ffeb95d953
3 changed files with 59 additions and 9 deletions

View File

@@ -104,16 +104,10 @@ int Server::Ready() {
buildIdList(ID_LIST_SIZE);
while (!readystart) {
sockaddr_in sockad;
#ifdef _WIN32
int addrlen = sizeof(sockad);
#else // maudit que c'est con, <20>a.
unsigned int addrlen = sizeof(sockad);
#endif
addrlen_t addrlen = sizeof(sockad);
SOCKET sock = accept(m_sock_tcp, (sockaddr*)&sockad, &addrlen);
@@ -223,7 +217,7 @@ void Server::Log(std::string str, bool is_error = false, bool is_fatal = false)
void Server::buildIdList(size_t size) {
std::set<uint64_t> lst;
do lst.insert(((uint64_t)rand() << 25) % 8675309); // EIGHT SIX SEVENFIVE THREE AUGHT NIIIIIIiIIiiIiINE!
do lst.insert(((uint64_t)rand() << 32 | rand())); // EIGHT SIX SEVENFIVE THREE AUGHT NIIIIIIiIIiiIiINE!
while (lst.size() < size);
m_ids = std::vector<uint64_t>(lst.begin(), lst.end());