added getSpawnedPlayersAndTheirPositions in order to get already spawned players to spawn the moment you join and spawn yourself. fixes #26

This commit is contained in:
Logsol 2013-01-05 22:38:29 +01:00
parent a852bccae6
commit a1e94e1ed0
6 changed files with 55 additions and 8 deletions

View file

@ -49,9 +49,17 @@ function (ProtocolHelper, GameController, User, NotificationCenter) {
this.onUserJoined(options.userId);
this.gameController.onJoinMe(options.userId);
if (options.others) {
for(var i = 0; i < options.others.length; i++) {
this.onUserJoined(options.others[i]);
if (options.joinedUsers) {
for(var i = 0; i < options.joinedUsers.length; i++) {
this.onUserJoined(options.joinedUsers[i]);
}
}
if (options.spawnedPlayers) {
for(var i = 0; i < options.spawnedPlayers.length; i++) {
this.gameController.onSpawnPlayer(options.spawnedPlayers[i]);
console.log("already spawned player, options: ", options.spawnedPlayers[i])
}
}
}