Example #1
0
        private static string GetAvailablePort(string defaultport)
        {
            MainWindow WindowsGSM = (MainWindow)System.Windows.Application.Current.MainWindow;

            int[] portlist = new int[WindowsGSM.ServerGrid.Items.Count];

            for (int i = 0; i < WindowsGSM.ServerGrid.Items.Count; i++)
            {
                GameServerTable row = WindowsGSM.ServerGrid.Items[i] as GameServerTable;
                portlist[i] = Int32.Parse(string.IsNullOrWhiteSpace(row.Port) ? "0" : row.Port);
            }

            Array.Sort(portlist);

            int port = Int32.Parse(defaultport);

            for (int i = 0; i < WindowsGSM.ServerGrid.Items.Count; i++)
            {
                if (port == portlist[i])
                {
                    port++;
                }

                //SourceTV port 27020
                if (port == 27020)
                {
                    port++;
                }
            }

            return(port.ToString());
        }
Example #2
0
 public Stop(GameServerTable server)
 {
     this.server = server;
 }
Example #3
0
 public Restart(GameServerTable server, string gslt, string additionalParam)
 {
     this.server          = server;
     this.gslt            = gslt;
     this.additionalParam = additionalParam;
 }
Example #4
0
 public static void Initialize()
 {
     DatabaseManager.Provider.ExecuteQuery("UPDATE accounts set logged = 0");
     Logger.Info(string.Format("{0} gameservers catched !", GameServerTable.FindAll()));
 }
Example #5
0
 public Update(GameServerTable server)
 {
     this.server = server;
 }