public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. RedisConnector.Server.FlushDatabase(); }
public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. RedisConnector.Server.FlushDatabase(); // Create two new user accounts. authHelper = new AuthTestHelper(client); authHelper.createAccount(playerOneInGame); authHelper.createAccount(playerTwoInGame); authHelper.createAccount(playerThreeInGame); authHelper.createAccount(playerOutOfGame); authHelper.loginToAccount(playerOneInGame); gameId = client.CreateNewRoom(new CreateRoomRequest() { MaxPlayers = 3, RoomName = "TestRoom", MinutesPerTick = (1.0 / 60.0), // One second per tick }).CreatedRoom.RoomId; authHelper.loginToAccount(playerTwoInGame); client.JoinRoom(new JoinRoomRequest() { RoomId = gameId }); authHelper.loginToAccount(playerThreeInGame); client.JoinRoom(new JoinRoomRequest() { RoomId = gameId }); // Game has begun. authHelper.loginToAccount(playerOneInGame); }
public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. MongoConnector.FlushCollections(); }
public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. MongoConnector.FlushCollections(); // Create two new user accounts. authHelper = new AuthTestHelper(client); authHelper.createAccount(playerOneInGame); authHelper.createAccount(playerTwoInGame); authHelper.createAccount(playerThreeInGame); authHelper.createAccount(playerOutOfGame); authHelper.loginToAccount(playerOneInGame); gameId = client.CreateNewRoom(new CreateRoomRequest() { GameSettings = new GameSettings() { Anonymous = false, Goal = Goal.Domination, IsRanked = false, MaxPlayers = 3, MinutesPerTick = (1.0 / 60.0), // One second per tick }, RoomName = "TestRoom", MapConfiguration = new MapConfiguration() { Seed = 123123, OutpostsPerPlayer = 3, MinimumOutpostDistance = 100, MaximumOutpostDistance = 1200, DormantsPerPlayer = 3, OutpostDistribution = new OutpostWeighting() { FactoryWeight = 0.33f, GeneratorWeight = 0.33f, WatchtowerWeight = 0.33f, } }, }).CreatedRoom.Id; authHelper.loginToAccount(playerTwoInGame); client.JoinRoom(new JoinRoomRequest() { RoomId = gameId }); authHelper.loginToAccount(playerThreeInGame); client.JoinRoom(new JoinRoomRequest() { RoomId = gameId }); // Game has begun. authHelper.loginToAccount(playerOneInGame); }
public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. MongoConnector.FlushCollections(); // Create two new user accounts. authHelper = new AuthTestHelper(client); authHelper.createAccount("userOne"); authHelper.createAccount("userTwo"); authHelper.loginToAccount("userOne"); }
public void Setup() { client = ClientHelper.GetClient(); // Clear the database every test. RedisConnector.Server.FlushDatabase(); // Create three new user accounts. authHelper = new AuthTestHelper(client); authHelper.createAccount("userOne"); authHelper.createAccount("userTwo"); authHelper.createAccount("userThree"); authHelper.loginToAccount("userOne"); }
public bool tryConnectServer() { String Hostname = "52.14.116.178"; // For server // String Hostname = "localhost"; // For local int Port = 5000; client = new SubterfugeClient.SubterfugeClient(Hostname, Port.ToString()); // Ensure that the client can connect to the server. try { client.HealthCheck(new HealthCheckRequest()); return(isConnected = true); } catch (RpcException exception) { client = null; return(isConnected = false); } }
public AuthTestHelper(SubterfugeClient.SubterfugeClient client) { this.client = client; }