Description

(>= 1.3.0) Assign events of a class to a user

Usage

Parameters

  • name {String}

    Class name

  • socket {Object}

    Socket

Returns

Class

Example

var Map = require("./map").New(null); // socket is null. It indicates that not assign an event to sockets

CE.Model.init("Main", {

     enterMap: function() {
         CE.Model.assignEvents(Map, this.socket);
     }

});

Discussion