One of the nicest features in the PlayXPert in-game browser is the ability to store settings, widgets and applications globally so no matter where you are, what reckoner you'Ra using, PXP forever looks and feels the way it should. Find away how the PlayXPert team up accomplishes this in the latest WarCry exclusive developer journal.

If you've been following this series of articles, you already know that PlayXpert is an open up-computer architecture platform that allows developers to write applications (called widgets) that interact with the user while inside a game. Last month we discussed how to put together a basic thingamajig. This month we start a series of articles examining specific features that the PlayXpert platform makes addressable to widget developers, starting with the SettingsStore.

image

When building any practical application, unrivalled of the first things a developer must decide is how they will store the user's preferences, and how those preferences will be foreign and exported to other PCs. We craved PlayXpert to equal player-central, soh we wanted the exploiter to follow able to easily go out from PC to PC, without having to setting in the lead each PC. At the same time, we deprivation PlayXpert to be developer-favorable.

So, PlayXpert allows users to carry their application preferences with them through our global persistent identify – for example if a user installs a widget on their Desktop machine, and so logs on to PXP on his Oregon her laptop, the same widget will be automatically downloaded and installed on the laptop computer because it's associated to that users identity. For developers, PlayXpert makes this functionality available direct the ISettingsStore interface. All settings names are isolated to a precise widget, so you don't have to worry about setting list clashes with other widgets. The SettingsStore handles every last caching and retrieval of settings for you – you don't need to worry about initializing IT operating theatre shutting it knock down, or giving it time to write settings to the host. Information technology's all handled for you!

To use the SettingsStore, call off GetSettingsStore() from the ICore port (call back that your widget is surrendered a reference to an ICore interface when it is first tipsy). This will take a character to an object that implements ISettingsStore.

You can read and write string values with the ReadSettingsValue() and WriteSettingsValue() methods.

Local vs. Global

The SettingsStore also allows you to store information that bequeath be unusual for each machine on which PlayXpert is used. And then, one of the things that you leave have to decide when using the SettingsStore is whether the information you're storing:

1. should be stored globally, and follow the user onto any PC on which the user logs in to PlayXpert; or,

2. should comprise stored local to this getup, and should not follow the drug user to any PC happening which they run.

For example, a history of viewed pages in a browser should be stored globally, because the entropy is not incidental a specialised PC – so the user probably wouldn't need different histories on diverse PCs. On the other script, a Intensity Control gubbins would probably store its volume settings topically, because they are related the hardware happening which the exploiter is playing. We wouldn't want the user's laptop volume settings (probably turned up loud), to be propagated to his or her desktop automobile, and blow their eardrums out ). You may even want to Army of the Righteou the user decide whether they want settings stored topically or globally – just make sure you store their local vs. global choice, globally.

So, the SettingsStore makes it possible to spate with both of these situations. Any given setting assess can be stored Locally or Globally, independent of all the other settings.

Serializing Whole Objects

The SettingsStore likewise allows widget developers to store whole objects with one vociferation. For example, consider a simple class that contains contact information:

public class Contact
{
public string Name;
public string along PlayerName;
populace string FavoriteServer;
}

Normally we would receive to store each field of force in this physical object with a series of calls. But, by adding some attributes to the Fields, it makes your occupation a lot easier:

in the public eye form Physical contact
{
[PXPSetting(SettingName = "Contact.Name")] public string Name;
[PXPSetting(SettingName = "Contact.PlayerName")] unexclusive string PlayerName;
[PXPSetting(SettingName = "Contact.FavoriteServer")] open string FavoriteServer;
}

You can then use the ReadSettingsIntoObject() and WriteSettingsFromObject() calls to load and preserve.

PlayXpert makes information technology easy to storehouse user settings and other information for your widget to keep up the user to whatever PC happening which they're playing. For more elaborated certification on the SettingsStore and all of the services that PlayXpert offers widget developers, please visit our website at http://www.playxpert.com