Forums » Extensions and Tools » upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions »
| Marat Yakupov | upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|---|---|---|---|---|---|
|
Added by Marat Yakupov 12 months ago
Maybe it will be helpful for someone. We've open sourced upSL - our wrapper for Scoreloop which used in "Run In Crowd" https://github.com/ursine-paw/upSL
|
||||
| Zhe Wang | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Thanks Marat! I saw your post on facebook firstly, then search the forum immediately. Enjoy Coding, Enjoy Life. |
||||
| Marat Yakupov | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Marat Yakupov 12 months ago
Oh, i've missed this subforum |
||||
| Professor X | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Professor X 11 months ago
Thanks! But it would be really great if you can upload some example project! |
||||
| Petr Votocek | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Petr Votocek 11 months ago
Yes this will be great if we know where to put upSL wrapper and Scoreloop SDK + mini xcode sample how to initialise from cocos2d-x, get send values to ScoreLoop API etc... |
||||
| Chris Schere | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Chris Schere 9 months ago
hi, have anybody some example codes, how to handle the upsl, for setting up user, uploading scores etc? it would be very fine thank you |
||||
| Adrian Padure | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Adrian Padure 3 months ago
Thumbs up for upSL ! Chris Schere is right some code examples would be helpful for start-ups Cheers, |
||||
| Chris Schere | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Chris Schere 3 months ago
Hello, I don't use upSL anymore. I tried, but I don't get it working. And after my post six months ago, I don't get any examples, so I stopt working with it. I'm sorry! Cheers, |
||||
| Chris Schere | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Chris Schere 3 months ago
Adrian Padure wrote:
Hi, i found this, maybe it's helpful!
#include "Application.h"
#include "GameScene.h"
#include "Scoreloop.h"
Scoreloop::UserController* gUserController = NULL;
Scoreloop::AchievementsController* gAchievementsController = NULL;
bool gScoreloopInitialized = false;
Scoreloop::SessionState::Enum gSessionState = Scoreloop::SessionState::Initial; // there is own enumeration, not from upSL
Application::Application()
{
}
Application::~Application()
{
if (gAchievementsController)
Scoreloop::AchievementsController::Release(gAchievementsController);
if (gUserController)
Scoreloop::UserController::Release(gUserController);
Scoreloop::Client::Shutdown();
}
void LoadUserRequestComplete(int error_code)
{
if (error_code == Scoreloop::ErrorCode::Ok)
{
gSessionState = Scoreloop::SessionState::Authenticated;
Scoreloop::User* user = Scoreloop::Session::GetUser();
const char* login = Scoreloop::User::GetLogin(user);
}
else
gSessionState = Scoreloop::SessionState::Failed;
}
void LoadAchievementsComplete(int error_code)
{
if (error_code == ErrorCode::Ok)
{
AchievementList* achievements = AchievementsController::GetAchievements(gAchievementsController);
unsigned int achievements_count = AchievementList::GetAchievementsCount(achievements);
for (size_t i = 0; i < achievements_count; i++)
{
Achievement* achievement = AchievementList::GetAchievement(achievements, i);
if (Achievement::IsAchieved(achievement))
{
Award* award = Achievement::GetAward(achievement);
const char* award_identifier = Award::GetIdentifier(award);
// do something
}
}
}
}
void InitializeScoreloopControllers()
{
gSessionState = Scoreloop::SessionState::Authenticating;
if (gUserController == NULL)
{
gSessionState = Scoreloop::SessionState::Authenticating;
gUserController = Scoreloop::UserController::Create(LoadUserRequestComplete);
Scoreloop::UserController::LoadUser(gUserController);
}
if (gAchievementsController == NULL)
{
gAchievementsController = Scoreloop::AchievementsController::Create(LoadAchievementsComplete);
gAchievementsSynchronizationInProgress = true;
Scoreloop::AchievementsController::SynchronizeAchievements(gAchievementsController);
}
}
void TOSAccepted()
{
gScoreloopInitialized = true;
InitializeScoreloopControllers();
}
bool Application::applicationDidFinishLaunching()
{
// ... usual steps
Scoreloop::Client::Initialize(TOSAccepted);
pDirector->runWithScene(GameScene::node());
return true;
}
// .. other methods not contained any upSL related code
Cheers |
||||
| Adrian Padure | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Adrian Padure 3 months ago
Thank you Chris, Cheers, |
||||
| Dean W | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Dean W about 1 month ago
Any news on the examples? Would be really useful Cheers, ThrowEmBalls Now Available on Android and iPhone :) |
||||
| Adrian Padure | RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions | ||||
|
Added by Adrian Padure about 1 month ago
Hi Marat, What "network solution" did you used so that you have several concurrent players in your game ? Thanks |
(1-11/11)

Rarely visit boards last time. Thanks.