/// <summary>
        /// Gets a list of up to randomCount randomly selected entities from the server based on the where condition and specified maximum return count.
        /// </summary>
        /// <remarks>
        /// Service Name - globalEntity
        /// Service Operation - GET_RANDOM_ENTITIES_MATCHING
        /// </remarks>
        /// <param name="where">Mongo style query string</param>
        /// <param name="maxReturn">The maximum number of entities to return</param>
        /// <param name="success">The success callback</param>
        /// <param name="failure">The failure callback</param>
        /// <param name="cbObject">The callback object</param>
        public void GetRandomEntitiesMatching(
            string whereJson,
            int maxReturn,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            if (Util.IsOptionalParameterValid(whereJson))
            {
                var where = JsonReader.Deserialize <Dictionary <string, object> >(whereJson);
                data[OperationParam.GlobalEntityServiceWhere.Value] = where;
            }

            data[OperationParam.GlobalEntityServiceMaxReturn.Value] = maxReturn;

            var callback   = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var serverCall = new ServerCall(ServiceName.GlobalEntity, ServiceOperation.GetRandomEntitiesMatching, data, callback);

            _client.SendRequest(serverCall);
        }
        /// <summary>
        /// Updates the "friend summary data" associated with the logged in user.
        /// Some operations will return this summary data. For instance the social
        /// leaderboards will return the player's score in the leaderboard along
        /// with the friend summary data. Generally this data is used to provide
        /// a quick overview of the player without requiring a separate API call
        /// to read their public stats or entity data.
        ///
        /// </summary>
        /// <remarks>
        /// Service Name - PlayerState
        /// Service Operation - UpdateSummary
        /// </remarks>
        /// <param name="jsonSummaryData">
        /// A JSON string defining the summary data.
        /// For example:
        /// {
        ///   "xp":123,
        ///   "level":12,
        ///   "highScore":45123
        /// }
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        ///
        /// </param>
        public void UpdateSummaryFriendData(
            string jsonSummaryData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            if (Util.IsOptionalParameterValid(jsonSummaryData))
            {
                Dictionary <string, object> summaryData = JsonReader.Deserialize <Dictionary <string, object> > (jsonSummaryData);
                data[OperationParam.PlayerStateServiceUpdateSummaryFriendData.Value] = summaryData;
            }
            else
            {
                data = null;
            }
            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PlayerState, ServiceOperation.UpdateSummary, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
        /// <summary>
        /// Method updates an existing entity on the server.
        /// </summary>
        /// <remarks>
        /// Service Name - GlobalEntity
        /// Service Operation - Update
        /// </remarks>
        /// <param name="entityId">
        /// The entity ID
        /// </param>
        /// <param name="version">
        /// The version of the entity to update
        /// </param>
        /// <param name="jsonEntityData">
        /// The entity's data as a json string
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void UpdateEntity(
            string entityId,
            int version,
            string jsonEntityData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.GlobalEntityServiceEntityId.Value] = entityId;
            data[OperationParam.GlobalEntityServiceVersion.Value]  = version;

            var entityData = JsonReader.Deserialize <Dictionary <string, object> >(jsonEntityData);

            data[OperationParam.GlobalEntityServiceData.Value] = entityData;

            var callback   = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var serverCall = new ServerCall(ServiceName.GlobalEntity, ServiceOperation.Update, data, callback);

            _client.SendRequest(serverCall);
        }
示例#4
0
        /// <summary>
        /// Updates an event in the user's incoming event mailbox.
        /// </summary>
        /// <remarks>
        /// Service Name - Event
        /// Service Operation - UpdateEventData
        /// </remarks>
        /// <param name="evId">
        /// The event id
        /// </param>
        /// <param name="jsonEventData">
        /// The user-defined data for this event encoded in JSON.
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void UpdateIncomingEventData(
            string evId,
            string jsonEventData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.EvId.Value] = evId;

            if (Util.IsOptionalParameterValid(jsonEventData))
            {
                Dictionary <string, object> eventData = JsonReader.Deserialize <Dictionary <string, object> > (jsonEventData);
                data[OperationParam.EventServiceUpdateEventDataData.Value] = eventData;
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.Event, ServiceOperation.UpdateEventData, data, callback);

            _client.SendRequest(sc);
        }
示例#5
0
        /// <summary>
        /// Creates custom data stream screen event
        /// </summary>
        /// <remarks>
        /// Service Name - DataStream
        /// Service Operation - CustomScreenEvent
        /// </remarks>
        /// <param name="eventName">
        /// The name of the event
        /// </param>
        /// <param name="jsonEventProperties">
        /// The properties of the event
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void CustomScreenEvent(
            string eventName,
            string jsonEventProperties,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.DataStreamEventName.Value] = eventName;

            if (Util.IsOptionalParameterValid(jsonEventProperties))
            {
                Dictionary <string, object> eventProperties = JsonReader.Deserialize <Dictionary <string, object> >(jsonEventProperties);
                data[OperationParam.DataStreamEventProperties.Value] = eventProperties;
            }

            ServerCallback callback   = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     serverCall = new ServerCall(ServiceName.DataStream, ServiceOperation.CustomScreenEvent, data, callback);

            _client.SendRequest(serverCall);
        }
