当前位置: 首页>>代码示例>>Java>>正文


Java Invitation.getInvitationId方法代码示例

本文整理汇总了Java中com.google.android.gms.games.multiplayer.Invitation.getInvitationId方法的典型用法代码示例。如果您正苦于以下问题:Java Invitation.getInvitationId方法的具体用法?Java Invitation.getInvitationId怎么用?Java Invitation.getInvitationId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.games.multiplayer.Invitation的用法示例。


在下文中一共展示了Invitation.getInvitationId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onConnected(Bundle connectionHint) {
  Log.d(TAG, "onConnected() called. Sign in successful!");

  Log.d(TAG, "Sign-in succeeded.");

  // register listener so we are notified if we receive an invitation to play
  // while we are in the game
  Games.Invitations.registerInvitationListener(mGoogleApiClient, this);

  if (connectionHint != null) {
    Log.d(TAG, "onConnected: connection hint provided. Checking for invite.");
    Invitation inv = connectionHint
        .getParcelable(Multiplayer.EXTRA_INVITATION);
    if (inv != null && inv.getInvitationId() != null) {
      // retrieve and cache the invitation ID
      Log.d(TAG,"onConnected: connection hint has a room invite!");
      acceptInviteToRoom(inv.getInvitationId());
      return;
    }
  }
  switchToMainScreen();

}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:25,代码来源:Example.java

示例2: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
public final void onConnected(Bundle paramBundle)
{
  if (paramBundle != null)
  {
    Invitation localInvitation = (Invitation)paramBundle.getParcelable("invitation");
    if ((localInvitation != null) && (localInvitation.getInvitationId() != null))
    {
      this.ʽ = localInvitation;
      this.ʽ.getInvitationId();
    }
    this.゙ = ((TurnBasedMatch)paramBundle.getParcelable("turn_based_match"));
  }
  this.ʻ = null;
  this.ᐝ = true;
  this.ـ = false;
  this.ˊ = false;
  if (this.ͺ != null)
  {
    this.ͺ.onSignInSucceeded();
    return;
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:23,代码来源:Ô¨ª.java

示例3: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
@Override
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected!");

    if (connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
                .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // retrieve and cache the invitation ID
            debugLog("onConnected: connection hint has a room invite!");
            mInvitation = inv;
            debugLog("Invitation ID: " + mInvitation.getInvitationId());
        }

        debugLog("onConnected: connection hint provided. Checking for TBMP game.");
        mTurnBasedMatch = connectionHint.getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
    }

    // we're good to go
    succeedSignIn();
}
 
开发者ID:AlexShafir,项目名称:google-play-game-services-ane,代码行数:24,代码来源:GameHelper.java

示例4: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onConnected(Bundle connectionHint) {
    Log.d(LOG_TAG, "onConnected() called. Sign in successful!");
    Log.d(LOG_TAG, "Sign-in succeeded.");

    // register listener so we are notified if we receive an invitation to play
    // while we are in the game
    Games.Invitations.registerInvitationListener(mGoogleApiClient, this);

    if (connectionHint != null) {
        Log.d(LOG_TAG, "onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
                .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // retrieve and cache the invitation ID
            Log.d(LOG_TAG,"onConnected: connection hint has a room invite!");
            acceptInviteToRoom(inv.getInvitationId());
        }
    }
}
 
开发者ID:TylerCarberry,项目名称:2048-Battles,代码行数:21,代码来源:MultiplayerActivity.java

示例5: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
@Override
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected!");

    if (connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
                .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // retrieve and cache the invitation ID
            debugLog("onConnected: connection hint has a room invite!");
            mInvitation = inv;
            debugLog("Invitation ID: " + mInvitation.getInvitationId());
        }

        debugLog("onConnected: connection hint provided. Checking for TBMP game.");
        mTurnBasedMatch = connectionHint
                .getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
    }

    // we're good to go
    succeedSignIn();
}
 
开发者ID:freshplanet,项目名称:ANE-Google-Play-Game-Services,代码行数:25,代码来源:GameHelper.java

