Added a room check to the character query

This commit is contained in:
Kayne Ruse
2014-12-27 01:33:10 +11:00
parent 3e2d1a5a56
commit 398f1c8bfd
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -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<SerialPacket*>(&newPacket));