upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions

Maybe it will be helpful for someone.

We’ve open sourced upSL - our wrapper for Scoreloop which used in “Run In Crowd”

Thanks Marat! I saw your post on facebook firstly, then search the forum immediately.
I move this thread to “extensions” subforum.
Also I helped you to commit it onto http://www.cocos2d-x.org/projects/cocos2d-x/assets/9

Oh, i’ve missed this subforum :slight_smile: Rarely visit boards last time. Thanks.

Thanks! But it would be really great if you can upload some example project!

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…
Thank you

hi,

have anybody some example codes, how to handle the upsl, for setting up user, uploading scores etc? :slight_smile:

it would be very fine :slight_smile:

thank you
respectfully
chris

Thumbs up for upSL !

Chris Schere is right some code examples would be helpful for start-ups

Cheers,
Adrian

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

Adrian Padure wrote:

Thumbs up for upSL !
>
Chris Schere is right some code examples would be helpful for start-ups
>
Cheers,
Adrian

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
Chris

Thank you Chris,
It’s on my priority list for next week, I’ll give it a try ! :slight_smile:

Cheers,
Adrian

Any news on the examples? Would be really useful

Cheers,
Dean

Hi Marat,

What “network solution” did you used so that you have several concurrent players in your game ?

Thanks
Adrian

Anyone knows if this project still alive?