internal static IPBanInfo LoadFormat1([NotNull] string[] fields)
{
if (fields == null)
{
throw new ArgumentNullException("fields");
}
if (fields.Length != 8)
{
throw new ArgumentException("Unexpected field count", "fields");
}
IPBanInfo info = new IPBanInfo {
Address = IPAddress.Parse(fields[0]),
BannedBy = FlatfilePlayerDBProvider.Unescape(fields[1])
};
FlatfilePlayerDBProvider.ToDateTimeLegacy(fields[2], out info.BanDate);
if (fields[3].Length > 0)
{
info.BanReason = FlatfilePlayerDBProvider.Unescape(fields[3]);
}
if (fields[4].Length > 0)
{
info.PlayerName = FlatfilePlayerDBProvider.Unescape(fields[4]);
}
Int32.TryParse(fields[5], out info.Attempts);
info.LastAttemptName = FlatfilePlayerDBProvider.Unescape(fields[6]);
FlatfilePlayerDBProvider.ToDateTimeLegacy(fields[7], out info.LastAttemptDate);
return(info);
}