2

我一直在为我的游戏使用 Google Play 游戏服务的多人游戏功能,最近我无法再创建房间了。

自从我没有接触这部分代码以来已经很长时间了,所以我不明白是什么让它失败了。我正在通过 Wifi 连接到互联网的 Nexus 4 和 Motorola Razr 上进行测试。

首先,我使用 Google+ 登录并调用 onSignInSucceeded()。然后我调用这段代码:

public void startQuickMatch() {
    // quick-start a game with 1 to 3 randomly selected opponents
    final int MIN_OPPONENTS = 1, MAX_OPPONENTS = 3;
    Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(MIN_OPPONENTS, MAX_OPPONENTS, 0);
    //Bundle autoMatchCriteria = RoomConfig.createAutoMatchCriteria(2, 2, 0);
    RoomConfig.Builder rtmConfigBuilder = RoomConfig.builder(this);
    rtmConfigBuilder.setMessageReceivedListener(this);
    rtmConfigBuilder.setRoomStatusUpdateListener(this);
    rtmConfigBuilder.setAutoMatchCriteria(autoMatchCriteria);
    //keepScreenOn();
    getGamesClient().createRoom(rtmConfigBuilder.build());
    Log.d(TAG, "createRoom called");
}

但是,我没有创建房间并将我放在候诊室,而是得到了那些对我没有帮助的日志,因为它们对我来说不清楚,而且在谷歌上也找不到。

06-24 13:10:34.366: D/SuperNinjaRun(29402): createRoom called
06-24 13:10:34.376: E/DataConnectionManager(21359): tearDown() called when network is NOT ready for match !
06-24 13:10:34.426: I/libjingle(21359): Token type:OAuth2
06-24 13:10:34.426: I/libjingle(21359): Final XMPP server hostname talk.google.com port to 5222
06-24 13:10:34.436: D/games_rtmp:Libjingle(21359): Release: call nativeRelease
06-24 13:10:34.436: W/RealTimeAndroidService(21359): Could not prepare network for the room.
06-24 13:10:34.496: W/InputMethodManagerService(551): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42843b40 attribute=null, token = android.os.BinderProxy@42b617d0
06-24 13:10:34.776: I/libjingle(21359): OpenSSLAdapter::OnConnectEvent
06-24 13:10:34.976: I/libjingle(21359): BeginSSL: gmail.com
06-24 13:10:35.797: I/libjingle(21359): Starting Jingle info task.
06-24 13:10:35.797: I/libjingle(21359): IbbDataTask::ProcessStart() called:
06-24 13:10:35.807: I/libjingle(21359): ProcessStart()::Sending Jingle info stanza.
06-24 13:10:35.907: I/libjingle(21359): OnJingleInfo called. Setting relay/stun hosts.
06-24 13:10:36.928: E/libjingle(21359): Error(libjingleclient.cpp:232): Exiting with unfinished tasks.
06-24 13:10:36.928: I/libjingle(21359): Cleanup

有时它也会在几秒钟后给我这些日志:

06-24 13:30:48.043: E/Volley(1165): [80] il.a: Unexpected response code 400 for https://www.googleapis.com/games/v1whitelisted/applications?language=en_US&platformType=ANDROID
06-24 13:30:48.043: E/GameAgent(1165): Unable to retrieve applications from network
06-24 13:30:48.043: I/GameAgent(1165): {"code":400,"errors":[{"message":"Invalid applicationId with value ReplaceMe.","domain":"global","reason":"invalid"}]}
06-24 13:30:48.103: D/SyncManager(531): failed sync operation raphael.royer.rivard@gmail.com u0 (com.google), com.google.android.gms.games, USER, earliestRunTime 28048, SyncResult: stats [ numIoExceptions: 1]

任何人都知道问题可能来自哪里?

4

1 回答 1

3

它现在可以工作了,我忘记了break;开关...所以玩家在尝试创建房间之前就退出了...

于 2013-06-24T23:57:16.010 回答