Exemplo n.º 1
0
 public Message( )
 {
     _dbal = DAL.singleton( );
 }
Exemplo n.º 2
0
 public User()
 {
     this._db = DAL.singleton();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Singletons the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 /// <param name="port">The port.</param>
 /// <param name="username">The username.</param>
 /// <param name="password">The password.</param>
 /// <param name="schema">The schema.</param>
 /// <returns></returns>
 public static DAL singleton(string host, uint port, string username, string password, string schema)
 {
     return _singleton ??
            ( _singleton =
              new DAL( host, port, username, password, schema ) );
 }
Exemplo n.º 4
0
        private static void initialiseBot(string configFile)
        {
            string username;
            string password;
            string schema;
            uint port = 0;
            string server = username = password = schema = "";

            Configuration.readHmbotConfigFile(configFile, ref server, ref username, ref password, ref port, ref schema);

            _dbal = DAL.singleton(server, port, username, password, schema);

            if (!_dbal.connect())
            {
                // can't connect to database, DIE
                return;
            }

            Configuration.singleton();

            debugChannel = Configuration.singleton()["channelDebug"];

            _ircNetwork = uint.Parse(Configuration.singleton()["ircNetwork"]);

            _trigger = Configuration.singleton()["commandTrigger"];

            irc = new IAL(_ircNetwork);

            new IrcProxy(irc, int.Parse(Configuration.singleton()["proxyPort"]), Configuration.singleton()["proxyPassword"]);

            PageWatcherController.instance();

            setupEvents();

            TimeMonitor.instance();

            if (!irc.connect())
            {
                // if can't connect to irc, die
                return;
            }

            new MonitorService(62167, "Helpmebot v6 (Nagios Monitor service)");

            new UDPListener(4357);

            string[] twparms = {server, schema, irc.ircServer};
            try
            {
                new Twitter().updateStatus(new Message().get("tweetStartup", twparms));
            }
            catch(Twitterizer.TwitterizerException ex)
            {
                GlobalFunctions.errorLog( ex );
            }

            // ciavc hook
            irc.privmsgEvent+=AccAi.checkCiaVcCommits;
        }