Adjusted a few comments
This commit is contained in:
@@ -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 */) {
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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<Region*>* GetContainer() { return ®ionList; }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user