mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
gameCommand implementation
This commit is contained in:
parent
6219a82fbd
commit
c4c48ab821
10 changed files with 62 additions and 39 deletions
|
|
@ -1,10 +1,11 @@
|
|||
define([
|
||||
"Game/Core/Protocol/Helper",
|
||||
"Game/Client/GameController",
|
||||
"Game/Core/User"
|
||||
"Game/Core/User",
|
||||
"Game/Core/NotificationCenter"
|
||||
],
|
||||
|
||||
function (ProtocolHelper, GameController, User) {
|
||||
function (ProtocolHelper, GameController, User, NotificationCenter) {
|
||||
|
||||
function Networker (socketLink) {
|
||||
this.socketLink = socketLink;
|
||||
|
|
@ -29,6 +30,7 @@ function (ProtocolHelper, GameController, User) {
|
|||
self.onDisconnect();
|
||||
});
|
||||
|
||||
NotificationCenter.on("sendGameCommand", this.sendGameCommand, this);
|
||||
}
|
||||
|
||||
Networker.prototype.onConnect = function () {
|
||||
|
|
@ -123,6 +125,11 @@ function (ProtocolHelper, GameController, User) {
|
|||
}
|
||||
}
|
||||
|
||||
Networker.prototype.sendGameCommand = function(command, options) {
|
||||
var message = ProtocolHelper.encodeCommand(command, options);
|
||||
this.sendCommand('gameCommand', message);
|
||||
};
|
||||
|
||||
return Networker;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue