mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add Tier 1 utility commands: ignore, sit/stand, and logout
Ignore Commands: - Add /ignore <name> to block messages from players - Add /unignore <name> to unblock players - Maintain ignoreCache for name-to-GUID lookups - Show confirmation and error messages for ignore actions - Use CMSG_ADD_IGNORE (0x6C) and CMSG_DEL_IGNORE (0x6D) Sit/Stand/Kneel Commands: - Add /sit to sit down (stand state 1) - Add /stand to stand up (stand state 0) - Add /kneel to kneel (stand state 8) - Instant visual feedback with CMSG_STAND_STATE_CHANGE (0x101) - Support for additional stand states (chair, sleep, etc.) Logout Commands: - Add /logout and /camp to initiate logout with countdown - Add /cancellogout to cancel pending logout - Show "Logging out in 20 seconds..." or "Logout complete" messages - Track logout state with loggingOut_ flag to prevent duplicate requests - Handle instant logout (in inn/city) vs countdown logout - Use opcodes: - CMSG_LOGOUT_REQUEST (0x4B) - CMSG_LOGOUT_CANCEL (0x4E) - SMSG_LOGOUT_RESPONSE (0x4C) - SMSG_LOGOUT_COMPLETE (0x4D) Implementation: - Add LogoutRequestPacket, LogoutCancelPacket builders - Add LogoutResponseParser to parse server logout responses - Add StandStateChangePacket builder for stance changes - Add AddIgnorePacket and DelIgnorePacket for ignore list management - Add handleLogoutResponse() and handleLogoutComplete() handlers - Add ignoreCache map and loggingOut_ state tracking - All commands display feedback in chat window
This commit is contained in:
parent
6f45c6ab69
commit
ec32286b0d
6 changed files with 325 additions and 0 deletions
|
|
@ -1079,6 +1079,77 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
|||
return;
|
||||
}
|
||||
|
||||
// /ignore command
|
||||
if (cmdLower == "ignore") {
|
||||
if (spacePos != std::string::npos) {
|
||||
std::string playerName = command.substr(spacePos + 1);
|
||||
gameHandler.addIgnore(playerName);
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
game::MessageChatData msg;
|
||||
msg.type = game::ChatType::SYSTEM;
|
||||
msg.language = game::ChatLanguage::UNIVERSAL;
|
||||
msg.message = "Usage: /ignore <name>";
|
||||
gameHandler.addLocalChatMessage(msg);
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /unignore command
|
||||
if (cmdLower == "unignore") {
|
||||
if (spacePos != std::string::npos) {
|
||||
std::string playerName = command.substr(spacePos + 1);
|
||||
gameHandler.removeIgnore(playerName);
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
game::MessageChatData msg;
|
||||
msg.type = game::ChatType::SYSTEM;
|
||||
msg.language = game::ChatLanguage::UNIVERSAL;
|
||||
msg.message = "Usage: /unignore <name>";
|
||||
gameHandler.addLocalChatMessage(msg);
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /sit command
|
||||
if (cmdLower == "sit") {
|
||||
gameHandler.setStandState(1); // 1 = sit
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /stand command
|
||||
if (cmdLower == "stand") {
|
||||
gameHandler.setStandState(0); // 0 = stand
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /kneel command
|
||||
if (cmdLower == "kneel") {
|
||||
gameHandler.setStandState(8); // 8 = kneel
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /logout command (already exists but using /logout instead of going to login)
|
||||
if (cmdLower == "logout" || cmdLower == "camp") {
|
||||
gameHandler.requestLogout();
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /cancellogout command
|
||||
if (cmdLower == "cancellogout") {
|
||||
gameHandler.cancelLogout();
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// Chat channel slash commands
|
||||
bool isChannelCommand = false;
|
||||
if (cmdLower == "s" || cmdLower == "say") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue