implement feedback from issue #91 when sv_running is off

clean up a trying to abort thread which doesn't actually work with .net core
don't log event tasks cancelled as error, because it's not
This commit is contained in:
RaidMax
2020-01-13 16:51:16 -06:00
parent 639db5d7eb
commit cd387ca08b
7 changed files with 30 additions and 8 deletions

View File

@ -184,16 +184,22 @@ namespace SharedLibraryCore.RCon
string responseString = defaultEncoding.GetString(response, 0, response.Length) + '\n';
// note: not all games respond if the pasword is wrong or not set
if (responseString.Contains("Invalid password") || responseString.Contains("rconpassword"))
{
throw new NetworkException(Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_RCON_INVALID"]);
}
if (responseString.ToString().Contains("rcon_password"))
if (responseString.Contains("rcon_password"))
{
throw new NetworkException(Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_RCON_NOTSET"]);
}
if (responseString.Contains(Config.ServerNotRunningResponse))
{
throw new ServerException(Utilities.CurrentLocalization.LocalizationIndex["SERVER_ERROR_NOT_RUNNING"].FormatExt(Endpoint.ToString()));
}
string[] splitResponse = responseString.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries)
.Select(line => line.Trim())
.ToArray();