示例#6
0
        /// <summary>
        /// Finalize A Two Staged Purchase Transaction
        /// </summary>
        /// <remarks>
        /// Service Name - AppStore
        /// Service Operation - FINALIZE_PURCHASE
        /// </remarks>
        /// <param name="storeId">
        /// The store storeId. Valid stores are:
        /// - itunes
        /// - facebook
        /// - appworld
        /// - steam
        /// - windows
        /// - windowsPhone
        /// - googlePlay
        /// </param>
        /// /// <param name="transactionId">
        /// The Transaction Id returned in Start Transaction
        /// </param>
        /// <param name="transactionJson">
        /// The specific store data required
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void FinalizePurchase(
            string storeId,
            string transactionId,
            string transactionJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.AppStoreServiceStoreId.Value]       = storeId;
            data[OperationParam.AppStoreServiceTransactionId.Value] = transactionId;

            var transactionData = JsonReader.Deserialize <Dictionary <string, object> >(transactionJson);

            data[OperationParam.AppStoreServiceTransactionData.Value] = transactionData;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.AppStore, ServiceOperation.FinalizePurchase, data, callback);

            _client.SendRequest(sc);
        }
示例#7
0
        /// <summary>
        /// Executes a script on the server.
        /// </summary>
        /// <remarks>
        /// Service Name - Script
        /// Service Operation - Run
        /// </remarks>
        /// <param name="scriptName">
        /// The name of the script to be run
        /// </param>
        /// <param name="jsonScriptData">
        /// Data to be sent to the script in json format
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void RunScript(
            string scriptName,
            string jsonScriptData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.ScriptServiceRunScriptName.Value] = scriptName;

            if (Util.IsOptionalParameterValid(jsonScriptData))
            {
                Dictionary <string, object> scriptData = JsonReader.Deserialize <Dictionary <string, object> >(jsonScriptData);
                data[OperationParam.ScriptServiceRunScriptData.Value] = scriptData;
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.Script, ServiceOperation.Run, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
        /// <summary>
        /// Removes the match and match history from the server. DEBUG ONLY, in production it is recommended
        /// the user leave it as completed.
        /// </summary>
        /// <remarks>
        /// Service Name - AsyncMatch
        /// Service Operation - Delete
        /// </remarks>
        /// <param name="ownerId">
        /// Match owner identifier
        /// </param>
        /// <param name="matchId">
        /// Match identifier
        /// </param>
        /// <param name="pushContent">
        /// Match owner identifier
        /// </param>
        /// <param name="summary">
        /// Match owner identifier
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        //string abandonedBy,
        public void AbandonMatchWithSummaryData(
            string ownerId,
            string matchId,
            string pushContent,
            string summary,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            //abandoneddby not needed?
            data["ownerId"]     = ownerId;
            data["matchId"]     = matchId;
            data["pushContent"] = pushContent;
            data["summary"]     = JsonReader.Deserialize <Dictionary <string, object> >(summary);

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.AsyncMatch, ServiceOperation.AbandonMatchWithSummaryData, data, callback);

            _client.SendRequest(sc);
        }
        /// <summary>
        /// Registers the given device token with the server to enable this device
        /// to receive push notifications.
        /// </param>
        /// <param name="in_device">
        /// The device platform being registered.
        /// </param>
        /// <param name="in_token">
        /// The platform-dependant device token needed for push notifications.
        /// </param>
        /// <param name="in_success">
        /// The success callback
        /// </param>
        /// <param name="in_failure">
        /// The failure callback
        /// </param>
        /// <param name="in_cbObject">
        /// The callback object
        /// </param>
        /// <returns> JSON describing the new value of the statistics and any rewards that were triggered:
        /// {
        ///   "status":200,
        ///   "data":null
        /// }
        /// </returns>
        public bool RegisterPushNotificationDeviceToken(
            string in_device,
            string in_token,
            SuccessCallback in_success = null,
            FailureCallback in_failure = null,
            object in_cbObject         = null)
        {
            bool bToReturn = false;

            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.PushNotificationRegisterParamDeviceType.Value]  = in_device;
            data[OperationParam.PushNotificationRegisterParamDeviceToken.Value] = in_token;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(in_success, in_failure, in_cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PushNotification, ServiceOperation.Register, data, callback);

            m_brainCloudClientRef.SendRequest(sc);

            bToReturn = true;
            return(bToReturn);
        }
        /// <summary>
        /// Sends a notification to multiple users consisting of alert content and custom data.
        /// </param>
        /// <param name="profileIds">
        /// Collection of profile IDs to send the notification to
        /// </param>
        /// <param name="alertContentJson">
        /// Body and title of alert
        /// </param>
        /// <param name="customDataJson">
        /// Optional custom data
        /// </param>
        /// <param name="success">
        /// The success callback
        /// </param>
        /// <param name="failure">
        /// The failure callback
        /// </param>
        /// <param name="cbObject">
        /// The callback object
        /// </param>
        public void SendNormalizedPushNotificationBatch(
            IList <string> profileIds,
            string alertContentJson,
            string customDataJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.PushNotificationSendParamProfileIds.Value] = profileIds;
            data[OperationParam.AlertContent.Value] = JsonReader.Deserialize <Dictionary <string, object> >(alertContentJson);
            if (Util.IsOptionalParameterValid(customDataJson))
            {
                data[OperationParam.CustomData.Value] = JsonReader.Deserialize <Dictionary <string, object> >(customDataJson);
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PushNotification, ServiceOperation.SendNormalizedBatch, data, callback);

            _client.SendRequest(sc);
        }
