Forums » C++ Framework » Anyone tried the scoreloop wrapper upSL? »
| Alex Chan | Anyone tried the scoreloop wrapper upSL? | ||||
|---|---|---|---|---|---|
|
I have been playing around with upSL (https://github.com/ursine-paw/upSL), but I can't seem to figure out how to integrate it. For any operation, upSL takes a callback function pointer. But if I call the static wrapper operations from my class, I do not know how to communicate my instance object when an operation is complete since upSL takes in a function pointer and not a members function pointer. The only thing I can think of is to use a static variable to communicate between the C callbacks and my instance members, but I don't think that is a very good idea. Anyone have any thoughts? |
||||
| Petr Votocek | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Petr Votocek 9 months ago
Hi to comunicate with your instances use CCNotification when you get the callback from upSL. I send nottification in both cases (ok and errors). Subscribed instances will get these notification and can update the gui based on response codes or load aditional data from already initialized static SL controllers like next score, friends etc. |
||||
| Marat Yakupov | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Marat Yakupov 9 months ago
Alex Chan wrote:
Hello, as author of upSL i can say that we use static variables(Singleton pattern or global variable, not so important). Btw, on Blackberry Scorelooop have C-style API For example Achievements callback can be:
void LoadAchievementsComplete(int error_code)
{
if (error_code == ErrorCode::Ok)
{
AchievementManager::Instance()->AchievementsLoaded(); // store something important for game logic, displays notification, etc.
AchievementsLayer* achievements_layer = AchievementManager::Instance();
if (achievements_layer) // if user currently have opened "Achievements" screen opened
achievements_layer->AchievementsLoaded();
}
}
I have only wish have void* pointer to controller in all callbacks. Will look how make it if i have enough time. |
||||
| Alex Chan | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
@Petr Votocek, I never thought of using CCNotificationCenter. Thanks for pointing this out to me. @Marat Yakupov, This is the route I'm currently doing but I am not sure if creating many singleton objects would be a good idea. Will look into this and the CCNotificationCenter. Thanks! |
||||
| Emilio Exposito | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Emilio Exposito 9 months ago
Hi Marat, first of all I want to say that your work in this wrapper is impresive, good job!!!! I have downloaded the wrapper from https://github.com/ursine-paw/upSL and followed the Integration Guide in the wiki but I do not get my game working... I always get some JNI errors (as W/dalvikvm(1019): in Lcom/ursinepaw/scoreloop/Scoreloop;.nativeTOSAccepted:(J)V(NewGlobalRef)) so I suppose I did not set up the project in the right way. Could someone who have used that explain where I should copy the wrapper files and provide me some advices to get it working? Thank you very much!!! |
||||
| Marat Yakupov | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Marat Yakupov 9 months ago
Can you show your initialization code? and callback function passed to Initialize()? |
||||
| Emilio Exposito | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Emilio Exposito 9 months ago
Hi, thanks for your response!! I followed the steps in this web http://pastebin.com/hH4GKd9s but it seems something there is not correct... The callback function in the initialize(), what functionality should it have? As you can see I am a little bit lost... All your help will be grateful!!!! |
||||
| Marat Yakupov | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Marat Yakupov 9 months ago
Emilio Exposito wrote:
Calling of this callback means that you can use Scoreloop functionality from this moment (so we create nessessary controllers & set global flag gScoreloopInitialized(which means we_can_use_scoreloop) to true) |
||||
| Emilio Exposito | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Emilio Exposito 9 months ago
Ok, so the callback function will be executed when the Scoreloop functionality can be used, I understand that. On the other hand, I have tried to execute the game in Xcode and the page to accept the Scoreloop´s Terms of Service is showed, if I choose the cancel button the game is executed like always, but if I choose the accept button always a "signal SIGABRT" is launched in the main.m file and the game will close. Does this point give you an idea about what can be happening? Just for my testings, the callback function is empty. Thank you for all your help!!! |
||||
| Marat Yakupov | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Marat Yakupov 9 months ago
I believe that your situation like this http://github.com/ursine-paw/upSL/issues/3 |
||||
| Marat Yakupov | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Marat Yakupov 9 months ago
Emilio Exposito wrote:
Thanks for report, i've fixed some issues and hope that this problem must be solved now :) Don't forget to update upSL sources. |
||||
| Emilio Exposito | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Emilio Exposito 9 months ago
No problem!! We are all here just to help each others, aren't we? I have implemented my game in Xcode and it works perfect (almost, what I have done so far)... in Android it still throws exceptions when I invoke the method LoadUser, the error is "JNI WARNING: 0x412dc3e8 is not a valid JNI reference in Lcom/ursinepaw/scoreloop/Scoreloop;.nativeRequestComplete:(Lcom/scoreloop/client/android/core/controller/RequestController;IJ)V (CallObjectMethodV)" and the game is closed. I have update the files you modified some days ago... do you have any idea of what can it be happening? Thank you for your Response!!! |
||||
| Emilio Exposito | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Emilio Exposito 9 months ago
Hi again!! I "have found" the cause of the problem in my code, it was not caused by the wrapper, although the error launched indicates Scoreloop.java, I have tested my code in a real device and it works so I suppose it is a hardware limitation of the android emulator... Marat, again, thank you very much for the extension, it opens a lot of possibilities. |
||||
| fahad shafique | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by fahad shafique 7 months ago
guys anyone to help me regarding integration in android project, i have integrated core scoreloop but i just don't know where to put upSL wrapper files(though i have done it for ios and everything working fine there) |
||||
| fahad shafique | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by fahad shafique 7 months ago
the way i am putting the given wrapper files in my android project, it is giving me error in file named jni_scoreloop "error: android/jni/JniHelper.h" and when i change the import path to "platform/android/jni/JniHelper.h" it gives me error that "JniMethodInfo" and "JniHelper" has not been declared and are not in the scope. |
||||
| Edwin van Poeijer | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Edwin van Poeijer 7 months ago
fahad shafique wrote:
Can't help you with the upSL wrapper, i had the same problems. I hope to finish it this week to get my first Android game in the stores (it's a new version of Asteroid Invaders which can already be found in the appstore for iPhone). Check out my latest games: QUADRO ASTEROID INVADERS 2 |
||||
| fahad shafique | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by fahad shafique 7 months ago
Edwin: i have solved them all and its working all perfect. please see https://github.com/ursine-paw/upSL/issues/6 and you will get to know what is to be done to solve the issues that i was having. i would really appreciate Marat Yakupov for his support.. really admirable |
||||
| Edwin van Poeijer | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Edwin van Poeijer 7 months ago
fahad shafique wrote:
Thanks, i will take a look at it :-) Check out my latest games: QUADRO ASTEROID INVADERS 2 |
||||
| jigar shah | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by jigar shah 6 months ago
Hi, and in Scoreloop.h Thank you. |
||||
| jigar shah | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by jigar shah 6 months ago
Hi, Thank you. |
||||
| Romain TISSERAND | RE: Anyone tried the scoreloop wrapper upSL? | ||||
|
Added by Romain TISSERAND 4 months ago
Cannot use upSL with current master / (old "gles20") branch because of lack of setEventHandler / getWindowGroupId() function to CCEGLView BlackBerry implementation. |
(1-20/20)
