/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.xmr.core;

/**
 *
 * @author Adil
 * Bootstrap for all methods & whatnot
 * Habbo.Invoke
 * Net.Invoke
 * Util.Invoke
 * 
 * Only method here is:
 * Boot
 */
import com.xmr.net.*;


import java.io.IOException;
import java.sql.SQLException;
import com.xmr.storage.*;
import com.xmr.storage.mongo.MongoCore;
import java.io.FileInputStream;
import java.util.Properties;


public class Bootstrap {
    
         static  TCPConn connection = new TCPConn(30000);
    
    public static void Boot() throws SQLException, IOException{
        
       
        
      
  
         connection.bootSock();
        Log.WriteInfo("Network I/O booted");
        Properties conf = new Properties();
  conf.load(new FileInputStream("conf/xmr.properties"));
        if(conf.getProperty("system.engine").matches("MySQL")){
        SQLCore.Connect();
        }else if(conf.getProperty("system.engine").matches("Mongo")){
       // MongoCore.InitMongo();}


        
        
                
    }}
    public static void Shutdown(){
    connection.Close();
    Log.WriteInfo("Connection shut down");
    System.exit(1);
    }
  public static TCPConn getConnection(){
return connection;
}
    }