示例#11
0
        /// <summary>
        /// Sends a notification to a "group" of user based on a brainCloud portal configured notification template.
        /// Includes JSON defining the substitution params to use with the template.
        /// See the Portal documentation for more info.
        /// </param>
        /// <param name="groupId">
        /// Target group
        /// </param>
        /// <param name="alertContentJson">
        /// Body and title of alert
        /// </param>
        /// <param name="customDataJson">
        /// Optional custom data
        /// </param>
        /// <param name="success">
        /// The success callback
        /// </param>
        /// <param name="failure">
        /// The failure callback
        /// </param>
        /// <param name="cbObject">
        /// The callback object
        /// </param>
        public void SendNormalizedPushNotificationToGroup(
            string groupId,
            string alertContentJson,
            string customDataJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.GroupId.Value]      = groupId;
            data[OperationParam.AlertContent.Value] = JsonReader.Deserialize <Dictionary <string, object> >(alertContentJson);
            if (Util.IsOptionalParameterValid(customDataJson))
            {
                data[OperationParam.CustomData.Value] = JsonReader.Deserialize <Dictionary <string, object> >(customDataJson);
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PushNotification, ServiceOperation.SendNormalizedToGroup, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
示例#12
0
        /// <summary>
        /// Method updates an existing entity on the server.
        /// </summary>
        /// <remarks>
        /// Service Name - GlobalEntity
        /// Service Operation - Update
        /// </remarks>
        /// <param name="in_entityId">
        /// The entity ID
        /// </param>
        /// <param name="in_version">
        /// The version of the entity to update
        /// </param>
        /// <param name="in_jsonEntityData">
        /// The entity's data as a json string
        /// </param>
        /// <param name="in_success">
        /// The success callback.
        /// </param>
        /// <param name="in_failure">
        /// The failure callback.
        /// </param>
        /// <param name="in_cbObject">
        /// The user object sent to the callback.
        /// </param>
        /// <returns> The JSON returned in the callback is as follows:
        /// {
        ///   "status":200,
        ///   "data":
        ///   {
        ///      gameId : "game",
        ///      entityId : "hucfshugvgvfhug",
        ///      ownerId : "ubfcbvfbsdvbb",
        ///      entityType : "",
        ///      entityIndexedId : "",
        ///      version : 1,
        ///      timeToLive: 0,
        ///      expiresAt : 9947395735758975,
        ///      data :
        ///      {
        ///          field : "value"
        ///      },
        ///      acl :
        ///      {
        ///          other, 1
        ///      },
        ///      createdAt : 74889479874,
        ///      updatedAt : 73847474897487
        ///
        ///   }
        /// }
        /// </returns>
        public void UpdateEntity(
            string in_entityId,
            int in_version,
            string in_jsonEntityData,
            SuccessCallback in_success = null,
            FailureCallback in_failure = null,
            object in_cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.GlobalEntityServiceEntityId.Value] = in_entityId;
            data[OperationParam.GlobalEntityServiceVersion.Value]  = in_version;

            Dictionary <string, object> entityData = JsonReader.Deserialize <Dictionary <string, object> >(in_jsonEntityData);

            data[OperationParam.GlobalEntityServiceData.Value] = entityData;

            ServerCallback callback   = BrainCloudClient.CreateServerCallback(in_success, in_failure, in_cbObject);
            ServerCall     serverCall = new ServerCall(ServiceName.GlobalEntity, ServiceOperation.Update, data, callback);

            m_brainCloudClientRef.SendRequest(serverCall);
        }
示例#13
0
        /// <summary>
        /// Reset Email password with service parameters - sends a password reset email to
        ///the specified addresses.
        /// </summary>
        /// <remarks>
        /// Service Name - Authenticate
        /// Operation - ResetEmailPasswordAdvanced
        /// </remarks>
        /// <param name="appId">
        /// The app id
        /// </param>
        /// <param name="emailAddress">
        /// The email address to send the reset email to
        /// </param>
        /// <param name="serviceParams">
        /// The parameters to send the email service. See documentation for full list
        /// http://getbraincloud.com/apidocs/apiref/#capi-mail
        /// </param>
        /// <param name="success">
        /// The method to call in event of success
        /// </param>
        /// <param name="failure">
        /// The method to call in the event of an error
        /// </param>
        /// <param name="cbObject">
        /// The user supplied callback object
        /// </param>
        public void ResetEmailPasswordAdvanced(
            string emailAddress,
            //Dictionary<string, object> serviceParams,
            string serviceParams,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.AuthenticateServiceAuthenticateGameId.Value]       = _client.AppId;
            data[OperationParam.AuthenticateServiceAuthenticateEmailAddress.Value] = emailAddress;

            var jsonParams = JsonReader.Deserialize <Dictionary <string, object> >(serviceParams);

            data[OperationParam.AuthenticateServiceAuthenticateServiceParams.Value] = jsonParams;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure);
            ServerCall     sc       = new ServerCall(ServiceName.Authenticate, ServiceOperation.ResetEmailPasswordAdvanced, data, callback);

            _client.SendRequest(sc);
        }
        /// <summary>
        /// For sharded custom collection entities. Sets the specified fields within custom entity data on the server, enforcing ownership/ACL permissions.
        /// </summary>
        /// <param name="entityType">
        /// The entity type as defined by the user
        /// </param>
        /// <param name="entityId"></param>
        /// <param name="version"></param>
        /// <param name="fieldsJson"></param>
        /// <param name="shardKeyJson">
        /// The shard key field(s) and value(s), as JSON, applicable to the entity being updated.
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void UpdateEntityFieldsSharded(
            string entityType,
            string entityId,
            int version,
            string fieldsJson,
            string shardKeyJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.CustomEntityServiceEntityType.Value]   = entityType;
            data[OperationParam.CustomEntityServiceEntityId.Value]     = entityId;
            data[OperationParam.CustomEntityServiceVersion.Value]      = version;
            data[OperationParam.CustomEntityServiceFieldsJson.Value]   = JsonReader.Deserialize <Dictionary <string, object> >(fieldsJson);;
            data[OperationParam.CustomEntityServiceShardKeyJson.Value] = JsonReader.Deserialize <Dictionary <string, object> >(shardKeyJson);

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.CustomEntity, ServiceOperation.UpdateCustomEntityFieldsShards, data, callback);

            _client.SendRequest(sc);
        }
