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);
        }
示例#2
0
        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");
        }