/// <summary>
        /// Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid
        /// Entity Token.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        public static Task <GetEntityTokenResponse> GetEntityToken(EntityKey Entity = default,
                                                                   PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetEntityTokenRequest request = new GetEntityTokenRequest()
            {
                Entity = Entity,
            };

            var      context  = GetContext(customAuthContext);
            AuthType authType = AuthType.None;

#if !DISABLE_PLAYFABCLIENT_API
            if (context.ClientSessionTicket != null)
            {
                authType = AuthType.LoginSession;
            }
#endif
#if ENABLE_PLAYFABSERVER_API || ENABLE_PLAYFABADMIN_API
            if (PlayFabSettings.staticSettings.DeveloperSecretKey != null)
            {
                authType = AuthType.DevSecretKey;
            }                                                                                                    // TODO: Need to get the correct settings first
#endif
#if !DISABLE_PLAYFABENTITY_API
            if (context.EntityToken != null)
            {
                authType = AuthType.EntityToken;
            }
#endif

            return(PlayFabHttp.MakeApiCallAsync <GetEntityTokenResponse>("/Authentication/GetEntityToken", request,
                                                                         authType,
                                                                         customData, extraHeaders, context));
        }
        /// <summary>
        /// Retrieves the list of allowed languages, only accessible by title entities
        /// </summary>
        public static Task <GetLanguageListResponse> GetLanguageList(
            PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetLanguageListRequest request = new GetLanguageListRequest()
            {
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <GetLanguageListResponse>("/Locale/GetLanguageList", request,
                                                                          AuthType.EntityToken,
                                                                          customData, extraHeaders, context));
        }
        /// <summary>
        /// Method for a server to validate a client provided EntityToken. Only callable by the title entity.
        /// </summary>
        /// <param name="EntityToken">Client EntityToken (Required)</param>
        public static Task <ValidateEntityTokenResponse> ValidateEntityToken(string EntityToken,
                                                                             PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            ValidateEntityTokenRequest request = new ValidateEntityTokenRequest()
            {
                EntityToken = EntityToken,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <ValidateEntityTokenResponse>("/Authentication/ValidateEntityToken", request,
                                                                              AuthType.EntityToken,
                                                                              customData, extraHeaders, context));
        }
Beispiel #4
0
        /// <summary>
        /// Sets the global title access policy
        /// </summary>
        /// <param name="Permissions">The permissions that govern access to all entities under this title or namespace. (Optional)</param>
        public static Task <SetGlobalPolicyResponse> SetGlobalPolicy(List <EntityPermissionStatement> Permissions   = default,
                                                                     PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            SetGlobalPolicyRequest request = new SetGlobalPolicyRequest()
            {
                Permissions = Permissions,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <SetGlobalPolicyResponse>("/Profile/SetGlobalPolicy", request,
                                                                          AuthType.EntityToken,
                                                                          customData, extraHeaders, context));
        }
Beispiel #5
0
        /// <summary>
        /// Write batches of entity based events to as Telemetry events (bypass PlayStream).
        /// </summary>
        /// <param name="Events">Collection of events to write to PlayStream. (Required)</param>
        public static Task <WriteEventsResponse> WriteTelemetryEvents(List <EventContents> Events,
                                                                      PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            WriteEventsRequest request = new WriteEventsRequest()
            {
                Events = Events,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <WriteEventsResponse>("/Event/WriteTelemetryEvents", request,
                                                                      AuthType.EntityToken,
                                                                      customData, extraHeaders, context));
        }
        /// <summary>
        /// Validates a user with the PlayFab service
        /// </summary>
        /// <param name="AuthorizationTicket">Session Ticket provided by the client. (Required)</param>
        public static Task <AuthUserResponse> AuthUser(string AuthorizationTicket,
                                                       PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            AuthUserRequest request = new AuthUserRequest()
            {
                AuthorizationTicket = AuthorizationTicket,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <AuthUserResponse>("/Matchmaker/AuthUser", request,
                                                                   AuthType.DevSecretKey,
                                                                   customData, extraHeaders, context));
        }