示例6: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
@Override
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected! client=" + mClientCurrentlyConnecting);

    // Mark the current client as connected
    mConnectedClients |= mClientCurrentlyConnecting;
    debugLog("Connected clients updated to: " + mConnectedClients);

    // If this was the games client and it came with an invite, store it for
    // later retrieval.
    if (mClientCurrentlyConnecting == CLIENT_GAMES && connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint.getParcelable(GamesClient.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // accept invitation
            debugLog("onConnected: connection hint has a room invite!");
            mInvitationId = inv.getInvitationId();
            debugLog("Invitation ID: " + mInvitationId);
        }
    }

    // connect the next client in line, if any.
    connectNextClient();
}
 
开发者ID:dbaelz,项目名称:Secludedness,代码行数:26,代码来源:GameHelper.java

示例7: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected! client=" + mClientCurrentlyConnecting);

    // Mark the current client as connected
    mConnectedClients |= mClientCurrentlyConnecting;
    debugLog("Connected clients updated to: " + mConnectedClients);

    // If this was the games client and it came with an invite, store it for
    // later retrieval.
    if (mClientCurrentlyConnecting == CLIENT_GAMES && connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint.getParcelable(GamesClient.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // accept invitation
            debugLog("onConnected: connection hint has a room invite!");
            mInvitationId = inv.getInvitationId();
            debugLog("Invitation ID: " + mInvitationId);
        }
    }

    // connect the next client in line, if any.
    connectNextClient();
}
 
开发者ID:d3alek,项目名称:TheHunt---Interactive-graphical-platform-for-AI-Experiments,代码行数:25,代码来源:GameHelper.java

示例8: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
@Override
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected!");

    if (connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
                .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // retrieve and cache the invitation ID
            debugLog("onConnected: connection hint has a room invite!");
            mInvitation = inv;
            debugLog("Invitation ID: " + mInvitation.getInvitationId());
        }

        // Do we have any requests pending?
        mRequests = Games.Requests
                .getGameRequestsFromBundle(connectionHint);
        if (!mRequests.isEmpty()) {
            // We have requests in onConnected's connectionHint.
            debugLog("onConnected: connection hint has " + mRequests.size()
                    + " request(s)");
        }

        debugLog("onConnected: connection hint provided. Checking for TBMP game.");
        mTurnBasedMatch = connectionHint
                .getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
    }

    // we're good to go
    succeedSignIn();
}
 
开发者ID:AndreFCruz,项目名称:feup-lpoo-armadillo,代码行数:34,代码来源:GameHelper.java

示例9: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/**
 * Called when we successfully obtain a connection to a client.
 */
@Override
public void onConnected(Bundle connectionHint) {
    debugLog("onConnected: connected!");

    if (connectionHint != null) {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
                .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null) {
            // retrieve and cache the invitation ID
            debugLog("onConnected: connection hint has a room invite!");
            mInvitation = inv;
            debugLog("Invitation ID: " + mInvitation.getInvitationId());
        }

        // Do we have any requests pending?
        mRequests = Games.Requests
                .getGameRequestsFromBundle(connectionHint);
        if (!mRequests.isEmpty()) {
            // We have requests in onConnected's connectionHint.
            debugLog("onConnected: connection hint has " + mRequests.size()
                    + " request(s)");
        }

        debugLog("onConnected: connection hint provided. Checking for TBMP game.");
        mTurnBasedMatch = connectionHint
                .getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
    }

    // we're good to go
    succeedSignIn();
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:36,代码来源:GameHelper.java

