Пример #1
0
        internal static void Main()
        {
            Constants.Port       = 17777;
            Constants.MaxPlayers = 1;

            ServerStarter.Start(new EmptyLogic());
            Server.PacketHandlers.Add((int)PacketEnum.Lol, SendAndHandel.ReceiveLol);
        }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            Instnace = this;
            //GV.MCanvas = mainCanvas;
            //GV.MWindow = window;
            //GV.MGrid = MainGrid;

            ServerStarter serverIniter = new ServerStarter();
        }
Пример #3
0
        private void OnStartServer(object sender, RoutedEventArgs e)
        {
            // allow only one instance to run
            if (serverWatcher.IsProcessAlive())
            {
                // show error message
                return;
            }

            ServerStarter starter = new ServerStarter(ServerLocation.Text);
        }
Пример #4
0
        private void OnStartServer(object sender, RoutedEventArgs e)
        {
            string check_server_file = laucherSettings.GetServerLocation() + @"\" + laucherSettings.GetServerFilename() + ".exe";

            if (!File.Exists(check_server_file))
            {
                ErrorHandler.AddError(112, "Cannot find server at this location.");
            }
            else
            {
                ErrorHandler.RemoveError(112, "Cannot find server at this location.");
                // allow only one instance to run
                if (serverWatcher.IsProcessAlive())
                {
                    ErrorHandler.AddError(201, "Server is already running");
                }
                else
                {
                    ErrorHandler.RemoveError(201, "Client is already running");
                    ServerStarter starter = new ServerStarter(ServerLocation.Text, ServerFileName.Text);
                }
            }
            DisplayErrors();
        }
Пример #5
0
        private void OnStartServer(object sender, RoutedEventArgs e)
        {
            string check_server_file = laucherSettings.GetServerLocation() + @"\" + laucherSettings.GetServerFilename() + ".exe";

            if (!File.Exists(check_server_file))
            {
                ErrorHandler.AddError(ErrorType.error_Client_noLocation);
            }
            else
            {
                ErrorHandler.RemoveError(ErrorType.error_Server_noLocation);
                // allow only one instance to run
                if (serverWatcher.IsProcessAlive())
                {
                    ErrorHandler.AddError(ErrorType.error_ServerAlreadyRunning);
                }
                else
                {
                    ErrorHandler.RemoveError(ErrorType.error_ServerAlreadyRunning);
                    ServerStarter starter = new ServerStarter(laucherSettings.GetServerLocation(), laucherSettings.GetServerFilename());
                }
            }
            DisplayErrors();
        }
Пример #6
0
 private void OnStartServer(object sender, RoutedEventArgs e)
 {
     ServerStarter starter = new ServerStarter(ServerLocation.Text);
 }
Пример #7
0
 public UnitTest1()
 {
     _publisher = new ServerStarter(PUBLISHER_ROOT);
     _publisher.Start("publisher.appsettings.json");
 }
Пример #8
0
 private static void Main(string[] args)
 {
     ServerStarter.Start(new GameLogic());
 }