diff --git a/client/in_world.cpp b/client/in_world.cpp index f24247d..c1d1e06 100644 --- a/client/in_world.cpp +++ b/client/in_world.cpp @@ -25,6 +25,16 @@ using namespace std; +//------------------------- +//Quick and dirty +//------------------------- + +static std::string itos(int i) { + char buffer[20]; + snprintf(buffer, 20, "%d", i); + return std::string(buffer); +} + //------------------------- //Public access members //------------------------- diff --git a/client/in_world.hpp b/client/in_world.hpp index bf707db..77fa69f 100644 --- a/client/in_world.hpp +++ b/client/in_world.hpp @@ -24,7 +24,6 @@ #include "base_scene.hpp" -#include "utilities.hpp" #include "defines.hpp" #include "singleton.hpp" #include "packet.hpp" diff --git a/client/lobby.cpp b/client/lobby.cpp index 07bd859..ce8726a 100644 --- a/client/lobby.cpp +++ b/client/lobby.cpp @@ -25,6 +25,16 @@ using namespace std; +//------------------------- +//Quick and dirty +//------------------------- + +static std::string itos(int i) { + char buffer[20]; + snprintf(buffer, 20, "%d", i); + return std::string(buffer); +} + //------------------------- //Public access members //------------------------- diff --git a/client/lobby.hpp b/client/lobby.hpp index f830b5f..2f51d5d 100644 --- a/client/lobby.hpp +++ b/client/lobby.hpp @@ -24,11 +24,9 @@ #include "base_scene.hpp" -#include "utilities.hpp" #include "defines.hpp" #include "singleton.hpp" -#include "server_entry.hpp" #include "packet.hpp" #include "network_queue.hpp" #include "information_manager.hpp" @@ -42,6 +40,12 @@ #include #include +struct ServerEntry { + std::string name; + IPaddress address; + //TODO: player count +}; + class Lobby : public BaseScene { public: //Public access members diff --git a/common/client_entry.hpp b/common/client_entry.hpp deleted file mode 100644 index 7390e2d..0000000 --- a/common/client_entry.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef CLIENTENTRY_HPP_ -#define CLIENTENTRY_HPP_ - -#include "SDL/SDL_net.h" - -struct ClientEntry { - int index; - IPaddress address; -}; - -#endif diff --git a/common/player_entry.hpp b/common/player_entry.hpp deleted file mode 100644 index 389bdeb..0000000 --- a/common/player_entry.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef PLAYERENTRY_HPP_ -#define PLAYERENTRY_HPP_ - -#include "vector2.hpp" - -#include - -struct PlayerEntry { - int index; - int clientIndex; - std::string handle; - std::string avatar; - Vector2 position; - Vector2 motion; -}; - -#endif diff --git a/common/server_entry.hpp b/common/server_entry.hpp deleted file mode 100644 index 500ed7e..0000000 --- a/common/server_entry.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef SERVERENTRY_HPP_ -#define SERVERENTRY_HPP_ - -#include "SDL/SDL_net.h" - -#include - -struct ServerEntry { - std::string name; - IPaddress address; - //TODO: player count -}; - -#endif diff --git a/common/utilities.cpp b/common/utilities.cpp deleted file mode 100644 index bd8aed7..0000000 --- a/common/utilities.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#include "utilities.hpp" - -#include - -std::string itos(int i) { - char buffer[20]; - snprintf(buffer, 20, "%d", i); - return std::string(buffer); -} \ No newline at end of file diff --git a/common/utilities.hpp b/common/utilities.hpp deleted file mode 100644 index fdf4618..0000000 --- a/common/utilities.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef UTILITIES_HPP_ -#define UTILITIES_HPP_ - -#include - -std::string itos(int i); - -#endif diff --git a/server/server_application.cpp b/server/server_application.cpp index 3663418..79e4b1e 100644 --- a/server/server_application.cpp +++ b/server/server_application.cpp @@ -27,6 +27,16 @@ using namespace std; +//------------------------- +//Quick and dirty +//------------------------- + +static std::string itos(int i) { + char buffer[20]; + snprintf(buffer, 20, "%d", i); + return std::string(buffer); +} + //------------------------- //Public access members //------------------------- diff --git a/server/server_application.hpp b/server/server_application.hpp index 48fef51..8aa9442 100644 --- a/server/server_application.hpp +++ b/server/server_application.hpp @@ -22,14 +22,10 @@ #ifndef SERVERAPPLICATION_HPP_ #define SERVERAPPLICATION_HPP_ -#include "utilities.hpp" #include "packet.hpp" #include "singleton.hpp" #include "network_queue.hpp" -#include "client_entry.hpp" -#include "player_entry.hpp" - #include "config_Utility.hpp" #include "udp_network_utility.hpp" #include "vector2.hpp" @@ -40,6 +36,20 @@ #include #include +struct ClientEntry { + int index; + IPaddress address; +}; + +struct PlayerEntry { + int index; + int clientIndex; + std::string handle; + std::string avatar; + Vector2 position; + Vector2 motion; +}; + class ServerApplication { public: ServerApplication();