ursine-paw / upSL

UrsinePaw's ScoreLoop wrapper
21 stars 11 forks source link

SubmitScore issue in #9

Closed skzinzuwadia closed 11 years ago

skzinzuwadia commented 11 years ago

Hi, I am new on C++ and Cocos2dx. I need to submit score to scoreloop.

Cocos2dx := cocos2d-2.0-x-2.0.4 Platform := Android I have done following steps. 1.In Android side i have added jar and scoreloop.properties in assests. 2.I made new pakcket com.ursinepaw.scoreloop and add Scoreloop.java. 3.add new application class in onCreate Client.init(this, secret, null); 4.add jni_scoreloop.java and scoreloop.h file in classes folder. 5.add jni_scoreloop.ccp in Android.mk littel modification in Scoreloop.,h // Copyright (c) 2012 ursinepaw.com

pragma once

include

include

include "jni/JniHelper.h"

namespace Scoreloop

and in jni_scoreloop.ccp

include "Scoreloop.h"

using namespace cocos2d; 6.In AppDelegate.ccp AppDelegate::~AppDelegate() { //scoreloop shut down Scoreloop::Client::Shutdown(); } pDirector->runWithScene(pScene);

//init scoreloop
 Scoreloop::Client::Initialize(0);

now i hellow word i have added code on button click Scoreloop::Score * score = new Scoreloop::Score(); score->setScore(100);

Scoreloop::ScoreController *controller =  Scoreloop::ScoreController::Create(0);
//controller->SubmitScore(&controller,100,1,2,3);

Can please let me know what arg need to pass as context Other thing is my app is also crashing due to Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 37 cannot locate '_ZN9Scoreloop6Client8ShutdownEv'...

Can you please helpe me out,if possible then please provide me sample example.

Thank you.

moadib commented 11 years ago

Scoreloop::Score * score = new Scoreloop::Score(); ///score->setScore(100);

This can't be compiled and compiler must tell you about it ;)

controller->SubmitScore(&controller,100,1,2,3);

And this code wrong too.

Example of working code is: Scoreloop::ScoreController::SubmitScore(controller, 100, 1, 2, 3);

Can please let me know what arg need to pass as context

You can omit this argument. It only used if you want associate some data with score.

Other thing is my app is also crashing due to Please ensure that dynamic library (.so) with your game compiled and linked without error.