Beispiel #7
0
        /// <summary>
        /// Lists all outstanding invitations and group applications for an entity
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        public static Task <ListMembershipOpportunitiesResponse> ListMembershipOpportunities(EntityKey Entity = default,
                                                                                             PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            ListMembershipOpportunitiesRequest request = new ListMembershipOpportunitiesRequest()
            {
                Entity = Entity,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <ListMembershipOpportunitiesResponse>("/Group/ListMembershipOpportunities", request,
                                                                                      AuthType.EntityToken,
                                                                                      customData, extraHeaders, context));
        }
Beispiel #8
0
        /// <summary>
        /// Lists all outstanding invitations for a group
        /// </summary>
        /// <param name="Group">The identifier of the group (Required)</param>
        public static Task <ListGroupInvitationsResponse> ListGroupInvitations(EntityKey Group,
                                                                               PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            ListGroupInvitationsRequest request = new ListGroupInvitationsRequest()
            {
                Group = Group,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <ListGroupInvitationsResponse>("/Group/ListGroupInvitations", request,
                                                                               AuthType.EntityToken,
                                                                               customData, extraHeaders, context));
        }
Beispiel #9
0
        /// <summary>
        /// Gets information about a group and its roles
        /// </summary>
        /// <param name="Group">The identifier of the group (Optional)</param>
        /// <param name="GroupName">The full name of the group (Optional)</param>
        public static Task <GetGroupResponse> GetGroup(EntityKey Group = default, string GroupName = default,
                                                       PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetGroupRequest request = new GetGroupRequest()
            {
                Group     = Group,
                GroupName = GroupName,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <GetGroupResponse>("/Group/GetGroup", request,
                                                                   AuthType.EntityToken,
                                                                   customData, extraHeaders, context));
        }
Beispiel #10
0
        /// <summary>
        /// Deletes an existing role in a group.
        /// </summary>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="RoleId">The ID of the role to delete. Role IDs must be between 1 and 64 characters long. (Optional)</param>
        public static Task <EmptyResponse> DeleteRole(EntityKey Group, string RoleId = default,
                                                      PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            DeleteRoleRequest request = new DeleteRoleRequest()
            {
                Group  = Group,
                RoleId = RoleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/DeleteRole", request,
                                                                AuthType.EntityToken,
                                                                customData, extraHeaders, context));
        }
Beispiel #11
0
        /// <summary>
        /// Retrieves the entity's profile.
        /// </summary>
        /// <param name="DataAsObject">Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON string. (Optional)</param>
        /// <param name="Entities">Entity keys of the profiles to load. Must be between 1 and 25 (Required)</param>
        public static Task <GetEntityProfilesResponse> GetProfiles(List <EntityKey> Entities, bool?DataAsObject   = default,
                                                                   PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetEntityProfilesRequest request = new GetEntityProfilesRequest()
            {
                Entities     = Entities,
                DataAsObject = DataAsObject,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <GetEntityProfilesResponse>("/Profile/GetProfiles", request,
                                                                            AuthType.EntityToken,
                                                                            customData, extraHeaders, context));
        }
Beispiel #12
0
        /// <summary>
        /// Finalize file uploads to an entity's profile.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="FileNames">Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' (Required)</param>
        public static Task <FinalizeFileUploadsResponse> FinalizeFileUploads(EntityKey Entity, List <string> FileNames,
                                                                             PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            FinalizeFileUploadsRequest request = new FinalizeFileUploadsRequest()
            {
                Entity    = Entity,
                FileNames = FileNames,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <FinalizeFileUploadsResponse>("/File/FinalizeFileUploads", request,
                                                                              AuthType.EntityToken,
                                                                              customData, extraHeaders, context));
        }
Beispiel #13
0
        /// <summary>
        /// Retrieves the title player accounts associated with the given master player account.
        /// </summary>
        /// <param name="MasterPlayerAccountIds">Master player account ids. (Required)</param>
        /// <param name="TitleId">Id of title to get players from. (Optional)</param>
        public static Task <GetTitlePlayersFromMasterPlayerAccountIdsResponse> GetTitlePlayersFromMasterPlayerAccountIds(List <string> MasterPlayerAccountIds, string TitleId = default,
                                                                                                                         PlayFabAuthenticationContext customAuthContext       = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetTitlePlayersFromMasterPlayerAccountIdsRequest request = new GetTitlePlayersFromMasterPlayerAccountIdsRequest()
            {
                MasterPlayerAccountIds = MasterPlayerAccountIds,
                TitleId = TitleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <GetTitlePlayersFromMasterPlayerAccountIdsResponse>("/Profile/GetTitlePlayersFromMasterPlayerAccountIds", request,
                                                                                                    AuthType.EntityToken,
                                                                                                    customData, extraHeaders, context));
        }
