public SrcdsLogService(DataService dataService, RconService rconService, LogHandler logHandler) { //Setup vars _rconService = rconService; _dataService = dataService; _logHandler = logHandler; _port = _dataService.RSettings.ProgramSettings.ListenPort; Console.WriteLine("Setting up SRCDS Log Service..."); //Need to map servers var servers = DatabaseUtil.GetAllTestServers(); foreach (var server in servers) { _serverIdDictionary.Add(GeneralUtil.GetIpEndPointFromString(server.Address), server); } var oldSessions = DatabaseUtil.GetAllFeedbackFiles(); //Re-add old sessions. foreach (var session in oldSessions) { Console.WriteLine($"Re-adding FB sessions for: {session.ServerAddress}"); _feedbackFiles.Add(new FeedbackFile(session, _rconService)); } Start(); }
public SrcdsLogService(DataService dataService, RconService rconService, LogHandler logHandler) { //Setup vars _rconService = rconService; _dataService = dataService; _logHandler = logHandler; _port = _dataService.RSettings.ProgramSettings.ListenPort; Console.WriteLine("Setting up SRCDS Log Service..."); //Need to map servers var servers = DatabaseUtil.GetAllTestServers(); foreach (var server in servers) { var ip = GeneralUtil.GetIpEndPointFromString(server.Address); if (ip == null) { _ = _logHandler.LogMessage($"Unable to add SRCDS Log listener for {server.Address} becuase it returned null for IPEndPoint", false, color: LOG_COLOR); continue; } _serverIdDictionary.Add(ip, server); } var oldSessions = DatabaseUtil.GetAllFeedbackFiles(); //Re-add old sessions. foreach (var session in oldSessions) { Console.WriteLine($"Re-adding FB sessions for: {session.ServerAddress}"); _feedbackFiles.Add(new FeedbackFile(session, _rconService)); } Start(); }