Beispiel #1
0
    public void CreateGroup(string adminUsername, string password, string groupName)
    {
        var loginWithPlayFabRequest = new LoginWithPlayFabRequest {
            Username = adminUsername, Password = password
        };

        PlayFabClientAPI.LoginWithPlayFab(loginWithPlayFabRequest,
                                          delegate(LoginResult loginResult)
        {
            PlayFabAuthenticationAPI.GetEntityToken(new PlayFab.AuthenticationModels.GetEntityTokenRequest(),
                                                    delegate(GetEntityTokenResponse getEntityTokenResponse)
            {
                var createGroupRequest = new CreateGroupRequest {
                    GroupName = groupName,
                    Entity    = ConvertEntityKey(getEntityTokenResponse.Entity)
                };

                PlayFabGroupsAPI.CreateGroup(createGroupRequest,
                                             delegate(CreateGroupResponse response)
                {
                    Debug.Log("Group was successfully created: " + response.GroupName + " -  " + response.Group.Id);
                },
                                             SharedError.OnSharedError);
            },
                                                    SharedError.OnSharedError);
        },
                                          SharedError.OnSharedError);
    }
Beispiel #2
0
        public void CreateGroup(string groupName, EntityKey entityKey)
        {
            // A player-controlled entity creates a new group
            var request = new CreateGroupRequest {
                GroupName = groupName, Entity = EntityKeyMaker(PlayFabManager.Instance.CurrentEntity.Id)
            };

            PlayFabGroupsAPI.CreateGroup(request, OnCreateGroup, OnSharedError);
        }