实时多人房间创建进度卡在 20%

Posted

技术标签:

【中文标题】实时多人房间创建进度卡在 20%【英文标题】:Real-Time Multiplayer Room Creation progress stuck at 20% 【发布时间】:2014-12-20 09:02:44 【问题描述】:

每当我尝试使用适用于 Unity 的 Google Play 游戏服务插件创建房间时,进度都会停留在 20%。 20% 是OnRoomSetupProgress(float percent) 函数中返回的第一个也是唯一的值,它是我的RealTimeMultiplayerListener 实例的一部分。 OnRoomConnected(bool success) 永远不会被调用。

实时多人游戏肯定在我的 Google Play 开发者控制台中激活(否则我会收到错误代码 6003 - 去过那里)。 我在两个不同的 WLAN 网络和 3G 上的两个不同设备(Nexus S 和 Wacom Cintiq Companion Hybrid)上测试了代码。 我从官方 Git Hub 存储库下载了作为 Unity 包的插件。我测试了多个版本(所有 0.9.0x 包到 0.9.07)。 我的 Unity 版本是 Unity free 4.5.4,使用免费的 android 扩展。

代码本身基于 GPGS Plug-in for Unity 附带的 Minimal 示例。这是附加到游戏对象并负责 GUI 绘制的“行为”类:

using System.Collections;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using GooglePlayGames;

public class MainGui : MonoBehaviour 
    private bool mWaitingForAuth = false;
    private bool mWaitingForRoom = false;
    private string mStatusText = "Ready.";
    private VersusListener vsListener;

    void Start() 
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        vsListener = new VersusListener();
    

    void OnGUI() 
        if (mWaitingForRoom) 
            mStatusText = "Loading room... " + vsListener.m_roomProgress.ToString() + "%";
        

        GUILayout.Label(mStatusText);

        if (mWaitingForAuth) 
            return;
        

        if (mWaitingForRoom) 
            if (GUILayout.Button("Cancel")) 
                // Cancel room loading!
                mStatusText = "Loading room cancelled.";
                mWaitingForRoom = false;
                PlayGamesPlatform.Instance.RealTime.LeaveRoom();
            
            return;
        

        if (Social.localUser.authenticated) 
            if (GUILayout.Button("Sign Out")) 
                // Sign out!
                mStatusText = "Signing out.";
                ((PlayGamesPlatform)Social.Active).SignOut();
            
            if (GUILayout.Button("Quick Match")) 
                mWaitingForRoom = true;
                PlayGamesPlatform.Instance.RealTime.CreateQuickGame(1, 1, 0, vsListener);
            
        
        else 
            if (GUILayout.Button("Authenticate")) 
                // Authenticate
                mWaitingForAuth = true;
                mStatusText = "Authenticating...";
                Social.localUser.Authenticate((bool success) => 
                    mWaitingForAuth = false;
                    mStatusText = success ? "Successfully authenticated" : "Authentication failed.";
                );
            
        
    

...这就是我使用的 RealTimeMultiplayerListener 接口实现:

using UnityEngine;
using GooglePlayGames.BasicApi.Multiplayer;

