AmberCutie's Forum
An adult community for cam models and members to discuss all the things!

cb.getRoomOwnerData() sucks

  • ** WARNING - ACF CONTAINS ADULT CONTENT **
    Only persons aged 18 or over may read or post to the forums, without regard to whether an adult actually owns the registration or parental/guardian permission. AmberCutie's Forum (ACF) is for use by adults only and contains adult content. By continuing to use this site you are confirming that you are at least 18 years of age.
Status
Not open for further replies.
Feb 21, 2021
40
9
21
I have developed a new app, MultiApp: TNG, in which I use cb.getRoomOwnerData() to get the number of followers and Private Show information.

When my app starts I query it to get the starting numbers. Then set a timer to then query again and show the new numbers. This works fine, BUT, only after the second query.

Code:
    cb.getRoomOwnerData(ownerData =>
    {
        if (ownerData['success'])
        {
            privateshowAllowPrivateShows = ownerData['data']['allow_private_shows'];
            privateshowTokensPerMinute = parseInt(ownerData['data']['private_show_tokens_per_minute']);
            privateshowMinimumMinutes = parseInt(ownerData['data']['private_show_minimum_minutes']);
            privateshowSpyTokensPerMinute = parseInt(ownerData['data']['spy_on_private_show_tokens_per_minute']);
        }
    });

Then do a cb.SendNotice() with the information. Works fine.

Broadcaster changes the price(s) of Private Show. OK.
Timer expires. Checks the numbers. Posts the message.
It is the old prices.
Timer expires. Check the numbers. Post the message.
It is the new prices.

EVERY TIME!!!!

So you would think, just check the numbers twice before posting. Nope. I tried it 25 times in a loop. Tried a longer timer. Nope. Always takes 2 times. FOR NO OBVIOUS REASON! My message it started from scratch every time, so no carryover code.

Why does it do this? Am I doing something wrong? It does it for Private Show costs and follower count. You can see you have 3 new followers, takes 2 posts to show the updated count.
 
Hi. I have discovered some strange scoping issues with this function and cb.getRoomUsersData. As a result, I've been forced to run some FULL blocks of code from within them. A solution not always optimized to my liking.

Cheers,
Cexmental
 
Last edited:
Upvote 0
Hi. I have discovered some strange scoping issues with this function and cb.getRoomUsersData. As a result, I've been forced to run some FULL blocks of code from within them. A solution not always optimized to my liking.

Cheers,
Cexmental
What have you done? Show an example?
 
Upvote 0
I have been forced to run all of the code I need inside of the cb.getRoomOwnerData handler. Calling this handler and getting its information with each event becomes less overhead than calling it on a timer. However, the code I want to execute remains between the handlers curly braces. I can not rely on the results of externally exceuted code (in-line or not). This means I can not update global variables and have found some issues even updating arrays (or hybrid databases) with scope outside the handler.

There really is no example to give beyond that explination. Try containing all of your code inside the handler and maybe you will reach a working solution. I have this handler accomplishing many tasks including starting/stopping timed events, advertising private costs, etc. For each section the code is self contained and nothing external is called, placed in-line, or written/read from.

I feel that whoever added this to the CB API didn't do a very good job. It wasn't well thought out and execution is hampered by scope (possible timing) issues. It even uses a different notation than the rest of the API.

Cheers,
Cexmental
 
Upvote 0
Status
Not open for further replies.