[Server] Move setPlayer() to PlayerProcessor

pull/199/head
Koncord 8 years ago
parent 0317e2523b
commit ead92fff61

@ -30,6 +30,7 @@ bool PlayerProcessor::Process(RakNet::Packet &packet) noexcept
{
Player *player = Players::getPlayer(packet.guid);
PlayerPacket *myPacket = Networking::get().getPlayerController()->GetPacket(packet.data[0]);
myPacket->setPlayer(player);
processor.second->Do(*myPacket, *player);
return true;

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
Script::CallBackReturn<Script::CallbackIdentity("OnPlayerSendMessage")> result = true;
Script::Call<Script::CallbackIdentity("OnPlayerSendMessage")>(result, player.getId(), player.chatMessage.c_str());
@ -31,8 +30,6 @@ namespace mwmp
{
player.chatMessage = player.npc.mName + " (" + std::to_string(player.getId()) + "): "
+ player.chatMessage + "\n";
packet.setPlayer(&player);
packet.Send(false);
packet.Send(true);
}

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
Script::Call<Script::CallbackIdentity("OnGUIAction")>(player.getId(), (int)player.guiMessageBox.id,

@ -22,7 +22,6 @@ namespace mwmp
{
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
//packet.Send(&player, true);

@ -26,8 +26,6 @@ namespace mwmp
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
Player *target = Players::getPlayer(player.attack.target);

@ -22,7 +22,6 @@ namespace mwmp
{
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
//myPacket->Send(player, true);

@ -28,7 +28,6 @@ namespace mwmp
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
LOG_APPEND(Log::LOG_INFO, "- Moved to %s", player.cell.getDescription().c_str());

@ -27,7 +27,6 @@ namespace mwmp
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID, player.npc.mName.c_str());
packet.setPlayer(&player);
packet.Read();
CellController::get()->update(&player);

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
}
};

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
if (player.charGenStage.current == player.charGenStage.end && player.charGenStage.current != 0)

@ -41,7 +41,6 @@ namespace mwmp
player.creatureStats.mDead = true;
packet.setPlayer(&player);
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnPlayerDeath")>(player.getId(), reason, killer->getId());

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
//packet.Send(&player, true);

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
player.sendToLoaded(&packet);

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
//myPacket->Send(player, true);

@ -21,7 +21,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
Script::Call<Script::CallbackIdentity("OnPlayerInventoryChange")>(player.getId());

@ -22,7 +22,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
Script::Call<Script::CallbackIdentity("OnPlayerJournalChange")>(player.getId());

@ -22,7 +22,6 @@ namespace mwmp
//DEBUG_PRINTF(strPacketID);
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
//myPacket.Send(player, true); //send to other clients

@ -24,7 +24,6 @@ namespace mwmp
player.creatureStats.mDead = false;
packet.setPlayer(&player);
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnPlayerResurrect")>(player.getId());

@ -21,7 +21,6 @@ namespace mwmp
{
if (!player.creatureStats.mDead)
{
packet.setPlayer(&player);
packet.Read();
//myPacket->Send(player, true);
player.sendToLoaded(&packet);

@ -20,8 +20,7 @@ namespace mwmp
void Do(PlayerPacket &packet, Player &player) override
{
DEBUG_PRINTF(strPacketID.c_str());
packet.setPlayer(&player);
packet.Read();
Script::Call<Script::CallbackIdentity("OnPlayerSpellbookChange")>(player.getId());

Loading…
Cancel
Save