Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto switch hotkey presets #2115

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6564,6 +6564,7 @@ void ProtocolGame::sendAddCreature(std::shared_ptr<Creature> creature, const Pos

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

Expand Down Expand Up @@ -9048,3 +9049,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