From 6c6a025f2a1e8c543e9efe01b7f31b209d93873c Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 21 Apr 2014 02:13:00 +1000 Subject: [PATCH] Adjusted a few comments --- client/scenes/in_world.cpp | 2 +- client/scenes/lobby_menu.cpp | 1 + common/map/region_pager.hpp | 2 +- common/network/serial.hpp | 2 +- common/network/serial_packet.hpp | 3 +-- server/server_application.cpp | 8 +++++--- server/server_application.hpp | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/client/scenes/in_world.cpp b/client/scenes/in_world.cpp index 4f9e002..d6cb5a5 100644 --- a/client/scenes/in_world.cpp +++ b/client/scenes/in_world.cpp @@ -453,7 +453,7 @@ int InWorld::CheckBufferDistance(Region* const region) { return std::max(abs(x), abs(y)); } -//TODO: eew ugly +//TODO: Revise InWorld::UpdateMap() after InWorld::CheckBufferDistance() void InWorld::UpdateMap() { //prune distant regions for (auto it = regionPager.GetContainer()->begin(); it != regionPager.GetContainer()->end(); /* EMPTY */) { diff --git a/client/scenes/lobby_menu.cpp b/client/scenes/lobby_menu.cpp index 24c5b5c..1000af4 100644 --- a/client/scenes/lobby_menu.cpp +++ b/client/scenes/lobby_menu.cpp @@ -155,6 +155,7 @@ void LobbyMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) { } else if (join.MouseButtonUp(button) == Button::State::HOVER && selection != nullptr && selection->compatible) { + //TODO: The player login information should be collected by the lobby screen //the vars SerialPacket packet; char buffer[PACKET_BUFFER_SIZE]; diff --git a/common/map/region_pager.hpp b/common/map/region_pager.hpp index 0bf035e..9b3b991 100644 --- a/common/map/region_pager.hpp +++ b/common/map/region_pager.hpp @@ -46,7 +46,7 @@ public: virtual Region* SaveRegion(int x, int y) = 0; virtual Region* CreateRegion(int x, int y) = 0; virtual void UnloadRegion(int x, int y) = 0; - //TODO: delete? + //TODO: delete existing regions //accessors & mutators std::list* GetContainer() { return ®ionList; } diff --git a/common/network/serial.hpp b/common/network/serial.hpp index 5f002e7..b532bb8 100644 --- a/common/network/serial.hpp +++ b/common/network/serial.hpp @@ -24,7 +24,7 @@ #include "serial_packet.hpp" -/* TODO: Keep the PACKET_BUFFER_SIZE up to date +/* NOTE: Keep the PACKET_BUFFER_SIZE up to date * NOTE: REGION_CONTENT is currently the largest type of packet * map content: REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizoeof(region::type_t) * map format: sizeof(int) * 2 diff --git a/common/network/serial_packet.hpp b/common/network/serial_packet.hpp index 84f4a39..35f117e 100644 --- a/common/network/serial_packet.hpp +++ b/common/network/serial_packet.hpp @@ -99,8 +99,7 @@ union SerialPacket { Metadata meta; int clientIndex; int playerIndex; - //TODO: should probably move these into the client info - //TODO: these might actually do better during the login system + //TODO: should move handle/avatar into clientInfo; these might actually do better during the login system char handle[PACKET_STRING_SIZE]; char avatar[PACKET_STRING_SIZE]; Vector2 position; diff --git a/server/server_application.cpp b/server/server_application.cpp index bba6c26..7317058 100644 --- a/server/server_application.cpp +++ b/server/server_application.cpp @@ -110,7 +110,7 @@ void ServerApplication::Proc() { HandlePacket(packet); } //give the computer a break - //TODO: remove this? + //TODO: remove this delay? SDL_Delay(10); } } @@ -252,7 +252,7 @@ void ServerApplication::HandleSynchronize(SerialPacket packet) { SerialPacket newPacket; char buffer[PACKET_BUFFER_SIZE]; - //TODO: map? + //TODO: syncronize the map? //players newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE; @@ -314,13 +314,15 @@ void ServerApplication::HandlePlayerNew(SerialPacket packet) { PlayerEntry::uidCounter++; } +//TODO: differentiate between delete and unload void ServerApplication::HandlePlayerDelete(SerialPacket packet) { - //TODO: remove this? //TODO: authenticate who is deleting this player if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) { throw(std::runtime_error("Cannot delete a non-existant player")); } + //TODO: remove the deleted player from the database? + //prep the delete packet SerialPacket delPacket; delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE; diff --git a/server/server_application.hpp b/server/server_application.hpp index b0b3fe6..c34172e 100644 --- a/server/server_application.hpp +++ b/server/server_application.hpp @@ -74,7 +74,7 @@ private: void HandlePlayerUpdate(SerialPacket); void HandleRegionRequest(SerialPacket); - //TODO: a function that sends to players in a certain proximity + //TODO: a function that only sends to players in a certain proximity void PumpPacket(SerialPacket); //APIs