reduce data sent to clients
This commit is contained in:
parent
cac1f02557
commit
1025d42ea2
4 changed files with 63 additions and 46 deletions
|
|
@ -368,12 +368,10 @@ async function main() {
|
|||
|
||||
if (MODE === 'play') {
|
||||
const game = await Communication.connect(gameId, CLIENT_ID)
|
||||
game.rng.obj = Rng.unserialize(game.rng.obj)
|
||||
Game.newGame(game)
|
||||
Game.newGame(Util.decodeGame(game))
|
||||
} else if (MODE === 'replay') {
|
||||
const {game, log} = await Communication.connectReplay(gameId, CLIENT_ID)
|
||||
game.rng.obj = Rng.unserialize(game.rng.obj)
|
||||
Game.newGame(game)
|
||||
Game.newGame(Util.decodeGame(game))
|
||||
GAME_LOG = log
|
||||
lastRealTime = Util.timestamp()
|
||||
GAME_START_TS = GAME_LOG[0][GAME_LOG[0].length - 1]
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export default {
|
|||
(or select from below)
|
||||
</span>
|
||||
</div>
|
||||
<span class="btn" :class="" @click="newGame">Start new game</span>
|
||||
<span class="btn" :class="" @click="onNewGameClick">Start new game</span>
|
||||
|
||||
<h1>Image lib</h1>
|
||||
<div>
|
||||
|
|
@ -131,7 +131,7 @@ export default {
|
|||
mediaImgUploaded(j) {
|
||||
this.image = j.image
|
||||
},
|
||||
async newGame() {
|
||||
async onNewGameClick() {
|
||||
const res = await fetch('/newgame', {
|
||||
method: 'post',
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue