Minor tweaks, prepping for a merge

This commit is contained in:
Kayne Ruse
2014-05-06 19:18:53 +10:00
parent 0ff787abda
commit 4ebff4a25a
5 changed files with 7 additions and 7 deletions
-1
View File
@@ -277,7 +277,6 @@ void InWorld::HandleDisconnect(SerialPacket packet) {
void InWorld::HandleRegionContent(SerialPacket packet) { void InWorld::HandleRegionContent(SerialPacket packet) {
//replace existing regions //replace existing regions
//TODO: account for map index
if (regionPager.FindRegion(packet.regionInfo.x, packet.regionInfo.y)) { if (regionPager.FindRegion(packet.regionInfo.x, packet.regionInfo.y)) {
regionPager.UnloadRegion(packet.regionInfo.x, packet.regionInfo.y); regionPager.UnloadRegion(packet.regionInfo.x, packet.regionInfo.y);
} }
+1
View File
@@ -88,6 +88,7 @@ union SerialPacket {
//information about the client //information about the client
struct ClientInformation { struct ClientInformation {
Metadata meta; Metadata meta;
//TODO: change clientIndex to accountIndex for player ID
int clientIndex; int clientIndex;
int characterIndex; int characterIndex;
char username[PACKET_STRING_SIZE]; char username[PACKET_STRING_SIZE];
+4 -2
View File
@@ -76,13 +76,15 @@ private:
//TODO: a function that only sends to characters in a certain proximity //TODO: a function that only sends to characters in a certain proximity
void PumpPacket(SerialPacket); void PumpPacket(SerialPacket);
//TODO: manage the database //Account management
int CreateUserAccount(std::string username, int clientIndex); int CreateUserAccount(std::string username, int clientIndex);
int LoadUserAccount(std::string username, int clientIndex); int LoadUserAccount(std::string username, int clientIndex);
int SaveUserAccount(int uid); int SaveUserAccount(int uid);
void UnloadUserAccount(int uid); void UnloadUserAccount(int uid);
void DeleteUserAccount(int uid); void DeleteUserAccount(int uid);
//TODO: character management
//TODO: combat systems //TODO: combat systems
//APIs //APIs
@@ -94,7 +96,7 @@ private:
std::map<int, ClientData> clientMap; std::map<int, ClientData> clientMap;
std::map<int, AccountData> accountMap; std::map<int, AccountData> accountMap;
std::map<int, CharacterData> characterMap; std::map<int, CharacterData> characterMap;
std::map<int, CombatInstance> CombatMap; std::map<int, CombatInstance> combatMap;
//maps //maps
//TODO: I need to handle multiple map objects //TODO: I need to handle multiple map objects
+1 -4
View File
@@ -46,15 +46,12 @@ void ServerApplication::HandleJoinRequest(SerialPacket packet) {
ClientData newClient; ClientData newClient;
newClient.address = packet.meta.srcAddress; newClient.address = packet.meta.srcAddress;
//debug //load the user account
int uid = LoadUserAccount(packet.clientInfo.username, ClientData::uidCounter); int uid = LoadUserAccount(packet.clientInfo.username, ClientData::uidCounter);
if (uid < 0) { if (uid < 0) {
std::cerr << "Error: Account already loaded: " << uid << std::endl; std::cerr << "Error: Account already loaded: " << uid << std::endl;
return; return;
} }
accountMap[uid].blackListed = true;
accountMap[uid].whiteListed = false;
SaveUserAccount(uid);
//TODO: move this into the character management code //TODO: move this into the character management code
//create the new character //create the new character
+1
View File
@@ -1,4 +1,5 @@
I need to keep the documentation up to date. Namey, the GDD is getting out of date. I need to keep the documentation up to date. Namey, the GDD is getting out of date.
change clientIndex to accountIndex for player ID
--Naming conventions-- --Naming conventions--