示例#15
0
        private void SwitchToChildProfile(string in_childProfileId, string in_childGameId, bool in_forceCreate, bool in_forceSingleton, SuccessCallback in_success, FailureCallback in_failure)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            if (Util.IsOptionalParameterValid(in_childProfileId))
            {
                data[OperationParam.ServiceMessageProfileId.Value] = in_childProfileId;
            }

            data[OperationParam.AuthenticateServiceAuthenticateGameId.Value]      = in_childGameId;
            data[OperationParam.AuthenticateServiceAuthenticateForceCreate.Value] = in_forceCreate;
            data[OperationParam.IdentityServiceForceSingleton.Value] = in_forceSingleton;

            data[OperationParam.AuthenticateServiceAuthenticateReleasePlatform.Value] = m_brainCloudClientRef.ReleasePlatform.ToString();
            data[OperationParam.AuthenticateServiceAuthenticateCountryCode.Value]     = Util.GetCurrentCountryCode();
            data[OperationParam.AuthenticateServiceAuthenticateLanguageCode.Value]    = Util.GetIsoCodeForCurrentLanguage();
            data[OperationParam.AuthenticateServiceAuthenticateTimeZoneOffset.Value]  = Util.GetUTCOffsetForCurrentTimeZone();

            ServerCallback callback = BrainCloudClient.CreateServerCallback(in_success, in_failure);
            ServerCall     sc       = new ServerCall(ServiceName.Identity, ServiceOperation.SwitchToChildProfile, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
示例#16
0
        /// <summary>
        /// Partial increment of shared entity data field items. Partial set of items incremented as specified.
        /// </summary>
        /// <remarks>
        /// Service Name - entity
        /// Service Operation - INCREMENT_SHARED_USER_ENTITY_DATA
        /// </remarks>
        /// <param name="entityId">The entity to increment</param>
        /// <param name="targetProfileId">Profile ID of the entity owner</param>
        /// <param name="jsonData">The subset of data to increment</param>
        /// <param name="success">The success callback</param>
        /// <param name="failure">The failure callback</param>
        /// <param name="cbObject">The callback object</param>
        public void IncrementSharedUserEntityData(
            string entityId,
            string targetProfileId,
            string jsonData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.EntityServiceEntityId.Value]       = entityId;
            data[OperationParam.EntityServiceTargetPlayerId.Value] = targetProfileId;
            if (Util.IsOptionalParameterValid(jsonData))
            {
                var where = JsonReader.Deserialize <Dictionary <string, object> >(jsonData);
                data[OperationParam.EntityServiceData.Value] = where;
            }

            var callback   = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var serverCall = new ServerCall(ServiceName.Entity, ServiceOperation.IncrementSharedUserEntityData, data, callback);

            _client.SendRequest(serverCall);
        }
