Skip to content

Commit

Permalink
Update protocolgame.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Mar 20, 2024
1 parent bd21278 commit 255fbf3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,19 +906,16 @@ void ProtocolGame::parsePacket(NetworkMessage &msg) {
m_playerDeathTime++;
}

g_dispatcher().addEvent([self = getThis(), recvbyte] { self->parsePacketDead(recvbyte); }, "ProtocolGame::parsePacketDead");
parsePacketDead(recvbyte);
return;
}

// Modules system
if (player && recvbyte != 0xD3) {
g_dispatcher().addEvent([playerId = player->getID(), &msg, recvbyte] {
g_modules().executeOnRecvbyte(playerId, msg, recvbyte);
},
"Modules::executeOnRecvbyte");
g_modules().executeOnRecvbyte(player->getID(), msg, recvbyte);
}

g_dispatcher().addEvent([self = getThis(), msg, recvbyte] { self->parsePacketFromDispatcher(msg, recvbyte); }, "ProtocolGame::parsePacketFromDispatcher");
parsePacketFromDispatcher(msg, recvbyte);
}

void ProtocolGame::parsePacketDead(uint8_t recvbyte) {
Expand All @@ -928,7 +925,7 @@ void ProtocolGame::parsePacketDead(uint8_t recvbyte) {
g_game().removePlayerUniqueLogin(player->getName());
}
disconnect();
g_dispatcher().addEvent([payerGUID = player->getGUID()] { IOLoginData::updateOnlineStatus(payerGUID, false); }, "IOLoginData::updateOnlineStatus");
IOLoginData::updateOnlineStatus(player->getGUID(), false);
return;
}

Expand All @@ -947,8 +944,8 @@ void ProtocolGame::parsePacketDead(uint8_t recvbyte) {
return;
}

g_dispatcher().addEvent([self = getThis(), player = player] { self->sendAddCreature(player, player->getPosition(), 0, false); }, "ProtocolGame::sendAddCreature");
g_dispatcher().addEvent([self = getThis()] { self->addBless(); }, "ProtocolGame::addBless");
sendAddCreature(player, player->getPosition(), 0, false);
addBless();
resetPlayerDeathTime();
return;
}
Expand Down

0 comments on commit 255fbf3

Please sign in to comment.