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."); }
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 })); }
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."); }