 http = require('http')
 EventEmitter = require('events').EventEmitter
 Encoder = require('node-html-encoder').Encoder
+
+# track state of room internally
+Room = require('./room')
 
 # create our entity encoder for decoding chat messages
 encoder = new Encoder('entity')

	# sane functions. This is the actual API
	# any function who differs in name from the ttfm ones have a copy that calls said ttfm function
	# this is for API compatibility between ttapi and plugapi
	joinRoom: (name, callback)->
		@sendRPC('room.join', [name], callback)

	# alias for ttapi compatibility
	roomRegister: (name, callback)->

		if (!key)
			throw new Error("You must pass the authentication cookie into the PlugAPI object to connect correctly")
		@rpcHandlers = {}
		@room = new Room()

	setLogObject: (c)->
		logger = c
