Beispiel #1
0
 void ISocialPlatform.LoadFriends(ILocalUser user, Action<bool> callback)
 {
   if (!this.VerifyUser())
     return;
   ((LocalUser) user).SetFriends((IUserProfile[]) this.m_Friends.ToArray());
   if (callback == null)
     return;
   callback(true);
 }
Beispiel #2
0
		void ISocialPlatform.LoadFriends(ILocalUser user, Action<bool> callback)
		{
			if (!this.VerifyUser())
			{
				return;
			}
			((LocalUser)user).SetFriends(this.m_Friends.ToArray());
			if (callback != null)
			{
				callback(true);
			}
		}
Beispiel #3
0
	/// <summary>
	/// Authenticates the given user.
	/// </summary>
	/// <param name="user">The user to authenticate.</param>
	/// <param name="callback">Callback.</param>
	public void Authenticate (ILocalUser user, Action<bool> callback)
	{
		user.Authenticate(
			success => {
				if (success) {
					_localUser = user as LumosUser;
				}

				if (callback != null) {
					callback(success);
				}
			});
	}
 /// <summary>
 /// Authenticate the specified user and callback.
 /// </summary>
 /// <param name='user'>
 /// User.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void Authenticate(ILocalUser user, System.Action<bool> callback)
 {
     // Forward the AGSClient callbacks to the passed in callback.
     if(null != callback) {
         AGSClient.ServiceReadyEvent += () => {
             callback(true);
         };
         AGSClient.ServiceNotReadyEvent += (error) => { callback(false); };
     }
     // If using GameCircle with the Unity Social API,
     // initialize it with leaderboards and achievements, but not whispersync.
     AGSClient.Init(/*Leaderboards*/true,/*Achievements*/true,/*Whispersync*/false);
 }
Beispiel #5
0
 void ISocialPlatform.Authenticate(ILocalUser user, Action<bool> callback)
 {
   LocalUser localUser = (LocalUser) user;
   this.m_DefaultTexture = this.CreateDummyTexture(32, 32);
   this.PopulateStaticData();
   localUser.SetAuthenticated(true);
   localUser.SetUnderage(false);
   localUser.SetUserID("1000");
   localUser.SetUserName("Lerpz");
   localUser.SetImage(this.m_DefaultTexture);
   if (callback == null)
     return;
   callback(true);
 }
Beispiel #6
0
		/// <summary>
		/// Shows the default save system UI. This allows user to select/delete saves as required.
		/// </summary>
		/// <param name="user">User.</param>
		/// <param name="callback">Invokes, when save game has been selected. Check for status for errors, or </param>
		public void ShowSaveSystemUI(ILocalUser user, Action<SelectUIStatus, ISavedGameMetadata> callback) {
			
			uint maxNumToDisplay = 1;
			bool allowCreateNew = true;
			bool allowDelete = true;
			
			ISavedGameClient savedGameClient = PlayGamesPlatform.Instance.SavedGame;
			
			if(savedGameClient != null) {
				
				savedGameClient.ShowSelectSavedGameUI(
					user.userName + "\u0027s saves",
					maxNumToDisplay,
					allowCreateNew,
					allowDelete,
					(SelectUIStatus status, ISavedGameMetadata saveGame) => {
						
						// some error occured, just show window again
						if (status != SelectUIStatus.SavedGameSelected) {
							ShowSaveSystemUI(user,callback);
							return;
						}
						
						if (callback != null) callback.Invoke(status, saveGame);
						
						if (OnSaveGameSelected != null && status == SelectUIStatus.SavedGameSelected) OnSaveGameSelected.Invoke();
					}
				);
				
			} else {
				
				// this is usually due to incorrect APP ID
				Debug.LogError("Save Game client is null...");
				
			}
			
		}
Beispiel #7
0
 public virtual void UpdateProfile(string firstName, string parentEmail, IEnumerable <ILegalDocument> legal, ILocalUser localUser)
 {
     if (NetworkConfigIsNotSet)
     {
         throw new NullReferenceException("NetworkServicesConfig not set");
     }
     localUser.UpdateProfile(firstName, null, null, null, parentEmail, null, null, legal, onProfileUpdated);
 }
 public void Authenticate(ILocalUser user, Action<bool> callback)
 {
     GPGLocalUser tUser = user as GPGLocalUser;
     tUser.Authenticate(callback);
 }
Beispiel #9
0
 public void LoadFriends(ILocalUser user, Action <bool> callback)
 {
 }
 public void LoadFriends(ILocalUser user, Action <bool> callback)
 {
     throw new NotImplementedException();
 }
 public void Authenticate(ILocalUser user, Action<bool, string> callback)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
 /// <summary>
 /// Authenticate the local user with the Google Play Games service.
 /// </summary>
 /// <param name='localUser'>
 /// The local user. Must be <c>Social.localUser</c>.
 /// </param>
 /// <param name='callback'>
 /// The callback to call when authentication finishes. It will be called
 /// with <c>true</c> if authentication was successful, <c>false</c>
 /// otherwise.
 /// </param>
 public void Authenticate(ILocalUser localUser, Action <bool> callback)
 {
     Authenticate(localUser, callback, false);
 }
