08-04-2012 09:26 PM
Hi,
I have more than 1 PlayBook and am using the Scoreloop SDK. On one of my devices, I keep getting SC_HTTP_SERVER_ERROR returned. The other works fine. Any ideas?
I've compared Wi-Fi settings, tried with/without bluetooth, api.scoreloop.com resolves to the same IP on both devices, rebooted the device that doesn't work, it's the exact same .BAR file, etc. For all practical purposes, to me everything looks to be identical.
Thanks,
-Jason
(note: recently I upgraded the working one to 2.0.1.668, so technically it's a different OS version now
. However, it was working before with 2.0.1.358 as well)
Solved! Go to Solution.
08-04-2012 09:29 PM
08-04-2012 09:56 PM
08-04-2012 11:15 PM
100% can connect fine from one and haven't been able to connect ever from the other. They have ping off (neither playbook gets replies). I've hit the https fine from the browser in both but can't get beyond a login so it's not the most comprehensive test. With WiFi off, I get the error instantly.. With it on, it takes a bit, then errors. The code is "non-200 response from server" in the documentation but clearly it's working from the one device. Unfortunately my router sucks, so I can't sniff the traffic too easily.
08-05-2012 02:14 PM
08-07-2012 11:54 PM
11-09-2012 06:35 PM
Hi Jason,
Is there any upate from Scoreloop? I am hitting the same error. My code run fine in simulator but get this error when deployed to Playbook. I have only one Playbook though, and I am using the Marmalade SDK.
Regards,
Sean
11-12-2012 10:30 AM
Can you share what exaclty you are requesting from ScoreLoop (which function) when you get this error?
11-12-2012 11:31 AM
Since my main.cpp is not that big I paste the whole file here:
#include <algorithm>
#include <stdlib.h>
#include "s3e.h"
#include "Iw2D.h"
#include "IwGx.h"
#include "s3ePointer.h"
#include "sc_client.h"
#include "BasicBoard.h"
#include "UIBoard.h"
#include "UIInkButtons.h"
#include "Touch.h"
#define SC_TEST_GAME_ID "b9b41ecc-8d98-4363-bfb3-c530e3452456"
#define SC_TEST_GAME_SECRET "9RqaCfv3bAYhxyviEipsmxmOh3dbApWlrpdmY1hlCUXOxa5wA
#define SC_TEST_GAME_CURRENCY "YDC"
using namespace std;
SC_Client_h client;
SC_User_h user = NULL;
const char *login = NULL;
bool callbackCalled = false;
SC_Error_t errorCode = 0;
void UserControllerCallback(void * data, SC_Error_t error)
{
if (error == SC_OK){
user = SC_Session_GetUser(SC_Client_GetSession(client));
login = SC_String_GetData(SC_User_GetLogin(user));
} else {
errorCode = error;
}
callbackCalled = true;
}
int main()
{
IwGxInit();
Iw2DInit();
IwGxSetColClear(0x40, 0x40, 0x40, 0);
int ErrCode;
PAL_InitData_t palData;
ErrCode = SC_Client_New(&client, &palData, SC_TEST_GAME_ID,
SC_TEST_GAME_SECRET, SC_TEST_GAME_CURRENCY, NULL);
SC_UserController_h userController = NULL;
if (SC_OK == ErrCode){
ErrCode = SC_Client_CreateUserController(client, &userController,
&UserControllerCallback, NULL);
if (SC_OK != ErrCode) exit(1);
}
ErrCode = SC_UserController_RequestBuddies(userController);
if (ErrCode != SC_OK) {
return 1;
}
int surface_wid = Iw2DGetSurfaceWidth();
int surface_hei = Iw2DGetSurfaceHeight();
int16 boardSize = min(surface_wid, surface_hei);
int16 inkBtnSize = surface_wid / 6;
UIBoard uiBoard = UIBoard(20, 20, boardSize, boardSize, CIwSVec2(0, 0));
BasicBoard board = BasicBoard(20, 20, &uiBoard);
UIInkButtons inkButtons = UIInkButtons(CIwSVec2(0, surface_hei - inkBtnSize),
inkBtnSize, &board);
uiBoard.setTiles(board.getTiles());
s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)&Touch:
nTouch,
NULL);
while(!s3eDeviceCheckQuitRequest()){
surface_wid = Iw2DGetSurfaceWidth();
surface_hei = Iw2DGetSurfaceHeight();
s3eKeyboardUpdate();
if (s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN){
break;
}
IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);
uiBoard.draw();
inkButtons.draw();
if (callbackCalled){
if (NULL == login){
if (NULL == user){
char buffer[16];
sprintf(buffer, "%d", errorCode);
IwGxPrintString(200, 200, buffer);
} else {
IwGxPrintString(200, 200, "No login got!");
}
} else {
IwGxPrintString(200, 200, login);
}
} else {
IwGxPrintString(200, 200, "Waiting...");
}
Iw2DSurfaceShow();
s3eDeviceYield(10);
}
s3ePointerUnRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)&Touch:
nTouch);
Iw2DTerminate();
IwGxTerminate();
return 0;
}
I think in theory the SC_UserController_RequestBuddies(userController) function call should be place in the UserControllerCallback() callback function, but if I did that the callback function is never called. On my Playbook after a while the number 100 is printed on the screen. I look it up and it's the SC_HTTP_SERVER_ERROR. Yesterday I deployed the exact same code to a HTC Android phone and a player login is printed on the screen so I think the code is fine.
Regards,
Sean
11-12-2012 11:53 AM
The code looks ok.
What I am really puzzled with it is it works one one PB and does not on another one.
BTW the fact that this code works on Android should not prove anything as even between BB10 and Playbook ScoreLoop API is a bit different.