Beispiel #14
0
        /// <summary>
        /// Retrieves objects from an entity's profile.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="EscapeObject">Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON object. (Optional)</param>
        public static Task <GetObjectsResponse> GetObjects(EntityKey Entity, bool?EscapeObject            = default,
                                                           PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            GetObjectsRequest request = new GetObjectsRequest()
            {
                Entity       = Entity,
                EscapeObject = EscapeObject,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <GetObjectsResponse>("/Object/GetObjects", request,
                                                                     AuthType.EntityToken,
                                                                     customData, extraHeaders, context));
        }
Beispiel #15
0
        /// <summary>
        /// Unblocks a list of entities from joining a group
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        public static Task <EmptyResponse> UnblockEntity(EntityKey Entity, EntityKey Group,
                                                         PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            UnblockEntityRequest request = new UnblockEntityRequest()
            {
                Entity = Entity,
                Group  = Group,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/UnblockEntity", request,
                                                                AuthType.EntityToken,
                                                                customData, extraHeaders, context));
        }
Beispiel #16
0
        /// <summary>
        /// Accepts an invitation to join a group
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        public static Task <EmptyResponse> AcceptGroupInvitation(EntityKey Group, EntityKey Entity = default,
                                                                 PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            AcceptGroupInvitationRequest request = new AcceptGroupInvitationRequest()
            {
                Group  = Group,
                Entity = Entity,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/AcceptGroupInvitation", request,
                                                                AuthType.EntityToken,
                                                                customData, extraHeaders, context));
        }
        /// <summary>
        /// Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified
        /// </summary>
        /// <param name="LobbyId">Unique identifier of the Game Server Instance the user is leaving. This must be a Game Server Instance started with the Matchmaker/StartGame API. (Required)</param>
        /// <param name="PlayFabId">PlayFab unique identifier for the player leaving. (Required)</param>
        public static Task <PlayerLeftResponse> PlayerLeft(string LobbyId, string PlayFabId,
                                                           PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            PlayerLeftRequest request = new PlayerLeftRequest()
            {
                LobbyId   = LobbyId,
                PlayFabId = PlayFabId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <PlayerLeftResponse>("/Matchmaker/PlayerLeft", request,
                                                                     AuthType.DevSecretKey,
                                                                     customData, extraHeaders, context));
        }
        /// <summary>
        /// Retrieves the relevant details for a specified user, which the external match-making service can then use to compute
        /// effective matches
        /// </summary>
        /// <param name="MinCatalogVersion">Minimum catalog version for which data is requested (filters the results to only contain inventory items which have a catalog version of this or higher). (Required)</param>
        /// <param name="PlayFabId">PlayFab unique identifier of the user whose information is being requested. (Required)</param>
        public static Task <UserInfoResponse> UserInfo(int MinCatalogVersion, string PlayFabId,
                                                       PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            UserInfoRequest request = new UserInfoRequest()
            {
                MinCatalogVersion = MinCatalogVersion,
                PlayFabId         = PlayFabId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <UserInfoResponse>("/Matchmaker/UserInfo", request,
                                                                   AuthType.DevSecretKey,
                                                                   customData, extraHeaders, context));
        }
Beispiel #19
0
        /// <summary>
        /// Checks to see if an entity is a member of a group or role within the group
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="RoleId">Optional: ID of the role to check membership of. Defaults to any role (that is, check to see if the entity is a member of the group in any capacity) if not specified. (Optional)</param>
        public static Task <IsMemberResponse> IsMember(EntityKey Entity, EntityKey Group, string RoleId = default,
                                                       PlayFabAuthenticationContext customAuthContext   = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            IsMemberRequest request = new IsMemberRequest()
            {
                Entity = Entity,
                Group  = Group,
                RoleId = RoleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <IsMemberResponse>("/Group/IsMember", request,
                                                                   AuthType.EntityToken,
                                                                   customData, extraHeaders, context));
        }
