RBuster's Recent Forum Activity

  • Could someone please help me with this? I don't need anyone to do anything for me, just explain how to do to identify a RETURN and how to check information (balance(using GET I presume)). Please,step by step. To update the data using POST, I think that the way it was explained, I could understand. Thanks.

  • In fact, things are different from what I had understood. The first POST is made by the game portal server and returns the URL where the game will be located, with the user already logged into the portal.

    RETURN
    {
     “status": 1,
     “msg": ‘SUCCESS’,
     “launch_url": ”http://...”
     }
    

    Then I need to check the credit balance and then update the balance at the end of the game

    //Get Account Balance
    curl --location 'https://...' \
    --header 'Content-Type: application/json' \
    --data '{
    “method": ‘user_balance’,
    “user_code": ”000”
    }'
    
    
    //Define whether you won or lost
    curl --location 'https://...' \
    --header 'Content-Type: application/json' \
    --data ' {
    “method": ‘transaction’,
    “user_code": ‘000’,
    “game_type": ‘XXX’,
    “slot": {
    “provider_code": ‘XXX’,
    “game_code": ‘XXX’,
    “type": ‘BASE’,
    “used_credit": 10,
    “win_credit": 0,
    “txn_id": ”XXX”
    }
    
  • I have a question about how to work with returns. How do I check if the message is equal to SUCCESS so that I can send the second POST?

    EDITED:

    In your example you used URL as URL instead of the http address. Is this a variable that is not declared with the others?

  • Thanks for the explanations and the suggestion. I'll use variables to make it more handy.

    The right thing to do would be to create an empty template, with just a few buttons and fields, so that I can check that everything is working. Then I'll post C3 here for you to take a look at and perhaps make some changes or improvements. Is that ok?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just to see if I'm on the right track. I took this example from another post.

    I'd have to include the data and then send the post as shown, right?

    POST
    
     {
     “method": ‘game_launch’,
     “agent_code": ‘XXX’,
     “agent_token": ‘0123456789’,
     “user_code": ‘test’,
     “provider_code": ‘TEST’,
     “game_code": ‘XXXXXXXX’, // Optional - When it is empty, lobby url is returned.
     “lang": ”en”
     }
    
    //which will return a url already logged into the session
    
    RETURN
    {
     “status": 1,
     “msg": ‘SUCCESS’,
     “launch_url": ”http://”
     }
    
    

    EDITED:

    Then the server will return the information that I'm logged in, right? Do I use this information to open this URL or do I not need to do anything with it?

  • Thanks Igor, but it is greek for me :(

    I will try to understand. Thank you anyway

  • Hi Igor. Thanks for answering

    Here's a copy of the code I need to include in the game:

    POST
    
     {
     “method": ‘game_launch’,
     “agent_code": ‘XXX’,
     “agent_token": ‘0123456789’,
     “user_code": ‘test’,
     “provider_code": ‘TEST’,
     “game_code": ‘XXXXXXXX’, // Optional - When it is empty, lobby url is returned.
     “lang": ”en”
     }
    
    //which will return a url already logged into the session
    
    RETURN
    {
     “status": 1,
     “msg": ‘SUCCESS’,
     “launch_url": ”http://”
     }
    
    //where it will play your system will take data and insert it via webhook on my site
    
    Collect balance data
    POST
    {
     “method": ‘money_info’,
     “agent_code": ‘XXX’,
     “agent_token": ‘0123456789’,
     }
    RETURN
     {
     “status": 1,
     “msg": ‘SUCCESS’,
     “agent": {
     “agent_code": ‘XXX’,
     “balance": 1000000,
     }
     }
    
    //To change the balance is
    POST
     {
     “method": ‘win’,#Lose
     “agent_code": ‘XXX’,
     “agent_token": ‘0123456789’,
     “user_code": ‘test’,
     “amount": 10000
     }
    RETURN
    {
     “status": 1,
     “msg": ”SUCCESS”
     “agent_balance": 100000,
     “user_balance": 10000
     }
    
  • Any good soul willing to give a quick lesson on this process of linking an api in the construct game, please?

  • Hi everyone.

    I need to include an API code in the game I'm developing and I have no idea how to do it. Could someone be so kind as to give me some tips on this? I can share the code, which is quite small. Thanks in advance for any help.

  • Thanks

  • Just one question: how do I remove the correct frame number when generating permutation. For example: I have 20 frames and the correct frame is the 5, how to make it not to be part of it?

  • So a possible solution would be for me to store the result of the first advancerandom in an array and then use it again for the buttons. Thanks.

RBuster's avatar

RBuster

Early Adopter

Member since 29 Oct, 2012

Twitter
RBuster has 2 followers

Connect with RBuster

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

21/44
How to earn trophies