Add danger-aware companion selection and native survival assistance
Core tests / core (push) Successful in 39s
Core tests / core (push) Successful in 39s
This commit is contained in:
@@ -16,7 +16,8 @@ def publish_recovery_intents(state, cfg):
|
||||
guid=identity.get('characterGuid');account=identity.get('accountId')
|
||||
if type(guid) is not int or type(account) is not int or guid<=0 or account<=0:continue
|
||||
rows.append('{guid=%d,account=%d,name=%s,action=%s}'%(guid,account,literal(bot['name']),literal(action)))
|
||||
source='if not AzerothAISetRecoveryIntents then error("Recovery guard not loaded") end; return AzerothAISetRecoveryIntents({'+','.join(rows)+'})'
|
||||
survival='true' if state.get('community',{}).get('partiesEnabled',True) else 'false'
|
||||
source='if AzerothAISetSurvivalEnabled then AzerothAISetSurvivalEnabled('+survival+') end; if not AzerothAISetRecoveryIntents then error("Recovery guard not loaded") end; return AzerothAISetRecoveryIntents({'+','.join(rows)+'})'
|
||||
req=urllib.request.Request('http://127.0.0.1:8787/api/ale/operator',data=json.dumps({'kind':'raw','source':source}).encode(),headers={'Content-Type':'application/json','Authorization':'Bearer '+cfg['ALE_OPERATOR_TOKEN']})
|
||||
with urllib.request.urlopen(req,timeout=10) as r:
|
||||
if r.status not in (200,202):raise RuntimeError('Recovery publication failed')
|
||||
|
||||
Reference in New Issue
Block a user