mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added lobby, nickname fixes #44, channel name
This commit is contained in:
parent
aa4535cb0c
commit
da913c4709
10 changed files with 285 additions and 68 deletions
|
|
@ -34,7 +34,12 @@ function (ProtocolHelper, GameController, User, NotificationCenter, Settings, Do
|
|||
|
||||
Networker.prototype.onConnect = function () {
|
||||
console.log('connected.')
|
||||
this.sendCommand('join', 'dungeon');
|
||||
var channel = JSON.parse(localStorage["channel"]);
|
||||
if(channel.name) {
|
||||
this.sendCommand('join', channel.name);
|
||||
} else {
|
||||
window.location.href = "/";
|
||||
}
|
||||
}
|
||||
|
||||
Networker.prototype.onDisconnect = function () {
|
||||
|
|
@ -45,6 +50,7 @@ function (ProtocolHelper, GameController, User, NotificationCenter, Settings, Do
|
|||
}
|
||||
|
||||
Networker.prototype.onJoinSuccess = function (options) {
|
||||
console.log("join success")
|
||||
this.userId = options.userId;
|
||||
|
||||
this.gameController = new GameController();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue