With Mac OS X 10.8 Apple adds GameKit for Mac. This is a great chance for a lot of new games on the Mac as the work needed to get your app working for several players is much easier.
For MBS Plugin 12.3 we have implemented the whole GameKit framework. As you see in the documentation, this includes 20 classes with hundreds of methods, events and constants.
We had to make some design decision. One is the GameKitMBS class. This is the base class with a few global methods, error constants and 50 events. Due to the way Apple implemented GameKit there are a lot of functions which run asynchronously. When the work is done, they call a function to inform the application that the work is done. Our plugin now doesn't provide you with a lot of events all over the classes, but events in one central class. So with one subclass you can handle all events.
As a convenience in the events, we pass you the objects and parameters from the method call. And we carry you a variant parameter call tag to the event for context information. For example if you load the image for a player or achievement, you could pass the canvas where the event puts the picture after loading is done.
Under the hood the plugin puts a lot of work into getting things thread safe. So all events are redirected to the main thread. For best performance, please keep the main thread unblocked.
For the game data, Apple allows to pass a block of bytes. But instead of having a memoryblock in Real Studio, we decided that it is more convenient to serialize a dictionary. This way you can pass a lot of data easily. The dictionary can contain memory blocks, strings, numbers, dictionaries and arrays. Of course we could later make this an option if you have special needs.
Who wants to make the first GameKit game in Real Studio?