Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@socialgorithm/game-server

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socialgorithm/game-server - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

6

dist/GameServer.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc