         expect(match.min).to.equal 2
         expect(match.max).to.equal 3
         MatchId = match.id # server assigned GUID
+        History += 1
       @lukas.on 'host', (match) ->
         expect(match.host).to.equal "Anyname"
         expect(match.min).to.equal 2

      @anyplayer.on 'join', (msg) =>
        expect(msg.player).to.equal "Ananda"
        expect(msg.id).to.equal MatchId
        done()

  
  


  describe "HISTORY (catch up)", ->

    it "should tell (the diff) what happened in some meanwhile", (done) ->
      @anyplayer.emit 'history', { since: Date.now }
      @anyplayer.on 'history', (diffs) ->
        expect(diffs).to.deep.equal( {
          players: [],
          games: [],
          match: [],
          chat: []
          stats: { player_online: 3, games_played: 1}
        } # not much happened since now :-)
    
      @anyplayer.emit 'history', { since: BeginOfTest }
      @anyplayer.on 'history', (diffs) ->
        expect(diffs).to.deep.equal( {
          players: [],
          games: [],
          match: [ {
            id: MatchID
            min: 2
            max: 3
            host: "Anyname"
            players: ["Ananda"]
            } ],
          chat: ["Lukas:   happy again :-)"]
          stats: { player_online: 3, games_played: 1}
        }
 
 



  describe "CUSTOM MESSAGING", () ->

    it "should send custom game messages to everyone in the game", (done) ->
      @anyplayer.emit 'move', {foo: "my", data: 42}
      @anotherplayer.on 'move', (msg) =>
        expect(msg).to.deep.equal( {
          foo: "my"
          data: 42
        }






      @lukas.send "happy again :-)"
      @anyplayer.on 'message', (msg) ->
        expect(msg).to.equal "Lukas:   happy again :-)"
        History += 1
      @anotherplayer.on 'message', (msg) ->
        expect(msg).to.equal "Lukas:   happy again :-)"
        done()
