Example #1
0
        public void ApiInstanceLogin(UUnitTestContext testContext)
        {
            PlayFabApiSettings settings = new PlayFabApiSettings();

            settings.TitleId            = testTitleData.titleId;
            settings.DeveloperSecretKey = testTitleData.developerSecretKey;

            var loginRequest1 = new LoginWithServerCustomIdRequest()
            {
                CreateAccount  = true,
                ServerCustomId = "test_Instance1"
            };

            var loginRequest2 = new LoginWithServerCustomIdRequest()
            {
                CreateAccount  = true,
                ServerCustomId = "test_Instance2"
            };

            PlayFabServerInstanceAPI serverInstance1 = new PlayFabServerInstanceAPI(settings);
            PlayFabServerInstanceAPI serverInstance2 = new PlayFabServerInstanceAPI(settings);

            serverInstance1.LoginWithServerCustomId(loginRequest1, PlayFabUUnitUtils.ApiActionWrapper <ServerLoginResult>(testContext, OnInstanceLogin1), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, SharedErrorCallback), testContext);
            serverInstance2.LoginWithServerCustomId(loginRequest2, PlayFabUUnitUtils.ApiActionWrapper <ServerLoginResult>(testContext, OnInstanceLogin2), PlayFabUUnitUtils.ApiActionWrapper <PlayFabError>(testContext, SharedErrorCallback), testContext);
        }