Spaces:
Running
Running
Commit ·
e7b103a
1
Parent(s): 07165b2
clean
Browse files3005 unmodified lines30063007300830093010301130123013301411 unmodified lines3026302730283029303030313032303330343005 unmodified linesvar fixedAction = Math.floor(this.fixedTimer / this.FIXED_CYCLE) % 2 === 0 ? 0 : 1;promises.push(fetch(BASE+'/step',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({session_id:this.fixedSessionId,action:fixedAction})}).then(r=>{ if(!r.ok) throw new Error('HTTP '+r.status); return r.json(); }).catch(e=>{log('Battle step err: '+e.message,'err');return null;}));} else { promises.push(Promise.resolve(null)); }11 unmodified lines}promises.push(fetch(BASE+'/step',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({session_id:this.aiSessionId,action:aiAction})}).then(r=>{ if(!r.ok) throw new Error('HTTP '+r.status); return r.json(); }).catch(e=>{log('Battle step err: '+e.message,'err');return null;}));} else { promises.push(Promise.resolve(null)); }3005 unmodified lines300630073008300930103011301211 unmodified lines30243025302630273028302930303005 unmodified linesvar fixedAction = Math.floor(this.fixedTimer / this.FIXED_CYCLE) % 2 === 0 ? 0 : 1;promises.push(fetch(BASE+'/step',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({session_id:this.fixedSessionId,action:fixedAction})}).then(r=>r.json()).catch(e=>{log('Step err:'+e.message,'err');return null;}));} else { promises.push(Promise.resolve(null)); }11 unmodified lines}promises.push(fetch(BASE+'/step',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({session_id:this.aiSessionId,action:aiAction})}).then(r=>r.json()).catch(e=>{log('Step err:'+e.message,'err');return null;}));} else { promises.push(Promise.resolve(null)); }
app/viz/dashboard.py+2-6