Exemplo n.º 1
0
        static Program()
        {
            var pList = Process.GetProcessesByName("OCTGN");
            if(pList != null && pList.Length > 0 && pList.Any(x=>x.Id != Process.GetCurrentProcess().Id))
            {
                var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?","OCTGN",MessageBoxButton.YesNo,MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    foreach (var p in Process.GetProcessesByName("OCTGN"))
                    {
                        if (p.Id != Process.GetCurrentProcess().Id)
                            p.Kill();
                    }
                }
            }



            LobbyClient = new Skylabs.Lobby.Client();
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            GamesPath = BasePath + @"Games\";
            LauncherWindow = new LauncherWindow();
            Application.Current.MainWindow = LauncherWindow;
            LobbyClient.Chatting.OnCreateRoom += Chatting_OnCreateRoom;
        }
Exemplo n.º 2
0
        static Program()
        {
            var pList = Process.GetProcessesByName("OCTGN");

            if (pList != null && pList.Length > 0 && pList.Any(x => x.Id != Process.GetCurrentProcess().Id))
            {
                var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?", "OCTGN", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    foreach (var p in Process.GetProcessesByName("OCTGN"))
                    {
                        if (p.Id != Process.GetCurrentProcess().Id)
                        {
                            p.Kill();
                        }
                    }
                }
            }



            LobbyClient = new Skylabs.Lobby.Client();
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            BasePath       = Path.GetDirectoryName(typeof(Program).Assembly.Location) + '\\';
            GamesPath      = BasePath + @"Games\";
            LauncherWindow = new LauncherWindow();
            Application.Current.MainWindow     = LauncherWindow;
            LobbyClient.Chatting.OnCreateRoom += Chatting_OnCreateRoom;
        }
Exemplo n.º 3
0
 static Program()
 {
     LobbyClient = new Skylabs.Lobby.Client();
     Debug.Listeners.Add(DebugListener);
     DebugTrace.Listeners.Add(DebugListener);
     Trace.Listeners.Add(DebugListener);
     BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
     GamesPath = BasePath + @"Games\";
     LauncherWindow = new LauncherWindow();
     Application.Current.MainWindow = LauncherWindow;
     LobbyClient.Chatting.OnCreateRoom += Chatting_OnCreateRoom;
 }
Exemplo n.º 4
0
        static Program()
        {
            try
            {
                RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
            }
            catch (Exception)
            {
                // if the system gets mad, best to leave it alone.
            }
            UseTransparentWindows = Prefs.UseWindowTransparency;
            WebsitePath           = ConfigurationManager.AppSettings["WebsitePath"];
            ChatServerPath        = ConfigurationManager.AppSettings["ChatServerPath"];
            GameServerPath        = ConfigurationManager.AppSettings["GameServerPath"];
            GameFeed = ConfigurationManager.AppSettings["GameFeed"];
            UseGamePackageManagement = bool.Parse(ConfigurationManager.AppSettings["UseGamePackageManagement"]);
#if (Release_Test)
            UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPathTest"];
#else
            UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPath"];
#endif

            var pList = Process.GetProcessesByName("OCTGN");
            if (pList != null && pList.Length > 0 && pList.Any(x => x.Id != Process.GetCurrentProcess().Id))
            {
                var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?", "OCTGN", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    foreach (var p in Process.GetProcessesByName("OCTGN"))
                    {
                        if (p.Id != Process.GetCurrentProcess().Id)
                        {
                            p.Kill();
                        }
                    }
                }
            }



            LobbyClient = new Skylabs.Lobby.Client(ChatServerPath);
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            GamesPath     = BasePath + @"Games\";
            MainWindowNew = new Main();
            Application.Current.MainWindow = MainWindowNew;
        }
Exemplo n.º 5
0
        static Program()
        {
            Log.Info("Starting OCTGN");
            try
            {
                Log.Debug("Setting rendering mode.");
                RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
            }
            catch (Exception)
            {
                // if the system gets mad, best to leave it alone.
            }

            Application.Current.MainWindow = new Window();

            CheckSSLCertValidation();
            try
            {
                Log.Info("Checking if admin");
                var isAdmin = UacHelper.IsProcessElevated && UacHelper.IsUacEnabled;
                if (isAdmin)
                {
                    MessageBox.Show(
                        "You are currently running OCTGN as Administrator. It is recommended that you run as a standard user, or you will most likely run into problems. Please exit OCTGN and run as a standard user.",
                        "WARNING",
                        MessageBoxButton.OK,
                        MessageBoxImage.Exclamation);
                }
            }
            catch (Exception e)
            {
                Log.Warn("Couldn't check if admin", e);
            }

            Log.Info("Creating Lobby Client");
            LobbyClient = new Skylabs.Lobby.Client(LobbyConfig.Get());
            Log.Info("Adding trace listeners");
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            Log.Info("Setting Games Path");
        }
Exemplo n.º 6
0
        static Program()
        {
            Log.Info("Starting OCTGN");
            try
            {
                Log.Debug("Setting rendering mode.");
                RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
            }
            catch (Exception)
            {
                // if the system gets mad, best to leave it alone.
            }

            Log.Info("Creating Lobby Client");
            LobbyClient = new Skylabs.Lobby.Client(AppConfig.ChatServerPath);
            Log.Info("Adding trace listeners");
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            Log.Info("Setting Games Path");
            GamesPath = BasePath + @"GameDatabase\";
        }
