private PlayGamesClientConfiguration(Builder builder) { this.mEnableSavedGames = builder.mEnableSaveGames; this.mEnableDeprecatedCloudSave = builder.mEnableDeprecatedCloudSave; this.mInvitationDelegate = builder.mInvitationDelegate; this.mMatchDelegate = builder.mMatchDelegate; }
private PlayGamesClientConfiguration(Builder builder) { this.mEnableSavedGames = builder.HasEnableSaveGames(); this.mEnableDeprecatedCloudSave = builder.HasEnableDeprecatedCloudSave(); this.mInvitationDelegate = builder.GetInvitationDelegate(); this.mMatchDelegate = builder.GetMatchDelegate(); }
// called from game thread public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { Logger.d("AndroidClient.RegisterInvitationDelegate"); if (deleg == null) { Logger.w("AndroidClient.RegisterInvitationDelegate called w/ null argument."); return; } mInvitationDelegate = deleg; // install invitation listener, if we don't have one yet if (!mRegisteredInvitationListener) { Logger.d("Registering an invitation listener."); RegisterInvitationListener(); } if (mInvitationFromNotification != null) { Logger.d("Delivering pending invitation from notification now."); Invitation inv = mInvitationFromNotification; mInvitationFromNotification = null; PlayGamesHelperObject.RunOnGameThread(() => { if (mInvitationDelegate != null) { mInvitationDelegate.Invoke(inv, true); } }); } }
/// <summary> /// Initializes a new instance of the <see cref="GooglePlayGames.BasicApi.PlayGamesClientConfiguration"/> struct. /// </summary> /// <param name="builder">Builder for this configuration.</param> private PlayGamesClientConfiguration(Builder builder) { this.mEnableSavedGames = builder.HasEnableSaveGames(); this.mInvitationDelegate = builder.GetInvitationDelegate(); this.mMatchDelegate = builder.GetMatchDelegate(); this.mPermissionRationale = builder.GetPermissionRationale(); }
/// <summary> /// Initializes a new instance of the <see cref="GooglePlayGames.BasicApi.PlayGamesClientConfiguration"/> struct. /// </summary> /// <param name="builder">Builder for this configuration.</param> private PlayGamesClientConfiguration(Builder builder) { this.mEnableSavedGames = builder.HasEnableSaveGames(); this.mInvitationDelegate = builder.GetInvitationDelegate(); this.mMatchDelegate = builder.GetMatchDelegate(); this.mPermissionRationale = builder.GetPermissionRationale(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { Logger.d("AndroidClient.RegisterInvitationDelegate"); if (deleg == null) { Logger.w("AndroidClient.RegisterInvitationDelegate called w/ null argument."); return; } this.mInvitationDelegate = deleg; if (!this.mRegisteredInvitationListener) { Logger.d("Registering an invitation listener."); this.RegisterInvitationListener(); } if (this.mInvitationFromNotification != null) { Logger.d("Delivering pending invitation from notification now."); Invitation inv = this.mInvitationFromNotification; this.mInvitationFromNotification = null; PlayGamesHelperObject.RunOnGameThread(delegate { if (this.mInvitationDelegate != null) { this.mInvitationDelegate(inv, true); } }); } }
public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { if (invitationDelegate == null) { this.mInvitationDelegate = (Action <Invitation, bool>)null; } else { this.mInvitationDelegate = Callbacks.AsOnGameThreadCallback <Invitation, bool>((Action <Invitation, bool>)((invitation, autoAccept) => invitationDelegate(invitation, autoAccept))); } }
///<summary></summary> /// <seealso cref="GooglePlayGames.BasicApi.IPlayGamesClient.RegisterInvitationDelegate"/> public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { if (invitationDelegate == null) { mInvitationDelegate = null; } else { mInvitationDelegate = AsOnGameThreadCallback <Invitation, bool>( (invitation, autoAccept) => invitationDelegate(invitation, autoAccept)); } }
/// <summary> /// Initializes a new instance of the <see cref="GooglePlayGames.BasicApi.PlayGamesClientConfiguration"/> struct. /// </summary> /// <param name="builder">Builder for this configuration.</param> private PlayGamesClientConfiguration(Builder builder) { this.mEnableSavedGames = builder.HasEnableSaveGames(); this.mInvitationDelegate = builder.GetInvitationDelegate(); this.mMatchDelegate = builder.GetMatchDelegate(); this.mScopes = builder.getScopes(); this.mHidePopups = builder.IsHidingPopups(); this.mRequestAuthCode = builder.IsRequestingAuthCode(); this.mForceRefresh = builder.IsForcingRefresh(); this.mRequestEmail = builder.IsRequestingEmail(); this.mRequestIdToken = builder.IsRequestingIdToken(); this.mAccountName = builder.GetAccountName(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { if (invitationDelegate == null) { mInvitationDelegate = null; } else { mInvitationDelegate = Callbacks.AsOnGameThreadCallback(delegate(Invitation invitation, bool autoAccept) { invitationDelegate(invitation, autoAccept); }); } }
/// <summary> /// Registers the invitation delegate for both real-time and turn-based matches. /// This should be done as soon as authentication completes, /// i.e. in the handler of <see cref="UserLoginSucceeded"/> event. /// </summary> /// <param name="invitationDelegate">Invitation delegate.</param> public static void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { sInvitationDelegate = invitationDelegate; #if UNITY_ANDROID && EM_GPGS // Invoke delegate for pending invitations if any. if (sInvitationDelegate != null && sGPGSPendingInvitations != null) { while (sGPGSPendingInvitations.Count > 0) { sGPGSPendingInvitations.Dequeue()(); } sGPGSPendingInvitations = null; } #endif }
// Register an invitation delegate for RTMP/TBMP invitations public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { Logger.d("iOSClient.RegisterInvitationDelegate"); if (deleg == null) { Logger.w("iOSClient.RegisterInvitationDelegate called w/ null argument."); return; } sInvitationDelegate = deleg; // install invitation listener, if we don't have one yet if (!mRegisteredInvitationListener) { Logger.d("Registering an invitation listener."); RegisterInvitationListener(); } // I don't think I need to deal with pending notifications, as the iOS library // caches them until the user has signed in }
public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { if (invitationDelegate == null) { mInvitationDelegate = null; } else { mInvitationDelegate = Callbacks.AsOnGameThreadCallback<Invitation, bool>( (invitation, autoAccept) => invitationDelegate(invitation, autoAccept)); } }
/// <summary> /// Registers the invitation delegate. /// </summary> /// <param name="invitationDelegate">Invitation delegate.</param> public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { LogUsage(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { throw new NotSupportedException("unsupported"); }
/// <summary> /// Register an invitation delegate to be /// notified when a multiplayer invitation arrives /// </summary> /// <param name="deleg">The delegate to register</param> public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { mClient.RegisterInvitationDelegate(deleg); }
// called from game thread public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { Logger.d("AndroidClient.RegisterInvitationDelegate"); if (deleg == null) { Logger.w("AndroidClient.RegisterInvitationDelegate called w/ null argument."); return; } mInvitationDelegate = deleg; // install invitation listener, if we don't have one yet if (!mRegisteredInvitationListener) { Logger.d("Registering an invitation listener."); RegisterInvitationListener(); } if (mInvitationFromNotification != null) { Logger.d("Delivering pending invitation from notification now."); Invitation inv = mInvitationFromNotification; mInvitationFromNotification = null; PlayGamesHelperObject.RunOnGameThread(() => { if (mInvitationDelegate != null) { mInvitationDelegate.Invoke(inv, true); } }); } }
/// <summary> /// Adds the invitation delegate. This is called when an invitation /// is received. /// </summary> /// <returns>The builder</returns> /// <param name="invitationDelegate">Invitation delegate.</param> public Builder WithInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { this.mInvitationDelegate = Misc.CheckNotNull(invitationDelegate); return(this); }
public PlayGamesClientConfiguration.Builder WithInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { this.mInvitationDelegate = Misc.CheckNotNull <InvitationReceivedDelegate>(invitationDelegate); return(this); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { throw new NotSupportedException("unsupported"); }
public void Initialize(bool isEnableSavedGames = true, bool isRequestEmail = false, bool isRequestServerAuthCode = false, bool isRequestIdToken = false, InvitationReceivedDelegate invitationReceivedCallback = null, MatchDelegate matchCallback = null) { if (_isInited) { Log.Warning(nameof(GooglePlayGameService), "플랫폼은 이미 초기화 되어 있다"); return; } _isInited = true; Log.Verbose(nameof(GooglePlayGameService), "Initialize"); var config = new PlayGamesClientConfiguration.Builder(); // 구글 계정에 게임 저장 가능. if (isEnableSavedGames) { config = config.EnableSavedGames(); } // 게임이 실행되고 있지 않을 때 받은 게임 초대장을 처리하기 위해 Callback 등록. if (invitationReceivedCallback != null) { config = config.WithInvitationDelegate(invitationReceivedCallback); } // 플레이어의 email 주소를 요청. (동의 여부를 묻는 메시지가 나타난다.) if (isRequestEmail) { config = config.RequestEmail(); } // 게임이 실행되고 있지 않을 때 받은 턴기반 매치 알림에 대한 Callback 등록. if (matchCallback != null) { config = config.WithMatchDelegate(matchCallback); } // 서버 인증 코드를 생성하여 관련된 백엔드 서버 응용 프로그램에 전달하고 OAuth 토큰과 교환 할수 있도록 요청한다. if (isRequestServerAuthCode) { config = config.RequestServerAuthCode(false); } // ID 토큰을 생성하도록 요청한다. 이 OAuth 토큰을 사용하여 플레이어를 Firebase와 같은 다른 서비스로 식별 할수 있다. if (isRequestIdToken) { config = config.RequestIdToken(); } PlayGamesPlatform.InitializeInstance(config.Build()); #if BF_DEBUG PlayGamesPlatform.DebugLogEnabled = true; #endif // Google Play Games platform 활성화 PlayGamesPlatform.Activate(); _savedDataFilename = Application.identifier + "_cloud_savegame"; IsGuestUser = PlatformService.GetGuestUser(); IsPlatformAuth = PlatformService.GetPlatformAuth(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { LogUsage(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { DummyClient.LogUsage(); }
public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { }
/// <summary> /// Adds the invitation delegate. This is called when an invitation /// is received. /// </summary> /// <returns>The builder</returns> /// <param name="invitationDelegate">Invitation delegate.</param> public Builder WithInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { this.mInvitationDelegate = Misc.CheckNotNull(invitationDelegate); return this; }
public MultiplayerListener(IQuickMatchManager quickMatchManager) { _quickMatchManager = quickMatchManager; _invitationReceivedCallback = new InvitationReceivedDelegate(InvitationReceived); }
/// <summary> /// Register an invitation delegate to be /// notified when a multiplayer invitation arrives /// </summary> /// <param name="deleg">The delegate to register</param> public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { mClient.RegisterInvitationDelegate(deleg); }
// Register an invitation delegate for RTMP/TBMP invitations public void RegisterInvitationDelegate(InvitationReceivedDelegate deleg) { Logger.d("iOSClient.RegisterInvitationDelegate"); if (deleg == null) { Logger.w("iOSClient.RegisterInvitationDelegate called w/ null argument."); return; } sInvitationDelegate = deleg; // install invitation listener, if we don't have one yet if (!mRegisteredInvitationListener) { Logger.d("Registering an invitation listener."); RegisterInvitationListener(); } // I don't think I need to deal with pending notifications, as the iOS library // caches them until the user has signed in }
public void RegisterInvitationDelegate(InvitationReceivedDelegate invitationDelegate) { throw new System.NotImplementedException(); }