Added a room check to the character query
This commit is contained in:
@@ -579,6 +579,7 @@ void InWorld::HandleCharacterSetRoom(CharacterPacket* const argPacket) {
|
|||||||
//request the info on characters in this room
|
//request the info on characters in this room
|
||||||
CharacterPacket newPacket;
|
CharacterPacket newPacket;
|
||||||
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
||||||
|
newPacket.roomIndex = roomIndex;
|
||||||
network.SendTo(Channels::SERVER, &newPacket);
|
network.SendTo(Channels::SERVER, &newPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,12 @@ void ServerApplication::HandleRegionRequest(RegionPacket* const argPacket) {
|
|||||||
|
|
||||||
void ServerApplication::HandleCharacterExists(CharacterPacket* const argPacket) {
|
void ServerApplication::HandleCharacterExists(CharacterPacket* const argPacket) {
|
||||||
//respond with all character data
|
//respond with all character data
|
||||||
//TODO: handle room and location specifications
|
|
||||||
CharacterPacket newPacket;
|
CharacterPacket newPacket;
|
||||||
|
|
||||||
for (auto& it : *characterMgr.GetContainer()) {
|
for (auto& it : *characterMgr.GetContainer()) {
|
||||||
|
if (argPacket->roomIndex != -1 && it.second.GetRoomIndex() != argPacket->roomIndex) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
CopyCharacterToPacket(&newPacket, it.first);
|
CopyCharacterToPacket(&newPacket, it.first);
|
||||||
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
||||||
network.SendTo(argPacket->srcAddress, static_cast<SerialPacket*>(&newPacket));
|
network.SendTo(argPacket->srcAddress, static_cast<SerialPacket*>(&newPacket));
|
||||||
|
|||||||
Reference in New Issue
Block a user