feat(Scripts/Commands): Add online session time to pinfo command (#24388)
Co-authored-by: victor <vngodoyr@unap.cl> Co-authored-by: sogladev <sogladev@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Add language string for pinfo online time
|
||||
DELETE FROM `acore_string` WHERE `entry` = 35410;
|
||||
INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES
|
||||
(35410, '¦ Online for: {}', '¦ 온라인 시간: {}', '¦ Online depuis : {}', '¦ Online seit: {}', '¦ 在线时长:{}', '¦ 線上時間:{}', '¦ Conectado durante: {}', '¦ Conectado durante: {}', '¦ Онлайн: {}');
|
||||
@@ -815,6 +815,7 @@ enum AcoreStrings
|
||||
LANG_NO_REASON = 35407,
|
||||
LANG_UNAUTHORIZED = 35408,
|
||||
LANG_PINFO_CHR_MAP_WITH_AREA = 35409,
|
||||
LANG_PINFO_CHR_ONLINETIME = 35410,
|
||||
|
||||
LANG_CHARACTER_GENDER_MALE = 855,
|
||||
LANG_CHARACTER_GENDER_FEMALE = 856,
|
||||
|
||||
@@ -2418,6 +2418,13 @@ public:
|
||||
// Output XX. LANG_PINFO_CHR_PLAYEDTIME
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_PLAYEDTIME, (secsToTimeString(totalPlayerTime, true)));
|
||||
|
||||
// Output XXI. LANG_PINFO_CHR_ONLINETIME (only for online players)
|
||||
if (playerTarget)
|
||||
{
|
||||
uint32 onlineTime = uint32(GameTime::GetGameTime().count() - playerTarget->m_logintime);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_ONLINETIME, secsToTimeString(onlineTime, true));
|
||||
}
|
||||
|
||||
// Mail Data - an own query, because it may or may not be useful.
|
||||
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
|
||||
CharacterDatabasePreparedStatement* mailQuery = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
|
||||
|
||||
Reference in New Issue
Block a user