Finished the server-side modifications (read more)

* There seems to be something iffy with this branch
* The size of SerialPacket may have changed

I've implemented the accountIndex variable as best I can, but I really
shouldn't code at night. I'll need to go over the changes again before
merging this.
This commit is contained in:
Kayne Ruse
2014-05-06 22:46:24 +10:00
parent 1beb7cbd5d
commit 4d12788c53
7 changed files with 35 additions and 52 deletions
+3 -1
View File
@@ -63,6 +63,7 @@ InWorld::InWorld(ConfigUtility* const argConfig, UDPNetworkUtility* const argNet
//TODO: add the tilesheet to the map system?
tileSheet.Load(config["dir.tilesets"] + "terrain.bmp", 12, 15);
//TODO: move this into it's own function
//request a sync
SerialPacket packet;
char buffer[PACKET_STRING_SIZE];
@@ -265,7 +266,7 @@ void InWorld::HandlePacket(SerialPacket packet) {
break;
//handle errors
default:
throw(std::runtime_error("Unknown SerialPacket::Type encountered"));
throw(std::runtime_error(std::string() + "Unknown SerialPacket::Type encountered in InWorld: " + to_string_custom(int(packet.meta.type))));
break;
}
}
@@ -326,6 +327,7 @@ void InWorld::HandleCharacterNew(SerialPacket packet) {
}
void InWorld::HandleCharacterDelete(SerialPacket packet) {
//TODO: authenticate
if (playerCharacters.find(packet.characterInfo.characterIndex) == playerCharacters.end()) {
throw(std::runtime_error("Cannot delete non-existant characters"));
}
+1 -1
View File
@@ -230,7 +230,7 @@ void LobbyMenu::HandlePacket(SerialPacket packet) {
//handle errors
default:
throw(std::runtime_error("Unknown SerialPacket::Type encountered"));
throw(std::runtime_error(std::string() + "Unknown SerialPacket::Type encountered in LobbyMenu: " + to_string_custom(int(packet.meta.type))));
break;
}
}