Hello guys.
I recently ported SdkboxPlay. and it works with Apple Game Center logging in.
But I have no idea it crashed some time in SdkboxPlayGCDelegate.mm.
crash call stack is here below
#0. Crashed: com.apple.main-thread
0 MyApp 0x100642a74 __30-[SdkboxPlayGCDelegate signin]_block_invoke (SdkboxPlayGCDelegate.mm:162)
1 GameCenterFoundation 0x19bf995d8 __42-[GKLocalPlayer callAuthHandlerWithError:]_block_invoke + 104
2 libdispatch.dylib 0x18b9e21fc _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x18b9e21bc _dispatch_client_callout + 16
4 libdispatch.dylib 0x18b9e6d68 _dispatch_main_queue_callback_4CF + 1000
5 CoreFoundation 0x18cb06810 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
6 CoreFoundation 0x18cb043fc __CFRunLoopRun + 1660
7 CoreFoundation 0x18ca322b8 CFRunLoopRunSpecific + 444
8 GraphicsServices 0x18e4e6198 GSEventRunModal + 180
9 UIKit 0x192a797fc -[UIApplication _run] + 684
10 UIKit 0x192a74534 UIApplicationMain + 208
11 MyApp 0x100179804 main (main.m:6)
12 (Missing) 0x18ba155b8 (Missing)
my dev environment is.
- Xcode version: 9.2(9C40b)
- macOS version: Sierra version 10.12.6
- cocos2d-x version: 3.9
is anyone know solution for this problem? please help!
Hello. I’m StrongLight’s colleague.
sdkbox version: V2.3.17.3
SdkboxPlay version: 1.0.0
for the detailed information
TomLee
#2
Hello. I’m StrongLight’s colleague.
sdkbox version: V2.3.17.3
SdkboxPlay version: 1.0.0
for the detailed information
TomLee
#4
there is no difference between sample and my project code.
here is full source code for using sdkboxplay in my project.
CGameCenterManager::CGameCenterManager()
{
m_bLoggingIn = false;
}
CGameCenterManager::~CGameCenterManager()
{
}
void CGameCenterManager::Initialize()
{
m_eGraphType = EGRAPH_TYPE_GAME_CENTER;
}
void CGameCenterManager::Destroy()
{
}
void CGameCenterManager::InitSdkboxPlay()
{
CSDKBoxPlayManager::InitSdkboxPlay();
}
void CGameCenterManager::GameCenterSignIn()
{
#ifdef SDKBOX_PLAY_ENABLED
if (m_sSignedInID == “”)
{
m_bLoggingIn = true;
sdkbox::PluginSdkboxPlay::signin();
TRLOGINFO(“PluginSdkboxPlay::signin()”);
}
else
SendGraphAddPacket(m_sSignedInID);
#endif
}
void CGameCenterManager::GameCenterSignOut()
{
m_bLoggingIn = false;
sdkbox::PluginSdkboxPlay::signout();
TRLOGINFO(“PluginSdkboxPlay::signout()”);
}
void CGameCenterManager::AccountSignIn_Impl()
{
GameCenterSignIn();
}
void CGameCenterManager::AccountSignOut_Impl()
{
GameCenterSignOut();
}
void CGameCenterManager::onConnectionStatusChanged(int status)
{
TRLOGINFO(“onConnectionStatusChanged called”);
string sPlayerID = "";
if (status == sdkbox::GPS_CONNECTED)
{
TRLOGINFO("onConnectionStatusChanged called status is GPS_CONNECTED");
sPlayerID = sdkbox::PluginSdkboxPlay::getPlayerId();
}
else if (status == sdkbox::GPS_DISCONNECTED)
{
TRLOGINFO("onConnectionStatusChanged called status is GPS_DISCONNECTED");
return;
}
else if (status == sdkbox::GPS_CONNECTION_ERROR)
{
TRLOGINFO("onConnectionStatusChanged called status is GPS_CONNECTION_ERROR");
return;
}
else if (status == sdkbox::GPS_FETCH_SERVER_AUTH_CODE_SUCCESS)
{
TRLOGINFO("onConnectionStatusChanged called status is GPS_FETCH_SERVER_AUTH_CODE_SUCCESS");
return;
}
if (m_bLoggingIn == true && sPlayerID == m_sSignedInID)
{
m_bLoggingIn = false;
return;
}
else if (m_bLoggingIn == true && sPlayerID != m_sSignedInID)
{
m_bLoggingIn = false;
m_sSignedInID = sPlayerID;
SendGraphAddPacket(m_sSignedInID);
return;
}
else if(sPlayerID != m_sSignedInID)
{
m_sSignedInID = sPlayerID;
SendGraphAddPacket(m_sSignedInID);
return;
}
}