|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.plugins.ObjectManagerClient
public class ObjectManagerClient
Interface to the object manager plugin. The object manager can create, load, unload, and delete distributed objects. Objects can be persistent or non-persistent.
The object manager also provides a mechanism for saving non-distributed object data.
Constructor Summary | |
---|---|
ObjectManagerClient()
|
Method Summary | |
---|---|
static java.lang.Boolean |
addSubObjectNamespace(OID oid,
java.util.Collection<Namespace> namespaces)
|
static java.lang.Boolean |
deleteObject(OID oid)
Delete an object. |
static boolean |
fixWorldNode(OID oid,
BasicWorldNode worldNode)
Modify location of persistent object. |
static OID |
generateLight(OID instanceOid,
LightData lightData)
Create a point light object. |
static OID |
generateObject(int templateID,
java.lang.String templateType,
OID instanceOid,
Point loc)
Create an object. |
static OID |
generateObject(int templateID,
java.lang.String templateType,
Point loc)
Create an object. |
static OID |
generateObject(int templateID,
java.lang.String templateType,
Template overrideTemplate)
Create an object. |
static java.util.List<OID> |
getMatchingObjects(OID instanceOid,
java.lang.String name,
ObjectType objectType,
java.util.Map<Namespace,java.util.Map<java.lang.String,java.io.Serializable>> filters)
Get a list of object ids based on various filters. |
static OID |
getNamedObject(OID instanceOid,
java.lang.String name,
ObjectType objectType)
Get object id by name. |
static ObjectManagerClient.ObjectStatus |
getObjectStatus(OID oid)
Get object status. |
static Template |
getTemplate(int templateID,
java.lang.String templateType)
Get object property template. |
static java.util.List<java.lang.String> |
getTemplateNames(java.lang.String templateType)
Get registered template names. |
static OID |
loadObject(OID oid)
Load a persistent object. |
static OID |
loadObject(java.lang.String key)
Load a persistent object by persistence key. |
static Entity |
loadObjectData(OID oid,
Namespace namespace)
Load persistent sub-object. |
static Entity |
loadObjectData(java.lang.String persistenceKey)
Load persistent entity from the database by persistence key. |
static OID |
loadSubObject(OID oid,
java.util.Collection<Namespace> namespaces)
|
static boolean |
registerTemplate(Template template)
Register object property template. |
static boolean |
saveObject(OID oid)
Save persistent object. |
static boolean |
saveObject(OID oid,
java.lang.String persistenceKey)
Save persistent object with persistence key. |
static boolean |
saveObjectData(java.lang.String persistenceKey,
Entity entity,
Namespace namespace)
Save a sub-object. |
static void |
setPersistenceFlag(OID oid,
boolean flag)
Set object persistence flag. |
static java.lang.Boolean |
unloadObject(OID oid)
Unload an object. |
static java.lang.Boolean |
unloadSubObject(OID oid,
java.util.Collection<Namespace> namespaces)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MessageType MSG_TYPE_SET_PERSISTENCE
public static final MessageType MSG_TYPE_SET_SUBPERSISTENCE
public static final MessageType MSG_TYPE_MODIFY_NAMESPACE
public static final MessageType MSG_TYPE_LOAD_OBJECT
public static final MessageType MSG_TYPE_LOAD_SUBOBJECT
public static final MessageType MSG_TYPE_UNLOAD_OBJECT
public static final MessageType MSG_TYPE_UNLOAD_SUBOBJECT
public static final MessageType MSG_TYPE_DELETE_OBJECT
public static final MessageType MSG_TYPE_DELETE_SUBOBJECT
public static final MessageType MSG_TYPE_LOAD_OBJECT_DATA
public static final MessageType MSG_TYPE_SAVE_OBJECT_DATA
public static final MessageType MSG_TYPE_SAVE_OBJECT
public static final MessageType MSG_TYPE_SAVE_SUBOBJECT
public static final MessageType MSG_TYPE_GENERATE_OBJECT
public static final MessageType MSG_TYPE_GENERATE_SUB_OBJECT
public static final MessageType MSG_TYPE_SUB_OBJECT_DEPS_READY
public static final MessageType MSG_TYPE_REGISTER_TEMPLATE
public static final MessageType MSG_TYPE_GET_TEMPLATE
public static final MessageType MSG_TYPE_GET_TEMPLATE_NAMES
public static final MessageType MSG_TYPE_FIX_WNODE_REQ
public static final MessageType MSG_TYPE_GET_NAMED_OBJECT
public static final MessageType MSG_TYPE_GET_MATCHING_OBJECTS
public static final MessageType MSG_TYPE_GET_OBJECT_STATUS
public static final java.lang.String BASE_TEMPLATE
#generateObject(String,Template)
,
Constant Field Valuespublic static final int BASE_TEMPLATE_ID
public static final java.lang.String TEMPL_PERSISTENT
public static final java.lang.String TEMPL_INSTANCE_RESTORE_STACK
public static final java.lang.String TEMPL_CURRENT_INSTANCE_NAME
Constructor Detail |
---|
public ObjectManagerClient()
Method Detail |
---|
public static OID generateObject(int templateID, java.lang.String templateType, Template overrideTemplate)
templateName
merged with the overrideTemplate
.
Properties in the override template take precedence over those
in the registered template.
To create a persistent object, set the persistent property to true.
Java: template.put(Namespace.OBJECT_MANAGER, ObjectManagerClient.TEMPL_PERSISTENT, true) Python: template.put(Namespace.OBJECT_MANAGER, ObjectManagerClient.TEMPL_PERSISTENT, Boolean(True))
Perceivable objects (those with a location) must have an instance oid property (Namespace.WORLD_MANAGER, WorldManagerClient.TEMPL_INSTANCE, type OID).
templateName
- Registered template. If you don't want to use
a registered template, then pass ObjectManagerClient.BASE_TEMPLATE.overrideTemplate
- Override template, may be null.
public static OID generateObject(int templateID, java.lang.String templateType, Point loc)
templateName
. The object location is set
via loc
. To make the object perceivable, the caller
must spawn the object in the world manager.
templateName
- Registered template.loc
- Object location.
#generateObject(String,Template)
public static OID generateObject(int templateID, java.lang.String templateType, OID instanceOid, Point loc)
templateName
. The object location is set
via instanceOid
and loc
. To make the object perceivable, the caller
must spawn the object in the world manager.
templateName
- Registered template.instanceOid
- Object instance.loc
- Object location.
#generateObject(String,Template)
public static OID generateLight(OID instanceOid, LightData lightData)
instanceOid
- Instance oid.lightData
- Point light data.
public static OID loadObject(OID oid)
public static OID loadObject(java.lang.String key)
public static java.lang.Boolean unloadObject(OID oid)
If the object is an instance,
contained objects (excluding players) will be unloaded.
However, the correct way to unload an instance is
InstanceClient.unloadInstance(atavism.server.engine.OID)
.
public static java.lang.Boolean addSubObjectNamespace(OID oid, java.util.Collection<Namespace> namespaces)
public static OID loadSubObject(OID oid, java.util.Collection<Namespace> namespaces)
public static java.lang.Boolean unloadSubObject(OID oid, java.util.Collection<Namespace> namespaces)
public static java.lang.Boolean deleteObject(OID oid)
InstanceClient.deleteInstance(atavism.server.engine.OID)
.
public static boolean saveObject(OID oid, java.lang.String persistenceKey)
oid
- Object identifierpersistenceKey
- Unique object identifier. Replaces previous
persistence key.
public static boolean saveObject(OID oid)
public static boolean saveObjectData(java.lang.String persistenceKey, Entity entity, Namespace namespace)
persistenceKey
- Object persistence key, null for no keyentity
- Entity to savenamespace
- Entity's namespace
public static Entity loadObjectData(java.lang.String persistenceKey)
persistenceKey
- Object persistence key.
public static Entity loadObjectData(OID oid, Namespace namespace)
oid
- The object oid.namespace
- The sub-object namespace.
public static boolean registerTemplate(Template template)
#generateObject(String,Template)
public static Template getTemplate(int templateID, java.lang.String templateType)
public static void setPersistenceFlag(OID oid, boolean flag)
public static boolean fixWorldNode(OID oid, BasicWorldNode worldNode)
This call should only be used when the object's world manager sub-object is NOT loaded. The ProxyPlugin uses fixWorldNode() during player login when their logout instance no longer exists.
public static java.util.List<java.lang.String> getTemplateNames(java.lang.String templateType)
public static OID getNamedObject(OID instanceOid, java.lang.String name, ObjectType objectType)
instanceOid
is non-null,
the lookup is confined to the instance content. Only works on
loaded instances and loaded objects. If instanceOid
is null, lookup considers all loaded objects.
If objectType
is non-null, both the name and
object type must match.
Object names are set at creation time from the WorldManager object name (WorldManagerClient.TEMPL_NAME) or the Template name.
NOTE: Object lookup is currently an O(N) operation.
instanceOid
- Instance oid, may be null.name
- Object name.objectType
- Object type, may be null.
public static java.util.List<OID> getMatchingObjects(OID instanceOid, java.lang.String name, ObjectType objectType, java.util.Map<Namespace,java.util.Map<java.lang.String,java.io.Serializable>> filters)
instanceOid
is non-null,
the lookup is confined to the instance content. Only works on
loaded instances and loaded objects. If instanceOid
is null, lookup considers all loaded objects.
If objectType
is non-null, both the name and
object type must match.
Object names are set at creation time from the WorldManager object name (WorldManagerClient.TEMPL_NAME) or the Template name.
NOTE: Object lookup is currently an O(N) operation.
instanceOid
- Instance oid, may be null.name
- Object name.objectType
- Object type, may be null.filters
- mapping of property name to required value
public static ObjectManagerClient.ObjectStatus getObjectStatus(OID oid)
ObjectManagerClient.ObjectStatus
for a complete list. If the object is loaded, then
ObjectStatus.namespaces
will be non-null and
ObjectStatus.loadedNamespaces
will contain the currently loaded
namespaces. If the object is not loaded, then ObjectStatus.namespaces
will be null, but ObjectStatus.name
will contain the object
name (if it has one), if the object exists.
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |