![]() The implementation of the Tris game for other platforms instead features a server-side Extension which is in charge of handling the game logic, as opposed to keeping the logic on the client-side only. ![]() In this game the message contains informations on the "move" played by the user. ![]() This means that a change in a Room Variable will be reflected on all clients within the same Room so that, for example, they can start a game in synch.Īn Object Message is a specific kind of message exchanged between clients, allowing data to be transferred from one user to another. In particular, a Room Variable is broadcasted to all the users in the same Room where it is set. What's the difference between a server variable and a regular one? The main difference is that the first one (as the word says) is stored on the server and broadcasted to the other clients. Room Variables are one of the three server variable objects available in SmartFoxServer to store data to be shared among the clients of an application or game (the other two are User Variables and Buddy Variables, which we aren't deal with in this example). In this implementation of the Tris game, all the logic is confined on the client: Room Variables are used to keep the game state and Object Messages are exchanged by clients to syncronize the game boards. In this example spectators are not supported. A Game Room also provides player indexes: each user joining the room is automatically assigned a unique player index which facilitates the tasks of starting and stopping the game (spectators are not indexed instead). Game Rooms are specifically aimed at representing games (or matches) as they can contain two different types of users: players and spectators. This example shows how to create a SmartFoxServer Room of type "game".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |