  module JamWebsockets
  class ClientContext
    
    attr_accessor :user, :client, :msg_count, :session, :sent_bad_state_previously

    def initialize(user, client)
      @user = user
      @client = client
      @msg_count = 0
      @session = nil
      @sent_bad_state_previously = false
    end

    def to_s
      return "Client[user:#{@user} client:#{@client} msgs:#{@msg_count} session:#{@session}]"
    end

    def hash
      @client.hash
    end

    def ==(o)
      o.class == self.class && o.client == @client
    end
    alias_method :eql?, :==

  end
end
