Daniele Bartolini 11 ani în urmă
părinte
comite
119311d44b
4 a modificat fișierele cu 9 adăugiri și 9 ștergeri
  1. 3 3
      engine/console_server.cpp
  2. 4 4
      engine/console_server.h
  3. 1 1
      engine/core/log.h
  4. 1 1
      engine/lua/lua_device.cpp

+ 3 - 3
engine/console_server.cpp

@@ -66,7 +66,7 @@ namespace console_server_internal
 	}
 	}
 }
 }
 
 
-void ConsoleServer::log_to_all(const char* msg, LogSeverity::Enum severity)
+void ConsoleServer::log(const char* msg, LogSeverity::Enum severity)
 {
 {
 	using namespace string_stream;
 	using namespace string_stream;
 	using namespace console_server_internal;
 	using namespace console_server_internal;
@@ -80,7 +80,7 @@ void ConsoleServer::log_to_all(const char* msg, LogSeverity::Enum severity)
 	json << "\"severity\":\"" << stt[severity] << "\",";
 	json << "\"severity\":\"" << stt[severity] << "\",";
 	json << "\"message\":\""; sanitize(json, msg) << "\"}";
 	json << "\"message\":\""; sanitize(json, msg) << "\"}";
 
 
-	send_to_all(c_str(json));
+	send(c_str(json));
 }
 }
 
 
 void ConsoleServer::send(TCPSocket client, const char* json)
 void ConsoleServer::send(TCPSocket client, const char* json)
@@ -90,7 +90,7 @@ void ConsoleServer::send(TCPSocket client, const char* json)
 	client.write(json, len);
 	client.write(json, len);
 }
 }
 
 
-void ConsoleServer::send_to_all(const char* json)
+void ConsoleServer::send(const char* json)
 {
 {
 	for (uint32_t i = 0; i < id_array::size(m_clients); i++)
 	for (uint32_t i = 0; i < id_array::size(m_clients); i++)
 	{
 	{

+ 4 - 4
engine/console_server.h

@@ -34,8 +34,6 @@ struct Client
 	}
 	}
 };
 };
 
 
-typedef IdArray<CE_MAX_CONSOLE_CLIENTS, Client> ClientArray;
-
 class ConsoleServer
 class ConsoleServer
 {
 {
 public:
 public:
@@ -45,13 +43,13 @@ public:
 	ConsoleServer(uint16_t port, bool wait);
 	ConsoleServer(uint16_t port, bool wait);
 	void shutdown();
 	void shutdown();
 
 
-	void log_to_all(const char* msg, LogSeverity::Enum severity = LogSeverity::INFO);
+	void log(const char* msg, LogSeverity::Enum severity = LogSeverity::INFO);
 
 
 	/// Collects requests from clients and processes them all.
 	/// Collects requests from clients and processes them all.
 	void update();
 	void update();
 
 
 	/// Sends the given JSON-encoded string to all clients.
 	/// Sends the given JSON-encoded string to all clients.
-	void send_to_all(const char* json);
+	void send(const char* json);
 
 
 private:
 private:
 
 
@@ -68,6 +66,8 @@ private:
 private:
 private:
 
 
 	TCPSocket m_server;
 	TCPSocket m_server;
+
+	typedef IdArray<CE_MAX_CONSOLE_CLIENTS, Client> ClientArray;
 	ClientArray m_clients;
 	ClientArray m_clients;
 };
 };
 
 

+ 1 - 1
engine/core/log.h

@@ -23,7 +23,7 @@ namespace log_internal
 			len = sizeof(buf) - 1;
 			len = sizeof(buf) - 1;
 
 
 		buf[len] = '\0';
 		buf[len] = '\0';
-		console_server_globals::console().log_to_all(buf, sev);
+		console_server_globals::console().log(buf, sev);
 		os::log(buf);
 		os::log(buf);
 	}
 	}
 
 

+ 1 - 1
engine/lua/lua_device.cpp

@@ -120,7 +120,7 @@ static int device_console_send(lua_State* L)
 	stack.pop(1);
 	stack.pop(1);
 	json << "}";
 	json << "}";
 
 
-	console_server_globals::console().send_to_all(c_str(json));
+	console_server_globals::console().send(c_str(json));
 	return 0;
 	return 0;
 }
 }