Exceptions are being thrown; retiring for the night

I don't know what's causing these issues, so I'm leaving it for tonight.
This commit is contained in:
Kayne Ruse
2014-04-26 02:48:15 +10:00
parent 6f1c2d0555
commit 9ec1ddab99
3 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -287,7 +287,8 @@ void InWorld::HandleRegionContent(SerialPacket packet) {
void InWorld::HandlePlayerUpdate(SerialPacket packet) { void InWorld::HandlePlayerUpdate(SerialPacket packet) {
if (playerCharacters.find(packet.playerInfo.playerIndex) == playerCharacters.end()) { if (playerCharacters.find(packet.playerInfo.playerIndex) == playerCharacters.end()) {
throw(std::runtime_error("Cannot update nen-existant players")); HandlePlayerNew(packet);
return;
} }
//update only if the message didn't originate from here //update only if the message didn't originate from here
+1
View File
@@ -110,6 +110,7 @@ union SerialPacket {
int playerIndex; int playerIndex;
char handle[PACKET_STRING_SIZE]; char handle[PACKET_STRING_SIZE];
char avatar[PACKET_STRING_SIZE]; char avatar[PACKET_STRING_SIZE];
int mapIndex;
Vector2 position; Vector2 position;
Vector2 motion; Vector2 motion;
}playerInfo; }playerInfo;
@@ -87,6 +87,7 @@ void ServerApplication::HandleSynchronize(SerialPacket packet) {
newPacket.playerInfo.playerIndex = it.first; newPacket.playerInfo.playerIndex = it.first;
snprintf(newPacket.playerInfo.handle, PACKET_STRING_SIZE, "%s", it.second.handle.c_str()); snprintf(newPacket.playerInfo.handle, PACKET_STRING_SIZE, "%s", it.second.handle.c_str());
snprintf(newPacket.playerInfo.avatar, PACKET_STRING_SIZE, "%s", it.second.avatar.c_str()); snprintf(newPacket.playerInfo.avatar, PACKET_STRING_SIZE, "%s", it.second.avatar.c_str());
newPacket.playerInfo.mapIndex = it.second.mapIndex;
newPacket.playerInfo.position = it.second.position; newPacket.playerInfo.position = it.second.position;
newPacket.playerInfo.motion = it.second.motion; newPacket.playerInfo.motion = it.second.motion;
serialize(&newPacket, buffer); serialize(&newPacket, buffer);