Marat Yakupov upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 99
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
Posts 1642
Location Amoy, China
Added by Zhe Wang 12 months ago

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

Enjoy Coding, Enjoy Life.

Marat Yakupov RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 99
Added by Marat Yakupov 12 months ago

Oh, i've missed this subforum :) Rarely visit boards last time. Thanks.

Professor X RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 4
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
Posts 10
Location Prague
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...
Thank you

Chris Schere RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 10
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
respectfully
chris

Adrian Padure RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 19
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,
Adrian

Chris Schere RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 10
Added by Chris Schere 2 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

Chris Schere RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 10
Added by Chris Schere 2 months ago

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

Adrian Padure RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 19
Added by Adrian Padure 2 months ago

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

Cheers,
Adrian

Dean W RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 4
Location Cornwall
Added by Dean W about 1 month ago

Any news on the examples? Would be really useful

Cheers,
Dean

Adrian Padure RE: upSL - crossplatform wrapper for games developed with cocos2d-x which want use Scoreloop functions
Posts 19
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
Adrian


(1-11/11)