O'Reilly logo

Flash Multiplayer Virtual Worlds by Makzan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required