2019-06-24 12:01:34 -04:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
2020-02-11 17:44:06 -05:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2019-06-24 12:01:34 -04:00
|
|
|
|
using SharedLibraryCore.RCon;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tests
|
|
|
|
|
{
|
|
|
|
|
class TestRconParser : IW4MAdmin.Application.RconParsers.BaseRConParser
|
|
|
|
|
{
|
2020-04-01 15:11:56 -04:00
|
|
|
|
public TestRconParser(IParserRegexFactory f) : base(f)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-24 12:01:34 -04:00
|
|
|
|
public int FakeClientCount { get; set; }
|
|
|
|
|
public List<EFClient> FakeClients { get; set; } = new List<EFClient>();
|
|
|
|
|
|
|
|
|
|
public override string Version => "test";
|
|
|
|
|
|
2020-02-11 17:44:06 -05:00
|
|
|
|
public override async Task<(List<EFClient>, string)> GetStatusAsync(IRConConnection connection)
|
2019-06-24 12:01:34 -04:00
|
|
|
|
{
|
|
|
|
|
var clientList = new List<EFClient>();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < FakeClientCount; i++)
|
|
|
|
|
{
|
|
|
|
|
clientList.Add(new EFClient()
|
|
|
|
|
{
|
|
|
|
|
ClientNumber = i,
|
|
|
|
|
NetworkId = i + 1,
|
|
|
|
|
CurrentAlias = new EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Name = $"test_bot_{i}",
|
|
|
|
|
IPAddress = i + 1
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-25 13:05:12 -05:00
|
|
|
|
return clientList.Count > 0 ? (clientList, "mp_rust") : (FakeClients, "mp_rust");
|
2019-06-24 12:01:34 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|