diff --git a/client/scenes/in_world.cpp b/client/scenes/in_world.cpp index 1b6e060..63b5afc 100644 --- a/client/scenes/in_world.cpp +++ b/client/scenes/in_world.cpp @@ -579,6 +579,7 @@ void InWorld::HandleCharacterSetRoom(CharacterPacket* const argPacket) { //request the info on characters in this room CharacterPacket newPacket; newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS; + newPacket.roomIndex = roomIndex; network.SendTo(Channels::SERVER, &newPacket); } diff --git a/server/server_data.cpp b/server/server_data.cpp index b9098fa..bd00a8f 100644 --- a/server/server_data.cpp +++ b/server/server_data.cpp @@ -73,9 +73,12 @@ void ServerApplication::HandleRegionRequest(RegionPacket* const argPacket) { void ServerApplication::HandleCharacterExists(CharacterPacket* const argPacket) { //respond with all character data - //TODO: handle room and location specifications CharacterPacket newPacket; + for (auto& it : *characterMgr.GetContainer()) { + if (argPacket->roomIndex != -1 && it.second.GetRoomIndex() != argPacket->roomIndex) { + continue; + } CopyCharacterToPacket(&newPacket, it.first); newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS; network.SendTo(argPacket->srcAddress, static_cast(&newPacket));