       @net.on types.end,              @handleEnd
       @net.on types.serverDown,       @handleServerDown
 
+    # Logically register as sharing client
     connectedToServer: =>
       @sendToServer
         type:     types.connecting
         username: @username
         color:    @color
 
+    # Send a message to the server and manage the state.
+    # If the connection is initialized, there is no state to update.
     sendToServer: (transform) =>
       @state.inc @id if @state? and transform.type isnt types.connect
       transform.id = @id

    handleEnd: =>
      @emit 'end'

    handleServerDown: ->

    initialize: (transform) =>
      @emit types.clear
      @id       = transform.clientId

      initialized = true
      @emit types.initialized

    # Manage acknowledges
    acknowledge: (ack) =>
      for i in [0...@notAcked.length]
        if @notAcked[i].state[@id] is ack[@id]
