无法通过Google Play游戏服务创造空间

时间:2013-06-24 17:34:48

标签: android google-play-services google-play-games

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

很长一段时间以来,我没有碰过这部分代码,所以我不明白是什么让它失败了。我正在测试Nexus 4和Motorola Razr,它们都通过Wifi连接到互联网。

首先我使用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");
}

但是不是创建房间并让我进入候诊室,我得到那些对我没有帮助的日志,因为它们对我来说并不清楚,而且它们无法在Google上找到。

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]

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

1 个答案:

答案 0 :(得分:2)

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