Keep takeoff clearance until actual ascent, blacklist rejected dynamic bridges, and diagnose group ground-path rejection. Synchronize native Wintergrasp client mount permission with battle state and fix duplicate Zangarmarsh graveyard ownership. Add regression tests and generic testbot aura inspection.
31 lines
1.7 KiB
Python
31 lines
1.7 KiB
Python
"""Verify delayed dynamic bridge rejection blocks only its directed connection."""
|
|
from pathlib import Path
|
|
import subprocess, tempfile
|
|
root = Path(__file__).resolve().parents[2]
|
|
source = (root / "src/server/game/World/ClientlessActionExecutorMgr.cpp").read_text()
|
|
start = source.index(' if (!failedEdgeDatabaseId && reason.rfind("route-local-", 0) == 0 &&')
|
|
end = source.index(' // A failed initial local approach', start)
|
|
code = r'''
|
|
#include <string>
|
|
#include <vector>
|
|
#include <unordered_set>
|
|
#include <cassert>
|
|
struct Step {std::string NodeKey,EdgeType;};
|
|
struct Record {unsigned RouteStep;std::vector<Step> Route;std::unordered_set<std::string> FailedBridgeKeys;};
|
|
void reject(Record& record,unsigned failedEdgeDatabaseId,std::string reason){
|
|
''' + source[start:end] + r'''
|
|
}
|
|
int main(){Record r{1,{{"taxi_2","start"},{"stormwind_tradecenter","local_bridge"}}, {}};
|
|
reject(r,0,"route-local-PathRejected");assert(r.FailedBridgeKeys.count("taxi_2->stormwind_tradecenter"));
|
|
assert(!r.FailedBridgeKeys.count("stormwind_tradecenter->taxi_2"));
|
|
r.FailedBridgeKeys.clear();reject(r,15,"route-local-PathRejected");assert(r.FailedBridgeKeys.empty());
|
|
r.RouteStep=0;reject(r,0,"route-local-PathRejected");assert(r.FailedBridgeKeys.empty());
|
|
r.RouteStep=1;r.Route[1].EdgeType="free_flight";reject(r,0,"route-local-PathRejected");assert(r.FailedBridgeKeys.empty());}
|
|
'''
|
|
with tempfile.TemporaryDirectory(prefix="vcore-dynamic-bridge-") as directory:
|
|
path=Path(directory)
|
|
(path/"test.cpp").write_text(code)
|
|
subprocess.run(["c++","-std=c++17",str(path/"test.cpp"),"-o",str(path/"test")],check=True)
|
|
subprocess.run([str(path/"test")],check=True)
|
|
print("Delayed bridge rejection, direction, persistent edges and non-bridge exclusions PASS")
|