@socialgorithm/game-server
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -45,3 +45,3 @@ "use strict"; | ||
var playerGameTokens = _this.generateGameTokens(createGameMessage.players); | ||
createGameMessage.players = createGameMessage.players.map(function (player) { return playerGameTokens.get(player); }); | ||
createGameMessage.players = createGameMessage.players.map(function (player) { return playerGameTokens[player]; }); | ||
var gameOutputChannel = { | ||
@@ -73,3 +73,5 @@ sendGameEnd: _this.sendGameEnded(socket, createGameMessage.gameID), | ||
this.generateGameTokens = function (players) { | ||
return new Map(players.map(function (player) { return [player, uuid_1.v4()]; })); | ||
var gameTokens = {}; | ||
players.forEach(function (player) { gameTokens[player] = uuid_1.v4(); }); | ||
return gameTokens; | ||
}; | ||
@@ -76,0 +78,0 @@ this.allPlayersReady = function (gameID) { |
{ | ||
"name": "@socialgorithm/game-server", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "JS Game Server library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -71,3 +71,3 @@ import { GAME_SOCKET_MESSAGE, GameMessage, Player } from "@socialgorithm/model"; | ||
const playerGameTokens = this.generateGameTokens(createGameMessage.players); | ||
createGameMessage.players = createGameMessage.players.map(player => playerGameTokens.get(player)); | ||
createGameMessage.players = createGameMessage.players.map(player => playerGameTokens[player]); | ||
@@ -110,3 +110,5 @@ const gameOutputChannel: GameOutputChannel = { | ||
private generateGameTokens = (players: Player[]) => { | ||
return new Map(players.map(player => [player, uuid()] as [string, string])); | ||
const gameTokens: { [key: string]: string } = {}; | ||
players.forEach(player => { gameTokens[player] = uuid(); }); | ||
return gameTokens; | ||
} | ||
@@ -113,0 +115,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57917
368