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:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
Reference in New Issue
Block a user