Description

Model used for the server. Socket.io resumes with a notion of class

  1. Import CanvasEngine
  2. Listen a port
  3. Initialize the model with a main class

    var CE = require("canvasengine").listen(8336);

    CE.Model.init("Main", {

    initialize: function(socket) {
        // Code
    }
    

    });

Properties

io

`(>= 1.3.0)` Object of Socket.io. View [https://github.com/LearnBoost/socket.io/wiki/Exposed-events#client](https://github.com/LearnBoost/socket.io/wiki/Exposed-events#client)

Methods

connectServer

`(>= 1.3.0)` Allows you to connect to the server. Created a Socket object from socket.io. Use the property `io` then to perform methods of Socket.io To use Socket.io , do not forget to put the JS file :

requireExtend

`(>= 1.3.0)` Load a class

io

`(>= 1.3.0)` Reference Socket.io. To call an event on a stage, you must prefix the name of the event by the name of the scene

init

Initializes the connection and call the class

create

Create a model

new

(alias `New`) Instantiating a model

assignEvents

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

Discussion