 	wss: require('websocket').server
 	sha: require('sha1')
 	aes: require('aes256')
+	readline: require('readline')
 
 # Initialize modules
 WebServer = https.createServer

eventHandlers = [
	{
		expectedType: "dm"
		onMessage: (msg, source) ->

	}
]
setupHandlersForUser

# Login procedure
WSServer.on 'request', (req) ->

	for group in groupRegistry
		return group if group.id is id

User.fromJSON = (jsonExpression) -> new User(jsonExpression.id, jsonExpression.powerLevel, jsonExpression.auth)
Group.fromJSON = (jsonExpression) -> new Group(jsonExpression.id, getUserById userExp for userExp in jsonExpression.members, jsonExpression.passphrase)

# Set up variables
userRegistry.push User.fromJSON json for json in JSON.parse Modules.fs.readFileSync ResourceDir + "users.json"
groupRegistry.push Group.fromJSON json for json in JSON.parse Modules.fs.readFileSync ResourceDir + "groups.json"


containsUser = (id) -> (getUserById id)?
containsGroup = (id) -> (getGroupById id)?

