Exemple #1
0
        public static int Main(string[] args)
        {
            Network network;

            try
            {
                IPAddress.Parse(args[0]);
                address = args[0];
                port    = Int32.Parse(args[1]);
            }
            catch
            {
                Console.Error.WriteLine("Wrong parameters...\nHELP:\n1st parameter: ip address\n2nd parameter: port");
                return(84);
            }
            try
            {
                Console.WriteLine("Hello world!\nServer is running on address " + address + ":" + port + ".\nPress escape to quit (some say that a platypus will appear...)\nLauching lobby!");
                Console.WriteLine();
                network = new Network(address, port);
                Lobby lobby = new Lobby();
                lobby.Run();
                Console.WriteLine(
                    "      .--..-'''-''''-._\n  ___/%   ) )      \\ i-;;,_\n((:___/--/ /--------\\ ) `'-'\n         \"\"          \"\"");
                return(0);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Something happened... " + e.Message);
                return(84);
            }
        }
Exemple #2
0
        /// <summary>
        /// The entry point of the program, where the program control starts and ends.
        /// </summary>
        /// <returns>The exit code that is given to the operating system after the program ends.</returns>
        public static int Main(string[] args)
        {
            GameManager manager;

            try
            {
                IPAddress.Parse("127.0.0.1");
                address = "127.0.0.1";
                port    = Int32.Parse("8080");
            }
            catch
            {
                Console.Error.WriteLine("IP adress error.");
                return(84);
            }
            try
            {
                Console.WriteLine("Hi ! DOT_cardGames is running on address " + address + ":" + port + ".\nLauching lobby...");
                Console.WriteLine();
                manager = new GameManager(address, port);
                Lobby lobby = new Lobby();
                lobby.Run();
                Console.WriteLine("Bye ! DOT_cardGames is shutting down. Thanks for playing.");
                return(0);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Server error... " + e.Message);
                return(84);
            }
        }