Beispiel #1
0
        public async Task <string> CreateDummyPlayer()
        {
            if (!Configuration.IsUtilityOperationsAllowed)
            {
                return(UTILITY_OPS_DISABLED_MESSAGE);
            }

            var createPlayerController = new CreatePlayerController();
            await createPlayerController.HandleHttpRequestAsync(JToken.Parse(@"{'PlayerId':'Dummy','Password':'******'}"));

            return($"Operation completed.\nDummy player created.");
        }
Beispiel #2
0
        public async Task <IActionResult> CreatePlayer(string idAndPswd)
        {
            var splittedString = idAndPswd.Split(';');
            var playerId       = splittedString[0];
            var password       = splittedString.Length > 1 ? splittedString[1] : string.Empty;

            var data = JToken.Parse($@"{{'PlayerId':'{playerId}','Password':'******'}}");
            var createPlayerController = new CreatePlayerController();
            var responseToken          = await createPlayerController.HandleHttpRequestAsync(data);

            return(RedirectToAction("Edit", new { entityId = playerId }));
        }
Beispiel #3
0
        public async Task <string> CreateMillionTestPlayers()
        {
            if (!Configuration.IsUtilityOperationsAllowed)
            {
                return(UTILITY_OPS_DISABLED_MESSAGE);
            }

            for (int i = 0; i < 1000000; i++)
            {
                var createPlayerController = new CreatePlayerController();
                await createPlayerController.HandleHttpRequestAsync(JToken.Parse($@"{{'PlayerId':'TestPlayer{i}','Password':'******'}}"));
            }

            return($"Operation completed.\n1 million players created.");
        }