Class MMORoomSettings
- java.lang.Object
-
- sfs2x.client.requests.RoomSettings
-
- sfs2x.client.requests.mmo.MMORoomSettings
-
public class MMORoomSettings extends RoomSettings
The MMORoomSettings class is a container for the settings required to create an MMORoom using the CreateRoomRequest request.- See Also:
CreateRoomRequest
,MMORoom
-
-
Constructor Summary
Constructors Constructor Description MMORoomSettings(java.lang.String name)
Creates a new MMORoomSettings instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vec3D
getDefaultAOI()
Defines the Area of Interest (AoI) for the MMORoom.MapLimits
getMapLimits()
Defines the limits of the virtual environment represented by the MMORoom.int
getProximityListUpdateMillis()
Configures the speed at which the SFSEvent.PROXIMITY_LIST_UPDATE event is sent by the server.int
getUserMaxLimboSeconds()
Defines the time limit before a user without a physical position set inside the MMORoom is kicked from the Room.boolean
isSendAOIEntryPoint()
Sets if the users entry points in the current user's Area of Interest should be transmitted in the SFSEvent.PROXIMITY_LIST_UPDATE event.void
setDefaultAOI(Vec3D defaultAOI)
void
setMapLimits(MapLimits mapLimits)
void
setProximityListUpdateMillis(int proximityListUpdateMillis)
void
setSendAOIEntryPoint(boolean sendAOIEntryPoint)
void
setUserMaxLimboSeconds(int userMaxLimboSeconds)
-
Methods inherited from class sfs2x.client.requests.RoomSettings
allowOwnerOnlyInvitation, getEvents, getExtension, getGroupId, getMaxSpectators, getMaxUsers, getMaxVariables, getName, getPassword, getPermissions, getVariables, isGame, setAllowOwnerOnlyInvitation, setEvents, setExtension, setGame, setGroupId, setMaxSpectators, setMaxUsers, setMaxVariables, setName, setPassword, setPermissions, setVariables
-
-
-
-
Constructor Detail
-
MMORoomSettings
public MMORoomSettings(java.lang.String name)
Creates a new MMORoomSettings instance. The instance must be passed to the CreateRoomRequest class constructor.- Parameters:
name
- The name of the MMORoom to be created.- See Also:
CreateRoomRequest
-
-
Method Detail
-
getDefaultAOI
public Vec3D getDefaultAOI()
Defines the Area of Interest (AoI) for the MMORoom.This value represents the area/range around the user that will be affected by server events and other users events. It is represented by a Vec3D object providing 2D or 3D coordinates.
Setting this value is mandatory.
Example #1: a Vec3D(50,50) describes a range of 50 units (e.g. pixels) in all four directions (top, bottom, left, right) with respect to the user position in a 2D coordinates system.
Example #2: Vec3D(120,120,60) describes a range of 120 units in all four directions (top, bottom, left, right) and 60 units along the two Z-axis directions (backward, forward) with respect to the user position in a 3D coordinates system.
- See Also:
Vec3D
-
setDefaultAOI
public void setDefaultAOI(Vec3D defaultAOI)
- See Also:
getDefaultAOI()
-
getMapLimits
public MapLimits getMapLimits()
Defines the limits of the virtual environment represented by the MMORoom.When specified, this property must contain two non-null Vec3D objects representing the minimum and maximum limits of the 2D/3D coordinates systems. Any positional value that falls outside the provided limit will be refused by the server.
This setting is optional but its usage is highly recommended.
- See Also:
MapLimits
-
setMapLimits
public void setMapLimits(MapLimits mapLimits)
- See Also:
getMapLimits()
-
getUserMaxLimboSeconds
public int getUserMaxLimboSeconds()
Defines the time limit before a user without a physical position set inside the MMORoom is kicked from the Room.As soon as the MMORoom is joined, the user still doesn't have a physical position set in the coordinates system, therefore it is considered in a "limbo" state. At this point the user is expected to set his position (via the SetUserPositionRequest request) within the amount of seconds expressed by this value.
Default is 50 seconds
-
setUserMaxLimboSeconds
public void setUserMaxLimboSeconds(int userMaxLimboSeconds)
- See Also:
getUserMaxLimboSeconds()
-
getProximityListUpdateMillis
public int getProximityListUpdateMillis()
Configures the speed at which the SFSEvent.PROXIMITY_LIST_UPDATE event is sent by the server.In an MMORoom, the regular users list is replaced by a proximity list, which keeps an updated view of the users currently within the Area of Interest of the current user. The speed at which these updates are fired by the server is regulated by this parameter, which sets the minimum time between two subsequent updates.
NOTE: values below the default might be unnecessary for most applications unless they are in realtime.
Default: 250 milliseconds
- See Also:
SFSEvent.PROXIMITY_LIST_UPDATE
-
setProximityListUpdateMillis
public void setProximityListUpdateMillis(int proximityListUpdateMillis)
- See Also:
getProximityListUpdateMillis()
-
isSendAOIEntryPoint
public boolean isSendAOIEntryPoint()
Sets if the users entry points in the current user's Area of Interest should be transmitted in the SFSEvent.PROXIMITY_LIST_UPDATE event.If this setting is set to
true
, when a user enters the AoI of another user, the server will also send the coordinates at which the former "appeared" within the AoI. This option should be turned off in case these coordinates are not needed, in order to save bandwidth.Default: true
-
setSendAOIEntryPoint
public void setSendAOIEntryPoint(boolean sendAOIEntryPoint)
-
-