Adjusted a few comments

This commit is contained in:
Kayne Ruse
2014-04-21 02:13:00 +10:00
parent 60edc97ea5
commit 6c6a025f2a
7 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -453,7 +453,7 @@ int InWorld::CheckBufferDistance(Region* const region) {
return std::max(abs(x), abs(y)); return std::max(abs(x), abs(y));
} }
//TODO: eew ugly //TODO: Revise InWorld::UpdateMap() after InWorld::CheckBufferDistance()
void InWorld::UpdateMap() { void InWorld::UpdateMap() {
//prune distant regions //prune distant regions
for (auto it = regionPager.GetContainer()->begin(); it != regionPager.GetContainer()->end(); /* EMPTY */) { for (auto it = regionPager.GetContainer()->begin(); it != regionPager.GetContainer()->end(); /* EMPTY */) {
+1
View File
@@ -155,6 +155,7 @@ void LobbyMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
} }
else if (join.MouseButtonUp(button) == Button::State::HOVER && selection != nullptr && selection->compatible) { 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 //the vars
SerialPacket packet; SerialPacket packet;
char buffer[PACKET_BUFFER_SIZE]; char buffer[PACKET_BUFFER_SIZE];
+1 -1
View File
@@ -46,7 +46,7 @@ public:
virtual Region* SaveRegion(int x, int y) = 0; virtual Region* SaveRegion(int x, int y) = 0;
virtual Region* CreateRegion(int x, int y) = 0; virtual Region* CreateRegion(int x, int y) = 0;
virtual void UnloadRegion(int x, int y) = 0; virtual void UnloadRegion(int x, int y) = 0;
//TODO: delete? //TODO: delete existing regions
//accessors & mutators //accessors & mutators
std::list<Region*>* GetContainer() { return &regionList; } std::list<Region*>* GetContainer() { return &regionList; }
+1 -1
View File
@@ -24,7 +24,7 @@
#include "serial_packet.hpp" #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 * NOTE: REGION_CONTENT is currently the largest type of packet
* map content: REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizoeof(region::type_t) * map content: REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizoeof(region::type_t)
* map format: sizeof(int) * 2 * map format: sizeof(int) * 2
+1 -2
View File
@@ -99,8 +99,7 @@ union SerialPacket {
Metadata meta; Metadata meta;
int clientIndex; int clientIndex;
int playerIndex; int playerIndex;
//TODO: should probably move these into the client info //TODO: should move handle/avatar into clientInfo; these might actually do better during the login system
//TODO: these might actually do better during the login system
char handle[PACKET_STRING_SIZE]; char handle[PACKET_STRING_SIZE];
char avatar[PACKET_STRING_SIZE]; char avatar[PACKET_STRING_SIZE];
Vector2 position; Vector2 position;
+5 -3
View File
@@ -110,7 +110,7 @@ void ServerApplication::Proc() {
HandlePacket(packet); HandlePacket(packet);
} }
//give the computer a break //give the computer a break
//TODO: remove this? //TODO: remove this delay?
SDL_Delay(10); SDL_Delay(10);
} }
} }
@@ -252,7 +252,7 @@ void ServerApplication::HandleSynchronize(SerialPacket packet) {
SerialPacket newPacket; SerialPacket newPacket;
char buffer[PACKET_BUFFER_SIZE]; char buffer[PACKET_BUFFER_SIZE];
//TODO: map? //TODO: syncronize the map?
//players //players
newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE; newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE;
@@ -314,13 +314,15 @@ void ServerApplication::HandlePlayerNew(SerialPacket packet) {
PlayerEntry::uidCounter++; PlayerEntry::uidCounter++;
} }
//TODO: differentiate between delete and unload
void ServerApplication::HandlePlayerDelete(SerialPacket packet) { void ServerApplication::HandlePlayerDelete(SerialPacket packet) {
//TODO: remove this?
//TODO: authenticate who is deleting this player //TODO: authenticate who is deleting this player
if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) { if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) {
throw(std::runtime_error("Cannot delete a non-existant player")); throw(std::runtime_error("Cannot delete a non-existant player"));
} }
//TODO: remove the deleted player from the database?
//prep the delete packet //prep the delete packet
SerialPacket delPacket; SerialPacket delPacket;
delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE; delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE;
+1 -1
View File
@@ -74,7 +74,7 @@ private:
void HandlePlayerUpdate(SerialPacket); void HandlePlayerUpdate(SerialPacket);
void HandleRegionRequest(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); void PumpPacket(SerialPacket);
//APIs //APIs