add ffw to replay

This commit is contained in:
Alberto Xamin 2023-01-19 10:04:02 +00:00
parent c5dab6fde7
commit c05e2a69e2
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
2 changed files with 5 additions and 2 deletions

View File

@ -150,7 +150,10 @@ def get_me(sid, room):
return return
log = response.text.splitlines() log = response.text.splitlines()
sid.game.spectators.append(sid) sid.game.spectators.append(sid)
sid.game.replay(log) if 'ffw' not in room:
sid.game.replay(log)
else:
sid.game.replay(log, speed=0.1, fast_forward=int(room['ffw']))
return return
de_games = [g for g in games if g.name == room['name']] de_games = [g for g in games if g.name == room['name']]
if len(de_games) == 1 and not de_games[0].started: if len(de_games) == 1 and not de_games[0].started:

View File

@ -400,7 +400,7 @@ export default {
console.log('mounted lobby') console.log('mounted lobby')
if (!this.$route.query.code && !this.$route.query.replay) if (!this.$route.query.code && !this.$route.query.replay)
return this.$router.push('/') return this.$router.push('/')
this.$socket.emit('get_me', {name:this.$route.query.code, password:this.$route.query.pwd, username: localStorage.getItem('username'), discord_token: localStorage.getItem('discord_token'), replay: this.$route.query.replay}) this.$socket.emit('get_me', {name:this.$route.query.code, password:this.$route.query.pwd, username: localStorage.getItem('username'), discord_token: localStorage.getItem('discord_token'), replay: this.$route.query.replay, ffw: this.$route.query.ffw})
}, },
} }
</script> </script>