mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 00:00:13 +00:00
Add server info commands: /time, /played, and /who
- Add CMSG_QUERY_TIME (0x1CE) and SMSG_QUERY_TIME_RESPONSE (0x1CF) opcodes - Add CMSG_REQUEST_PLAYED_TIME (0x1CC) and SMSG_PLAYED_TIME (0x1CD) opcodes - Add CMSG_WHO (0x062) and SMSG_WHO (0x063) opcodes - Implement /time command to query and display server time - Implement /played command to show total and level playtime statistics - Implement /who [name] command to list online players with level and guild - Add packet builders: QueryTimePacket, RequestPlayedTimePacket, WhoPacket - Add response parsers for all three server info packet types - Add handlers that format and display responses in chat as system messages - Format played time as "X days, Y hours, Z minutes" for readability - Format server time as "YYYY-MM-DD HH:MM:SS" for readability
This commit is contained in:
parent
8b8e32e716
commit
f9c4cbddee
6 changed files with 287 additions and 0 deletions
|
|
@ -963,6 +963,31 @@ void GameScreen::sendChatMessage(game::GameHandler& gameHandler) {
|
|||
return;
|
||||
}
|
||||
|
||||
// /time command
|
||||
if (cmdLower == "time") {
|
||||
gameHandler.queryServerTime();
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /played command
|
||||
if (cmdLower == "played") {
|
||||
gameHandler.requestPlayedTime();
|
||||
chatInputBuffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
// /who command
|
||||
if (cmdLower == "who") {
|
||||
std::string playerName;
|
||||
if (spacePos != std::string::npos) {
|
||||
playerName = command.substr(spacePos + 1);
|
||||
}
|
||||
gameHandler.queryWho(playerName);
|
||||
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