- localStorage["gid"] = getRandString();
- // Extract times (in [milli]seconds), set clocks, store in localStorage
- const tc = extractTime(gameInfo.timeControl);
- localStorage["timeControl"] = gameInfo.timeControl;
- localStorage["clocks"] = JSON.stringify(
- [...Array(gameInfo.players.length)].fill(tc.mainTime));
- localStorage["increment"] = tc.increment;
- localStorage["started"] = JSON.stringify(
- [...Array(gameInfo.players.length)].fill(false));
- localStorage["vname"] = this.getVname(gameInfo.vid);
- localStorage["fenInit"] = gameInfo.fen;
- localStorage["players"] = JSON.stringify(gameInfo.players);
+ GameStorage.init({
+ gameId: getRandString(),
+ vname: this.getVname(gameInfo.vid),
+ fenStart: gameInfo.fen,
+ players: gameInfo.players,
+ timeControl: gameInfo.timeControl,
+ });