public BotTestServer(int serverPort, int wolfCount, int serverSideBotsCount = 0) { _test = new ToonKnifeTest(); ToonKnifeTest.current = _test; _test.UserCount = wolfCount * 2; //TODO как-то надо протестить много каток подряд с одного лкиента без переподключения _test.Step_AllRabbitUsers_SendFail.overrideValueToSuccess = _test.RabbitTotalCount; _test.Step_AllWolfUsers_SendWin.overrideValueToSuccess = _test.WolfTotalCount; _server = new Server.Server(); _server.UserFightQueue.UserEnqueue += UserFightQueue_UserEnqueue; _server.FightList.FightCreated += FightList_FightCreated; // scs _scsServer = new ScsService.Server.ScsService(serverPort); _scsServer.OnUserLogin += ScsServer_OnUserLogin; _scsServer.OnUserDisconnected += ScsServer_OnUserDisconnected; _scsServer.Start(); for (int i = 0; i < serverSideBotsCount; i++) { } }
public TestBotFighterController(string login, Fight fight, int knifeIndex, ToonKnifeTest test, bool isWolf) { Login = login ?? throw new ArgumentNullException(nameof(login)); _fight = fight ?? throw new ArgumentNullException(nameof(fight)); _knifeIndex = knifeIndex; _test = test; _isWolf = isWolf; _fight.Win += Fight_Win_Handler; _fight.FightStart += Fight_FightStart_Handler; _fight.FightClose += Fight_FightClose_Handler; _fight.KnifeThrow += Fight_KnifeThrow; if (_isWolf) { _input = new float[] { 1173.6f, 1250.4f, 1166.4f, 1197.6f, 1185.6f, 1197.6f, 1300.8f, 1231.2f, 1224f, 1228.8f, 1166.4f, 1236f, 1216.8f, 1231.2f, 1228.8f, 1152f, 1224f, 1185.6f, 1224f }; } else { _input = new float[] { 1068f, }; } }
public TestBotControllerFactory(string login, bool isWoll, ToonKnifeTest test) { _isWoll = isWoll; _test = test; _login = login ?? throw new ArgumentNullException(nameof(login)); }