Sharing object data between players

We have discussed how to communicate with text messages. In many cases, we need to share some pieces of information with other players. For example, we want to update others with our location. In previous chapters, we used serialization and deserialization methods to put information inside the private and public messages in some special format. This is a useful method where we can only send out and receive text messages.

Recently the SmartFoxServer introduced the sendObject and sendObjectToGroup functions to broadcast data object to all players or specific players. The data communication flow of the two methods is basically the same. The difference is public message serializes all data into strings and sendObject ...

Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.