Ejemplo n.º 1
0
        /// <summary>
        /// Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified
        /// </summary>
        /// <param name="LobbyId">Unique identifier of the Game Server Instance the user is joining. This must be a Game Server Instance started with the Matchmaker/StartGame API. (Required)</param>
        /// <param name="PlayFabId">PlayFab unique identifier for the player joining. (Required)</param>
        public static Task <PlayerJoinedResponse> PlayerJoined(string LobbyId, string PlayFabId,
                                                               PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            PlayerJoinedRequest request = new PlayerJoinedRequest()
            {
                LobbyId   = LobbyId,
                PlayFabId = PlayFabId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <PlayerJoinedResponse>("/Matchmaker/PlayerJoined", request,
                                                                       AuthType.DevSecretKey,
                                                                       customData, extraHeaders, context));
        }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets the profiles access policy
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="Statements">The statements to include in the access policy. (Optional)</param>
        public static Task <SetEntityProfilePolicyResponse> SetProfilePolicy(EntityKey Entity, List <EntityPermissionStatement> Statements = default,
                                                                             PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            SetEntityProfilePolicyRequest request = new SetEntityProfilePolicyRequest()
            {
                Entity     = Entity,
                Statements = Statements,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <SetEntityProfilePolicyResponse>("/Profile/SetProfilePolicy", request,
                                                                                 AuthType.EntityToken,
                                                                                 customData, extraHeaders, context));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Adds members to a group or role.
        /// </summary>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="Members">List of entities to add to the group. Only entities of type title_player_account and character may be added to groups. (Required)</param>
        /// <param name="RoleId">Optional: The ID of the existing role to add the entities to. If this is not specified, the default member role for the group will be used. Role IDs must be between 1 and 64 characters long. (Optional)</param>
        public static Task <EmptyResponse> AddMembers(EntityKey Group, List <EntityKey> Members, string RoleId = default,
                                                      PlayFabAuthenticationContext customAuthContext           = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            AddMembersRequest request = new AddMembersRequest()
            {
                Group   = Group,
                Members = Members,
                RoleId  = RoleId,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <EmptyResponse>("/Group/AddMembers", request,
                                                                AuthType.EntityToken,
                                                                customData, extraHeaders, context));
        }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Creates a new group role.
        /// </summary>
        /// <param name="Group">The identifier of the group (Required)</param>
        /// <param name="RoleId">The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 characters long. (Required)</param>
        /// <param name="RoleName">The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and 100 characters long (Required)</param>
        public static Task <CreateGroupRoleResponse> CreateRole(EntityKey Group, string RoleId, string RoleName,
                                                                PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            CreateGroupRoleRequest request = new CreateGroupRoleRequest()
            {
                Group    = Group,
                RoleId   = RoleId,
                RoleName = RoleName,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <CreateGroupRoleResponse>("/Group/CreateRole", request,
                                                                          AuthType.EntityToken,
                                                                          customData, extraHeaders, context));
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
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));
        }
Ejemplo n.º 10
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));
        }
Ejemplo n.º 11
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));
        }
Ejemplo n.º 12
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));
        }
Ejemplo n.º 13
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));
        }
Ejemplo n.º 14
0
        /// <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));
        }
Ejemplo n.º 15
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));
        }
 public PlayFabProfilesInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context)
 {
     ApiSettings           = settings;
     authenticationContext = context;
 }
 public PlayFabLocalizationInstanceAPI(PlayFabApiSettings settings = null, PlayFabAuthenticationContext context = null)
 {
     apiSettings           = settings;
     authenticationContext = context;
 }
 public PlayFabProfilesInstanceAPI(PlayFabAuthenticationContext context)
 {
     authenticationContext = context;
 }
 public PlayFabLocalizationInstanceAPI(PlayFabAuthenticationContext context = null)
 {
     authenticationContext = context;
 }
 public PlayFabMatchmakerInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context)
 {
     apiSettings           = settings;
     authenticationContext = context;
 }
Ejemplo n.º 21
0
 public PlayFabEventsInstanceAPI(PlayFabAuthenticationContext context)
 {
     authenticationContext = context;
 }
 public PlayFabLeaderboardsInstanceAPI(PlayFabAuthenticationContext context = null)
 {
     authenticationContext = context;
 }
 public PlayFabCloudScriptInstanceAPI(PlayFabApiSettings settings, PlayFabAuthenticationContext context)
 {
     apiSettings           = settings;
     authenticationContext = context;
 }
 public PlayFabCloudScriptInstanceAPI(PlayFabAuthenticationContext context)
 {
     authenticationContext = context;
 }
Ejemplo n.º 25
0
 private static PlayFabAuthenticationContext GetContext(PlayFabAuthenticationContext context) => context ?? PlayFabSettings.staticPlayer;
 public PlayFabDataInstanceAPI(PlayFabAuthenticationContext context = null)
 {
     authenticationContext = context;
 }
Ejemplo n.º 27
0
 public PlayFabMultiplayerInstanceAPI(PlayFabAuthenticationContext context)
 {
     authenticationContext = context;
 }
 public PlayFabLeaderboardsInstanceAPI(PlayFabApiSettings settings = null, PlayFabAuthenticationContext context = null)
 {
     apiSettings           = settings;
     authenticationContext = context;
 }
 public PlayFabMatchmakerInstanceAPI(PlayFabAuthenticationContext context)
 {
     authenticationContext = context;
 }