Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
OUYA - The new (upcoming) Android console - Page 7 — Gideros Forum

OUYA - The new (upcoming) Android console

15791011

Comments

  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    @MobAmuse It worked immediately for me when I did a new version of the GiderosPlayer - but made the id the same as my app - 'com.sinistersoft.bacteria' (the id registered with Ouya for the app's key.der file).

    I tried again with the regular player and the same problem as you - it locks for a long time at purchasing'. Randomly staying stuck forever or going to a next stage then getting failed.

    Also with the same id as the one registered for the key.der file made the other stuff (receipts, etc) not crash out or return strange result codes. They didn't return actual data though.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Hmmmm yes I will try changing the id of the gideros ouya player as I'm using latest one.

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • Er I'm running the latest OUYAPlayer.apk from labs on my OUYA so how do I make it the same ID as my app i.e. 'com.mobileamusements.TropicalTreasures2Deluxe' ?
  • SinisterSoftSinisterSoft Maintainer
    If it works, can you try the receipts stuff and see if that works?

    function print_r (t, indent, done)
    done = done or {}
    indent = indent or ''
    local nextIndent -- Storage for next indentation value
    for key, value in pairs (t) do
    if type (value) == "table" and not done [value] then
    nextIndent = nextIndent or
    (indent .. string.rep(' ',string.len(tostring (key))+2))
    -- Shortcut conditional allocation
    done [value] = true
    print (indent .. "[" .. tostring (key) .. "] => Table {");
    print (nextIndent .. "{");
    print_r (value, nextIndent .. string.rep(' ',2), done)
    print (nextIndent .. "}");
    else
    print (indent .. "[" .. tostring (key) .. "] => " .. tostring (value).."")
    end
    end
    end

    ouya:addEventListener(Event.RECEIPT_REQUEST_SUCCESS, function(e)
    print("RECEIPT_REQUEST_SUCCESS")
    print_r(e.receipts)
    end)

    ouya:addEventListener(Event.PURCHASE_REQUEST_SUCCESS, function(e)
    print("PURCHASE_REQUEST_SUCCESS", e.productId)
    end)

    ouya:addEventListener(Event.PRODUCT_REQUEST_FAILED, function(e)
    print("PRODUCT_REQUEST_FAILED", e.error)
    end)

    ouya:addEventListener(Event.PURCHASE_REQUEST_FAILED, function(e)
    print("PURCHASE_REQUEST_FAILED", e.error)
    end)

    ouya:addEventListener(Event.RECEIPT_REQUEST_FAILED, function(e)
    print("RECEIPT_REQUEST_FAILED", e.error)
    end)

    ouya:addEventListener(Event.USER_REQUEST_FAILED, function(e)
    print("USER_REQUEST_FAILED", e.error)
    end)
    ouya:requestReceipts() -- this should return the receipt for a purchase, returns blank for me! :(

    ouya:addEventListener(Event.USER_REQUEST_SUCCESS, function(e)
    print("USER_REQUEST_SUCCESS", e.userId)
    end)

    ouya:requestUserId() -- this should return the user_id of the current user - works for me! :D

    ouya:addEventListener(Event.PRODUCT_REQUEST_SUCCESS, function(e)
    print("PRODUCT_REQUEST_SUCCESS")
    print_r(e.products)
    end)

    ouya:requestProducts({"BacteriaUnlimitedPlay"}) -- here put the identifier for one of your IAPs, it should return the name and the price. returns blank for me! :(
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    @MobAmuse To make a new player...

    Export your app, give it the proper package name. Do all the plugin mods to make it work on the Ouya. Then you delete the assets folder from the eclipse project files.

    A project with a deleted assets folder becomes a player.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Ah OK cheers :) FFS this is a real PITA! LOL
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    Yep, it is. Luckily for me I'm doing this whilst helping teachers using my reports program, otherwise I'd just be sat twiddling my thumbs. :)

    Anyhow, I made the app final - saw it had magically (almost) started working - so I then just deleted the assets folder to make a player and do more tests.

    Having the correct package name Id for the correct key.der file is the key to getting rid of strange errors and the purchase delay I think.

    The receipt/product list stuff must be a simple error in the plugin code and the black screen after purchase or cancel is anyones guess!

    To get them back you just export the assets from the Gideros editor.

    Likes: ar2rsawseen

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    @SinisterSoft if I manually invoke event and pass data to it I receive event with all data, that is how I determined that plugin is working correctly.

    Is it possible to debug app on Ouya so you could see LogCat output? If yes I can send you a debug version of GOuya.java with lots of Logs (one file which you can easily replace in your modified project), so you could launch it and paste the log cat here, we could determine where it goes wrong.

    But about black screen I have only very crazy ideas what might be happening, still need to do some thinking/digging
  • Nope I'm stuck and can't seem to build a 'working' player for ouya with my app ID - it just bombs out. I've probably missed something but this is like pulling teeth now to be honest.

    For now I've given up as got a lot on at the moment. I think I'll put my next Ouya release with IAP in it on the back burner for a bit meanwhile.

    Good luck!
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    Since anyone who will want to use Ouya IAP in this state will have to create their own Ouya players, let me record a video on how to do that
    It actually takes less than 5 minutes

    Likes: MobAmuse

    +1 -1 (+1 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    @ar2rsawseen I can plugin a usb and send run it on the Ouya (from eclipse) if that's what you mean? If so then send me the file. :) Do you need my email addr?

    Making the player is easy (just delete the asset folder), adding the extra bits for the Ouya is the tricky bit and if you make a mistake it will bomb out.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    @SinisterSoft I've attached modified debug file to my post, simply copy over existing one in your player ;) And thanks :)

    Video tutorial will be ready in a minute
    zip
    zip
    GOuya.zip
    5K
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013

    How to create Gideros Ouya Player in 5 minutes

    +1 -1 (+5 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    @ar2rsawseen I've pm'ed you with the results.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • OK that video worked (I missed out a whole section of code before) and now the purchase went thru fine. I checked it at the OUYA control panel end and it was there date stamped all ok. I then deleted the purchase for further testing. The only problem now is I get a black screen on purchase of course.
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    @SinisterSoft well based on logs you provided it returns your purchase information in receipt (1 purchase) so it also finished purchase but just can't return back to game.

    I have one crazy assumption (currently glsurface is added directly to the root view, usually android apps have some relative/framelayout etc added as wrapping view, maybe in this sort of mistake it somehow damages/removes gideros glsurface from view tree).

    Here are the steps to add some layout before glsurface:
    I've attached main.xml to this post, copy it to your /res/layout folder inside exported project.

    Inside your main activity:
    Comment out //setContentView(mGLView);
    And add this code instead:
    setContentView(R.layout.main);
    //get main layout
    final FrameLayout layout = (FrameLayout)findViewById(R.id.layout_main);
    // Add the Gideros view to main layout
    layout.addView(mGLView);

    you will probably have to import com.youdomain.yourapp.R <-replace it with you app package with .R in the end

    Clean project (Top menu -> Project-> Clean -> check your project -> Ok) and run as you would run it on Ouya in the way it works :)
    zip
    zip
    main.zip
    329B
  • SinisterSoftSinisterSoft Maintainer
    @MobAmuse My purchase went through too on my game - checked in the control panel - but the purchase receipt system isn't working, does the receipt stuff work for you (see code I posted before)?

    The black screen will be a problem.

    Likes: MobAmuse

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • No the receipt system appears not to be working. Actually does it even matter? can I not just purchase the app then store a flag that I bought it already so next boot of the app I check that flag and don't allow repurchase because already bought it earlier. Because I've not done IAP before, I'm trying to figure out in my brain what is the actual point of the receipt in that instance.
  • MobAmuseMobAmuse Member
    edited July 2013
    ...then again I guess if you uninstalled the app and the reinstalled it that idea would break and you end up being asked to pay again :P

    I'm done for today on this got to walk the dog who is very, very bored :)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    So both requestProducts and requestReceipts does not work?
    And black screen when returning back to the game, thats all right?
  • I've not tried requestProducts as don't have any in this title.

    requestReceipts does not appear to do/return anything.

    Get black screen either doing cancel on purchase or after making a purchase.

    Purchase working fine now tho otherwise.

    I have not done the black screen mod myself at this point.

    Cheers for now.
  • SinisterSoftSinisterSoft Maintainer
    The products is the IAP identifier. You need at least one.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    @MobAmuse what then did you buy from your app? :) It should be exactly same product identifier
  • SinisterSoftSinisterSoft Maintainer
    @ar2rsawseen I get 'FrameLayout cannot be resolved to a type' and 'R cannot be resolved to a variable'

    05-07-2013 16-54-48.png
    750 x 760 - 87K
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    Got rid of the R cannot be resolved by moving 'import com.sinistersoft.bacteria.R;' to be the first import.

    Still got FrameLayout cannot be resolved to a type.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    I got rid of the FrameLayout error by deleting the word 'final'. Will this be a problem?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2013
    @SinisterSoft hold on, maybe found the cause of the bug, will publish new Ouya update hopefully tonight, probably not completely related to layout (fingers crossed).

    but final should not be a problem

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    and black screen fault is because of me. you'll get a fix very soon.
    +1 -1 (+2 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    edited July 2013
    Sometimes the program will crash unless I comment out the receipts and products requests. Are you returning something that's not quite right - like a pointer to the data rather than the data (or similar?).
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    @SinisterSoft I will work on that more, I already found one warning thanks to your provided logs let me try fixing it first.
Sign In or Register to comment.