Exemplo n.º 7
0
 static Program()
 {
     Log.Info("Starting OCTGN");
     try
     {
         Log.Debug("Setting rendering mode.");
         RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
     }
     catch (Exception)
     {
         // if the system gets mad, best to leave it alone.
     }
     
     Log.Info("Creating Lobby Client");
     LobbyClient = new Skylabs.Lobby.Client(AppConfig.ChatServerPath);
     Log.Info("Adding trace listeners");
     Debug.Listeners.Add(DebugListener);
     DebugTrace.Listeners.Add(DebugListener);
     Trace.Listeners.Add(DebugListener);
     //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
     Log.Info("Setting Games Path");
     GamesPath = BasePath + @"GameDatabase\";
 }
Exemplo n.º 8
0
        static Program()
        {

            try
            {
                RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
            }
            catch (Exception)
            {
                // if the system gets mad, best to leave it alone.
            }
            UseTransparentWindows = Prefs.UseWindowTransparency;
            WebsitePath = ConfigurationManager.AppSettings["WebsitePath"];
            ChatServerPath = ConfigurationManager.AppSettings["ChatServerPath"];
            GameServerPath = ConfigurationManager.AppSettings["GameServerPath"];
            GameFeed = ConfigurationManager.AppSettings["GameFeed"];
            UseGamePackageManagement = bool.Parse(ConfigurationManager.AppSettings["UseGamePackageManagement"]);
#if(Release_Test)
            UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPathTest"];
#else
            UpdateInfoPath = ConfigurationManager.AppSettings["UpdateCheckPath"];
#endif
            bool.TryParse(ConfigurationManager.AppSettings["UseNewChrome"],out UseNewChrome);

            var pList = Process.GetProcessesByName("OCTGN");
            if(pList != null && pList.Length > 0 && pList.Any(x=>x.Id != Process.GetCurrentProcess().Id))
            {
                var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?","OCTGN",MessageBoxButton.YesNo,MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    foreach (var p in Process.GetProcessesByName("OCTGN"))
                    {
                        if (p.Id != Process.GetCurrentProcess().Id)
                            p.Kill();
                    }
                }
            }



            LobbyClient = new Skylabs.Lobby.Client(ChatServerPath);
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            GamesPath = BasePath + @"Games\";
            if (UseNewChrome)
            {
                MainWindowNew = new MainNew();
                Application.Current.MainWindow = MainWindowNew;
            }
            else
            {
                LauncherWindow = new LauncherWindow();
                Application.Current.MainWindow = LauncherWindow;
                LobbyClient.Chatting.OnCreateRoom += Chatting_OnCreateRoom;
            }
        }
Exemplo n.º 9
0
        static Program()
        {
            Log.Info("Starting OCTGN");
            try
            {
                Log.Debug("Setting rendering mode.");
                RenderOptions.ProcessRenderMode = Prefs.UseHardwareRendering ? RenderMode.Default : RenderMode.SoftwareOnly;
            }
            catch (Exception)
            {
                // if the system gets mad, best to leave it alone.
            }
	    
            Application.Current.MainWindow = new Window();

            CheckSSLCertValidation();
            try
            {
                Log.Info("Checking if admin");
                var isAdmin = UacHelper.IsProcessElevated && UacHelper.IsUacEnabled;
                if (isAdmin)
                {
                    MessageBox.Show(
                        "You are currently running OCTGN as Administrator. It is recommended that you run as a standard user, or you will most likely run into problems. Please exit OCTGN and run as a standard user.",
                        "WARNING",
                        MessageBoxButton.OK,
                        MessageBoxImage.Exclamation);
                }
            }
            catch (Exception e)
            {
                Log.Warn("Couldn't check if admin", e);
            }
            
            Log.Info("Creating Lobby Client");
            LobbyClient = new Skylabs.Lobby.Client(LobbyConfig.Get());
            Log.Info("Adding trace listeners");
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            Log.Info("Setting Games Path");
        }
Exemplo n.º 10
0
        static Program()
        {
            WebsitePath = ConfigurationManager.AppSettings["WebsitePath"];
            ChatServerPath = ConfigurationManager.AppSettings["ChatServerPath"];
            GameServerPath = ConfigurationManager.AppSettings["GameServerPath"];
            //TODO FIGURE THIS SHIT OUT!!!
            //var l = GameRepository.GetRepo().Games.ToList();
            //foreach (var a in l)
            //{
            //    if (a.Name == "Magic: the Gathering")
            //    {
            //        MessageBox.Show("Starting query all");
            //        var sets = a.Sets.ToList();
                    
            //        var cards = sets.SelectMany(x => x.Cards).ToArray();
            //        var c = cards.FirstOrDefault();
            //        MessageBox.Show("Finished Query All: " + c.Name);
            //    }
            //}
            var pList = Process.GetProcessesByName("OCTGN");
            if(pList != null && pList.Length > 0 && pList.Any(x=>x.Id != Process.GetCurrentProcess().Id))
            {
                var res = MessageBox.Show("Another instance of OCTGN is current running. Would you like to close it?","OCTGN",MessageBoxButton.YesNo,MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    foreach (var p in Process.GetProcessesByName("OCTGN"))
                    {
                        if (p.Id != Process.GetCurrentProcess().Id)
                            p.Kill();
                    }
                }
            }



            LobbyClient = new Skylabs.Lobby.Client(ChatServerPath);
            Debug.Listeners.Add(DebugListener);
            DebugTrace.Listeners.Add(DebugListener);
            Trace.Listeners.Add(DebugListener);
            //BasePath = Path.GetDirectoryName(typeof (Program).Assembly.Location) + '\\';
            GamesPath = BasePath + @"Games\";
            LauncherWindow = new LauncherWindow();
            Application.Current.MainWindow = LauncherWindow;
            LobbyClient.Chatting.OnCreateRoom += Chatting_OnCreateRoom;
        }