Example #1
0
 static void SetSong(MainServer ToSet)
 {
     Console.WriteLine("Caution: too many song slot will cause game crash!");
     Console.Write("How many song you want to insert(Default & Tested:400) :");
     while (true)
     {
         try
         {
             int NewAvaterCount = int.Parse(Console.ReadLine());
             ToSet.MaxAvater = NewAvaterCount;
             Console.Write("Song slot has updated to " + NewAvaterCount.ToString());
             Console.WriteLine(",restart game to take effect.");
             Console.ReadLine();
             return;
         }
         catch
         {
             Console.WriteLine("Error happended when setting new song slot.\nPlease try again.");
         }
     }
 }
Example #2
0
 static void SetSong(MainServer ToSet)
 {
     Console.WriteLine("Warning: too many song slot may cause game crash!");
     Console.Write("How many song would you like to insert(Default & Tested: 500) :");
     while (true)
     {
         try
         {
             int NewSongCount = int.Parse(Console.ReadLine());
             ToSet.MaxStage = NewSongCount;
             Console.WriteLine("Song slot has updated to " + NewSongCount.ToString());
             Console.WriteLine("Reboot game to take effect.");
             Console.ReadLine();
             return;
         }
         catch
         {
             Console.WriteLine("Error happended when setting new song slot.\nPlease try again.");
         }
     }
 }
Example #3
0
        static void Main(string[] args)
        {
            IPAddress[] addressList = Dns.GetHostAddresses(Dns.GetHostName());
            MainServer  Listener;

            try
            {
                Listener = new MainServer(Version);
                Thread ListenerThread = new Thread(new ThreadStart(Listener.listen));
                ListenerThread.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine("Error when setting up server.");
                Console.WriteLine("  " + e.Message);
                Console.WriteLine(e.StackTrace);

                Console.WriteLine("\nIf this is a network-related error,please ensure you have a network connection ");
                Console.WriteLine("and port 80 is not used.");
                Console.WriteLine("Else, try restart computer and try again.");
                Console.ReadLine();
                return;
            }
            Console.Title = "GC2 FullUnlock Toolkit | " + Version;
            Console.WriteLine("GC2 FullUnlock Toolkit Online.");

            Console.WriteLine("Set gc2.gczero.com to following address in hosts to get started.");
            foreach (var address in addressList)
            {
                Console.WriteLine(address);
            }
            Console.WriteLine("-------------");

            //Console.WriteLine("Enter tutorial to get detail.");
            while (true)
            {
                Console.WriteLine("\nCurrent SongSlot:" + Listener.MaxStage + ",AvaterSlot:" + Listener.MaxAvater);
                Console.WriteLine("Enter help for command detail.");
                Console.Write("GC2Toolkit>");
                string Input = Console.ReadLine();
                if (Input == "exit")
                {
                    Environment.Exit(0);
                }
                else if (Input == "help")
                {
                    Help();
                }
                else if (Input == "reset")
                {
                    Listener.ResetTimer();
                }
                else if (Input == "set")
                {
                    SetTimer(Listener);
                }
                else if (Input == "clear")
                {
                    Console.Clear();
                }
                else if (Input == "updatepak")
                {
                    Listener.PakUpdater();
                }
                else if (Input == "songcount")
                {
                    SetSong(Listener);
                }
                else if (Input == "avatercount")
                {
                    SetAvater(Listener);
                }
                else if (Input == "default")
                {
                    SetDefault(Listener);
                }
            }
        }