public AndroidSavedGameClient(AndroidClient androidClient, AndroidJavaObject account) { mAndroidClient = androidClient; using (var gamesClass = new AndroidJavaClass("com.google.android.gms.games.Games")) { mSnapshotsClient = gamesClass.CallStatic <AndroidJavaObject>("getSnapshotsClient", AndroidHelperFragment.GetActivity(), account); } }
public AndroidTurnBasedMultiplayerClient(AndroidClient androidClient, AndroidJavaObject account) { mAndroidClient = androidClient; using (var gamesClass = new AndroidJavaClass("com.google.android.gms.games.Games")) { mClient = gamesClass.CallStatic <AndroidJavaObject>("getTurnBasedMultiplayerClient", AndroidHelperFragment.GetActivity(), account); } }
public AndroidRealTimeMultiplayerClient(AndroidClient androidClient, AndroidJavaObject account) { mAndroidClient = androidClient; using (var gamesClass = new AndroidJavaClass("com.google.android.gms.games.Games")) { mRtmpClient = gamesClass.CallStatic <AndroidJavaObject>("getRealTimeMultiplayerClient", AndroidHelperFragment.GetActivity(), account); mInvitationsClient = gamesClass.CallStatic <AndroidJavaObject>("getInvitationsClient", AndroidHelperFragment.GetActivity(), account); } }
internal static void InitializeFactory() { // initialize the callback thread processing PlayGamesHelperObject.CreateObject(); //Read the Service ID NearbyConnectionsManager.ReadServiceId(); NearbyConnectionsManagerBuilder sBuilder = new NearbyConnectionsManagerBuilder(); // The connection manager needs to be initialized before using it, so // wait for initialization. sBuilder.SetOnInitializationFinished(OnManagerInitialized); PlatformConfiguration cfg = new AndroidClient().CreatePlatformConfiguration(); Debug.Log("Building manager Now"); sManager = sBuilder.Build(cfg); }
internal GameHelperManager(AndroidClient client) { mAndroidClient = client; Logger.d("Setting up GameHelperManager."); // create GameHelper Logger.d("GHM creating GameHelper."); mGameHelper = new AndroidJavaObject(GameHelperClass, mAndroidClient.GetActivity()); if (mGameHelper == null) { throw new System.Exception("Failed to create GameHelper."); } // set up the GameHelper Logger.d("GHM setting up GameHelper."); mGameHelper.Call("enableDebugLog", Logger.DebugLogEnabled, "GameHelper"); int flags = mGameHelper.GetStatic <int>("CLIENT_ALL"); Logger.d("GHM client request flags: " + flags); GameHelperListener listenerProxy = new GameHelperListener(this, ORIGIN_MAIN_ACTIVITY); Logger.d("GHM calling GameHelper.setRequestedClients, " + flags); mGameHelper.Call("setRequestedClients", flags); Logger.d("GHM calling GameHelper.setup"); mGameHelper.Call("setup", listenerProxy); // set up callbacks so we're informed of pause/unpause events PlayGamesHelperObject.SetPauseCallback((bool paused) => { if (paused) { OnPause(); } else { OnResume(); } }); // start silent auth Logger.d("GHM calling GameHelper.onStart to try silent auth."); mConnectionState = ConnectionState.Connecting; mGameHelper.Call("onStart", mAndroidClient.GetActivity()); }
internal GameHelperManager(AndroidClient client) { mAndroidClient = client; Logger.d("Setting up GameHelperManager."); // create GameHelper Logger.d("GHM creating GameHelper."); mGameHelper = new AndroidJavaObject(GameHelperClass, mAndroidClient.GetActivity()); if (mGameHelper == null) { throw new System.Exception("Failed to create GameHelper."); } // set up the GameHelper Logger.d("GHM setting up GameHelper."); mGameHelper.Call("enableDebugLog", Logger.DebugLogEnabled, "GameHelper"); int flags = mGameHelper.GetStatic<int>("CLIENT_ALL"); Logger.d("GHM client request flags: " + flags); GameHelperListener listenerProxy = new GameHelperListener(this, ORIGIN_MAIN_ACTIVITY); Logger.d("GHM calling GameHelper.setRequestedClients, " + flags); mGameHelper.Call("setRequestedClients", flags); Logger.d("GHM calling GameHelper.setup"); mGameHelper.Call("setup", listenerProxy); // set up callbacks so we're informed of pause/unpause events PlayGamesHelperObject.SetPauseCallback((bool paused) => { if (paused) { OnPause(); } else { OnResume(); } }); // start silent auth Logger.d("GHM calling GameHelper.onStart to try silent auth."); mConnectionState = ConnectionState.Connecting; mGameHelper.Call("onStart", mAndroidClient.GetActivity()); }
internal SnapshotAndroid(AndroidClient client, AndroidJavaObject obj) { mClient = client; mObj = obj; }
internal SnapshotMetadataAndroid(AndroidClient client, AndroidJavaObject metaObj) { mClient = client; mMetaObj = metaObj; }
internal OnInvitationReceivedProxy(AndroidClient owner) : base(JavaConsts.OnInvitationReceivedListenerClass) { mOwner = owner; }
internal OnInvitationReceivedProxy(AndroidClient owner) : base("com.google.android.gms.games.multiplayer.OnInvitationReceivedListener") { this.mOwner = owner; }
public AndroidRtmpClient(AndroidClient client) { mClient = client; }
internal OnStateLoadedProxy(AndroidClient androidClient, OnStateLoadedListener listener) : base("com.google.android.gms.appstate.OnStateLoadedListener") { mListener = listener; mAndroidClient = androidClient; }
internal OnStateResultProxy(AndroidClient androidClient, OnStateLoadedListener listener) : base(JavaUtil.ResultCallbackClass) { mListener = listener; mAndroidClient = androidClient; }
internal OnAchievementsLoadedListenerProxy(AndroidClient c) : base("com.google.android.gms.games.achievement.OnAchievementsLoadedListener") { mOwner = c; }
internal AndroidTbmpClient(AndroidClient client) { mClient = client; }
internal OnStateResultProxy(AndroidClient androidClient, OnStateLoadedListener listener) : base("com.google.android.gms.common.api.ResultCallback") { this.mListener = listener; this.mAndroidClient = androidClient; }
internal OnCommitResultProxy(AndroidClient client, OnSnapshotResultListener listener) : base(client, listener) { }
internal GameHelperManager(AndroidClient client) { mAndroidClient = client; Logger.d("Setting up GameHelperManager."); // create GameHelper Logger.d("GHM creating GameHelper."); int flags = JavaConsts.GAMEHELPER_CLIENT_ALL; Logger.d("GHM calling GameHelper constructor with flags=" + flags); mGameHelper = new AndroidJavaObject(GameHelperClass, mAndroidClient.GetActivity(), flags); if (mGameHelper == null) { throw new System.Exception("Failed to create GameHelper."); } // set up the GameHelper Logger.d("GHM setting up GameHelper."); mGameHelper.Call("enableDebugLog", Logger.DebugLogEnabled, "GameHelper"); GameHelperListener listenerProxy = new GameHelperListener(this, ORIGIN_MAIN_ACTIVITY); // IMPORTANT: we need to tweak the default behavior of GameHelper because // it should never attempt to automatically start the // sign in flow, because this must be done by the SignInActivity! This // is why we call setMaxAutoSignInAttempts(0). This is important because if THIS // GameHelper were to attempt the sign-in flow, nothing would work, because // it needs onActivityResult to be hooked up, and we have no way to access // onActivityResult on the Unity player activity. This is why we use a separate // Activity for the sign in flow. Logger.d("GHM Setting GameHelper options."); mGameHelper.Call("setMaxAutoSignInAttempts", 0); AndroidJavaClass gameOptionsClass = JavaUtil.GetGmsClass("games.Games$GamesOptions"); AndroidJavaObject builder = gameOptionsClass.CallStatic <AndroidJavaObject>("builder"); AndroidJavaObject tmp = builder.Call <AndroidJavaObject>("setSdkVariant", JavaConsts.SDK_VARIANT); AndroidJavaObject options = builder.Call <AndroidJavaObject>("build"); mGameHelper.Call("setGamesApiOptions", options); options.Dispose(); options = null; tmp.Dispose(); tmp = null; builder.Dispose(); builder = null; Logger.d("GHM calling GameHelper.setup"); mGameHelper.Call("setup", listenerProxy); Logger.d("GHM: GameHelper setup done."); // set up callbacks so we're informed of pause/unpause events Logger.d("GHM Setting up lifecycle."); PlayGamesHelperObject.SetPauseCallback((bool paused) => { if (paused) { OnPause(); } else { OnResume(); } }); // start initial auth Logger.d("GHM calling GameHelper.onStart to try initial auth."); mConnectionState = ConnectionState.Connecting; mGameHelper.Call("onStart", mAndroidClient.GetActivity()); }
internal OnAchievementsLoadedResultProxy(AndroidClient c) : base(JavaUtil.ResultCallbackClass) { mOwner = c; }
internal OnAchievementsLoadedResultProxy(AndroidClient c) : base("com.google.android.gms.common.api.ResultCallback") { this.mOwner = c; }
internal GameHelperManager(AndroidClient client) { this.mAndroidClient = client; Logger.d("Setting up GameHelperManager."); Logger.d("GHM creating GameHelper."); int num = 7; Logger.d("GHM calling GameHelper constructor with flags=" + num); this.mGameHelper = new AndroidJavaObject("com.google.example.games.basegameutils.GameHelper", new object[] { this.mAndroidClient.GetActivity(), num }); if (this.mGameHelper == null) { throw new Exception("Failed to create GameHelper."); } Logger.d("GHM setting up GameHelper."); this.mGameHelper.Call("enableDebugLog", new object[] { Logger.DebugLogEnabled }); GameHelperManager.GameHelperListener gameHelperListener = new GameHelperManager.GameHelperListener(this, 1000); Logger.d("GHM Setting GameHelper options."); this.mGameHelper.Call("setMaxAutoSignInAttempts", new object[] { 0 }); AndroidJavaClass gmsClass = JavaUtil.GetGmsClass("games.Games$GamesOptions"); AndroidJavaObject androidJavaObject = gmsClass.CallStatic <AndroidJavaObject>("builder", new object[0]); AndroidJavaObject androidJavaObject2 = androidJavaObject.Call <AndroidJavaObject>("setSdkVariant", new object[] { 37143 }); AndroidJavaObject androidJavaObject3 = androidJavaObject.Call <AndroidJavaObject>("build", new object[0]); this.mGameHelper.Call("setGamesApiOptions", new object[] { androidJavaObject3 }); androidJavaObject3.Dispose(); androidJavaObject2.Dispose(); androidJavaObject.Dispose(); Logger.d("GHM calling GameHelper.setup"); this.mGameHelper.Call("setup", new object[] { gameHelperListener }); Logger.d("GHM: GameHelper setup done."); Logger.d("GHM Setting up lifecycle."); PlayGamesHelperObject.SetPauseCallback(delegate(bool paused) { if (paused) { this.OnPause(); } else { this.OnResume(); } }); Logger.d("GHM calling GameHelper.onStart to try initial auth."); this.mGameHelper.Call("onStart", new object[] { this.mAndroidClient.GetActivity() }); }
internal SelectSnapshotProxy(AndroidClient client, OnSnapshotResultListener listener) : base(JavaConsts.SupportSelectSnapshotHelperActivityListener) { mClient = client; mListener = listener; }
internal OnSnapshotResultProxy(AndroidClient client, OnSnapshotResultListener listener) : base(JavaConsts.ResultCallbackClass) { mClient = client; mListener = listener; }
internal OnQuestsLoadedResultProxy(AndroidClient c) : base(JavaConsts.ResultCallbackClass) { mOwner = c; }