Esempio 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;
        }
Esempio 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;
        }
Esempio 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;
 }
Esempio n. 4
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;
        }