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
|
|
@ -38,14 +38,16 @@
|
|||
|
||||
Channel.prototype.onAddUser = function (userId) {
|
||||
var user = new User(userId, this);
|
||||
var others = Object.keys(this.users);
|
||||
var joinedUsers = Object.keys(this.users);
|
||||
var spawnedPlayers = this.gameController.getSpawnedPlayersAndTheirPositions();
|
||||
|
||||
this.users[user.id] = user;
|
||||
|
||||
var options = {
|
||||
userId: user.id,
|
||||
channelName: this.name,
|
||||
others: others
|
||||
joinedUsers: joinedUsers,
|
||||
spawnedPlayers: spawnedPlayers
|
||||
};
|
||||
|
||||
NotificationCenter.trigger('user/' + user.id + "/joinSuccess", options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue