Source

Vesperia / init.coffee

Full commit
###
 Vesperia: A Tethealla management port proxy and api server

 Copyright 2012 Pol Cámara
 Released under the MIT license
 Check LICENSE.MIT for more details.
###

net = require 'net'
mysql = require 'mysql'
settings = require './settings'
vespServer = require './server'
tethClient = require './client'

console.log ""
console.log "############################################################"
console.log "# Vesperia: A tethealla management port proxy and api server"
console.log "#"
console.log "# Copyright 2012 Pol Cámara"
console.log "# Released under the MIT License"
console.log "# Check LICENSE.MIT for more details"
console.log "############################################################"

ask_chat = false

if process.argv.length == 2 && process.argv[0] != "coffee"
  ask_chat = true

if process.argv.length == 3 && process.argv[0] == "coffee" 
  ask_chat = true

connection = mysql.createConnection settings.dbConnection

client = new tethClient.client net, settings.tetheallaPort, settings.tetheallaHost, ask_chat
client.initialize()

server = new vespServer.Server net, settings.vesperiaPort, settings.vesperiaHost, connection, client
server.initialize()