Sign In Register

How can we help you today?

Start a new topic
Answered

LastSeen on current challenge/isOnlin

Hello,

assuming i am using a single bot account that posts random scores in multiple challenges, and it also set a random display name when the challenge start, how do i set the state of that bot account to online, only relatively to the challenge the bot is playing in?


To be more specific, when the bot player receive the message "challenge started", i use the scheduler and execute a module ("POST SCORE") with a series of random delays (let's say the random used are 60s, 120s, 180s). 


I want the bot account to appear ONLINE only when the module is executed (at 60,120,180 seconds from the start of the challenge), but i also want the online status for the bot account to be online (or offline) only in the challenge where the account is posting the score in. 

If the same bot is also in another challenge (with a different name and a different pattern of delays), that should not appear online (or offline).


Is this actually possible with a single bot account or i am forced to use multiple?

Another solution would be forcing the Online/Offline icon on the client side (if the user that posted is a bot, set online icon to true for TOT seconds, then turn it off).


Any other ideas?




Best Answer

Hi Matteo,


There is no way to set a bot player as online. You can send requests on behalf of a player in Cloud Code but as no socket is opened for them when this happens isOnline() will always return false. Your best bet would probably be faking this on a challenge by challenge basis where required and just rely on Cloud Code for the sending of events from the bot user. 


Regards,

Liam


Answer

Hi Matteo,


There is no way to set a bot player as online. You can send requests on behalf of a player in Cloud Code but as no socket is opened for them when this happens isOnline() will always return false. Your best bet would probably be faking this on a challenge by challenge basis where required and just rely on Cloud Code for the sending of events from the bot user. 


Regards,

Liam

Thanks Liam,

i imagined that. 


At this point, as you mentioned, i will handle this behavior on client.


Thanks

Hi Matteo,


Glad to have cleared this up for you !


Regards,

Liam

Login to post a comment