Atavism Version 2018.1AGIS API

atavism.server.objects
Class AOObject

java.lang.Object
  extended by atavism.server.objects.NamedPropertyClass
      extended by atavism.server.objects.Entity
          extended by atavism.server.objects.AOObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AgisObject, Light, RoadSegment

public class AOObject
extends Entity

AOObject is a properties object, it does not contain 'logic' when you set a property, there are no callbacks which will then notify other players

See Also:
Serialized Form

Nested Class Summary
static class AOObject.StateMap
           
 
Field Summary
static java.lang.String aoidKey
          this is the master account id for this user (unique to each register atavism user)
static java.lang.String dcKey
           
static java.lang.String perceiverKey
           
static java.lang.String stateMapKey
           
static java.util.concurrent.locks.Lock transferLock
          use this global object to synchronize all object transfers. if you drop and object, pick up an object, destory an object, trade an object, etc, you must grab this lock to make sure there is no race condition. eg, someone sees that the obj is "free" on the ground THEN picks it up. there is a race condition there
static java.lang.String wnodeKey
           
 
Fields inherited from class atavism.server.objects.Entity
log, staticLock, subObjectNamespacesInt, transientPropertyKeys, type
 
Fields inherited from class atavism.server.objects.NamedPropertyClass
lock, name
 
Constructor Summary
AOObject()
           
AOObject(OID oid)
           
AOObject(java.lang.String name)
           
 
Method Summary
 OID atavismID()
           
 void atavismID(OID id)
          sets the atavismID for this user.
 BasicWorldNode baseWorldNode()
          returns a newly-created BasicWorldNode, with loc/dir/orient from the object's world node
 DisplayContext displayContext()
           
 void displayContext(DisplayContext dc)
           
static java.util.Collection<AOObject> getAllObjects()
          returns all entities in this server
 Point getCurrentLoc()
           
 AOVector getDirection()
           
 InterpolatedWorldNode.InterpolatedDirLocOrientTime getDirLocOrientTime()
          Returns all the values from the interpolated world node atomically
 Point getLoc()
          helper function - returns the location of this object by calling into the world node
 OID getMasterOid()
           
static AOObjectCreateHook getObjCreateHook()
           
static AOObject getObject(OID oid)
           
 Quaternion getOrientation()
           
 ObjState getState(java.lang.String s)
           
 boolean isItem()
           
 boolean isLight()
           
 boolean isMob()
           
 boolean isStructure()
           
 boolean isUser()
           
 MobilePerceiver<WMWorldNode> perceiver()
           
 void perceiver(MobilePerceiver<WMWorldNode> p)
           
 PermissionCallback permissionCallback()
           
 void permissionCallback(PermissionCallback cb)
          sets the permissioncallback, which gets called whenever something is trying to 'access' this object either by picking it up, dropping it, trading, etc.
static java.lang.Object readObject(java.io.ObjectInput in)
           
static void registerObjCreateHook(AOObjectCreateHook hook)
           
 AOVector scale()
           
 void scale(AOVector scale)
          sets the scale of this object (how much bigger to make it)
 void scale(float scale)
           
 void sendEvent(Event event)
           
 ObjState setState(java.lang.String state, ObjState obj)
          sets a state for the object. all states set here are transmitted to the client. examples would be when the player is dead.
 java.lang.String toString()
          Returns the string describing this entity, useful for logging.
 WorldNode worldNode()
          returns the object's world node
 void worldNode(WorldNode worldNode)
          sets which world node is associated with this object.
static void writeObject(java.io.ObjectOutput out, java.lang.Object obj)
          helper method which can handle writing a null object to the output stream. it first writes whether the obj is null, followed by the obj if it isnt null.. otherwise doesnt write the obj
static void writeString(java.io.ObjectOutput out, java.lang.String string)
          helper method that writes a null string as an empty string
 
Methods inherited from class atavism.server.objects.Entity
addSubObjectNamespace, equals, equals, getLock, getNamespace, getOid, getPersistenceFlag, getProperty, getSubObjectNamespaces, getSubObjectNamespacesInt, getTransientDataRef, getType, hashCode, hasSubObjectNamespace, isDeleted, registerTransientPropertyKey, removeProperty, removeSubObjectNamespace, setDeleted, setNamespace, setOid, setPersistenceFlag, setProperty, setSubObjectNamespaces, setSubObjectNamespacesInt, setType, toBytes, unregisterTransientPropertyKey
 
