/// <summary> /// Determine if the local user if following anyone. /// </summary> /// <param name='callback'> /// Called upon receiving results from the call. Second parameter is set to whether or not the /// user is following anyone. CANNOT be 'null'. /// </param> public static void IsLocalUserFollowingAnyone(Gree.Unity.CallbackFetcherOpenFeint.FollowingResultDelegate callback) { if(callback != null) { if(Gree.Unity.CallbackFetcherOpenFeint.followingResultCallback == null) { Gree.Unity.CallbackFetcherOpenFeint.followingResultCallback = callback; SendMessage("isLocalUserFollowingAnyone", new ArrayList()); } else { Debug.LogError("OpenFeint error: Cannot call IsLocalUserFollowingAnyone until previous call has returned success or failure."); } } else { Debug.LogError("OpenFeint error: No callback supplied to IsLocalUserFollowingAnyone."); } }
/// <summary> /// Submits the result of a played challenge to the server. This should always be called /// after the challenge game play session is over, regardless of the result or the type /// of challenge. It should be called before DisplayChallengeCompletedModal. /// </summary> /// <remarks> /// Events : OnChallengeResultSubmitted /// </remarks> /// <param name='result'> /// The result of the challenge. /// </param> /// <param name='resultDescription'> /// A string that will be prefixed by either the recipient's name or "You", depending on /// the player that is viewing the result. It should not contain whether the recipient won /// or lost, but should contain the statistics of his attempt. (Ex. "beat 30 monsters" will /// turn into "You beat 30 monsters") /// </param> public static void SubmitChallengeResult(Gree.Unity.CallbackFetcherOpenFeint.eChallengeResult result, string resultDescription) { ArrayList args = new ArrayList { result, resultDescription }; SendMessage("submitChallengeResult", args); }
/// <summary> /// Get a challenge defintion structure for a particular challenge ID. /// </summary> /// <param name='challengeId'> /// The ID of the challenge. /// </param> /// <param name='callback'> /// Called upon success or failure of the get. CANNOT be 'null'. /// </param> public static void GetChallengeDefinition(string challengeId, Gree.Unity.CallbackFetcherOpenFeint.ChallengeDefinitionResultDelegate callback) { #if UNITY_ANDROID throwAndroidUnsupported("OpenFeint.cs", "GetChallengeDefinition"); #else ArrayList args = new ArrayList { challengeId }; if(callback != null) { if(Gree.Unity.CallbackFetcherOpenFeint.challengeDefinitionResultCallback == null) { Gree.Unity.CallbackFetcherOpenFeint.challengeDefinitionResultCallback = callback; SendMessage("getChallengeDefinition", args); } else { Debug.LogError("OpenFeint error: Cannot call GetChallengeDefinition until previous call has returned success or failure."); } } else { Debug.LogError("OpenFeint error: No callback supplied to GetChallengeDefinition."); } #endif }
public static void GetChallengeDefinition(long challengeId, Gree.Unity.CallbackFetcherOpenFeint.ChallengeDefinitionResultDelegate callback) { GetChallengeDefinition(challengeId.ToString(), callback); }
/// <summary> /// Download a previously uploaded data blob from the "cloud". /// </summary> /// <remarks> /// Events : OnUploadedCloudBlob /// </remarks> /// <param name='blobKey'> /// The key of the blob you wish to download from the cloud. /// </param> /// <param name='playerPrefsKeys'> /// An array of PlayerPrefs keys that will be populated with the downloaded blob data. /// </param> /// <param name='callback'> /// Called whenever the action returns success or failure. CANNOT be 'null'. /// </param> public static void DownloadBlobToPlayerPrefs(string blobKey, string[] playerPrefsKeys, Gree.Unity.CallbackFetcherOpenFeint.DeferredResultDelegate callback) { #if UNITY_ANDROID throwAndroidUnsupported("OpenFeint.cs", "DownloadBlobToPlayerPrefs"); #else ArrayList args = new ArrayList { blobKey, playerPrefsKeys }; if(callback != null) { if(Gree.Unity.CallbackFetcherOpenFeint.downloadCloudBlobResultCallback == null) { Gree.Unity.CallbackFetcherOpenFeint.downloadCloudBlobResultCallback = callback; SendMessage("downloadBlobToPlayerPrefs", args); } else { Debug.LogError("OpenFeint error: Cannot call DownloadBlobToPlayerPrefsKeys until previous blob download has returned success or failure."); } } else { Debug.LogError("OpenFeint error: No callback supplied to DownloadBlobToPlayerPrefsKeys."); } #endif }
/// <summary> /// Download a previously uploaded data blob from the "cloud". /// </summary> /// <param name='blobKey'> /// The key of the blob you wish to download from the cloud. /// </param> /// <param name='filePath'> /// A path to a file in the app's Documents directory that you wish to be populated /// with the downloaded blob contents. This is the preferred method if using serialized /// XML data (Unity iPhone Advanced only). /// </param> /// <param name='callback'> /// Called whenever the action returns success or failure. CANNOT be 'null'. /// </param> public static void DownloadBlobToFilePath(string blobKey, string filePath, Gree.Unity.CallbackFetcherOpenFeint.DeferredResultDelegate callback) { ArrayList args = new ArrayList { blobKey, filePath }; if(callback != null) { if(Gree.Unity.CallbackFetcherOpenFeint.downloadCloudBlobResultCallback == null) { Gree.Unity.CallbackFetcherOpenFeint.downloadCloudBlobResultCallback = callback; SendMessage("downloadBlobToFile", args); } else { Debug.LogError("OpenFeint error: Cannot call DownloadBlobToFilePath until previous blob download has returned success or failure."); } } else { Debug.LogError("OpenFeint error: No callback supplied to DownloadBlobToFilePath."); } }
/// <summary> /// Displays the modal for showing the result of the challenge and allows for the user /// to re-challenge (if it was a multi-attempt challenge). Call SubmitChallengeResult BEFORE /// calling this. /// </summary> /// <param name='result'> /// The result of the challenge. /// </param> /// <param name='resultDescription'> /// A string that will be prefixed by either the recipient's name or "You", depending on the player /// that is viewing the result. It should not contain whether the recipient won or lost, but /// should contain the statistics of his attempt. (Ex. "beat 30 monsters" will turn into /// "You beat 30 monsters") /// </param> /// <param name='reChallengeDescription'> /// If the user decides to send out the result as a re-challenge, this will be the description /// for the new challenge. It should display what needs to be fulfilled to complete the challenge. /// Only used by multi-attempt challenges. /// </param> /// <param name='reChallengeDataKeys'> /// Tells the native code how/where to access the challenge data if the user decides to send out a /// "re-challenge". Only used for multi-attempt challenges. /// </param> public static void DisplayChallengeCompletedModalWithPlayerPrefs(Gree.Unity.CallbackFetcherOpenFeint.eChallengeResult result, string resultDescription, string reChallengeDescription, string[] reChallengeDataKeys) { ArrayList args = new ArrayList { result, resultDescription, reChallengeDescription, reChallengeDataKeys }; SendMessage("displayChallengeCompletedModalWithPlayerPrefs", args); }
/// <summary> /// Displays the modal for showing the result of the challenge and allows for the user /// to re-challenge (if it was a multi-attempt challenge). Call SubmitChallengeResult BEFORE /// calling this. /// </summary> /// <param name='result'> /// The result of the challenge. /// </param> /// <param name='resultDescription'> /// RA string that will be prefixed by either the recipient's name or "You", depending on the /// player that is viewing the result. It should not contain whether the recipient won or lost, /// but should contain the statistics of his attempt. (Ex. "beat 30 monsters" will turn into /// "You beat 30 monsters") /// </param> /// <param name='reChallengeDescription'> /// If the user decides to send out the result as a re-challenge, this will be the description /// for the new challenge. It should display what needs to be fulfilled to complete the challenge. /// Only used by multi-attempt challenges. /// </param> /// <param name='reChallengeDataFilePath'> /// Tells the native code how/where to access the challenge data if the user decides to send /// out a "re-challenge". Only used for multi-attempt challenges. /// </param> public static void DisplayChallengeCompletedModalWithFile(Gree.Unity.CallbackFetcherOpenFeint.eChallengeResult result, string resultDescription, string reChallengeDescription, string reChallengeDataFilePath) { ArrayList args = new ArrayList { result, resultDescription, reChallengeDescription, reChallengeDataFilePath }; SendMessage("displayChallengeCompletedModalWithFile", args); }
private void ReceivedNewChallenge(Gree.Unity.CallbackFetcherOpenFeint.ChallengeDefinition challengeDefinition) { OpenFeint.InGameNotification("Accepted Challenge with title: " + challengeDefinition.title); }