示例#17
0
        /// <summary>
        /// Sends a notification to a "group" of user based on a brainCloud portal configured notification template.
        /// Includes JSON defining the substitution params to use with the template.
        /// See the Portal documentation for more info.
        /// </param>
        /// <param name="groupId">
        /// Target group
        /// </param>
        /// <param name="notificationTemplateId">
        /// Id of the notification template
        /// </param>
        /// <param name="substitutionsJson">
        /// JSON defining the substitution params to use with the template
        /// </param>
        /// <param name="success">
        /// The success callback
        /// </param>
        /// <param name="failure">
        /// The failure callback
        /// </param>
        /// <param name="cbObject">
        /// The callback object
        /// </param>
        public void SendTemplatedPushNotificationToGroup(
            string groupId,
            int notificationTemplateId,
            string substitutionsJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.GroupId.Value] = groupId;
            data[OperationParam.PushNotificationSendParamNotificationTemplateId.Value] = notificationTemplateId;

            if (Util.IsOptionalParameterValid(substitutionsJson))
            {
                data[OperationParam.PushNotificationSendParamSubstitutions.Value] = JsonReader.Deserialize <Dictionary <string, object> >(substitutionsJson);
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PushNotification, ServiceOperation.SendTemplatedToGroup, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
        public void GetEntityPage(
            string entityType,
            int rowsPerPage,
            string searchJson,
            string sortJson,
            bool doCount,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.CustomEntityServiceEntityType.Value]  = entityType;
            data[OperationParam.CustomEntityServiceRowsPerPage.Value] = rowsPerPage;
            data[OperationParam.CustomEntityServiceSearchJson.Value]  = JsonReader.Deserialize <Dictionary <string, object> >(searchJson);
            data[OperationParam.CustomEntityServiceSortJson.Value]    = JsonReader.Deserialize <Dictionary <string, object> >(sortJson);
            data[OperationParam.CustomEntityServiceDoCount.Value]     = doCount;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.CustomEntity, ServiceOperation.GetCustomEntityPage, data, callback);

            _client.SendRequest(sc);
        }
        /// </summary>
        ///Updates the singleton owned by the user for the specified custom entity type on the server, creating the singleton if it does not exist. This operation results in the owned singleton's data being completely replaced by the passed in JSON object.
        /// <remarks>
        /// Service Name - CustomEntity
        /// Service Operation -UpdateSingleton
        /// </remarks>
        /// <param name="entityType">
        /// </param>
        /// <param name="entityId">
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void UpdateSingleton(
            string entityType,
            int version,
            string dataJson,
            string acl,
            string timeToLive,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.CustomEntityServiceEntityType.Value] = entityType;
            data[OperationParam.CustomEntityServiceVersion.Value]    = version;
            data[OperationParam.CustomEntityServiceDataJson.Value]   = JsonReader.Deserialize <Dictionary <string, object> >(dataJson);
            data[OperationParam.CustomEntityServiceAcl.Value]        = JsonReader.Deserialize <Dictionary <string, object> >(acl);
            data[OperationParam.CustomEntityServiceTimeToLive.Value] = timeToLive;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.CustomEntity, ServiceOperation.UpdateSingleton, data, callback);

            _client.SendRequest(sc);
        }
示例#20
0
        /// <summary>
        /// Method returns a view of global leaderboard results that centers on the current player.
        ///
        /// Leaderboards entries contain the player's score and optionally, some user-defined
        /// data associated with the score.
        /// </summary>
        /// <remarks>
        /// Service Name - SocialLeaderboard
        /// Service Operation - GetGlobalLeaderboardView
        /// </remarks>
        /// <param name="in_leaderboardId">
        /// The id of the leaderboard to retrieve.
        /// </param>
        /// <param name="in_sort">
        /// Sort key Sort order of page.
        /// </param>
        /// <param name="in_beforeCount">
        /// The count of number of players before the current player to include.
        /// </param>
        /// <param name="in_afterCount">
        /// The count of number of players after the current player to include.
        /// </param>
        /// <param name="in_includeLeaderboardSize">
        /// Whether to return the leaderboard size
        /// </param>
        /// <param name="in_success">
        /// The success callback.
        /// </param>
        /// <param name="in_failure">
        /// The failure callback.
        /// </param>
        /// <param name="in_cbObject">
        /// The user object sent to the callback.
        /// </param>
        /// <returns> JSON string representing the entries in the leaderboard.
        /// Note that the friend summary data is returned for each record
        /// in the leaderboard.
        ///
        /// {
        ///  "status": 200,
        ///  "data": {
        ///   "leaderboardId": "abc",
        ///   "moreBefore": false,
        ///   "timeBeforeReset": 48085996,
        ///   "leaderboard": [
        ///    {
        ///     "playerId": "8c86f306-73ea-4536-9c92-aba086064d2c",
        ///     "score": 10,
        ///     "data": {
        ///      "nickname": "batman"
        ///     },
        ///     "createdAt": 1433863814394,
        ///     "updatedAt": 1433863814394,
        ///     "index": 0,
        ///     "rank": 1,
        ///     "name": "",
        ///     "summaryFriendData": {
        ///      "xp": 12,
        ///      "favColour": "red"
        ///     }
        ///    },
        ///    {
        ///     "playerId": "ab21c0af-9d3e-4a81-b3c8-ddc1fb77d9a1",
        ///     "score": 8,
        ///     "data": {
        ///      "nickname": "robin"
        ///     },
        ///     "createdAt": 1433864253221,
        ///     "updatedAt": 1433864253221,
        ///     "index": 1,
        ///     "rank": 2,
        ///     "name": "",
        ///     "summaryFriendData": null
        ///    }
        ///   ],
        ///   "server_time": 1433864314004,
        ///   "moreAfter": false
        ///  }
        /// }
        /// </returns>
        public void GetGlobalLeaderboardView(
            string in_leaderboardId,
            SortOrder in_sort,
            int in_beforeCount,
            int in_afterCount,
            bool in_includeLeaderboardSize,
            SuccessCallback in_success = null,
            FailureCallback in_failure = null,
            object in_cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value]          = in_leaderboardId;
            data[OperationParam.SocialLeaderboardServiceSort.Value]                   = SortOrderToString(in_sort);
            data[OperationParam.SocialLeaderboardServiceBeforeCount.Value]            = in_beforeCount;
            data[OperationParam.SocialLeaderboardServiceAfterCount.Value]             = in_afterCount;
            data[OperationParam.SocialLeaderboardServiceIncludeLeaderboardSize.Value] = in_includeLeaderboardSize;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(in_success, in_failure, in_cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.SocialLeaderboard, ServiceOperation.GetGlobalLeaderboardView, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
示例#21
0
        /// <summary>
        /// Post the players score to the given social leaderboard.
        /// You can optionally send a user-defined json string of data
        /// with the posted score. This string could include information
        /// relevant to the posted score.
        ///
        /// Note that the behaviour of posting a score can be modified in
        /// the brainCloud portal. By default, the server will only keep
        /// the player's best score.
        /// </summary>
        /// <remarks>
        /// Service Name - leaderboard
        /// Service Operation - PostScore
        /// </remarks>
        /// <param name="leaderboardId">
        /// The leaderboard to post to
        /// </param>
        /// <param name="score">
        /// The score to post
        /// </param>
        /// <param name="data">
        /// Optional user-defined data to post with the score
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void PostScoreToLeaderboard(
            string leaderboardId,
            long score,
            string jsonData,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value] = leaderboardId;
            data[OperationParam.SocialLeaderboardServiceScore.Value]         = score;
            if (Util.IsOptionalParameterValid(jsonData))
            {
                var customData = JsonReader.Deserialize <Dictionary <string, object> >(jsonData);
                data[OperationParam.SocialLeaderboardServiceData.Value] = customData;
            }

            var callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var sc       = new ServerCall(ServiceName.Leaderboard, ServiceOperation.PostScore, data, callback);

            _client.SendRequest(sc);
        }
