Class SFSMMOApi
- java.lang.Object
- 
- com.smartfoxserver.v2.api.SFSMMOApi
 
- 
- All Implemented Interfaces:
- ISFSMMOApi
 
 public class SFSMMOApi extends java.lang.Object implements ISFSMMOApi Provides advanced features for MMO-related functionalities.TutorialTo learn more see this introductory tutorial.
- 
- 
Field SummaryFields Modifier and Type Field Description protected org.slf4j.Loggerlogprotected com.smartfoxserver.v2.api.response.ISFSMMOResponseApimmoResponseApiprotected SmartFoxServersfsprotected SFSApisfsAPI
 - 
Constructor SummaryConstructors Constructor Description SFSMMOApi(SmartFoxServer sfs)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description com.smartfoxserver.v2.api.response.ISFSMMOResponseApigetResponseAPI()voidremoveMMOItem(BaseMMOItem item)Remove an MMOItem from an MMORoom.voidsendObjectMessage(Room targetRoom, User sender, ISFSObject message, Vec3D aoi)Send an Object message based on a custom SFSObject that can contain any data.voidsendPublicMessage(Room targetRoom, User sender, java.lang.String message, ISFSObject params, Vec3D aoi)Sends a public chat message.voidsetMMOItemPosition(BaseMMOItem item, Vec3D pos, Room targetRoom)Set or update an MMOItem inside an MMORoomvoidsetMMOItemVariables(BaseMMOItem item, java.util.List<IMMOItemVariable> variables)Set MMOItemVariables.voidsetMMOItemVariables(BaseMMOItem item, java.util.List<IMMOItemVariable> variables, boolean fireClientEvent)Set MMOItemVariables.voidsetUserPosition(User user, Vec3D pos, Room targetRoom)Set the new User position inside an MMORoom
 
- 
- 
- 
Field Detail- 
sfsprotected final SmartFoxServer sfs 
 - 
logprotected final org.slf4j.Logger log 
 - 
sfsAPIprotected final SFSApi sfsAPI 
 - 
mmoResponseApiprotected final com.smartfoxserver.v2.api.response.ISFSMMOResponseApi mmoResponseApi 
 
- 
 - 
Constructor Detail- 
SFSMMOApipublic SFSMMOApi(SmartFoxServer sfs) 
 
- 
 - 
Method Detail- 
getResponseAPIpublic com.smartfoxserver.v2.api.response.ISFSMMOResponseApi getResponseAPI() - Specified by:
- getResponseAPIin interface- ISFSMMOApi
 
 - 
sendObjectMessagepublic void sendObjectMessage(Room targetRoom, User sender, ISFSObject message, Vec3D aoi) Send an Object message based on a custom SFSObject that can contain any data. Typically this is used for sending game moves to players or other game related updates. The difference with the regular version of this Request is that it works with a custom Area Of Interest (AOI) inside an MMORoom. Instead of using the default Room AOI here we can specify a custom AOI which should be smaller that the default one. Attempting to use a larger AOI is not possible. NOTE: The sender must be joined in the target MMORoom. - Specified by:
- sendObjectMessagein interface- ISFSMMOApi
- Parameters:
- targetRoom- the MMORoom
- sender- the sender of the Object
- message- the data
- aoi- the custom Area Of Interest (AOI)
 
 - 
sendPublicMessagepublic void sendPublicMessage(Room targetRoom, User sender, java.lang.String message, ISFSObject params, Vec3D aoi) Sends a public chat message.The difference with the regular version of this Request is that it works with a custom Area Of Interest (AOI) inside an MMORoom. Instead of using the default Room AOI here we can specify a custom AOI which should be smaller that the default one. Attempting to use a larger AOI is not possible. - Specified by:
- sendPublicMessagein interface- ISFSMMOApi
- Parameters:
- targetRoom- the MMORoom
- sender- the sender of the Message
- message- the chat message
- params- an optional data object (e.g. to define font and color of the message)
- aoi- the custom Area Of Interest (AOI)
 
 - 
setUserPositionpublic void setUserPosition(User user, Vec3D pos, Room targetRoom) Set the new User position inside an MMORoom- Specified by:
- setUserPositionin interface- ISFSMMOApi
- Parameters:
- user- The User
- pos- The new position
- targetRoom- The target MMORoom
- See Also:
- MMORoom
 
 - 
setMMOItemPositionpublic void setMMOItemPosition(BaseMMOItem item, Vec3D pos, Room targetRoom) Set or update an MMOItem inside an MMORoom- Specified by:
- setMMOItemPositionin interface- ISFSMMOApi
- Parameters:
- item- the MMOItem
- pos- the position in 2D/3D space
- targetRoom- the target MMORoom
- See Also:
- MMORoom,- MMOItem
 
 - 
removeMMOItempublic void removeMMOItem(BaseMMOItem item) Remove an MMOItem from an MMORoom. (The Room is not required as the system already keeps track of which MMOItem belongs to which MMORoom) This in turn will affect all Users who had this MMOItem in their AOI via a client side PROXIMITY_LIST_UPDATE- Specified by:
- removeMMOItemin interface- ISFSMMOApi
- Parameters:
- item- the MMOItem to remove
- See Also:
- MMORoom,- MMOItem
 
 - 
setMMOItemVariablespublic void setMMOItemVariables(BaseMMOItem item, java.util.List<IMMOItemVariable> variables) Set MMOItemVariables. Only the changed variables are broadcast to the Users that can "see" the MMOItem in the MMORoom. In order to delete a variable you can set it to null.- Specified by:
- setMMOItemVariablesin interface- ISFSMMOApi
- Parameters:
- item- the MMOItem, owner of the variables
- variables- the variables
- See Also:
- MMOItemVariable,- MMOItem,- MMORoom
 
 - 
setMMOItemVariablespublic void setMMOItemVariables(BaseMMOItem item, java.util.List<IMMOItemVariable> variables, boolean fireClientEvent) Set MMOItemVariables. Only the changed variables are broadcast to the Users that can "see" the MMOItem in the MMORoom. In order to delete a variable you can set it to null.- Specified by:
- setMMOItemVariablesin interface- ISFSMMOApi
- Parameters:
- item- the MMOItem, owner of the variables
- variables- the variables
- fireClientEvent- set to true to send an update to clients
- See Also:
- MMOItemVariable,- MMOItem,- MMORoom
 
 
- 
 
-