diff --git a/sources.cmake b/sources.cmake index 181714719..e39cd2546 100644 --- a/sources.cmake +++ b/sources.cmake @@ -1,5 +1,5 @@ # Modify this file to change the last-modified date when you add/remove a file. -# This will then trigger a new cmake run automatically. +# This will then trigger a new cmake run automatically. file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp") file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp") file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*") diff --git a/src/network/server_console.cpp b/src/network/network_console.cpp similarity index 92% rename from src/network/server_console.cpp rename to src/network/network_console.cpp index 6d2c7e708..d95b30c47 100644 --- a/src/network/server_console.cpp +++ b/src/network/network_console.cpp @@ -16,7 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "network/server_console.hpp" +#include "network/network_console.hpp" #include "main_loop.hpp" #include "network/protocol_manager.hpp" @@ -43,41 +43,41 @@ #include #endif -ServerConsole::ServerConsole() +NetworkConsole::NetworkConsole() { m_localhost = NULL; m_thread_keyboard = NULL; } // ---------------------------------------------------------------------------- -ServerConsole::~ServerConsole() +NetworkConsole::~NetworkConsole() { if (m_thread_keyboard) pthread_cancel(*m_thread_keyboard);//, SIGKILL); } // ---------------------------------------------------------------------------- -void ServerConsole::run() +void NetworkConsole::run() { if (enet_initialize() != 0) { - Log::error("ServerConsole", "Could not initialize enet."); + Log::error("NetworkConsole", "Could not initialize enet."); return; } - Log::info("ServerConsole", "Host initialized."); + Log::info("NetworkConsole", "Host initialized."); // listen keyboard console input m_thread_keyboard = new pthread_t; pthread_create(m_thread_keyboard, NULL, mainLoop, this); - Log::info("ServerConsole", "Ready."); + Log::info("NetworkConsole", "Ready."); } // run // ---------------------------------------------------------------------------- -void* ServerConsole::mainLoop(void* data) +void* NetworkConsole::mainLoop(void* data) { - ServerConsole *me = static_cast(data); + NetworkConsole *me = static_cast(data); std::string str = ""; bool stop = false; while (!stop) @@ -197,7 +197,7 @@ void* ServerConsole::mainLoop(void* data) } // mainLoop // ---------------------------------------------------------------------------- -void ServerConsole::kickAllPlayers() +void NetworkConsole::kickAllPlayers() { const std::vector &peers = STKHost::get()->getPeers(); for (unsigned int i = 0; i < peers.size(); i++) @@ -207,7 +207,7 @@ void ServerConsole::kickAllPlayers() } // kickAllPlayers // ---------------------------------------------------------------------------- -void ServerConsole::sendPacket(const NetworkString& data, bool reliable) +void NetworkConsole::sendPacket(const NetworkString& data, bool reliable) { m_localhost->broadcastPacket(data, reliable); } // sendPacket diff --git a/src/network/server_console.hpp b/src/network/network_console.hpp similarity index 88% rename from src/network/server_console.hpp rename to src/network/network_console.hpp index 99b5bb92b..16cf9228a 100644 --- a/src/network/server_console.hpp +++ b/src/network/network_console.hpp @@ -16,8 +16,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#ifndef SERVER_CONSOLE_HPP -#define SERVER_CONSOLE_HPP +#ifndef HEADER_NETWORK_CONSOLE_HPP +#define HEADER_NETWORK_CONSOLE_HPP #include "utils/types.hpp" @@ -26,7 +26,7 @@ class NetworkString; class STKHost; -class ServerConsole +class NetworkConsole { protected: @@ -39,8 +39,8 @@ protected: static void* mainLoop(void* data); public: - ServerConsole(); - virtual ~ServerConsole(); + NetworkConsole(); + virtual ~NetworkConsole(); virtual void run(); @@ -53,6 +53,6 @@ public: virtual bool isServer() { return true; } -}; // class ServerConsole +}; // class NetworkConsole #endif // SERVER_CONSOLE_HPP diff --git a/src/network/protocols/server_lobby_room_protocol.cpp b/src/network/protocols/server_lobby_room_protocol.cpp index 998753397..3438ec2b0 100644 --- a/src/network/protocols/server_lobby_room_protocol.cpp +++ b/src/network/protocols/server_lobby_room_protocol.cpp @@ -29,7 +29,6 @@ #include "network/protocols/start_server.hpp" #include "network/protocols/start_game_protocol.hpp" #include "network/protocol_manager.hpp" -#include "network/server_console.hpp" #include "network/stk_host.hpp" #include "network/stk_peer.hpp" #include "online/online_profile.hpp" diff --git a/src/network/stk_host.cpp b/src/network/stk_host.cpp index a0cd11ccf..85b195db9 100644 --- a/src/network/stk_host.cpp +++ b/src/network/stk_host.cpp @@ -23,7 +23,7 @@ #include "network/event.hpp" #include "network/protocols/server_lobby_room_protocol.hpp" #include "network/protocol_manager.hpp" -#include "network/server_console.hpp" +#include "network/network_console.hpp" #include "network/stk_peer.hpp" #include "utils/log.hpp" #include "utils/time.hpp" @@ -65,7 +65,7 @@ STKHost::STKHost() if (m_is_server) { - ServerConsole *sc = new ServerConsole(); + NetworkConsole *sc = new NetworkConsole(); sc->run(); setupServer(STKHost::HOST_ANY, 7321, 16, 2, 0, 0); startListening();