示例#22
0
        /// <summary>
        /// Post the players score to the given social leaderboard.
        /// You can optionally send a user-defined json string of data
        /// with the posted score. This string could include information
        /// relevant to the posted score.
        ///
        /// Note that the behaviour of posting a score can be modified in
        /// the brainCloud portal. By default, the server will only keep
        /// the player's best score.
        /// </summary>
        /// <remarks>
        /// Service Name - SocialLeaderboard
        /// Service Operation - PostScore
        /// </remarks>
        /// <param name="in_leaderboardId">
        /// The leaderboard to post to
        /// </param>
        /// <param name="in_score">
        /// The score to post
        /// </param>
        /// <param name="in_data">
        /// Optional user-defined data to post with the score
        /// </param>
        /// <param name="in_success">
        /// The success callback.
        /// </param>
        /// <param name="in_failure">
        /// The failure callback.
        /// </param>
        /// <param name="in_cbObject">
        /// The user object sent to the callback.
        /// </param>
        /// <returns> The JSON returned in the callback is as follows:
        /// {
        ///   "status":200,
        ///   "data": null
        /// }
        /// </returns>
        public void PostScoreToLeaderboard(
            string in_leaderboardId,
            long in_score,
            string in_jsonData,
            SuccessCallback in_success = null,
            FailureCallback in_failure = null,
            object in_cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value] = in_leaderboardId;
            data[OperationParam.SocialLeaderboardServiceScore.Value]         = in_score;
            if (Util.IsOptionalParameterValid(in_jsonData))
            {
                Dictionary <string, object> customData = JsonReader.Deserialize <Dictionary <string, object> >(in_jsonData);
                data[OperationParam.SocialLeaderboardServiceData.Value] = customData;
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(in_success, in_failure, in_cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.SocialLeaderboard, ServiceOperation.PostScore, data, callback);

            m_brainCloudClientRef.SendRequest(sc);
        }
        /// <summary>
        /// List user files from the given cloud path
        /// </summary>
        /// <param name="cloudPath">File path</param>
        /// <param name="recurse">Whether to recurse down the path</param>
        /// <param name="success">The success callback</param>
        /// <param name="failure">The failure callback</param>
        /// <param name="cbObject">The callback object</param>
        public void ListUserFiles(
            string cloudPath,
            bool?recurse,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            if (Util.IsOptionalParameterValid(cloudPath))
            {
                data[OperationParam.UploadPath.Value] = cloudPath;
            }
            if (recurse.HasValue)
            {
                data[OperationParam.UploadRecurse.Value] = recurse.Value;
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.File, ServiceOperation.ListUserFiles, data, callback);

            _client.SendRequest(sc);
        }
