Beispiel #1
0
        static void PromptLogin()
        {
            while (true)
            {
                string username, password;

                Console.Write("Username: "******"Password: "******"Login Successful!");
                    return;

                case LoginResult.AccountNotFound:
                    Console.WriteLine("Account not found");
                    break;

                case LoginResult.WrongPassword:
                    Console.WriteLine("Wrong password");
                    break;

                case LoginResult.Unknown:
                    Console.WriteLine("Unknown error has occurred while attempting login");
                    break;
                }
                Console.WriteLine();
            }
        }
Beispiel #2
0
        static void PromptGameSelection()
        {
            int      selectedGameIdx;
            UserInfo userInfo = NPClient.GetUserInfo();

            Console.WriteLine(string.Format("\nSelect a game:"));
            for (int gameIdx = 0; gameIdx < userInfo.OpenGames.Count; gameIdx++)
            {
                GameInfo gameInfo = userInfo.OpenGames[gameIdx];
                Console.WriteLine($"{gameIdx}. {gameInfo.Name}");
            }

            Console.WriteLine(string.Format($"\nGame selection (0-{userInfo.OpenGames.Count-1}): "));
            while (!int.TryParse(Console.ReadLine(), out selectedGameIdx) || selectedGameIdx < 0 || selectedGameIdx > userInfo.OpenGames.Count - 1)
            {
                Console.WriteLine("Invalid Selection. Try again: ");
            }

            currentUniverse = NPClient.GetFullUniverseReport(userInfo.OpenGames[selectedGameIdx].Id);
            Console.WriteLine(string.Format("Game Data Loaded!\n"));
        }