Beispiel #20
0
        /// <summary>
        /// Delete files on an entity's profile.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="FileNames">Names of the files to be deleted. (Required)</param>
        /// <param name="ProfileVersion">The expected version of the profile, if set and doesn't match the current version of the profile the operation will not be performed. (Optional)</param>
        public static Task <DeleteFilesResponse> DeleteFiles(EntityKey Entity, List <string> FileNames, int?ProfileVersion = default,
                                                             PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            DeleteFilesRequest request = new DeleteFilesRequest()
            {
                Entity         = Entity,
                FileNames      = FileNames,
                ProfileVersion = ProfileVersion,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <DeleteFilesResponse>("/File/DeleteFiles", request,
                                                                      AuthType.EntityToken,
                                                                      customData, extraHeaders, context));
        }
Beispiel #21
0
        /// <summary>
        /// Applies to join a group
        /// </summary>
        /// <param name="AutoAcceptOutstandingInvite">Optional, default true. Automatically accept an outstanding invitation if one exists instead of creating an application (Optional)</param>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        public static Task <ApplyToGroupResponse> ApplyToGroup(EntityKey Group, bool?AutoAcceptOutstandingInvite = default, EntityKey Entity = default,
                                                               PlayFabAuthenticationContext customAuthContext    = null, object customData   = null, Dictionary <string, string> extraHeaders = null)
        {
            ApplyToGroupRequest request = new ApplyToGroupRequest()
            {
                Group = Group,
                AutoAcceptOutstandingInvite = AutoAcceptOutstandingInvite,
                Entity = Entity,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <ApplyToGroupResponse>("/Group/ApplyToGroup", request,
                                                                       AuthType.EntityToken,
                                                                       customData, extraHeaders, context));
        }
Beispiel #22
0
        /// <summary>
        /// Sets objects on an entity's profile.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="ExpectedProfileVersion">Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any other clients since the version you last loaded. (Optional)</param>
        /// <param name="Objects">Collection of objects to set on the profile. (Required)</param>
        public static Task <SetObjectsResponse> SetObjects(EntityKey Entity, List <SetObject> Objects, int?ExpectedProfileVersion = default,
                                                           PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            SetObjectsRequest request = new SetObjectsRequest()
            {
                Entity  = Entity,
                Objects = Objects,
                ExpectedProfileVersion = ExpectedProfileVersion,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <SetObjectsResponse>("/Object/SetObjects", request,
                                                                     AuthType.EntityToken,
                                                                     customData, extraHeaders, context));
        }
Beispiel #23
0
        /// <summary>
        /// Updates the entity's language. The precedence hierarchy for communication to the player is Title Player Account
        /// language, Master Player Account language, and then title default language if the first two aren't set or supported.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        /// <param name="ExpectedVersion">The expected version of a profile to perform this update on (Optional)</param>
        /// <param name="Language">The language to set on the given entity. Deletes the profile's language if passed in a null string. (Optional)</param>
        public static Task <SetProfileLanguageResponse> SetProfileLanguage(EntityKey Entity = default, int?ExpectedVersion = default, string Language = default,
                                                                           PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            SetProfileLanguageRequest request = new SetProfileLanguageRequest()
            {
                Entity          = Entity,
                ExpectedVersion = ExpectedVersion,
                Language        = Language,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <SetProfileLanguageResponse>("/Profile/SetProfileLanguage", request,
                                                                             AuthType.EntityToken,
                                                                             customData, extraHeaders, context));
        }
Beispiel #24
0
        /// <summary>
        /// Updates metadata about a role.
        /// </summary>
        /// <param name="ExpectedProfileVersion">Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from the GetGroup API, you can ensure that the group data update will only be performed if the group has not been updated by any other clients since the version you last loaded. (Optional)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="RoleId">ID of the role to update. Role IDs must be between 1 and 64 characters long. (Optional)</param>
        /// <param name="RoleName">The new name of the role (Required)</param>
        public static Task <UpdateGroupRoleResponse> UpdateRole(EntityKey Group, string RoleName, int?ExpectedProfileVersion = default, string RoleId = default,
                                                                PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            UpdateGroupRoleRequest request = new UpdateGroupRoleRequest()
            {
                Group    = Group,
                RoleName = RoleName,
                ExpectedProfileVersion = ExpectedProfileVersion,
                RoleId = RoleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <UpdateGroupRoleResponse>("/Group/UpdateRole", request,
                                                                          AuthType.EntityToken,
                                                                          customData, extraHeaders, context));
        }
