mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
join success roundtrip added
This commit is contained in:
parent
e93dbf2f2a
commit
2183e70bd8
5 changed files with 48 additions and 53 deletions
|
|
@ -1,9 +1,10 @@
|
|||
define([
|
||||
"Game/Core/User",
|
||||
"Game/Core/Protocol/Helper"
|
||||
"Game/Core/Protocol/Helper",
|
||||
"Game/Core/NotificationCenter"
|
||||
],
|
||||
|
||||
function (Parent, ProtocolHelper) {
|
||||
function (Parent, ProtocolHelper, NotificationCenter) {
|
||||
|
||||
function User (socketLink, coordinator) {
|
||||
Parent.call(this, socketLink.id);
|
||||
|
|
@ -20,6 +21,8 @@ function (Parent, ProtocolHelper) {
|
|||
socketLink.on('disconnect', function () {
|
||||
self.onDisconnect();
|
||||
});
|
||||
|
||||
NotificationCenter.on("user/" + this.socketLink.id + "/message", this.onChannelMessage, this);
|
||||
}
|
||||
|
||||
User.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -62,6 +65,10 @@ function (Parent, ProtocolHelper) {
|
|||
}
|
||||
}
|
||||
|
||||
User.prototype.onChannelMessage = function(message) {
|
||||
this.socketLink.send(message);
|
||||
};
|
||||
|
||||
return User;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue