Ground bot intentions in live game knowledge and verify outcomes
Core tests / core (push) Successful in 28s
Core tests / core (push) Successful in 28s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Read native counters and profiler output; return bounded public measurements."""
|
||||
import json,subprocess,time,math
|
||||
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper')
|
||||
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper','nativeDeaths')
|
||||
def normalize_performance(raw):
|
||||
def number(v):
|
||||
try:
|
||||
@@ -28,9 +28,13 @@ def collect(sql,state):
|
||||
for line in sql('SELECT guid,COUNT(*) FROM acore_characters.character_queststatus_rewarded WHERE guid IN ('+guids+') GROUP BY guid').splitlines():
|
||||
guid,count=map(int,line.split('\t'));rewarded[guid]=count
|
||||
money={int(g):int(c) for g,c in (line.split('\t') for line in sql('SELECT guid,looted_copper FROM acore_auth.azerothai_currency').splitlines())}
|
||||
deaths={}
|
||||
for line in sql('SELECT guid,account_id,name,COUNT(*) FROM acore_auth.azerothai_death_experience GROUP BY guid,account_id,name').splitlines():
|
||||
g,account,name,count=line.split('\t');g=int(g)
|
||||
if g in allowed and allowed[g]['name']==name and allowed[g]['autonomy'].get('accountId')==int(account):deaths[g]=int(count)
|
||||
result=[]
|
||||
for guid,b in allowed.items():
|
||||
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0)
|
||||
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0);counters['nativeDeaths']=deaths.get(guid,0)
|
||||
result.append({'guid':guid,'name':b['name'],**counters})
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user