示例#24
0
        /// <summary>
        /// Like findLobby, but explicitely geared toward creating new lobbies
        /// </summary>
        ///
        /// otherUserCxIds support coming soon!
        ///
        public void CreateLobby(string in_roomType, int in_rating,
                                bool in_isReady, Dictionary <string, object> in_extraJson, string in_teamCode,
                                Dictionary <string, object> in_settings, string[] in_otherUserCxIds = null,
                                SuccessCallback success = null, FailureCallback failure = null, object cbObject = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.LobbyRoomType.Value] = in_roomType;
            data[OperationParam.LobbyRating.Value]   = in_rating;
            data[OperationParam.LobbySettings.Value] = in_settings;
            data[OperationParam.LobbyIsReady.Value]  = in_isReady;
            if (in_otherUserCxIds != null)
            {
                data[OperationParam.LobbyOtherUserCxIds.Value] = in_otherUserCxIds;
            }
            data[OperationParam.LobbyExtraJson.Value] = in_extraJson;
            data[OperationParam.LobbyTeamCode.Value]  = in_teamCode;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.Lobby, ServiceOperation.CreateLobby, data, callback);

            m_clientRef.SendRequest(sc);
        }
        /// <summary>
        /// Gifts item to the specified player.
        /// </summary>
        /// <remarks>
        /// Service Name - UserInventoryManagement
        /// Service Operation - GetUserItem
        /// </remarks>
        /// <param name="profileId">
        /// </param>
        /// <param name="itemId">
        /// </param>
        /// <param name="version">
        /// </param>
        /// <param name="quantity">
        /// </param>
        /// <param name="immediate">
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void GiveUserItemTo(
            String profileId,
            String itemId,
            int version,
            int quantity,
            bool immediate,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.UserItemsServiceProfileId.Value] = profileId;
            data[OperationParam.UserItemsServiceItemId.Value]    = itemId;
            data[OperationParam.UserItemsServiceVersion.Value]   = version;
            data[OperationParam.UserItemsServiceQuantity.Value]  = quantity;
            data[OperationParam.UserItemsServiceImmediate.Value] = immediate;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.UserItems, ServiceOperation.GiveUserItemTo, data, callback);

            _client.SendRequest(sc);
        }
        /// <summary>
        /// Allows a quantity of a specified user item to be sold.
        ///If any quantity of the user item remains,
        ///it will be returned, potentially with the associated
        ///itemDef (with language fields limited to the current
        ///or default language), along with the currency refunded
        ///and currency balances.
        /// </summary>
        /// <remarks>
        /// Service Name - UserInventoryManagement
        /// Service Operation - SellUserItem
        /// </remarks>
        /// <param name="itemId">
        /// </param>
        /// <param name="version">
        /// </param>
        /// <param name="quantity">
        /// </param>
        /// <param name="shopId">
        /// </param>
        /// <param name="includeDef">
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void SellUserItem(
            string itemId,
            int version,
            int quantity,
            string shopId,
            bool includeDef,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.UserItemsServiceItemId.Value]     = itemId;
            data[OperationParam.UserItemsServiceVersion.Value]    = version;
            data[OperationParam.UserItemsServiceQuantity.Value]   = quantity;
            data[OperationParam.UserItemsServiceShopId.Value]     = shopId;
            data[OperationParam.UserItemsServiceIncludeDef.Value] = includeDef;

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.UserItems, ServiceOperation.SellUserItem, data, callback);

            _client.SendRequest(sc);
        }
示例#27
0
        /// <summary>
        /// Retrieve a view of the group leaderboard surrounding the current group
        /// </summary>
        /// <remarks>
        /// Service Name - leaderboard
        /// Service Operation - GET_GROUP_LEADERBOARD_VIEW
        /// </remarks>
        /// <param name="leaderboardId">
        /// the id of the leaderboard
        /// </param>
        /// <param name="groupId">
        /// The groups Id
        /// </param>
        /// <param name="sort">
        /// The groups Id
        /// </param>
        /// <param name="beforeCount">
        /// The count of number of players before the current player to include.
        /// </param>
        /// <param name="afterCount">
        /// The count of number of players after the current player to include.
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void GetGroupLeaderboardView(
            string leaderboardId,
            string groupId,
            SortOrder sort,
            int beforeCount,
            int afterCount,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value] = leaderboardId;
            data[OperationParam.SocialLeaderboardServiceGroupId.Value]       = groupId;
            data[OperationParam.SocialLeaderboardServiceSort.Value]          = sort.ToString();
            data[OperationParam.SocialLeaderboardServiceBeforeCount.Value]   = beforeCount;
            data[OperationParam.SocialLeaderboardServiceAfterCount.Value]    = afterCount;

            var callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var sc       = new ServerCall(ServiceName.Leaderboard, ServiceOperation.GetGroupLeaderboardView, data, callback);

            _client.SendRequest(sc);
        }
        private void SendRichPushNotification(
            string toProfileId,
            int notificationTemplateId,
            string substitutionJson,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            Dictionary <string, object> data = new Dictionary <string, object>();

            data[OperationParam.PushNotificationSendParamToPlayerId.Value]             = toProfileId;
            data[OperationParam.PushNotificationSendParamNotificationTemplateId.Value] = notificationTemplateId;

            if (Util.IsOptionalParameterValid(substitutionJson))
            {
                data[OperationParam.PushNotificationSendParamSubstitutions.Value] = JsonReader.Deserialize <Dictionary <string, object> >(substitutionJson);
            }

            ServerCallback callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            ServerCall     sc       = new ServerCall(ServiceName.PushNotification, ServiceOperation.SendRich, data, callback);

            _client.SendRequest(sc);
        }
示例#29
0
        /// <summary>
        /// Method returns a page of global leaderboard results. By using a non-current version id,
        /// the user can retrieve a historical leaderboard. See GetGlobalLeaderboardVersions method
        /// to retrieve the version id.
        /// </summary>
        /// <remarks>
        /// Service Name - leaderboard
        /// Service Operation - GetGlobalLeaderboardPage
        /// </remarks>
        /// <param name="leaderboardId">
        /// The id of the leaderboard to retrieve.
        /// </param>
        /// <param name="sort">
        /// Sort key Sort order of page.
        /// </param>
        /// <param name="startIndex">
        /// The index at which to start the page.
        /// </param>
        /// <param name="endIndex">
        /// The index at which to end the page.
        /// </param>
        /// <param name="versionId">
        /// The historical version to retrieve.
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void GetGlobalLeaderboardPageByVersion(
            string leaderboardId,
            SortOrder sort,
            int startIndex,
            int endIndex,
            int versionId,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value] = leaderboardId;
            data[OperationParam.SocialLeaderboardServiceSort.Value]          = sort.ToString();
            data[OperationParam.SocialLeaderboardServiceStartIndex.Value]    = startIndex;
            data[OperationParam.SocialLeaderboardServiceEndIndex.Value]      = endIndex;
            data[OperationParam.SocialLeaderboardServiceVersionId.Value]     = versionId;

            var callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var sc       = new ServerCall(ServiceName.Leaderboard, ServiceOperation.GetGlobalLeaderboardPage, data, callback);

            _client.SendRequest(sc);
        }
