Beispiel #1
0
        private Server GetServer(ProcessItem process)
        {
            var baseDir = Directory.GetParent(Directory.GetParent(process.Path).FullName);
            var config  = new IL2StartupConfig(String.Concat(baseDir, @"\data\startup.cfg"));
            var rcon    = new RconConnection(config);
            var server  = new Server(rcon, process);

            return(new Server(rcon, process));
        }
Beispiel #2
0
 public Server(RconConnection rcon, ProcessItem process)
 {
     Name              = String.Format(@"PID: {0} {1}\DServer.exe", process.Id, process.Path);
     Process           = process;
     Rcon              = rcon;
     MissionLogService = new MissionLogDataService(this);
     ServerId          = default(Guid);
     IsConfigSet       = false;
     IsRconConnected   = false;
     TimeZoneOffset    = (int)TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow).TotalMinutes;
     Initialize();
 }
Beispiel #3
0
        private Server GetServer(ProcessItem process)
        {
            var baseDir = Directory.GetParent(Directory.GetParent(process.Path).FullName);
            var config  = new IL2StartupConfig(string.Concat(baseDir, @"\data\startup.cfg"));
            var rcon    = new RconConnection(config);

            var appSettings = Settings.Default.Config;

            rcon.RconDefaultLogin    = appSettings.RconStaticLogin;
            rcon.RconDefaultPassword = appSettings.RconStaticPassword;

            var server = new Server(config, rcon, process);

            return(server);
        }