Feature #33

Room Synchronization Levels

Added by colin moock 1382 days ago. Updated 1230 days ago.

Status :Closed Start :08/06/2008
Priority :High Due date :
Assigned to :- % Done :

0%

Category :Rooms
Target version :-

Description

Problem

By default, the Unity server updates clients using a "push" model, where clients in a particular room are automatically sent notification when that room's information changes. However, in applications with thousands of users, automated room updates can cause excessive network congestion, and poor application performance.

Solution

To improve performance, the server will allow each client to set its own update level for a room, specifying the type and amount of information it wishes to receive about the room.

Update levels fall into three categories: Occupant Updates, Room Updates, and Message Updates.

Levels of Occupant Updates are as follows:

  • None
  • Client count only
  • Clients and attributes

Levels of Room Updates are as follows:

  • None
  • All

Levels of Message Updates are as follows:

  • None
  • All

By setting all three Update levels to None, a client can join a room without ever being "pushed" updates about the room's state. The client would then be expected to "pull" information about the room on demand. For example, a client could ask for the number of users in a room once per minute. Or it could request the current question in a trivia game once per 10 seconds.

Implementation

Clients will be given the following API to specify an update level for Occupants, Room, and Messages:

URoom.setUpdateLevels(occupantUpdates, roomUpdates, messageUpdates)

someRoom.setUpdateLevels(UpdateLevel.COUNT, UpdateLevel.ALL, UpdateLevel.ALL);

Clients can also set the update level during the process of joining or observing a room:

URoom.join(password, occupantUpdateLevel, roomUpdateLevel, messageUpdateLevel);
URoom.observe(password, occupantUpdateLevel, roomUpdateLevel, messageUpdateLevel);
RoomManager.joinRoom(id, password, occupantUpdateLevel, roomUpdateLevel, messageUpdateLevel, weakRoom);
RoomManager.observeRoom(id, password, occupantUpdateLevel, roomUpdateLevel, messageUpdateLevel, weakRoom);
RoomManager.observeRooms(roomIDs, roomPasswords, occupantUpdateLevels, roomUpdateLevels, messageUpdateLevels, weakRooms);

Clients will be given the following means of requesting a one-time room synchronization (a "snapshot" of the room's current contents, filtered according to the client's update levels):

URoom.synchronize(), RoomManager.synchronizeRooms()

URoomEvent.SYNCHRONIZE

RoomManagerEvent.SYNC_NONEXISTENT_ROOM

UPC

This feature requires the following additional UPCs:

SET_ROOM_UPDATE_LEVELS
  • roomID
  • occupantUpdateLevel [RS] roomUpdateLevel [RS] messageUpdateLevel

Update levels will be room-scoped client attributes sent via SET_ROOM_UPDATE_LEVELS before a join or observe attempt. Update levels can be altered at any time via SET_ROOM_UPDATE_LEVELS.

SYNC_ROOMS

  • roomID[RS]password1 [RS][RS] roomID[RS]password2 [RS][RS] roomIDn[RS]passwordn
SYNC_ROOM_RESULTS
  • roomID
  • status

Security

Update levels need to be considered in the security model. Clients should not be able to receive information about a room they are not entitled to receive. For example, in a "Quiz the Nation" style game where clients store personal information in client attributes, clients should be prevented from receiving occupant updates.

Open Issues

  • Need a client API to tell the server to delete the update level attributes for a room.
  • Might need a system for auto-deleting level attributes (see Issue #79).

Related issues

related to Feature #22 Manually Request a Room Attribute New 07/30/2008
related to Feature #79 Auto-remove scoped client attributes on room exit New 09/17/2008
related to Feature #18 Room Observation Closed 07/30/2008

History

08/06/2008 01:58 PM - colin moock

  • Status changed from New to Resolved

Initial implementation complete. Ready for testing.

09/24/2008 02:52 AM - colin moock

  • Status changed from Resolved to New

09/24/2008 02:56 AM - colin moock

  • Subject changed from Room Synchronization Type to Room Synchronization Levels
  • Priority changed from Normal to High

01/05/2009 03:19 PM - derek clayton

  • Status changed from New to Closed

- implemented. open issues given new tickets

Also available in: Atom