示例10: onInvitationReceived

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onInvitationReceived(Invitation invitation) {
    // We got an invitation to play a game! So, store it in
    // mIncomingInvitationId
    // and show the popup on the screen.
    mIncomingInvitationId = invitation.getInvitationId();
    ((TextView) findViewById(R.id.incoming_invitation_text)).setText(
            invitation.getInviter().getDisplayName() + " " +
                    getString(R.string.is_inviting_you));
    switchToScreen(mCurScreen); // This will show the invitation popup
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:12,代码来源:Example.java

示例11: onInvitationReceived

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onInvitationReceived(Invitation invitation) {
    // We got an invitation to play a game! So, store it in
    // incomingInvitationId
    // and show the popup on the screen.
    Log.d(TAG, "onInvitationReceived: ");
    incomingInvitationId = invitation.getInvitationId();
    Toast.makeText(activity, invitation.getInviter().getDisplayName() + " has invited you. ", Toast.LENGTH_LONG).show();
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:10,代码来源:AndroidNetworkService.java

示例12: onInvitationReceived

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onInvitationReceived(@NonNull Invitation invitation) {
    // We got an invitation to play a game! So, store it in
    // mIncomingInvitationId
    // and show the popup on the screen.
    mIncomingInvitationId = invitation.getInvitationId();
    showPopUpNotification(true,
            invitation.getInviter().getDisplayName());
}
 
开发者ID:Augugrumi,项目名称:SpaceRace,代码行数:10,代码来源:AbsRoomActivity.java

示例13: onInvitationReceived

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
@Override
public void onInvitationReceived(Invitation invitation) {
    // We got an invitation to play a game! So, store it in
    // mIncomingInvitationId
    // and show the popup on the screen.
    incomingInvitationId = invitation.getInvitationId();
    Log.e(TAG, "GPGS: Invitation received " + incomingInvitationId);
    GodotLib.calldeferred(instanceId, "_on_gpgs_rtm_invitation_received", new Object[] { });
}
 
开发者ID:kloder-games,项目名称:godot-gpgs,代码行数:10,代码来源:RealTimeMultiplayer.java

示例14: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/**
 * Called when we successfully obtain a connection to a client.
 */
@Override
public void onConnected(Bundle connectionHint)
{
    debugLog("onConnected: connected!");

    if (connectionHint != null)
    {
        debugLog("onConnected: connection hint provided. Checking for invite.");
        Invitation inv = connectionHint
            .getParcelable(Multiplayer.EXTRA_INVITATION);
        if (inv != null && inv.getInvitationId() != null)
        {
            // retrieve and cache the invitation ID
            debugLog("onConnected: connection hint has a room invite!");
            this.mInvitation = inv;
            debugLog("Invitation ID: " + this.mInvitation.getInvitationId());
        }

        // Do we have any requests pending?
        this.mRequests = Games.Requests
            .getGameRequestsFromBundle(connectionHint);
        if (!this.mRequests.isEmpty())
        {
            // We have requests in onConnected's connectionHint.
            debugLog("onConnected: connection hint has " + this.mRequests.size()
                + " request(s)");
        }

        debugLog("onConnected: connection hint provided. Checking for TBMP game.");
        this.mTurnBasedMatch = connectionHint
            .getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
    }

    // we're good to go
    succeedSignIn();
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:40,代码来源:GameHelper.java

示例15: onConnected

import com.google.android.gms.games.multiplayer.Invitation; //导入方法依赖的package包/类
/** Called when we successfully obtain a connection to a client. */
    public void onConnected(Bundle connectionHint) {

        debugLog("onConnected: connected! client=" + mClientCurrentlyConnecting);

        // Mark the current client as connected
        mConnectedClients |= mClientCurrentlyConnecting;
        debugLog("Connected clients updated to: " + mConnectedClients);

        // If this was the games client and it came with an invite, store it for
        // later retrieval.
        if (mClientCurrentlyConnecting == CLIENT_GAMES
                && connectionHint != null) {
            debugLog("onConnected: connection hint provided. Checking for invite.");
            Invitation inv = connectionHint
                    .getParcelable(GamesClient.EXTRA_INVITATION);
            if (inv != null && inv.getInvitationId() != null) {
                // accept invitation
                debugLog("onConnected: connection hint has a room invite!");
                mInvitationId = inv.getInvitationId();
                debugLog("Invitation ID: " + mInvitationId);
            }

            debugLog("onConnected: connection hint provided. Checking for TBMP game.");

//            mTurnBasedMatch = connectionHint
//                    .getParcelable(GamesClient.EXTRA_TURN_BASED_MATCH);

        }

        // connect the next client in line, if any.
        connectNextClient();
    }
 
开发者ID:kebernet,项目名称:shortyz,代码行数:34,代码来源:GameHelper.java


注:本文中的com.google.android.gms.games.multiplayer.Invitation.getInvitationId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。