The SysRecordTransaction method should work for your needs. Refer to the provided link for more information -- https://docs-internal.braincloudservers.com/api/capi/appstore/sysrecordtransaction
bitHeads
bitHeads employees
Posts
-
-
You can schedule a recurring daily cloud code script to run after the completion of your daily tournament. This script will use the GetGlobalLeaderboardPage method to retrieve the daily tournament winner's information and score, then post it to the monthly tournament using the PostTournamentScoreOnBehalfOf method.
-
We agree with that @antony - we'll get that request to the devs.
-
No, after modifying the desired running time and adding your code, simply run this script without any further configuration.
-
Here is an example of scheduling a weekly cloud code execution,
"use strict"; function main() { var response = {} bridge.logDebugJson("Script Inputs", data) const scriptName = data.scriptName const interval = data.args.interval const searchSpan = interval < 60 ? 60 : 60 * 24 // schedule checking and re-schedule itself for the next week at 23:59 on the same day var scriptProxy = bridge.getScriptServiceProxy() var dateTimeSpanMinsFromNowInMillis = new Date().getTime() + (searchSpan * 60 * 1000) var result = scriptProxy.getScheduledCloudScripts(dateTimeSpanMinsFromNowInMillis) var nowTime = new Date().getTime() if ((result.status == 200) && (result.data !== null)) { for (var i = 0; i < result.data.scheduledJobs.length; i++) { if (result.data.scheduledJobs[i].scriptName === scriptName && result.data.scheduledJobs[i].scheduledStartTime > nowTime) { scriptProxy.cancelScheduledScript(result.data.scheduledJobs[i].jobId) } } } const targetHour = 23 const targetMinute = 59 const minutesDifference = getMinutesDifference(targetHour, targetMinute) let minutesFromNow = minutesDifference + interval bridge.logInfo(`minutesFromNow between the script calling time and the time of 23:59 on a same day${minutesFromNow}`) response.scheduleJob = scriptProxy.scheduleRunScriptMinutes(scriptName, data, minutesFromNow) // the code for your script return response } function getMinutesDifference(targetHour, targetMinute) { const now = new Date() const targetTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), targetHour, targetMinute) const differenceInMilliseconds = targetTime - now bridge.logInfo(`differenceInMilliseconds between the script calling time and the target time: ${differenceInMilliseconds}`) const differenceInMinutes = Math.floor(differenceInMilliseconds / (1000 * 60)) return differenceInMinutes } main()
The parameters for this script will be like below, the
interval
will be10080
minutes (a week),{ "scriptName": "thisScriptNameItself", "args": { "interval": 10080 } }
-
Hi @antony - I'll send that one off to the devs and see how that would affect the implementation.
We'd likely make it a separate call - as that's a heavier operation that just returning your friends in relative order. That said - if you have to do it manually yourself that's a LOT heavier on the servers -- so I agree that this new call would be beneficial.
Stay tuned!
-
Hi folks,
FYI, here's one minor update regarding the Retention Analytics screen:
We have changed it to show Classic retention by default.
The reason for the change is that Rolling Retention naturally trends downward over the 30-day period of the report. That's simply due to mathematics. Rolling retention for a particular day measures whether the user returns that day - or any day thereafter. Thus - the days at the end of the calendar period have fewer days after them - and so the stat will naturally be lower.
We don't want folks to mistakenly think their retention is trending down - so we're now defaulting to Classic Retention which is more deterministic over the 30 day period. For those who wish to view the Rolling Retention - it's just a mouse click away!
Cheers!
Paul.
-
Right now the only valid value is "retention" - but obviously we've built that API with an eye to the future!
-
Well - the "owned custom entities" approach could come into play again if you want to view the matches across the system. Although owned custom entities are owned by players (and get deleted if a player account is deleted) - they are still queryable across the system... via API or the Portal (see App > Global > Global Data > Custom Entities ).
I hope that helps!
-
Oh - and I should note that you can retrieve the latest retention report - as well as the retention report for a specific start date...
https://docs.braincloudservers.com/api/capi/report/sysgetlatestreport
What we don't have right now is an API to list the reports that are generated and waiting for retrieval. We are working on that for a future patch.
Also note that we currently keep daily reports for 10 days - and weekly reports for 37 days.
Virtual Purchase
Post Score when a Tournament ends?
Recurring scheduled tasks?
Recurring scheduled tasks?
Recurring scheduled tasks?
Return global rank for entries in social leaderboard
Any questions regarding the new Retention Analytics?
Any questions regarding the new Retention Analytics?
Match history
Any questions regarding the new Retention Analytics?