Beispiel #13
0
 public iOSLocalUser()
 {
     // Initialize properties
     m_localUserData = Social.localUser;
 }
Beispiel #14
0
 public static void ProcessCallbacks(this ILocalUser socialUser)
 {
     ((SteamLocalUser)socialUser).ProcessCallbacks();
 }
Beispiel #15
0
 public static bool CheckPasswordHash <TUserId>(ILocalUser <TUserId> user, string password)
 => CheckPasswordHash(user.Password, user.Salt, password);
Beispiel #16
0
 public override void UpdateProfile(string firstName, string parentEmail, IEnumerable <ILegalDocument> legal, ILocalUser localUser)
 {
     if (NetworkConfigIsNotSet)
     {
         throw new NullReferenceException("NetworkServicesConfig not set");
     }
     CoroutineRunner.StartPersistent(delayProfileUpdated(), this, "delay profile update");
 }
Beispiel #17
0
 public void Authenticate(ILocalUser unused, Action <bool, string> callback)
 {
     Authenticate(callback, false, "auth error");
 }
Beispiel #18
0
 public void Authenticate(ILocalUser unused, Action <Boolean> callback)
 {
     this.Authenticate(callback);
 }
Beispiel #19
0
 public OfflineSession(string userName)
 {
     this.userName = userName;
     localUser     = new OfflineLocalUser(userName);
 }
Beispiel #20
0
 /// <summary>
 /// Loads the friends.
 /// </summary>
 /// <param name='user'>
 /// User.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void LoadFriends(ILocalUser user, System.Action<bool> callback)
 {
     if(user == null) {
         AGSClient.LogGameCircleError("LoadFriends \"user\" argument should not be null");
         return;
     }
     user.LoadFriends(callback);
 }
 /// <summary>
 /// Authenticate the local user with the Google Play Games service.
 /// </summary>
 /// <param name='localUser'>
 /// The local user. Must be <c>Social.localUser</c>.
 /// </param>
 /// <param name='callback'>
 /// The callback to call when authentication finishes. It will be called
 /// with <c>true</c> if authentication was successful, <c>false</c>
 /// otherwise.
 /// </param>
 public void Authenticate(ILocalUser localUser, Action<bool> callback) {
     Authenticate(localUser, callback, false);
 }
Beispiel #22
0
        public void Authenticate(ILocalUser user, Action <bool> callback)
        {
            GPGLocalUser tUser = user as GPGLocalUser;

            tUser.Authenticate(callback);
        }
        /// <summary>
        /// Authenticate the local user with the Google Play Games service.
        /// </summary>
        /// <param name='unused'>
        /// Unused. For future compatibility, always pass <c>Social.localUser</c>.
        /// </param>
        /// <param name='callback'>
        /// The callback to call when authentication finishes. It will be called
        /// with <c>true</c> if authentication was successful, <c>false</c>
        /// otherwise.
        /// </param>
        /// <param name='silent'>
        /// Indicates whether authentication should be silent. If <c>false</c>,
        /// authentication may show popups and interact with the user to obtain
        /// authorization. If <c>true</c>, there will be no popups or interaction with
        /// the user, and the authentication will fail instead if such interaction
        /// is required. A typical pattern is to try silent authentication on startup
        /// and, if that fails, present the user with a "Sign in" button that then
        /// triggers normal (not silent) authentication.
        /// </param>
        public void Authenticate(ILocalUser unused, Action<bool> callback, bool silent) {
            // make a platform-specific Play Games client
            mClient = PlayGamesClientFactory.GetPlatformPlayGamesClient();

            // authenticate!
            mClient.Authenticate(callback, silent);
        }
 public void Authenticate(ILocalUser user, Action <bool, string> callback)
 {
     Authenticate(true, callback);
 }
		private sealed virtual void UnityEngine.SocialPlatforms.ISocialPlatform.LoadFriends(ILocalUser user, Action<Boolean> callback){}
        /// <summary>
        /// Authenticate the specified user.
        /// </summary>
        /// <param name="user">User.</param>
        /// <param name="callback">Callback.</param>
        /// <example>
        /// Example of usage:
        /// <code>
        /// CombuManager.platform.Authenticate (user, (bool success, string error) => {
        ///    Debug.Log("Authenticate: " + success + " -- " + error);
        /// });
        /// </code>
        /// </example>
        public virtual void Authenticate(ILocalUser user, System.Action <bool, string> callback)
        {
            string password = (user is User ? (user as User).password : "");

            Authenticate <User> (user.userName, password, callback);
        }
