Example #1
0
        private Timer _ticker; // Helps generate the periodic tick used by games

        #endregion Fields

        #region Constructors

        internal GameManager(IrcClient irc, Loader loader)
        {
            _irc = irc;
            _irc.OnIRCQEvent += OnIncoming;
            _loader = loader;

            _tickCount = 0;
            _ticker = new Timer(
                delegate { _irc.Enqueue(new TickEvent()); },
                null, Timeout.Infinite, Timeout.Infinite);

            _commands = new Dictionary<string, CommandHandler>();
            CommandSetup();
        }
Example #2
0
        public static void Main(string[] args)
        {
            GameChannel.Out("GameChannel", "Version " + Version);

            IrcClient irc = new IrcClient();
            irc.IsBackground = false;

            Loader loader = new Loader();
            dispatcher = new GameManager(irc, loader);
            manager = new ConnectManager(irc, dispatcher);

            Console.CancelKeyPress += OnConsoleInterrupt;
            AppDomain.CurrentDomain.UnhandledException += UnhandledException;

            GameChannel.Out("GameChannel", "Reading configuration");
            ConnectionSettings serverconf = LoadServerConfig();

            GameChannel.Out("GameChannel", "Applying configuration and connecting");
            irc.Settings = serverconf;

            irc.Connect();
        }