|
From: <xer...@us...> - 2026-07-18 03:23:02
|
Revision: 1675
http://sourceforge.net/p/seq/svn/1675
Author: xerxes00
Date: 2026-07-18 03:23:00 +0000 (Sat, 18 Jul 2026)
Log Message:
-----------
loot: corpse-contents window + route loot-colored messages to a Loot category
- decode OP_LootDrops (loot-window contents) and print "corpse: item1, item2"
under a new MT_Loot category
- route server loot-colored messages (CC_User_Loot) to MT_Loot in
chatColor2MessageType, so "you looted X", lore/no-room/too-far failures and
the like read as Loot: instead of General:
- MT_Loot gets its own blue color in the message window and terminal
Modified Paths:
--------------
showeq/branches/xerxes-trunk-dev/conf/zoneopcodes.xml
showeq/branches/xerxes-trunk-dev/src/interface.cpp
showeq/branches/xerxes-trunk-dev/src/message.cpp
showeq/branches/xerxes-trunk-dev/src/message.h
showeq/branches/xerxes-trunk-dev/src/messageshell.cpp
showeq/branches/xerxes-trunk-dev/src/messageshell.h
showeq/branches/xerxes-trunk-dev/src/messagewindow.cpp
showeq/branches/xerxes-trunk-dev/src/terminal.cpp
Modified: showeq/branches/xerxes-trunk-dev/conf/zoneopcodes.xml
===================================================================
--- showeq/branches/xerxes-trunk-dev/conf/zoneopcodes.xml 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/conf/zoneopcodes.xml 2026-07-18 03:23:00 UTC (rev 1675)
@@ -480,6 +480,10 @@
<comment>Loot item from corpse - 20 bytes</comment>
<payload dir="both" typename="uint8_t" sizechecktype="none"/>
</opcode>
+ <opcode id="e781" name="OP_LootDrops" updated="07/15/26">
+ <comment>Corpse loot-window contents: count@10, corpse name NUL@14, then per-item clean name + 0x12 serialized link</comment>
+ <payload dir="server" typename="uint8_t" sizechecktype="none"/>
+ </opcode>
<opcode id="ffff" name="OP_EndLootRequest" updated="11/28/12">
<comment>DoneLootingCode - 4 bytes</comment>
<payload dir="client" typename="uint8_t" sizechecktype="none"/>
Modified: showeq/branches/xerxes-trunk-dev/src/interface.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/interface.cpp 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/interface.cpp 2026-07-18 03:23:00 UTC (rev 1675)
@@ -750,6 +750,11 @@
m_packet->connect2("OP_MoneyOnCorpse", SP_Zone, DIR_Server,
"moneyOnCorpseStruct", SZC_Match,
m_messageShell, SLOT(moneyOnCorpse(const uint8_t*)));
+ // Corpse loot-window contents (variable length); print "corpse: items"
+ // as MT_Loot. The whole loot window (coin + items) rides this one opcode.
+ m_packet->connect2("OP_LootDrops", SP_Zone, DIR_Server,
+ "uint8_t", SZC_None,
+ m_messageShell, SLOT(lootDrops(const uint8_t*, size_t, uint8_t)));
m_packet->connect2("OP_Logout", SP_Zone, DIR_Server,
"uint16_t", SZC_Match,
m_messageShell, SLOT(logOut(const uint8_t*, size_t, uint8_t)));
Modified: showeq/branches/xerxes-trunk-dev/src/message.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/message.cpp 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/message.cpp 2026-07-18 03:23:00 UTC (rev 1675)
@@ -62,5 +62,6 @@
"Hunt",
"Locate",
"Chat", // UCS: MT_ChatChannel
+ "Loot", // corpse loot-window contents (MT_Loot)
};
Modified: showeq/branches/xerxes-trunk-dev/src/message.h
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/message.h 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/message.h 2026-07-18 03:23:00 UTC (rev 1675)
@@ -69,7 +69,8 @@
MT_Hunt,
MT_Locate,
MT_ChatChannel, // UCS: cross-zone/General channel chat
- MT_Max = MT_ChatChannel,
+ MT_Loot, // corpse loot-window contents (OP_LootDrops)
+ MT_Max = MT_Loot,
};
//----------------------------------------------------------------------
Modified: showeq/branches/xerxes-trunk-dev/src/messageshell.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/messageshell.cpp 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/messageshell.cpp 2026-07-18 03:23:00 UTC (rev 1675)
@@ -432,6 +432,9 @@
case CC_User_Random:
messageType = MT_Random;
break;
+ case CC_User_Loot:
+ messageType = MT_Loot;
+ break;
default:
messageType = MT_General;
break;
@@ -450,9 +453,10 @@
QString tempStr;
size_t messagesLen = len - ((uint8_t*)&fmsg->messages[0] - (uint8_t*)fmsg);
- m_messages->addMessage(chatColor2MessageType(fmsg->messageColor),
+
+ m_messages->addMessage(chatColor2MessageType(fmsg->messageColor),
m_eqStrings->formatMessage(fmsg->messageFormat,
- fmsg->messages,
+ fmsg->messages,
messagesLen));
}
@@ -515,6 +519,62 @@
}
+// Corpse loot-window contents (OP_LootDrops): the items you can loot off a
+// corpse, pushed when the loot window opens (and re-pushed at zone-in for a
+// corpse you still have rights to). Layout:
+// [2 bytes][u32][u32 corpseId @6][u32 count @10][corpse name NUL @14]
+// then per-item fields. Each item name is a clean NUL-terminated string;
+// the serialized link that follows repeats the name mangled (leading
+// capital fused to the hex), so we keep only NUL chunks that are entirely a
+// clean item name. Emits "corpse: item1, item2" under MT_Loot.
+void MessageShell::lootDrops(const uint8_t* data, size_t len, uint8_t dir)
+{
+ if (dir != DIR_Server || len < 15)
+ return;
+ uint32_t count = (uint32_t)data[10] | ((uint32_t)data[11] << 8) |
+ ((uint32_t)data[12] << 16) | ((uint32_t)data[13] << 24);
+ int i = 14;
+ while (i < (int)len && data[i] != 0) i++;
+ QString corpse = QString::fromLatin1((const char*)(data + 14), i - 14);
+ if (count == 0 || i >= (int)len) // empty corpse - nothing to loot
+ return;
+ i++; // skip corpse-name NUL
+
+ QStringList items;
+ int start = i;
+ for (int j = i; j <= (int)len; j++)
+ {
+ if (j == (int)len || data[j] == 0)
+ {
+ int clen = j - start;
+ if (clen >= 3 && clen <= 40)
+ {
+ bool ok = true, hasLower = false;
+ unsigned char c0 = data[start];
+ if (!((c0 >= 'A' && c0 <= 'Z') || (c0 >= 'a' && c0 <= 'z'))) ok = false;
+ for (int k = start; ok && k < j; k++)
+ {
+ unsigned char c = data[k];
+ if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
+ (c >= '0' && c <= '9') || c == ' ' || c == '\'' ||
+ c == '+' || c == '.' || c == '`' || c == '-'))
+ ok = false;
+ if (c >= 'a' && c <= 'z') hasLower = true;
+ }
+ if (ok && hasLower)
+ {
+ QString nm = QString::fromLatin1((const char*)(data + start), clen);
+ if (!items.contains(nm)) items.append(nm);
+ }
+ }
+ start = j + 1;
+ }
+ }
+ if (items.isEmpty())
+ return;
+ m_messages->addMessage(MT_Loot, corpse + ": " + items.join(", "));
+}
+
void MessageShell::moneyOnCorpse(const uint8_t* data)
{
const moneyOnCorpseStruct* money = (const moneyOnCorpseStruct*)data;
Modified: showeq/branches/xerxes-trunk-dev/src/messageshell.h
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/messageshell.h 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/messageshell.h 2026-07-18 03:23:00 UTC (rev 1675)
@@ -64,6 +64,8 @@
void specialMessage(const uint8_t* smsg, size_t, uint8_t);
// UCS: display decoded Universal Chat Service cross-zone/global chat.
void ucsChatMessage(const uint8_t* data, size_t len, uint8_t dir);
+ // corpse loot-window contents (OP_LootDrops): "corpse: item1, item2".
+ void lootDrops(const uint8_t* data, size_t len, uint8_t dir);
void guildMOTD(const uint8_t* gmotd, size_t, uint8_t);
void consent(const uint8_t* consent, size_t, uint8_t);
void moneyOnCorpse(const uint8_t* money);
Modified: showeq/branches/xerxes-trunk-dev/src/messagewindow.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/messagewindow.cpp 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/messagewindow.cpp 2026-07-18 03:23:00 UTC (rev 1675)
@@ -590,6 +590,7 @@
// (RGB 125,75,175). The load() below uses this as the default, so a
// user-set color preference still overrides it.
m_typeStyles[MT_ChatChannel].setColor(QColor(125, 75, 175));
+ m_typeStyles[MT_Loot].setColor(QColor(90, 90, 255));
QString typeName;
// iterate over the message types, filling in various menus and getting
Modified: showeq/branches/xerxes-trunk-dev/src/terminal.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/terminal.cpp 2026-07-18 02:18:34 UTC (rev 1674)
+++ showeq/branches/xerxes-trunk-dev/src/terminal.cpp 2026-07-18 03:23:00 UTC (rev 1675)
@@ -69,6 +69,7 @@
"\e[1;37;44m", // 34 - Locate
NULL, // 35
"\e[38;2;125;75;175m", // 36 - Chat (UCS: in-game universal-chat purple 125,75,175)
+ "\e[38;2;90;90;255m", // 37 - Loot (in-game loot-message blue 90,90,255)
};
//----------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|