Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
Delphi

AppTethering Leaderboard – Passing Objects Remotely and using Resources

AppTethering opens up a range of powerful features for coupled applications. Beyond the basic features for calling remote actions (which is rather cool and quick to setup) it is also possible to share resources between applications.

To give you an example I have built a Scoreboard that records the best scores in a simple game. As the scores come in and the leaderboard is updated, it rebuilds the resource that is then automatically sent out to the connected clients.

Using the TTetheringAppProfile.Resources you can add at Design time or run time a TLocalResource. The TLocalResource has a concept of being either Shared or Mirrored (set via the Kind property). In the example of the leaderboard both the Game (clients) and Leaderboard (server) have the same resource added to their TetheringAppProfile with the difference being that the clients have the kind as Mirror rather than Shared.  As the central Shared resource is updated this is broadcast to the clients and the TLocalResource then fires its OnResourceReceived event.

So with that in mind, see it in action and download the code sample.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Pre-sales Director at Embarcadero

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES