Skip to content

Commit

Permalink
feat: auto switch hotkey presets (#2115)
Browse files Browse the repository at this point in the history
Auto switch hotkey presets in login.
  • Loading branch information
Luan Luciano authored Jun 22, 2024
1 parent fb20f6f commit 0e13494
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6584,6 +6584,7 @@ void ProtocolGame::sendAddCreature(std::shared_ptr<Creature> creature, const Pos

if (isLogin) {
sendMagicEffect(pos, CONST_ME_TELEPORT);
sendHotkeyPreset();
sendDisableLoginMusic();
}

Expand Down Expand Up @@ -9056,3 +9057,17 @@ void ProtocolGame::sendDisableLoginMusic() {
msg.addByte(0x00);
writeToOutputBuffer(msg);
}

void ProtocolGame::sendHotkeyPreset() {
if (!player || oldProtocol) {
return;
}

auto vocation = g_vocations().getVocation(player->getVocation()->getBaseId());
if (vocation) {
NetworkMessage msg;
msg.addByte(0x9D);
msg.add<uint32_t>(vocation->getClientId());
writeToOutputBuffer(msg);
}
}
1 change: 1 addition & 0 deletions src/server/network/protocol/protocolgame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ class ProtocolGame final : public Protocol {
void sendSingleSoundEffect(const Position &pos, SoundEffect_t id, SourceEffect_t source);
void sendDoubleSoundEffect(const Position &pos, SoundEffect_t mainSoundId, SourceEffect_t mainSource, SoundEffect_t secondarySoundId, SourceEffect_t secondarySource);

void sendHotkeyPreset();
void sendDisableLoginMusic();

uint8_t m_playerDeathTime = 0;
Expand Down

0 comments on commit 0e13494

Please sign in to comment.