RBuster's Forum Posts

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're right, advancerandom is much simpler, however, as I said, I'm already using it to display images of the exercises on the screen. Can't a conflict occur if I also use it for the buttons, since there is only one advancerandom object available?

  • Hi dop2000

    Thanks for replying.

    Isn't there a way to sort the frames for each button so that they are not repeated, with the exception of the correct frame, without using advancedrandom and without using so many existences? The buttons actually have 3 different animations, each with 20 frames.

  • I have 5 button instances with 20 frames containing icons. One of the icons is the correct one and I already know which frame it is, but I would like the other buttons to show different icons (different frames) with the exception of the correct one and not repeat themselves.

    I thought about first distributing the different frames to each button, without including the correct frame, and then selecting one of them to show the correct frame. This second part I know how to do. Does anyone have any idea how I can distribute the frames to the buttons without repeating and leaving out the correct frame?

    PS: I am already using Advanced Random for another part of the script