Beispiel #25
0
        /// <summary>
        /// Changes the role membership of a list of entities from one role to another.
        /// </summary>
        /// <param name="DestinationRoleId">The ID of the role that the entities will become a member of. This must be an existing role. Role IDs must be between 1 and 64 characters long. (Optional)</param>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="Members">List of entities to move between roles in the group. All entities in this list must be members of the group and origin role. (Required)</param>
        /// <param name="OriginRoleId">The ID of the role that the entities currently are a member of. Role IDs must be between 1 and 64 characters long. (Required)</param>
        public static Task <EmptyResponse> ChangeMemberRole(EntityKey Group, List <EntityKey> Members, string OriginRoleId, string DestinationRoleId = default,
                                                            PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            ChangeMemberRoleRequest request = new ChangeMemberRoleRequest()
            {
                Group             = Group,
                Members           = Members,
                OriginRoleId      = OriginRoleId,
                DestinationRoleId = DestinationRoleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/ChangeMemberRole", request,
                                                                AuthType.EntityToken,
                                                                customData, extraHeaders, context));
        }
        /// <summary>
        /// Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance
        /// </summary>
        /// <param name="Build">Unique identifier of the previously uploaded build executable which is to be started. (Required)</param>
        /// <param name="CustomCommandLineData">Custom command line argument when starting game server process. (Optional)</param>
        /// <param name="ExternalMatchmakerEventEndpoint">HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an application/json body of { "EventName": "game_ended", "GameID": "<gameid>" }. (Required)</param>
        /// <param name="GameMode">Game mode for this Game Server Instance. (Required)</param>
        /// <param name="Region">Region with which to associate the server, for filtering. (Required)</param>
        public static Task <StartGameResponse> StartGame(string Build, string ExternalMatchmakerEventEndpoint, string GameMode, Region Region, string CustomCommandLineData = default,
                                                         PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            StartGameRequest request = new StartGameRequest()
            {
                Build = Build,
                ExternalMatchmakerEventEndpoint = ExternalMatchmakerEventEndpoint,
                GameMode = GameMode,
                Region   = Region,
                CustomCommandLineData = CustomCommandLineData,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <StartGameResponse>("/Matchmaker/StartGame", request,
                                                                    AuthType.DevSecretKey,
                                                                    customData, extraHeaders, context));
        }
Beispiel #27
0
        /// <summary>
        /// Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of
        /// custom server-side functionality you can implement, and it can be used in conjunction with virtually anything.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Optional)</param>
        /// <param name="FunctionName">The name of the CloudScript function to execute (Required)</param>
        /// <param name="FunctionParameter">Object that is passed in to the function as the first argument (Optional)</param>
        /// <param name="GeneratePlayStreamEvent">Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager. (Optional)</param>
        /// <param name="RevisionSelection">Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live' executes the current live, published revision, and 'Specific' executes the specified revision. The default value is 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'. (Optional)</param>
        /// <param name="SpecificRevision">The specific revision to execute, when RevisionSelection is set to 'Specific' (Optional)</param>
        public static Task <ExecuteCloudScriptResult> ExecuteEntityCloudScript(string FunctionName, EntityKey Entity          = default, object FunctionParameter = default, bool?GeneratePlayStreamEvent          = default, CloudScriptRevisionOption?RevisionSelection = default, int?SpecificRevision = default,
                                                                               PlayFabAuthenticationContext customAuthContext = null, object customData           = null, Dictionary <string, string> extraHeaders = null)
        {
            ExecuteEntityCloudScriptRequest request = new ExecuteEntityCloudScriptRequest()
            {
                FunctionName            = FunctionName,
                Entity                  = Entity,
                FunctionParameter       = FunctionParameter,
                GeneratePlayStreamEvent = GeneratePlayStreamEvent,
                RevisionSelection       = RevisionSelection,
                SpecificRevision        = SpecificRevision,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <ExecuteCloudScriptResult>("/CloudScript/ExecuteEntityCloudScript", request,
                                                                           AuthType.EntityToken,
                                                                           customData, extraHeaders, context));
        }