diff --git a/server/player_management.cpp b/server/player_management.cpp deleted file mode 100644 index 78ab785..0000000 --- a/server/player_management.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013, 2014 - * - * 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 "server_application.hpp" - -//------------------------- -//player management -//------------------------- - -void ServerApplication::LoadPlayer() { - // -} - -void ServerApplication::UnloadPlayer() { - // -} - -void ServerApplication::CreatePlayer() { - // -} - -void ServerApplication::DeletePlayer() { - // -} - -void ServerApplication::SavePlayer() { - // -} diff --git a/server/server_application.hpp b/server/server_application.hpp index c010dd2..cd6d4ac 100644 --- a/server/server_application.hpp +++ b/server/server_application.hpp @@ -74,12 +74,8 @@ private: //TODO: a function that only sends to players in a certain proximity void PumpPacket(SerialPacket); - //player management - void LoadPlayer(); - void UnloadPlayer(); - void CreatePlayer(); - void DeletePlayer(); - void SavePlayer(); + //TODO: manage the database + //TODO: combat systems //APIs UDPNetworkUtility network; diff --git a/server/server_networking.cpp b/server/server_connections.cpp similarity index 95% rename from server/server_networking.cpp rename to server/server_connections.cpp index c206077..35f54a9 100644 --- a/server/server_networking.cpp +++ b/server/server_connections.cpp @@ -47,6 +47,7 @@ void ServerApplication::HandleJoinRequest(SerialPacket packet) { newClient.address = packet.meta.srcAddress; clientMap[ClientEntry::uidCounter] = newClient; + //TODO: move this into the player management code //register the new player PlayerEntry newPlayer; newPlayer.clientIndex = ClientEntry::uidCounter; @@ -65,7 +66,7 @@ void ServerApplication::HandleJoinRequest(SerialPacket packet) { serialize(&packet, buffer); network.Send(&newClient.address, buffer, PACKET_BUFFER_SIZE); - //TODO: finish the player's initialization + //BUG: the new player object is not being sent to existing clients //finished this routine ClientEntry::uidCounter++; @@ -130,7 +131,7 @@ void ServerApplication::HandleDisconnect(SerialPacket packet) { } void ServerApplication::HandleShutdown(SerialPacket packet) { - //TODO: authenticate who is shitting the server down + //TODO: authenticate who is shutting the server down //end the server running = false; @@ -145,6 +146,7 @@ void ServerApplication::HandleShutdown(SerialPacket packet) { } void ServerApplication::HandlePlayerUpdate(SerialPacket packet) { + //TODO: this should be moved elsewhere if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) { throw(std::runtime_error("Cannot update a non-existant player")); } @@ -157,6 +159,7 @@ void ServerApplication::HandlePlayerUpdate(SerialPacket packet) { } void ServerApplication::HandleRegionRequest(SerialPacket packet) { + //TODO: this should be moved elsewhere packet.meta.type = SerialPacket::Type::REGION_CONTENT; packet.regionInfo.region = regionPager.GetRegion(packet.regionInfo.x, packet.regionInfo.y); diff --git a/todo.txt b/todo.txt index 7a6eb10..0ad57c6 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,8 @@ Please note that due to modificatons, the indicated line may be incorrect. +## BUG +1. server_connections.cpp:68 the new player object is not being sent to existing clients + ## TODO server_application.hpp:74 a function that only sends to players in a certain proximity server_application.hpp:94 I need to handle multiple map objects @@ -28,6 +31,3 @@ bbox.hpp:29 This is supposed to interact with the vector region_pager.hpp:49 delete existing regions serial_packet.hpp:71 combat packets setup_server.sql:1 The SQL startup script needs revising - -Move PlayerEntry into a proper class -Move ClientEntry into a proper class