Release 3.8 - RTT!
brainCloud 3.8 marks the beta release of our new Real-time Tech, which we ingeniously call brainCloud RTT.
The brainCloud Platform is built upon a request + response foundation – which provides great flexibility and reliability, together with incredible performance and scalability. There are times, however, when more adhoc communications are desirable (online gaming, chat, monitoring, etc) – and that is where RTT comes in.
brainCloud RTT adds a real-time channel to our client API. This channel allows clients to listen for and react to real-time events – without polling.
This enables a whole suite of new brainCloud features – the first of which you’ll see in brainCloud 3.8!
Note – brainCloud RTT is available to customers using the Business Plan and above <- this has changed – see below! Usage pricing above the initial set of included concurrent users will be announced soon!
To enable RTT, check [x] Real-time Tech (RTT) Enabled on the Design | Core App Info | Advanced Settings page.
Update – As of 4.0, brainCloud now supports Plus Plans – which provide RTT features across a variety of usage levels. For more information on Plus Plans, see our 4.0 plan announcement.
Release Highlights
Chat
Thanks to RTT, brainCloud now supports online chat!
We have focused primarily on supporting chat for groups, but we also provide support for global chat channels – which are available to all users of an app.
Chat offers the following features:
- global and group channel types
- simple or rich content messages (developer defined)
- caching of recent chat history
- support for system messages (from the app, instead of an end-user)
- support for hidden (semantic) messages
- ability to edit / delete chat messages
Note – Chat requires brainCloud RTT to be enabled for the app.
For more info, check out the Chat API page, and try out our example chat app – bcChat!
Messaging
brainCloud now provides a Messaging service as well. Messaging is different from chat, in that:
- recipients are addressed directly (i.e. not via channels)
- message history is managed on a user-by-user basis (i.e. not by channel)
- RTT is optional; if enabled, users will receive real-time notification of new messages
Messaging features:
- Support for multiple recipients
- Messages are organized into incoming (“inbox”) and sent (“sent”) messageboxes
- Support for readvs. unreadmessages
- Support for system messages (from the app, instead of an end-user)
- Automatic clean-up / deletion of expired messages (important to keep storage utilization low)
For more info, check out the Messaging API page.
RTT Online
With RTT, brainCloud now directly supports the development and integration of custom servers for shared experiences – such as online games (async or otherwise), online meetings, shared document editing, etc.
Room Servers
Room Servers are custom servers used to provide a shared experience (i.e. an online game, online meeting, etc.) to a set of users.
These servers are light-weight and simple to develop, and can easily integrate with brainCloud’s new Lobby and Online Matchmaking services.
In 3.8, Custom Room Servers must be hosted outside of brainCloud, but future brainCloud releases will support hosting the services directly under brainCloud via Docker containers.
Lobbies
Lobbies are used to gather up users prior to launching Room Servers. They provide an online matchmaking service (as opposed to the offline strategy provided by our existing Matchmaking service).
Lobbies provide:
- support for multiple teams – with min/max # of users
- automatic assignment of users to teams (users can switch afterwards)
- management of user settingsand readystatus
- support for multiple lobby types
- support for calling an external room server managerto launch a room serverwhen the lobby is ready
Lobby Matchmaking
Online matchmaking is used to match up users with lobbies, in preparation for entering Room Servers.
The Lobby Matchmaking APIs allow the developer to:
- specify the type of lobby / room to match with
- specify the player rating to target
- specify an algorithm to use when escalatingthe search
- provide a custom filter script to use to filter out candidates
For more info, check out the Lobby API page.
On Demand Tournaments
We have greatly enhanced our Leaderboard and Tournament systems to make the scheduling of tournaments more flexible.
brainCloud previously supported only regularly recurring tournaments – which are tournaments that happen daily, weekly, monthly, etc… (i.e. at preset intervals). brainCloud 3.8 introduces new On Demand / Adhoc Tournaments – to support irregularly scheduled tournaments (i.e. major holidays, new releases, etc.)
To create an adhoc tournament, create a leaderboard and choose the “Adhoc Tournaments” rotation type. Then manually add each tournament period.
Cloud Code Import / Export
Finally, we are reworking our cloud code management sytems. As part of this, we have created a new serialization format for cloud code scripts, that makes it easier to export the scripts, edit them locally on your workstation, and upload them back to us.
The handy cloud-code method below allows you to post a score to multiple leaderboards:
var result = {};
result.posted = 0;
result.errors = 0;
result.errorsList = [];
// Grab the parameters
var leaderboards = data.leaderboards;
var score = data.score;
var extras = data.extras;
var _leaderboard = bridge.getLeaderboardServiceProxy();
var postResult = {};
// Loop through the leaderboards
for (var i = 0; i < leaderboards.length; i++ ) {
// Post the score
postResult = _leaderboard.postScoreToLeaderboard(leaderboards[i], score, extras);
if (postResult.status == 200) {
result.posted++;
} else {
result.errors++;
result.errorsList.push(postResult);
}
}
// Return the results
result;
//*** ------------- brainCloud meta-data begins now - do not hand-edit -----------------
// "scriptName":"PostToLeaderboards",
// "clientCallable":true,
// "s2sCallable":false,
// "peerCallable":false,
// "scriptTimeout":10,
// "description":"Posts a score to multiple leaderboards",
// "parms":"{\n \"leaderboards\": [\"weekly\", \"alltime\"],\n \"score\": 1000,\n \"extras\": {}\n}",
// "version":3,
// "updatedAt":1530799500264
To import it into your app:
- Click here to download the serialized version of the cloud code script to your workstation
- Launch the Design Portal, and go to Design | Cloud Code | Scripts, and choose the Import Script option from the Import / Export menu button
- Navigate to your download directory, and choose the
PostToLeaderboards.cloudcode.js.zip
script - Click okay – and voila, you should now have the script, with all settings intact.
This new serialization format is the first step to a bunch of new features that we hope will make creating and managing cloud code scripts a lot easier for devs. We hope you like it!
Portal Changes
The following additions and changes have been made to the Design Portal:
Design
- Core App Info | Advanced Settings
- Added a new setting to enable RTT to the App Settings section.
- Cloud Code | Scripts
- Added new options for importing and exporting Cloud Code scripts.
- Leaderboards | Leaderboard Configs
- This dialog has been completely re-designed to better handle Tournament scenarios, including new On Demand Tournaments.
- One tournaments are enabled, a new Tournament Periods section appears – allowing the developer to select and edit the settings of a specific tournament rotation.
- Recurring tournaments will always show the current period, followed by the next (recurring) period. Changes to either period will affect all periods that follow.
- Adhoc tournaments will show the the current period (if there is one) and any future periods. Adhoc tournament periods do not repeat – you must individually schedule each one.
- Messaging | Chat
- Used to enable and configure the new Chat service.
- The settings determine how much chat history is preserved.
- Messaging | Chat Channels
- Used to configure the list of Global Chat Channels for the app.
- Messaging | Messaging
- Used to enable and configure the Messaging service.
- The settings determine message retention, and whether outgoing copies of messages are saved.
- Multiplayer | Lobbies
- Used to enable the Lobby service, and configure the list of Lobby Types.
- Lobby type settings include:
- team definitions – including min / max number of participants
- progression rules – including timing and ready-up percentages
- matchmaking filter – used to customize matchmaking beyond the built-in skill, lobby-type and team space algorithm
- room server manager – the web call to make to allocate a room server for the experience
- custom config – custom json parameters to pass onto the room server at the start of the experience
Monitoring
- Global Monitoring | Leaderboards
- Updated the leaderboard viewer to view On Demand / Adhoc Tournaments
API Changes
The following changes/additions have been made to the brainCloud API:
- [New!] Chat
- Add online chat to your app quickly and easily!
- Check out the Client and S2S Chat APIs.
- Client
- [New!] EnableRTT() – Used to establish the RTT connection from the client.
- [New!] DisableRTT() – Disconnect from RTT.
- Plus methods for registering and de-registering RTT listeners for Chat, Events, Messaging and Lobbies.
- Event
- No more polling! SendEvent() now sends a realtime event to the recipient if they are currently online, and RTT is enabled.
- See the RegisterRTTEventCallback() API for details.
- GlobalEntity
- Made the following system entity calls available from client session cloud-code scripts (they were previously S2S only)
- CreateSystemEntity(), GetSystemEntityList(), GetSystemEntityListCount(), GetSystemEntityPage(), GetSystemEntityPageOffset(), and ReadSystemEntity().
- GetListByIndexedId() now returns
entityListCount
in addition to the list of items.
- Made the following system entity calls available from client session cloud-code scripts (they were previously S2S only)
- [New!] Lobby
- Add online matchmaking, full lobby support and easy custom server integration to your app.
- Check out the Client and S2S Lobby APIs.
- [New!] Messaging
- Add user-to-user messaging to your app, with optional real-time delivery via RTT.
- Check out the Client and S2S Messaging APIs.
- Product
- Added the missing VerifyItunesReceipt() call to Cloud Code.
In addition, all brainCloud file downloads (global and user) are now resumable (we have added the “Accept-Ranges” header).
Miscellaneous Changes / Fixes
- Updated libraries
- RTT support, with Chat, Messaging and Lobby APIs, have been added to the Unity, Java and Javascript libraries. More libraries will follow soon!
- All libraries have been updated with improved retry and packet-in-progress handling
- Our Javascript library now directly supports NPM. Include
braincloud-js
to grab it.
- Documentation updates
- We have updated the docs to reflect the new brainCloud services
- Plus miscellaneous fixes and performance improvements