Ajout CMakeLists.txt pour compiler le serveur en Linux
This commit is contained in:
		| @@ -85,7 +85,7 @@ int Server::Ready() { | ||||
|  | ||||
| 	while (!readystart) { | ||||
| 		sockaddr_in sockad; | ||||
| 		int addrlen = sizeof(sockad); | ||||
| 		unsigned int addrlen = sizeof(sockad); | ||||
| 		SOCKET sock = accept(m_sock_tcp, (sockaddr*)&sockad, &addrlen); | ||||
|  | ||||
| 		if (sock < 0) | ||||
| @@ -140,7 +140,7 @@ void Server::Run() { | ||||
| 	Log("Partie en cours...", false, false); | ||||
| } | ||||
|  | ||||
| inline std::string Server::Timestamp() { | ||||
| inline std::string Server::LogTimestamp() { | ||||
| 	time_t rawtime; | ||||
| 	struct tm timeinfo; | ||||
| 	char buffer[80]; | ||||
| @@ -162,11 +162,11 @@ inline std::string Server::Timestamp() { | ||||
| void Server::Log(std::string str, bool is_error = false, bool is_fatal = false) { | ||||
| 	switch (m_log) { | ||||
| 	case LOG_DEST::LOGFILE: | ||||
| 		m_logfile << Timestamp() << (is_fatal ? "FATAL " : "") << (is_error ? "ERROR " : "") << str << std::endl; | ||||
| 		m_logfile << LogTimestamp() << (is_fatal ? "FATAL " : "") << (is_error ? "ERROR " : "") << str << std::endl; | ||||
| 		break; | ||||
| 	case LOG_DEST::CONSOLE: | ||||
| 	default: | ||||
| 		std::cout << Timestamp() << (is_fatal ? "FATAL " : "") << (is_error ? "ERROR " : "") << str << std::endl; | ||||
| 		std::cout << LogTimestamp() << (is_fatal ? "FATAL " : "") << (is_error ? "ERROR " : "") << str << std::endl; | ||||
| 		break; | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user