"""Execute the production map-worker damage enqueue concurrently, without pointers.""" from pathlib import Path import subprocess,tempfile root=Path(__file__).resolve().parents[2] s=(root/'src/server/game/World/ClientlessPlayerMgr.cpp').read_text() a=s.index('void ClientlessPlayerMgr::DamageTaken(');b=s.index('{',a);e=b+1;depth=1 while depth:depth+=(s[e]=='{')-(s[e]=='}');e+=1 code=r''' #include #include #include #include #include #include using uint32=unsigned; struct ObjectGuid{unsigned id;unsigned GetCounter(){return id;}}; struct Unit{ObjectGuid guid;ObjectGuid GetGUID(){return guid;}}; struct Session{bool clientless=true;bool IsClientless(){return clientless;}}; struct Player:Unit{Session session;Session* GetSession(){return &session;}}; struct ClientlessPlayerMgr{ struct DamageNotice{ObjectGuid Attacker;uint32 Damage;}; std::mutex _damageMutex;std::unordered_map> _damageNotices; void DamageTaken(Player*,Unit*,uint32); }; '''+s[a:e]+r''' int main(){ ClientlessPlayerMgr mgr;std::vector players(16);std::vector threads; for(unsigned i=0;iDamageTaken(',start) assert unit.index('GetCommandStatus(CHEAT_GOD)',start)ModifyHealth(-(int32)damage);',start)