Beispiel #27
0
 /// <summary>
 /// Same as <see cref="Authenticate(Action<bool>,bool)"/>. Provided for compatibility
 /// with ISocialPlatform.
 /// </summary>
 /// <param name="unused">Unused.</param>
 /// <param name="callback">Callback.</param>
 public void Authenticate(ILocalUser unused, Action <bool> callback)
 {
     Authenticate(callback, false);
 }
		private sealed virtual void UnityEngine.SocialPlatforms.ISocialPlatform.Authenticate(ILocalUser user, Action<Boolean> callback){}
 //Temporal fix for error on implementation
 public void Authenticate(ILocalUser x, Action <bool, string> callback)
 {
     //mPlatform.Authenticate(callback);
 }
Beispiel #30
0
 void ISocialPlatform.Authenticate(ILocalUser user, Action <bool, string> callback)
 {
     GameCenterPlatform.s_AuthenticateCallback = callback;
     GameCenterPlatform.Authenticate();
 }
Beispiel #31
0
	/// <summary>
	/// Loads the user's friends.
	/// </summary>
	/// <param name="user">User.</param>
	/// <param name="callback">Callback.</param>
	public void LoadFriends (ILocalUser user, Action<bool> callback)
	{
		user.LoadFriends(callback);
	}
Beispiel #32
0
		/// <summary>
		/// Loads the saved game. This should be a starting point for loading data.
		/// </summary>
		/// <param name="user">User.</param>
		/// <param name="onSaveLoadedCallback">On save loaded callback.</param>
		public void LoadSavedGame(ILocalUser user, Action<SaveDataBundle> onSaveLoadedCallback) {
			
			if(onSaveLoadedCallback != null) OnSaveLoaded += onSaveLoadedCallback;
			
			if(m_saveBundleMetadata == null) {
				ShowSaveSystemUI(user, LoadGame);
			} else {
				LoadGame(SelectUIStatus.SavedGameSelected, m_saveBundleMetadata);
			}
			
		}
 /// <summary>
 ///  Provided for compatibility with ISocialPlatform.
 /// </summary>
 /// <seealso cref="Authenticate(Action&lt;bool&gt;,bool)"/>
 /// <param name="unused">Unused.</param>
 /// <param name="callback">Callback.</param>
 public void Authenticate(ILocalUser unused, Action<bool> callback)
 {
     Authenticate(callback, false);
 }
 /// <summary>
 /// Not implemented yet. Calls the callback with <c>false</c>.
 /// </summary>
 public void LoadFriends(ILocalUser user, Action<bool> callback)
 {
     Logger.w("PlayGamesPlatform.LoadFriends not implemented.");
     if (callback != null)
     {
         callback.Invoke(false);
     }
 }
 void ISocialPlatform.Authenticate(ILocalUser user, System.Action <bool, string> callback)
 {
     ((ISocialPlatform)this).Authenticate(user, success => callback(success, null));
 }
Beispiel #36
0
 public void RejectFriendInvitation(IIncomingFriendInvitation incomingFriendInvitation, ILocalUser localUser)
 {
     if (incomingFriendInvitation == null)
     {
         throw new ArgumentNullException("incomingFriendInvitation");
     }
     localUser.RejectFriendInvitation(incomingFriendInvitation, delegate(IRejectFriendInvitationResult result)
     {
         onRejectFriendInvitationSent(result, incomingFriendInvitation.Inviter.DisplayName.Text);
     });
 }
Beispiel #37
0
 public void Authenticate(ILocalUser user, System.Action <bool> callback)
 {
     throw new System.NotImplementedException();
 }
        /// <summary>
        /// Loads the friends that also play this game.  See loadConnectedPlayers.
        /// </summary>
        /// <param name="callback">Callback.</param>
        public void LoadFriends(ILocalUser user, Action<bool> callback)
        {
            if (!IsAuthenticated())
            {
                GooglePlayGames.OurUtils.Logger.e("LoadScores can only be called after authentication.");
                if (callback != null)
                {
                    callback(false);
                }
            }

            mClient.LoadFriends(callback);
        }
Beispiel #39
0
 /// <summary>
 /// Authenticate the specified user and callback.
 /// </summary>
 /// <param name='user'>
 /// User.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void Authenticate(ILocalUser user, System.Action<bool> callback)
 {
     // Forward the AGSClient callbacks to the passed in callback.
     authenticationCallback = callback;
     // If using GameCircle with the Unity Social API,
     // initialize it with leaderboards and achievements, but not whispersync.
     AGSClient.Init(/*Leaderboards*/true,/*Achievements*/true,/*Whispersync*/false);
 }