I need to do some refactoring
This commit is contained in:
@@ -205,20 +205,28 @@ void RoomData::RunFrameCharacterBarrierCollisions() {
|
||||
//barrier bounds
|
||||
BoundingBox barrierBox = barrierIt.second.GetBounds() + barrierIt.second.GetOrigin();
|
||||
|
||||
//move the character to the battle screen
|
||||
if (characterBox.CheckOverlap(barrierBox)) {
|
||||
//Actually move the character to a battle
|
||||
BattleData* battle = battleMgr.Find(barrierIt.second.GetBattleIndex());
|
||||
// battle->PushCharacter(characterIt.second);
|
||||
// characterList.
|
||||
//pump character unload
|
||||
CharacterPacket charPacket;
|
||||
charPacket.type = SerialPacketType::CHARACTER_UNLOAD;
|
||||
charPacket.characterIndex = characterIt->GetIndex();
|
||||
pumpPacketProximity(static_cast<SerialPacket*>(&charPacket), characterIt->GetRoomIndex());
|
||||
|
||||
std::cout << "CharacterList size: " << characterList.size() << std::endl;
|
||||
|
||||
//Actually move the character to a battle
|
||||
BattleData* battle = battleMgr.Find(barrierIt.second.GetBattleIndex()); //TODO: barriers should hold the battle's pointer
|
||||
battle->PushCharacter(characterIt);
|
||||
PopCharacter(characterIt);
|
||||
|
||||
//DEBUG: output barrierIndex, battleIndex
|
||||
std::cout << barrierIt.first << "\t" << barrierIt.second.GetBattleIndex() << std::endl;
|
||||
std::cout << "CharacterList size: " << characterList.size() << std::endl;
|
||||
|
||||
//Send the entry message to the client
|
||||
BarrierPacket newPacket;
|
||||
newPacket.type = SerialPacketType::BARRIER_ENTRY;
|
||||
newPacket.barrierIndex = barrierIt.first;
|
||||
// BarrierPacket newPacket;
|
||||
// newPacket.type = SerialPacketType::BARRIER_ENTRY;
|
||||
// newPacket.barrierIndex = barrierIt.first;
|
||||
|
||||
// udpNetworkUtility.Send();
|
||||
|
||||
|
||||
@@ -596,6 +596,7 @@ void ServerApplication::hQueryCharacterExists(CharacterPacket* const argPacket)
|
||||
//respond with all character data
|
||||
CharacterPacket newPacket;
|
||||
|
||||
//TODO: move this expensive lookup
|
||||
for (auto& it : *characterMgr.GetContainer()) {
|
||||
if (argPacket->roomIndex != -1 && it.second.GetRoomIndex() != argPacket->roomIndex) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user