Example #1
0
 public static void Exit()
 {
     Console.WriteLine("");
     Console.WriteLine("Auto-Logout ...");
     KaroLogout.logout();
     Console.WriteLine("");
     Console.WriteLine("exit in 5 sec.");
     // Sleep for 3 seconds before exit
     Thread.Sleep(TimeSpan.FromSeconds(5));
     Console.WriteLine("[DONE]");
 }
Example #2
0
        private static bool loop = true; //variable for main-loop

        public static void Main()
        {
            //karotest.karotestprint();
            //karotest.karogetrequesttest();

            //while main loop
            while (loop == true)
            {
                csTlcHead();

                Console.WriteLine("Options:");
                Console.WriteLine("0: Exit");
                Console.WriteLine("1: UserInfo");
                Console.WriteLine("2: GameInfo");
                Console.WriteLine("3: login");
                Console.WriteLine("4: checkUser");
                Console.WriteLine("5: logout");
                Console.WriteLine("");

                // output cookie for debug
                Console.WriteLine("KeksName: " + KaroKeks.Name);
                Console.WriteLine("KeksExpires: " + KaroKeks.Expires);
                Console.WriteLine("KeksExpired: " + KaroKeks.Expired);
                Console.WriteLine("KeksValue: " + KaroKeks.Value);
                Console.WriteLine("");

                if (KaroKeks.Name == null)
                {
                    Console.WriteLine("you must login first!");
                    Console.WriteLine("");
                }
                Console.Write("Auswahl: ");
                string auswahl = Console.ReadLine();

                switch (auswahl)
                {
                case "0":
                    loop = false;
                    Exit();
                    break;

                case "1":
                    GetKaroUserInfo.GetUser();
                    Nochmal();
                    break;

                case "2":
                    GetKaroGameInfo.GetGame();
                    Nochmal();
                    break;

                case "3":
                    if (KaroKeks.Expired == false)
                    {
                        Console.WriteLine("You are already logged in!");
                        break;
                    }
                    else
                    {
                        KaroLogin.login();
                    }
                    Nochmal();
                    break;

                case "4":
                    KaroCheckUser.checkUser();
                    Nochmal();
                    break;

                case "5":
                    KaroLogout.logout();
                    Nochmal();
                    break;

                default:
                    Console.WriteLine(">> Eingabe ung�ltig! <<");
                    Nochmal();
                    break;
                }


                //Console.Clear(); // outcomment for CSharp_Shell!
            }
        }