Highscore: Remote Highscore

PreviousNext

Overview

The class EM_HIGHSCORE inherits from EM_LOCAL_HIGHSCORE and extends it with network code, so you can send your highscore to a server and receive a global highscore from it.

Synchronize with Server

First you have to specify where the highscore will be sent to using set_url. Then you should subscribe to several events to determine if the transfer was successful or failed. These are connection_closed_event, connection_failed_event and connection_established_event Now you can synchronize the highscore using synchronize_with_server. The remote highscore will then be available through the attribute remote_highscore in the same way as local_highscore.
The remote highscore does also have a Web interface, which you could integrate into your game's homepage. See Server side for more info.

Note: Along with the highscore, a client id is sent to the server. This id is an autogenerated number which is stored locally with the highscore. It is used to distinguish between several entries with the same name.
Note: You don't have to unsubscribe the events you have subscribed to check the connection status, because those subsciptions are thrown away when the connection finishes.