示例#30
0
        /// <summary>
        /// Post the players score to the given social leaderboard with a rotation type of DAYS.
        /// Pass leaderboard config data to dynamically create if necessary.
        /// You can optionally send a user-defined json string of data
        /// with the posted score. This string could include information
        /// relevant to the posted score.
        /// </summary>
        /// <remarks>
        /// Service Name - leaderboard
        /// Service Operation - PostScoreDynamic
        /// </remarks>
        /// <param name="leaderboardId">
        /// The leaderboard to post to
        /// </param>
        /// <param name="score">
        /// The score to post
        /// </param>
        /// <param name="data">
        /// Optional user-defined data to post with the score
        /// </param>
        /// <param name="leaderboardType">
        /// leaderboard type
        /// </param>
        /// <param name="rotationReset">
        /// Date to reset the leaderboard UTC
        /// </param>
        /// <param name="retainedCount">
        /// How many rotations to keep
        /// </param>
        /// <param name="numDaysToRotate">
        /// How many days between each rotation
        /// </param>
        /// <param name="success">
        /// The success callback.
        /// </param>
        /// <param name="failure">
        /// The failure callback.
        /// </param>
        /// <param name="cbObject">
        /// The user object sent to the callback.
        /// </param>
        public void PostScoreToDynamicLeaderboardDays(
            string leaderboardId,
            long score,
            string jsonData,
            SocialLeaderboardType leaderboardType,
            DateTime?rotationReset,
            int retainedCount,
            int numDaysToRotate,
            SuccessCallback success = null,
            FailureCallback failure = null,
            object cbObject         = null)
        {
            var data = new Dictionary <string, object>();

            data[OperationParam.SocialLeaderboardServiceLeaderboardId.Value] = leaderboardId;
            data[OperationParam.SocialLeaderboardServiceScore.Value]         = score;
            if (Util.IsOptionalParameterValid(jsonData))
            {
                var customData = JsonReader.Deserialize <Dictionary <string, object> >(jsonData);
                data[OperationParam.SocialLeaderboardServiceData.Value] = customData;
            }
            data[OperationParam.SocialLeaderboardServiceLeaderboardType.Value] = leaderboardType.ToString();
            data[OperationParam.SocialLeaderboardServiceRotationType.Value]    = "DAYS";

            if (rotationReset.HasValue)
            {
                data[OperationParam.SocialLeaderboardServiceRotationResetTime.Value] = Util.DateTimeToUnixTimestamp(rotationReset.Value);
            }

            data[OperationParam.SocialLeaderboardServiceRetainedCount.Value] = retainedCount;
            data[OperationParam.NumDaysToRotate.Value] = numDaysToRotate;

            var callback = BrainCloudClient.CreateServerCallback(success, failure, cbObject);
            var sc       = new ServerCall(ServiceName.Leaderboard, ServiceOperation.PostScoreDynamic, data, callback);

            _client.SendRequest(sc);
        }
 public BrainCloudGlobalStatistics(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudSocialLeaderboard(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#33
0
 /// <summary>A way to get a Singleton instance of brainCloud.</summary>
 public static BrainCloudClient Get()
 {
     // DO NOT USE THIS INTERNALLY WITHIN BRAINCLOUD LIBRARY...
     // THIS IS JUST A CONVENIENCE FOR APP DEVELOPERS TO STORE A SINGLETON!
     if (s_instance == null)
     {
         s_instance = new BrainCloudClient();
     }
     return s_instance;
 }
 public BrainCloudS3Handling(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudComms(BrainCloudClient in_client)
 {
     #if (DOT_NET)
     ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
     #endif
     m_brainCloudClientRef = in_client;
 }
示例#36
0
 public BrainCloudScript(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudAuthentication(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#38
0
 public BrainCloudEntity(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudPlayerStatistics(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudGlobalApp (BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudMatchMaking(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#42
0
 public BrainCloudEvent(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudPushNotification(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#44
0
 public BrainCloudProduct(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#45
0
 public BrainCloudTime(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#46
0
 public BrainCloudOneWayMatch(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudPlaybackStream(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#48
0
 public BrainCloudGamification(BrainCloudClient in_brainCloud)
 {
     m_brainCloudClientRef = in_brainCloud;
 }
 public BrainCloudWrapper()
 {
     m_client = new BrainCloudClient();
 }
 public BrainCloudWrapper()
 {
     m_client = BrainCloudClient.Get ();
 }
 public BrainCloudAsyncMatch(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
 public BrainCloudPlayerStatisticsEvent(BrainCloudClient in_brainCloud)
 {
     m_brainCloudClientRef = in_brainCloud;
 }
 public BrainCloudFriend(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }
示例#54
0
 public BrainCloudTwitter(BrainCloudClient in_brainCloudClientRef)
 {
     m_brainCloudClientRef = in_brainCloudClientRef;
 }