   describe "LOGOUT", () ->
 
     it "should notify about players that log out", (done) ->
-      @anyplayer.send 'logout'
+      @anyplayer.emit 'logout'
       @anotherplayer.on 'logout', (msg) ->
         expect(msg).to.equal "Anyname"
         done()

        expect(@happens.calledTwice).to.be.ok
        done() ), 42 # ms responsiveness !!!

    it "should alow a server to unhost games (e.g. when full)" , (done) ->
      @lukas.emit 'join', { game: @anyplayer.gameInstanceID }
      @anyplayer.on "unhost", (msg) =>
        this.happens()
        expect(msg.host).to.equal "Anyname"
        expect(msg.game).to.equal GameInstanceID
      @anotherplayer.on "unhost", (msg) =>
        this.happens()
        expect(msg.host).to.equal "Anyname"
        expect(msg.game).to.equal GameInstanceID
      @lukas.send 'state'
      @lukas.on 'state', (msg) ->
        expect(msg).to.deep.equal( {

    it "may inform about active games (for debugging)", (done) ->
      @lukas.send 'games'
      @lukas.on 'games', (msg) ->
        expect(msg.players[0].name).to.equal "Anyname"
        expect(msg.players[0].game).to.equal undefined # not hosted anymore because it is already 'full'
        done()



        expect(msg.abc).to.equal "my"
        expect(msg.data).to.equal 42
        this.happens()
      setTimeout ( () =>
        expect(@happens.calledTwice).to.be.ok
        done() ), 42 # ms
