mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
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:
parent
a852bccae6
commit
a1e94e1ed0
6 changed files with 55 additions and 8 deletions
|
|
@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue