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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.