Methods inherited from class atavism.server.objects.NamedPropertyClass
getBooleanProperty, getIntProperty, getName, getPropertyMap, getPropertyMapRef, getStringProperty, lock, modifyIntProperty, setName, setPropertyMap, setupTransient, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

stateMapKey

public static final java.lang.String stateMapKey
See Also:
Constant Field Values

wnodeKey

public static final java.lang.String wnodeKey
See Also:
Constant Field Values

perceiverKey

public static final java.lang.String perceiverKey
See Also:
Constant Field Values

aoidKey

public static final java.lang.String aoidKey
this is the master account id for this user (unique to each register atavism user)

See Also:
Constant Field Values

dcKey

public static final java.lang.String dcKey
See Also:
Constant Field Values

transferLock

public static java.util.concurrent.locks.Lock transferLock
use this global object to synchronize all object transfers. if you drop and object, pick up an object, destory an object, trade an object, etc, you must grab this lock to make sure there is no race condition. eg, someone sees that the obj is "free" on the ground THEN picks it up. there is a race condition there

Constructor Detail

AOObject

public AOObject()

AOObject

public AOObject(java.lang.String name)

AOObject

public AOObject(OID oid)
Method Detail

getMasterOid

public OID getMasterOid()

isMob

public boolean isMob()

isItem

public boolean isItem()

isLight

public boolean isLight()

isUser

public boolean isUser()

isStructure

public boolean isStructure()

toString

public java.lang.String toString()
Description copied from class: Entity
Returns the string describing this entity, useful for logging.

Overrides:
toString in class Entity
Returns:
string describing entity

setState

public ObjState setState(java.lang.String state,
                         ObjState obj)
sets a state for the object. all states set here are transmitted to the client. examples would be when the player is dead.


getState

public ObjState getState(java.lang.String s)

sendEvent

public void sendEvent(Event event)

worldNode

public WorldNode worldNode()
returns the object's world node


worldNode

public void worldNode(WorldNode worldNode)
sets which world node is associated with this object. this does remove it from the previous world node, nor add it to the worldnode passed it


baseWorldNode

public BasicWorldNode baseWorldNode()
returns a newly-created BasicWorldNode, with loc/dir/orient from the object's world node


getLoc

public Point getLoc()
helper function - returns the location of this object by calling into the world node


getCurrentLoc

public Point getCurrentLoc()

getOrientation

public Quaternion getOrientation()

getDirection

public AOVector getDirection()

getDirLocOrientTime

public InterpolatedWorldNode.InterpolatedDirLocOrientTime getDirLocOrientTime()
Returns all the values from the interpolated world node atomically


perceiver

public MobilePerceiver<WMWorldNode> perceiver()

perceiver

public void perceiver(MobilePerceiver<WMWorldNode> p)

atavismID

public OID atavismID()

atavismID

public void atavismID(OID id)
sets the atavismID for this user.


displayContext

public void displayContext(DisplayContext dc)

displayContext

public DisplayContext displayContext()

scale

public void scale(float scale)

scale

public void scale(AOVector scale)
sets the scale of this object (how much bigger to make it)


scale

public AOVector scale()

registerObjCreateHook

public static void registerObjCreateHook(AOObjectCreateHook hook)

getObjCreateHook

public static AOObjectCreateHook getObjCreateHook()

permissionCallback

public void permissionCallback(PermissionCallback cb)
sets the permissioncallback, which gets called whenever something is trying to 'access' this object either by picking it up, dropping it, trading, etc.

See Also:
PermissionCallback

permissionCallback

public PermissionCallback permissionCallback()

writeObject

public static void writeObject(java.io.ObjectOutput out,
                               java.lang.Object obj)
                        throws java.io.IOException
helper method which can handle writing a null object to the output stream. it first writes whether the obj is null, followed by the obj if it isnt null.. otherwise doesnt write the obj

Throws:
java.io.IOException

readObject

public static java.lang.Object readObject(java.io.ObjectInput in)
                                   throws java.io.IOException,
                                          java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeString

public static void writeString(java.io.ObjectOutput out,
                               java.lang.String string)
                        throws java.io.IOException
helper method that writes a null string as an empty string

Throws:
java.io.IOException

getAllObjects

public static java.util.Collection<AOObject> getAllObjects()
returns all entities in this server


getObject

public static AOObject getObject(OID oid)


Copyright © 2018 Dragonsan Studios Sp. z o.o.