Add read-only world boss tracking (AVA2 uitrack port)

Each game core snapshots its timed boss regens once a second and shares
them over the original HEADER_GG_RELAY addressed to "#mt_boss", so old
cores just miss the player lookup instead of dropping the P2P link.
New /mt_features query kind "bosses" (capability bit 256, mask 511)
lists the player's channel plus the shared channel 99.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-15 22:36:04 +09:00
co-authored by Claude Opus 5.5
parent a5293945b7
commit 400e44fae4
10 changed files with 322 additions and 5 deletions
+3 -1
View File
@@ -70,6 +70,7 @@ using LPCHARACTER=Character*;
#include <cstring>
static void PortCalendarQuery(LPCHARACTER,unsigned,unsigned){}
static bool PortDungeonQuery(LPCHARACTER,unsigned){return true;}
static unsigned bossQueries=0;void PortBossQuery(LPCHARACTER,unsigned request){bossQueries=request;}
#include "port_features.h"
#include "port_dungeon_rules.h"
static void query(Character& ch,const char* text){clockms+=300;do_port_features(&ch,text);}
@@ -106,7 +107,7 @@ int main(){
assert(rewards[0].total==100 && rewards[0].rule==WIKI_SINGLE);
rewards=items.PortWikiChest(50012);assert(rewards[1].rule==WIKI_INDEPENDENT && rewards[1].weight==150 && rewards[1].total==100);
assert(items.PortWikiChest(50013).empty() && items.PortWikiChest(19).empty());
Character ch;query(ch,"1 1 cap");assert(ch.messages.back()=="MTF1 cap 1 1 255 1700000000");
Character ch;query(ch,"1 1 cap");assert(ch.messages.back()=="MTF1 cap 1 1 511 1700000000");
ch.messages.clear();query(ch,"1 2 mob 101 0");assert(ch.messages.size()==10 && ch.messages.back()=="MTF1 end 2 8");
query(ch,"1 3 mob 101 999");assert(ch.messages.back()=="MTF1 error 3 offset");
query(ch,"1 4 mob 9001 0");assert(ch.messages.back()=="MTF1 error 4 missing");
@@ -116,6 +117,7 @@ int main(){
bool stone=false,hp=false;for(auto& line:ch.messages){stone|=line.find(" stone 10")!=std::string::npos;hp|=line.find(" hp 123")!=std::string::npos;}
assert(stone && hp && ch.messages.size()==sizeof(kPortStats)/sizeof(kPortStats[0])+2);
do_port_features(&ch,"1 8 stats");assert(ch.messages.back()=="MTF1 error 8 rate");
query(ch,"1 11 bosses");assert(bossQueries==11);query(ch,"1 12 bosses 1 0");assert(bossQueries==11 && ch.messages.back()=="MTF1 error 12 unsupported");
for(auto bad:{"2 9 stats","1 0 cap","1 -1 cap","1 4294967296 cap","1 10 cap too many extra"}) {
auto size=ch.messages.size();query(ch,bad);assert(ch.messages.size()==size);
}