public class VersusListener : RealTimeMultiplayerListener 

    public bool m_roomLoaded = false;
    public bool m_peerConnected = false;
    public float m_roomProgress = 0.0f;
    public bool m_messageReceived = false;
    public string m_message = "";

    public void OnRoomSetupProgress(float percent) 
        m_roomProgress = percent;
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
        Debug.Log("  Room Progress update: " + percent.ToString() + "%");
    

    public void OnRoomConnected(bool success) 
        m_roomLoaded = success;
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
    

    public void OnLeftRoom() 
        m_roomLoaded = false;
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
    

    public void OnPeersConnected(string[] participantIds) 
        m_peerConnected = true;
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
    

    public void OnPeersDisconnected(string[] participantIds) 
        m_peerConnected = false;
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
    

    public void OnRealTimeMessageReceived(bool isReliable, string senderId, byte[] data) 
        char[] chars = new char[data.Length / sizeof(char)];
        System.Buffer.BlockCopy(data, 0, chars, 0, data.Length);
        m_message = new string(chars);
        Debug.Log("Versus Listener: Callback - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " called");
    

最后这是我得到的(Unity 过滤的)日志:

10-24 15:05:24.218: D/Unity(477): GL_EXT_debug_marker GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_vertex_half_float GL_OES_texture_float GL_OES_texture_half_float GL_OES_element_index_uint GL_OES_mapbuffer GL_OES_fragment_precision_high GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_required_internalformat GL_OES_depth_texture GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_standard_derivatives GL_OES_vertex_array_object GL_OES_egl_sync GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888 GL_EXT_discard_framebuffer GL_EXT_shader_texture_lod GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc GL_IMG_texture_npot GL_IMG_texture_format_BGRA8888 GL_IMG_read_format GL_IMG_program_binary GL_IMG_multisampled_render_to_texture
10-24 15:05:33.367: I/Unity(477): [Play Games Plugin DLL] Activating PlayGamesPlatform.
10-24 15:05:33.367: I/Unity(477):  
10-24 15:05:33.367: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:33.910: I/Unity(477): [Play Games Plugin DLL] PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
10-24 15:05:33.910: I/Unity(477):  
10-24 15:05:33.910: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:44.160: I/Unity(477): [Play Games Plugin DLL] Creating platform-specific Play Games client.
10-24 15:05:44.160: I/Unity(477):  
10-24 15:05:44.160: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:45.218: I/Unity(477): [Play Games Plugin DLL] Making sure PlayGamesHelperObject is ready.
10-24 15:05:45.218: I/Unity(477):  
10-24 15:05:45.218: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:45.785: I/Unity(477): [Play Games Plugin DLL] Initializing Android Client.
10-24 15:05:45.785: I/Unity(477):  
10-24 15:05:45.785: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:45.785: I/Unity(477): [Play Games Plugin DLL] Creating GameHelperManager to manage GameHelper.
10-24 15:05:45.785: I/Unity(477):  
10-24 15:05:45.785: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:45.816: I/Unity(477): [Play Games Plugin DLL] Setting up GameHelperManager.
10-24 15:05:45.816: I/Unity(477):  
10-24 15:05:45.816: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:45.832: I/Unity(477): [Play Games Plugin DLL] GHM creating GameHelper.
10-24 15:05:45.832: I/Unity(477):  
10-24 15:05:45.832: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.023: I/Unity(477): [Play Games Plugin DLL] GHM calling GameHelper constructor with flags=7
10-24 15:05:46.023: I/Unity(477):  
10-24 15:05:46.023: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.207: I/Unity(477): [Play Games Plugin DLL] PlayGamesHelperObject created.
10-24 15:05:46.207: I/Unity(477):  
10-24 15:05:46.207: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.211: I/Unity(477): [Play Games Plugin DLL] AUTH: starting auth process, silent=False
10-24 15:05:46.211: I/Unity(477):  
10-24 15:05:46.211: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.695: I/Unity(477): [Play Games Plugin DLL] GHM setting up GameHelper.
10-24 15:05:46.695: I/Unity(477):  
10-24 15:05:46.695: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.754: I/Unity(477): [Play Games Plugin DLL] GHM Setting GameHelper options.
10-24 15:05:46.754: I/Unity(477):  
10-24 15:05:46.754: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:46.824: I/Unity(477): [Play Games Plugin DLL] GHM calling GameHelper.setup
10-24 15:05:46.824: I/Unity(477):  
10-24 15:05:46.824: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:47.062: I/Unity(477): [Play Games Plugin DLL] GHM: GameHelper setup done.
10-24 15:05:47.062: I/Unity(477):  
10-24 15:05:47.062: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:47.062: I/Unity(477): [Play Games Plugin DLL] GHM Setting up lifecycle.
10-24 15:05:47.062: I/Unity(477):  
10-24 15:05:47.062: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:47.066: I/Unity(477): [Play Games Plugin DLL] GHM calling GameHelper.onStart to try initial auth.
10-24 15:05:47.066: I/Unity(477):  
10-24 15:05:47.066: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:47.547: I/Unity(477): [Play Games Plugin DLL] AUTH: connection in progress; auth now pending.
10-24 15:05:47.547: I/Unity(477):  
10-24 15:05:47.547: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.433: I/Unity(477): [Play Games Plugin DLL] GHM/GameHelperListener got onSignInSucceeded, origin 1000, notifying GHM.
10-24 15:05:48.433: I/Unity(477):  
10-24 15:05:48.433: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.437: I/Unity(477): [Play Games Plugin DLL] GHM got onSignInSucceeded, origin 1000, notifying AndroidClient.
10-24 15:05:48.437: I/Unity(477):  
10-24 15:05:48.437: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.453: I/Unity(477): [Play Games Plugin DLL] AndroidClient got OnSignInSucceeded.
10-24 15:05:48.453: I/Unity(477):  
10-24 15:05:48.453: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.457: I/Unity(477): [Play Games Plugin DLL] Attempting to retrieve player info.
10-24 15:05:48.457: I/Unity(477):  
10-24 15:05:48.457: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.593: I/Unity(477): [Play Games Plugin DLL] Player ID: 123456789101112131415
10-24 15:05:48.593: I/Unity(477):  
10-24 15:05:48.593: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.601: I/Unity(477): [Play Games Plugin DLL] Player display name: Test User
10-24 15:05:48.601: I/Unity(477):  
10-24 15:05:48.601: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.601: I/Unity(477): [Play Games Plugin DLL] AUTH: Auth succeeded. Proceeding to achievement loading.
10-24 15:05:48.601: I/Unity(477):  
10-24 15:05:48.601: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.609: I/Unity(477): [Play Games Plugin DLL] AUTH: Now performing initial achievement load...
10-24 15:05:48.609: I/Unity(477):  
10-24 15:05:48.609: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:48.707: I/Unity(477): [Play Games Plugin DLL] AUTH: Initial achievement load call made.
10-24 15:05:48.707: I/Unity(477):  
10-24 15:05:48.707: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.156: I/Unity(477): [Play Games Plugin DLL] OnAchievementsLoadedResultProxy invoked
10-24 15:05:49.156: I/Unity(477):  
10-24 15:05:49.156: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.172: I/Unity(477): [Play Games Plugin DLL]     result=UnityEngine.AndroidJavaObject
10-24 15:05:49.172: I/Unity(477):  
10-24 15:05:49.172: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.230: I/Unity(477): [Play Games Plugin DLL] AUTH: Initial achievement load finished.
10-24 15:05:49.230: I/Unity(477):  
10-24 15:05:49.230: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.230: I/Unity(477): [Play Games Plugin DLL] Processing achievement buffer.
10-24 15:05:49.230: I/Unity(477):  
10-24 15:05:49.230: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.258: I/Unity(477): [Play Games Plugin DLL] AchievementBank: processing achievement buffer given as Java object.
10-24 15:05:49.258: I/Unity(477):  
10-24 15:05:49.258: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.261: I/Unity(477): [Play Games Plugin DLL] AchievementBank: buffer contains 0 achievements.
10-24 15:05:49.261: I/Unity(477):  
10-24 15:05:49.261: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.261: I/Unity(477): [Play Games Plugin DLL] AchievementBank: bank now contains 0 entries.
10-24 15:05:49.261: I/Unity(477):  
10-24 15:05:49.261: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.261: I/Unity(477): [Play Games Plugin DLL] Closing achievement buffer.
10-24 15:05:49.261: I/Unity(477):  
10-24 15:05:49.261: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.265: I/Unity(477): [Play Games Plugin DLL] AUTH: Auth process complete!
10-24 15:05:49.265: I/Unity(477):  
10-24 15:05:49.265: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.265: I/Unity(477): [Play Games Plugin DLL] AUTH: Calling auth callback: success=True
10-24 15:05:49.265: I/Unity(477):  
10-24 15:05:49.265: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.297: I/Unity(477): [Play Games Plugin DLL] AndroidClient: CheckInvitationFromNotification.
10-24 15:05:49.297: I/Unity(477):  
10-24 15:05:49.297: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.300: I/Unity(477): [Play Games Plugin DLL] AndroidClient: looking for invitation in our GameHelper.
10-24 15:05:49.300: I/Unity(477):  
10-24 15:05:49.300: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.328: I/Unity(477): [Play Games Plugin DLL] GHM clearing invitation and turn-based match on GameHelper.
10-24 15:05:49.328: I/Unity(477):  
10-24 15:05:49.328: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.343: I/Unity(477): [Play Games Plugin DLL] No invitation in our GameHelper. Trying SignInHelperManager.
10-24 15:05:49.343: I/Unity(477):  
10-24 15:05:49.343: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.383: I/Unity(477): [Play Games Plugin DLL] No invitation in SignInHelperManager either.
10-24 15:05:49.383: I/Unity(477):  
10-24 15:05:49.383: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.383: I/Unity(477): [Play Games Plugin DLL] No match in our GameHelper. Trying SignInHelperManager.
10-24 15:05:49.383: I/Unity(477):  
10-24 15:05:49.383: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.383: I/Unity(477): [Play Games Plugin DLL] No match in SignInHelperManager either.
10-24 15:05:49.383: I/Unity(477):  
10-24 15:05:49.383: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.386: I/Unity(477): [Play Games Plugin DLL] AndroidTbmpClient.OnSignInSucceeded
10-24 15:05:49.386: I/Unity(477):  
10-24 15:05:49.386: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.386: I/Unity(477): [Play Games Plugin DLL] Querying for max match data size...
10-24 15:05:49.386: I/Unity(477):  
10-24 15:05:49.386: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:05:49.425: I/Unity(477): [Play Games Plugin DLL] Max match data size: 131072
10-24 15:05:49.425: I/Unity(477):  
10-24 15:05:49.425: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:00.996: I/Unity(477): [Play Games Plugin DLL] AndroidRtmpClient.CreateQuickGame, opponents=1-1, variant=0
10-24 15:06:00.996: I/Unity(477):  
10-24 15:06:00.996: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:01.000: I/Unity(477): [Play Games Plugin DLL] Requesting API call: rtmp create quick game
10-24 15:06:01.000: I/Unity(477):  
10-24 15:06:01.000: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:01.050: I/Unity(477): [Play Games Plugin DLL] Connected! Calling API: rtmp create quick game
10-24 15:06:01.050: I/Unity(477):  
10-24 15:06:01.050: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.457: I/Unity(477): [Play Games Plugin DLL] AndroidClient.OnRoomCreated, status 0
10-24 15:06:07.457: I/Unity(477):  
10-24 15:06:07.457: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.488: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: Updating our cached data about the room.
10-24 15:06:07.488: I/Unity(477):  
10-24 15:06:07.488: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.488: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: room id: ChoKCQjHn6aguhAQAhABGAAg____________ARDR9MqBqbryg80B
10-24 15:06:07.488: I/Unity(477):  
10-24 15:06:07.488: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.496: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: querying for my player ID.
10-24 15:06:07.496: I/Unity(477):  
10-24 15:06:07.496: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.508: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: my player ID is: 123456789101112131415
10-24 15:06:07.508: I/Unity(477):  
10-24 15:06:07.508: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.508: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: querying for my participant ID in the room.
10-24 15:06:07.508: I/Unity(477):  
10-24 15:06:07.508: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.547: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: my participant ID is: p_CNH0yoGpuvKDzQEQAQ
10-24 15:06:07.547: I/Unity(477):  
10-24 15:06:07.547: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.570: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: # participants: 1
10-24 15:06:07.570: I/Unity(477):  
10-24 15:06:07.570: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.570: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: querying participant #0
10-24 15:06:07.570: I/Unity(477):  
10-24 15:06:07.570: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.593: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: participant #0 has id: p_CNH0yoGpuvKDzQEQAQ
10-24 15:06:07.593: I/Unity(477):  
10-24 15:06:07.593: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.648: I/Unity(477): [Play Games Plugin DLL] Participant is SELF.
10-24 15:06:07.648: I/Unity(477):  
10-24 15:06:07.648: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.730: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: participant list now has 0 participants.
10-24 15:06:07.730: I/Unity(477):  
10-24 15:06:07.730: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.730: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: cleanup.
10-24 15:06:07.730: I/Unity(477):  
10-24 15:06:07.730: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.730: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: newly connected participants: 0
10-24 15:06:07.730: I/Unity(477):  
10-24 15:06:07.730: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.730: I/Unity(477): [Play Games Plugin DLL] UpdateRoom: newly disconnected participants: 0
10-24 15:06:07.730: I/Unity(477):  
10-24 15:06:07.730: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.734: I/Unity(477): [Play Games Plugin DLL] AndroidRtmpClient: DeliverRoomSetupProgressUpdate
10-24 15:06:07.734: I/Unity(477):  
10-24 15:06:07.734: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.800: I/Unity(477): [Play Games Plugin DLL] room setup progress: 20%
10-24 15:06:07.800: I/Unity(477):  
10-24 15:06:07.800: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.800: I/Unity(477): [Play Games Plugin DLL] Delivering progress to callback.
10-24 15:06:07.800: I/Unity(477):  
10-24 15:06:07.800: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.828: I/Unity(477): Versus Listener: Callback - OnRoomSetupProgress called
10-24 15:06:07.828: I/Unity(477):  
10-24 15:06:07.828: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
10-24 15:06:07.832: I/Unity(477):   Room Progress update: 20%
10-24 15:06:07.832: I/Unity(477):  
10-24 15:06:07.832: I/Unity(477): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)

【问题讨论】:

【参考方案1】:

根据经验发现 20% 意味着“一切就绪,但没有其他人连接”。所以你在两个测试设备上同时卡在 20% 上?如果是这样,请确保您没有尝试使用相同的 google 帐户(去过那里)登录。如果没有,请确保两个设备都达到此状态。

【讨论】:

谢谢!出于某种原因,我假设房间必须处于 100% 状态,其他设备才能连接。我添加了邀请码,现在它可以工作了。当然,在房间被认为完整之前需要达到最小连接数是有道理的。很抱歉没有“支持”你的答案,但我没有足够的声誉。 ;)

以上是关于实时多人房间创建进度卡在 20%的主要内容,如果未能解决你的问题,请参考以下文章

如何创建多人大厅房间系统Java

在 iOS 上创建实时房间后,Google Play 游戏服务崩溃

房间配置在安卓的谷歌实时多人游戏服务中无法正常工作

Android 实时多人游戏通知连接丢失

如何检测客户端是不是故意离开 Google Play 游戏实时多人游戏中的房间?

来自谷歌服务的实时多人游戏问题(为您的房间配置添加专属位掩码)