|
|
|
@ -22,22 +22,27 @@ bool ActorProcessor::Process(RakNet::Packet &packet, ActorList &actorList)
|
|
|
|
|
myPacket->SetReadStream(&bsIn);
|
|
|
|
|
|
|
|
|
|
BOOST_FOREACH(processors_t::value_type &processor, processors)
|
|
|
|
|
{
|
|
|
|
|
if (processor.first == packet.data[0])
|
|
|
|
|
{
|
|
|
|
|
myGuid = Main::get().getLocalPlayer()->guid;
|
|
|
|
|
request = packet.length == myPacket->headerSize();
|
|
|
|
|
|
|
|
|
|
if (!request && !processor.second->avoidReading)
|
|
|
|
|
{
|
|
|
|
|
myPacket->Read();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
processor.second->Do(*myPacket, actorList);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
if (processor.first == packet.data[0])
|
|
|
|
|
{
|
|
|
|
|
myGuid = Main::get().getLocalPlayer()->guid;
|
|
|
|
|
request = packet.length == myPacket->headerSize();
|
|
|
|
|
|
|
|
|
|
actorList.isValid = true;
|
|
|
|
|
|
|
|
|
|
if (!request && !processor.second->avoidReading)
|
|
|
|
|
{
|
|
|
|
|
myPacket->Read();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (actorList.isValid)
|
|
|
|
|
processor.second->Do(*myPacket, actorList);
|
|
|
|
|
else
|
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -50,4 +55,4 @@ void ActorProcessor::AddProcessor(mwmp::ActorProcessor *processor)
|
|
|
|
|
processor->className + " and " + p.second->className);
|
|
|
|
|
}
|
|
|
|
|
processors.insert(processors_t::value_type(processor->GetPacketID(), boost::shared_ptr<ActorProcessor>(processor)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|