/* * server/zone/objects/scene/SceneObject.h generated by engine3 IDL compiler 0.60 */ #ifndef SCENEOBJECT_H_ #define SCENEOBJECT_H_ #include "engine/core/Core.h" #include "engine/core/ManagedReference.h" #include "engine/core/ManagedWeakReference.h" namespace server { namespace zone { namespace managers { namespace objectcontroller { class ObjectController; } // namespace objectcontroller } // namespace managers } // namespace zone } // namespace server using namespace server::zone::managers::objectcontroller; namespace server { namespace zone { class ZoneProcessServer; } // namespace zone } // namespace server using namespace server::zone; namespace server { namespace zone { class ZoneClientSession; } // namespace zone } // namespace server using namespace server::zone; namespace server { namespace zone { class Zone; } // namespace zone } // namespace server using namespace server::zone; namespace server { namespace zone { class ZoneServer; } // namespace zone } // namespace server using namespace server::zone; namespace server { namespace zone { namespace objects { namespace building { class BuildingObject; } // namespace building } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::building; namespace server { namespace zone { namespace packets { namespace object { class ObjectMenuResponse; } // namespace object } // namespace packets } // namespace zone } // namespace server using namespace server::zone::packets::object; namespace server { namespace zone { namespace objects { namespace creature { class CreatureObject; } // namespace creature } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::creature; namespace server { namespace zone { namespace packets { namespace scene { class AttributeListMessage; } // namespace scene } // namespace packets } // namespace zone } // namespace server using namespace server::zone::packets::scene; namespace server { namespace zone { namespace templates { class SharedObjectTemplate; } // namespace templates } // namespace zone } // namespace server using namespace server::zone::templates; namespace server { namespace zone { namespace objects { namespace area { class ActiveArea; } // namespace area } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::area; namespace server { namespace zone { namespace objects { namespace region { class CityRegion; } // namespace region } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::region; namespace server { namespace zone { namespace objects { namespace creature { class CreatureObject; } // namespace creature } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::creature; #include "engine/core/ManagedObject.h" #include "engine/util/Facade.h" #include "server/zone/objects/scene/ObserverEventType.h" #include "server/zone/ZoneReference.h" #include "server/zone/objects/scene/SceneObjectType.h" #include "server/zone/objects/scene/variables/StringId.h" #include "server/zone/objects/scene/TransferErrorCode.h" #include "server/zone/objects/scene/variables/PendingTasksMap.h" #include "server/zone/objects/scene/SessionFacadeType.h" #include "server/zone/objects/scene/ObserverType.h" #include "server/zone/managers/templates/PlanetMapCategory.h" #include "server/zone/managers/templates/TemplateManager.h" #include "server/zone/objects/scene/components/ZoneComponent.h" #include "server/zone/objects/scene/components/ObjectMenuComponent.h" #include "server/zone/objects/scene/components/ContainerComponent.h" #include "server/zone/objects/scene/components/AttributeListComponent.h" #include "server/zone/objects/scene/components/DataObjectComponentReference.h" #include "server/zone/objects/scene/variables/ContainerPermissions.h" #include "server/zone/objects/scene/variables/ContainerObjectsMap.h" #include "engine/log/Logger.h" #include "engine/core/ManagedReference.h" #include "engine/util/u3d/Coordinate.h" #include "engine/util/u3d/QuadTreeEntry.h" #include "system/io/Serializable.h" #include "engine/lua/Lua.h" #include "engine/lua/LuaObject.h" #include "system/util/Vector.h" #include "system/util/VectorMap.h" #include "engine/util/u3d/Quaternion.h" #include "engine/service/proto/BasePacket.h" #include "engine/service/proto/BaseMessage.h" #include "system/util/SortedVector.h" #include "system/lang/StackTrace.h" #include "system/lang/ref/Reference.h" #include "engine/core/Task.h" #include "engine/util/u3d/Vector3.h" #include "engine/util/Observable.h" #include "engine/util/Observer.h" #include "engine/util/u3d/Matrix4.h" #include "system/thread/ReadWriteLock.h" #include "system/thread/Mutex.h" namespace server { namespace zone { namespace objects { namespace scene { class SceneObject : public QuadTreeEntry { public: SceneObject(); void initializePrivateData(); void loadTemplateData(SharedObjectTemplate* templateData); void createComponents(); void createContainerComponent(); void initializeTransientMembers(); void notifyLoadFromDatabase(); void info(const String& msg, bool forced = false); void error(const String& msg); int inRangeObjects(unsigned int gameObjectType, float range); bool isInRange(SceneObject* obj, float range); bool transferObject(SceneObject* object, int containmentType, bool notifyClient = false); bool removeObject(SceneObject* object, SceneObject* destination, bool notifyClient = false); void destroyObjectFromWorld(bool sendSelfDestroy); int canAddObject(SceneObject* object, int containmentType, String& errorDescription); int notifyObjectInsertedToChild(SceneObject* object, SceneObject* child, SceneObject* oldParent); int notifyObjectRemovedFromChild(SceneObject* object, SceneObject* child); void synchronizedUIListen(SceneObject* player, int value); void synchronizedUIStopListen(SceneObject* player, int value); void updateToDatabase(); void updateToDatabaseWithoutChildren(); void updateToDatabaseAllObjects(bool startTask); void destroyPlayerCreatureFromDatabase(bool destroyContainedObjects = false); void destroyObjectFromDatabase(bool destroyContainedObjects = false); int canBeDestroyed(CreatureObject* player); BaseMessage* link(unsigned long long objectID, unsigned int containmentType = 4); void sendTo(SceneObject* player, bool doClose); void sendWithoutParentTo(SceneObject* player); void sendWithoutContainerObjectsTo(SceneObject* player); void sendDestroyTo(SceneObject* player); void sendBaselinesTo(SceneObject* player); void sendContainerObjectsTo(SceneObject* player); void sendSlottedObjectsTo(SceneObject* player); void sendToOwner(bool doClose = true); void sendAttributeListTo(CreatureObject* object); void fillAttributeList(AttributeListMessage* msg, CreatureObject* object); void setCustomObjectName(const UnicodeString& name, bool notifyClient); void fillObjectMenuResponse(ObjectMenuResponse* menuResponse, CreatureObject* player); void openContainerTo(CreatureObject* player); byte checkContainerPermission(CreatureObject* player, unsigned short permission); void closeContainerTo(CreatureObject* player, bool notify = true); void notifyInsertToZone(Zone* zone); void switchZone(const String& newTerrainName, float newPostionX, float newPositionZ, float newPositionY, unsigned long long parentID = 0); void teleport(float newPositionX, float newPositionZ, float newPositionY, unsigned long long parentID = 0); void updateDirection(float fw, float fx, float fy, float fz); void updateDirection(float angleHeadingRadians); void notifyInsert(QuadTreeEntry* entry); void notifyDissapear(QuadTreeEntry* entry); void notifyRemoveFromZone(); void updateZone(bool lightUpdate, bool sendPackets = true); void updateZoneWithParent(SceneObject* newParent, bool lightUpdate, bool sendPackets = true); void broadcastMessage(BasePacket* message, bool sendSelf, bool lockZone = true); void broadcastMessagePrivate(BasePacket* message, SceneObject* selfObject, bool lockZone); void broadcastObject(SceneObject* object, bool sendSelf); void broadcastObjectPrivate(SceneObject* object, SceneObject* selfObject); void broadcastDestroy(SceneObject* object, bool sendSelf); void broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject); void broadcastMessages(Vector* messages, bool sendSelf); void broadcastMessagesPrivate(Vector* messages, SceneObject* selfObject); void sendMessage(BasePacket* msg); int compareTo(SceneObject* obj); void getSlottedObjects(VectorMap >& objects); unsigned long long getParentID(); void addPendingTask(const String& name, Task* task, int miliseconds); void removePendingTask(const String& name); PendingTasksMap* getPendingTasks(); Task* getPendingTask(const String& name); bool containsPendingTask(const String& name); void showFlyText(const String& file, const String& uax, byte red, byte green, byte blue); int getContainedObjectsRecursive(); int getCountableObjectsRecursive(); Facade* getActiveSession(unsigned int type); void addActiveSession(unsigned int type, Facade* session); bool containsActiveSession(unsigned int type); bool dropActiveSession(unsigned int type); int getActiveSessionsCount(); VectorMap >* getObjectActiveSessions(); int handleObjectMenuSelect(CreatureObject* player, byte selectedID); float getDistanceTo(SceneObject* object); float getDistanceTo(Coordinate* coordinate); void updateVehiclePosition(bool sendPackets); int notifyObjectInserted(SceneObject* object); int notifyObjectRemoved(SceneObject* object); void addActiveArea(ActiveArea* area); void dropActiveArea(ActiveArea* area); bool hasActiveArea(ActiveArea* area); bool hasActiveArea(unsigned long long objectid); Vector >* getActiveAreas(); int getActiveAreasSize(); ActiveArea* getActiveRegion(); ManagedWeakReference getCityRegion(); void setCityRegion(CityRegion* region); Zone* getZone(); Zone* getLocalZone(); unsigned long long getObjectID(); Vector3 getCoordinate(float distance, float angleDegrees); Vector3 getWorldCoordinate(float distance, float angleDegrees); float getWorldPositionX(); float getWorldPositionY(); float getWorldPositionZ(); Vector3 getWorldPosition(); float getDirectionX(); float getDirectionZ(); float getDirectionY(); float getDirectionW(); Quaternion* getDirection(); unsigned int getClientObjectCRC(); unsigned int getServerObjectCRC(); bool isWaypointObject(); StringId* getObjectName(); String getObjectNameStringIdFile(); String getObjectNameStringIdName(); String getDetailedDescription(); void setDetailedDescription(const String& detail); int getArrangementDescriptorSize(); String getArrangementDescriptor(int idx); String getSlotDescriptor(int idx); bool hasSlotDescriptor(const String& descr); bool hasArrangementDescriptor(const String& descr); VectorMap >* getSlottedObjects(); SceneObject* getSlottedObject(const String& slot); int getSlotDescriptorSize(); SceneObject* getSlottedObject(int idx); void dropSlottedObject(const String& arrengementDescriptor); void removeSlottedObject(int index); int getContainerObjectsSize(); int getSlottedObjectsSize(); bool hasFullContainerObjects(); unsigned int getContainerVolumeLimit(); SceneObject* getContainerObject(int idx); VectorMap >* getContainerObjects(); bool hasObjectInContainer(unsigned long long objectID); bool hasObjectInSlottedContainer(SceneObject* object); SceneObject* getContainerObject(unsigned long long objectID); void removeAllContainerObjects(); void putInContainer(SceneObject* obj, unsigned long long key); void removeFromContainerObjects(int index); void setContainerVolumeLimit(int lim); void setContainerType(int type); unsigned int getContainerType(); ZoneClientSession* getClient(); unsigned int getGameObjectType(); unsigned int getClientGameObjectType(); unsigned int getContainmentType(); float getDirectionAngle(); float getSpecialDirectionAngle(); void rotate(int degrees); void faceObject(SceneObject* obj); void notifySelfPositionUpdate(); void notifyPositionUpdate(QuadTreeEntry* entry); void notifyCloseContainer(CreatureObject* player); unsigned int getMovementCounter(); ManagedWeakReference getParent(); void setParent(QuadTreeEntry* entry); ZoneServer* getZoneServer(); ManagedWeakReference getRootParent(); ManagedWeakReference getParentRecursively(unsigned int gameObjectType); bool isASubChildOf(SceneObject* object); ReadWriteLock* getContainerLock(); UnicodeString getCustomObjectName(); String getLoggingName(); bool isPlayerCreature(); bool isVendor(); bool isGCWBase(); bool isTurret(); bool isMinefield(); bool isDetector(); bool isSecurityTerminal(); bool isTurretControlTerminal(); ZoneComponent* getZoneComponent(); ObjectMenuComponent* getObjectMenuComponent(); DataObjectComponentReference* getDataObjectComponent(); void setObjectMenuComponent(const String& name); void setContainerComponent(const String& name); bool isNoTrade(); bool isContainerFull(); bool isShuttleInstallation(); bool isPlayerObject(); bool isActiveArea(); bool isRegion(); bool isCreatureObject(); bool isAiAgent(); bool isShipObject(); bool isVehicleObject(); bool isBuildingObject(); bool isCloningBuildingObject(); bool isGarage(); bool isWeaponObject(); bool isWearableObject(); bool isArmorObject(); bool isRobeObject(); bool isLightsaberCrystalObject(); bool isFireworkObject(); bool isPsgArmorObject(); bool isCellObject(); bool isTangibleObject(); bool isResourceContainer(); bool isResourceSpawn(); bool isComponent(); bool isIntangibleObject(); bool isInstrument(); bool isBazaarTerminal(); bool isLiveSample(); bool isInstallationObject(); bool isHarvesterObject(); bool isGeneratorObject(); bool isCityTerminal(); bool isCityVoteTerminal(); bool isFactory(); bool isFactoryCrate(); bool isFishingPoleObject(); bool isDeedObject(); bool isVehicleDeedObject(); bool isBuildingDeed(); bool isSignObject(); bool isInstallationDeed(); bool isCraftingTool(); bool isCraftingStation(); bool isManufactureSchematic(); bool isStructureObject(); bool isAuctionObject(); bool isFishingBait(); bool isTrapObject(); bool isThrownWeaponObject(); bool isSpecialHeavyWeapon(); bool isRepairTool(); bool isCamoKit(); bool isAttachment(); bool isDiceObject(); bool isCreatureHabitat(); bool isCampKit(); bool isCampStructure(); ContainerPermissions* getContainerPermissions(); void setContainerDefaultAllowPermission(unsigned short perm); void clearContainerDefaultAllowPermission(unsigned short perm); void setContainerDefaultDenyPermission(unsigned short perm); void clearContainerDefaultDenyPermission(unsigned short perm); void setContainerInheritPermissionsFromParent(bool val); void setContainerOwnerID(unsigned long long id); void setContainerAllowPermission(const String& group, unsigned short perm); void setContainerDenyPermission(const String& group, unsigned short perm); void setGameObjectType(unsigned int type); void setClientObjectCRC(unsigned int objCRC); void setServerObjectCRC(unsigned int objCRC); void setZoneProcessServer(ZoneProcessServer* srv); ZoneProcessServer* getZoneProcessServer(); void setZone(Zone* zone); void setObjectName(StringId& stringID); void setDirection(float fw, float fx, float fy, float fz); void setDirection(float headingAngleRadians); void setDirection(const Quaternion& dir); void setMovementCounter(unsigned int count); void incrementMovementCounter(); void setContainmentType(unsigned int type); void setLoggingName(const String& name); void setClientObject(bool val); unsigned int getPlanetCRC(); bool isStaticObject(); bool isContainerObject(); bool isTerminal(); bool isGroupObject(); bool isGuildObject(); bool isControlDevice(); bool isMissionTerminal(); bool isMissionObject(); bool isActorObject(); int getPlanetMapCategoryCRC(); int getPlanetMapSubCategoryCRC(); void setPlanetMapCategory(PlanetMapCategory* pmc); void setPlanetMapSubCategory(PlanetMapCategory* pmc); PlanetMapCategory* getPlanetMapCategory(); PlanetMapCategory* getPlanetMapSubCategory(); SortedVector >* getChildObjects(); bool containsChildObject(SceneObject* obj); SharedObjectTemplate* getObjectTemplate(); SortedVector >* getObservers(unsigned int eventType); void createChildObjects(); Matrix4* getTransformForCollisionMatrix(); bool setTransformForCollisionMatrixIfNull(Matrix4* mat); void initializeChildObject(SceneObject* controllerObject); bool isInWater(); String getDisplayedName(); bool doSendToClient(); void setSendToClient(bool val); DistributedObjectServant* _getImplementation(); DistributedObjectServant* _getImplementationForRead(); void _setImplementation(DistributedObjectServant* servant); protected: SceneObject(DummyConstructorParameter* param); virtual ~SceneObject(); friend class SceneObjectHelper; }; } // namespace scene } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::scene; namespace server { namespace zone { namespace objects { namespace scene { class SceneObjectImplementation : public QuadTreeEntryImplementation, public Logger { protected: ManagedReference server; Reference zoneComponent; Reference objectMenuComponent; Reference attributeListComponent; Reference containerComponent; Reference templateObject; bool sendToClient; ZoneReference zone; DataObjectComponentReference dataObjectComponent; Reference transformForCollisionMatrix; unsigned int containerType; unsigned int containerVolumeLimit; ContainerPermissions containerPermissions; unsigned int serverObjectCRC; unsigned int clientObjectCRC; Quaternion direction; unsigned int movementCounter; StringId objectName; Reference pendingTasks; bool staticObject; VectorMap > objectActiveSessions; unsigned int gameObjectType; unsigned int containmentType; int planetMapCategory; int planetMapSubCategory; UnicodeString customName; ManagedWeakReference cityRegion; SortedVector > activeAreas; SortedVector > childObjects; VectorMap > slottedObjects; ReadWriteLock containerLock; Mutex parentLock; ContainerObjectsMap containerObjects; public: SceneObjectImplementation(); SceneObjectImplementation(DummyConstructorParameter* param); void finalize(); void initializePrivateData(); virtual void loadTemplateData(SharedObjectTemplate* templateData); virtual void createComponents(); virtual void createContainerComponent(); void initializeTransientMembers(); void notifyLoadFromDatabase(); void info(const String& msg, bool forced = false); void error(const String& msg); int inRangeObjects(unsigned int gameObjectType, float range); bool isInRange(SceneObject* obj, float range); virtual bool transferObject(SceneObject* object, int containmentType, bool notifyClient = false); virtual bool removeObject(SceneObject* object, SceneObject* destination, bool notifyClient = false); virtual void destroyObjectFromWorld(bool sendSelfDestroy); virtual int canAddObject(SceneObject* object, int containmentType, String& errorDescription); virtual int notifyObjectInsertedToChild(SceneObject* object, SceneObject* child, SceneObject* oldParent); virtual int notifyObjectRemovedFromChild(SceneObject* object, SceneObject* child); virtual void synchronizedUIListen(SceneObject* player, int value); virtual void synchronizedUIStopListen(SceneObject* player, int value); void updateToDatabase(); void updateToDatabaseWithoutChildren(); void updateToDatabaseAllObjects(bool startTask); virtual void destroyPlayerCreatureFromDatabase(bool destroyContainedObjects = false); virtual void destroyObjectFromDatabase(bool destroyContainedObjects = false); virtual int canBeDestroyed(CreatureObject* player); protected: void close(SceneObject* client); void link(SceneObject* client, unsigned int containmentType = 4); public: BaseMessage* link(unsigned long long objectID, unsigned int containmentType = 4); virtual void sendTo(SceneObject* player, bool doClose); virtual void sendWithoutParentTo(SceneObject* player); virtual void sendWithoutContainerObjectsTo(SceneObject* player); virtual void sendDestroyTo(SceneObject* player); virtual void sendBaselinesTo(SceneObject* player); virtual void sendContainerObjectsTo(SceneObject* player); virtual void sendSlottedObjectsTo(SceneObject* player); virtual void sendToOwner(bool doClose = true); virtual void sendAttributeListTo(CreatureObject* object); virtual void fillAttributeList(AttributeListMessage* msg, CreatureObject* object); virtual void setCustomObjectName(const UnicodeString& name, bool notifyClient); virtual void fillObjectMenuResponse(ObjectMenuResponse* menuResponse, CreatureObject* player); virtual void openContainerTo(CreatureObject* player); virtual byte checkContainerPermission(CreatureObject* player, unsigned short permission); virtual void closeContainerTo(CreatureObject* player, bool notify = true); virtual void notifyInsertToZone(Zone* zone); virtual void switchZone(const String& newTerrainName, float newPostionX, float newPositionZ, float newPositionY, unsigned long long parentID = 0); virtual void teleport(float newPositionX, float newPositionZ, float newPositionY, unsigned long long parentID = 0); void updateDirection(float fw, float fx, float fy, float fz); void updateDirection(float angleHeadingRadians); void notifyInsert(QuadTreeEntry* entry); void notifyDissapear(QuadTreeEntry* entry); virtual void notifyRemoveFromZone(); virtual void updateZone(bool lightUpdate, bool sendPackets = true); virtual void updateZoneWithParent(SceneObject* newParent, bool lightUpdate, bool sendPackets = true); void broadcastMessage(BasePacket* message, bool sendSelf, bool lockZone = true); void broadcastMessagePrivate(BasePacket* message, SceneObject* selfObject, bool lockZone); void broadcastObject(SceneObject* object, bool sendSelf); void broadcastObjectPrivate(SceneObject* object, SceneObject* selfObject); void broadcastDestroy(SceneObject* object, bool sendSelf); void broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject); void broadcastMessages(Vector* messages, bool sendSelf); void broadcastMessagesPrivate(Vector* messages, SceneObject* selfObject); virtual void sendMessage(BasePacket* msg); int compareTo(SceneObject* obj); void getSlottedObjects(VectorMap >& objects); unsigned long long getParentID(); void addPendingTask(const String& name, Task* task, int miliseconds); void removePendingTask(const String& name); PendingTasksMap* getPendingTasks(); Task* getPendingTask(const String& name); bool containsPendingTask(const String& name); void showFlyText(const String& file, const String& uax, byte red, byte green, byte blue); int getContainedObjectsRecursive(); virtual int getCountableObjectsRecursive(); Facade* getActiveSession(unsigned int type); void addActiveSession(unsigned int type, Facade* session); bool containsActiveSession(unsigned int type); bool dropActiveSession(unsigned int type); int getActiveSessionsCount(); VectorMap >* getObjectActiveSessions(); virtual int handleObjectMenuSelect(CreatureObject* player, byte selectedID); float getDistanceTo(SceneObject* object); float getDistanceTo(Coordinate* coordinate); void updateVehiclePosition(bool sendPackets); virtual int notifyObjectInserted(SceneObject* object); virtual int notifyObjectRemoved(SceneObject* object); void addActiveArea(ActiveArea* area); void dropActiveArea(ActiveArea* area); bool hasActiveArea(ActiveArea* area); bool hasActiveArea(unsigned long long objectid); Vector >* getActiveAreas(); int getActiveAreasSize(); ActiveArea* getActiveRegion(); virtual ManagedWeakReference getCityRegion(); void setCityRegion(CityRegion* region); Zone* getZone(); Zone* getLocalZone(); unsigned long long getObjectID(); Vector3 getCoordinate(float distance, float angleDegrees); Vector3 getWorldCoordinate(float distance, float angleDegrees); float getWorldPositionX(); float getWorldPositionY(); float getWorldPositionZ(); Vector3 getWorldPosition(); float getDirectionX(); float getDirectionZ(); float getDirectionY(); float getDirectionW(); Quaternion* getDirection(); unsigned int getClientObjectCRC(); unsigned int getServerObjectCRC(); bool isWaypointObject(); StringId* getObjectName(); String getObjectNameStringIdFile(); String getObjectNameStringIdName(); virtual String getDetailedDescription(); virtual void setDetailedDescription(const String& detail); int getArrangementDescriptorSize(); String getArrangementDescriptor(int idx); String getSlotDescriptor(int idx); bool hasSlotDescriptor(const String& descr); bool hasArrangementDescriptor(const String& descr); VectorMap >* getSlottedObjects(); SceneObject* getSlottedObject(const String& slot); int getSlotDescriptorSize(); SceneObject* getSlottedObject(int idx); void dropSlottedObject(const String& arrengementDescriptor); void removeSlottedObject(int index); int getContainerObjectsSize(); int getSlottedObjectsSize(); bool hasFullContainerObjects(); unsigned int getContainerVolumeLimit(); SceneObject* getContainerObject(int idx); VectorMap >* getContainerObjects(); bool hasObjectInContainer(unsigned long long objectID); bool hasObjectInSlottedContainer(SceneObject* object); SceneObject* getContainerObject(unsigned long long objectID); void removeAllContainerObjects(); void putInContainer(SceneObject* obj, unsigned long long key); void removeFromContainerObjects(int index); void setContainerVolumeLimit(int lim); void setContainerType(int type); unsigned int getContainerType(); virtual ZoneClientSession* getClient(); unsigned int getGameObjectType(); unsigned int getClientGameObjectType(); unsigned int getContainmentType(); float getDirectionAngle(); float getSpecialDirectionAngle(); void rotate(int degrees); void faceObject(SceneObject* obj); virtual void notifySelfPositionUpdate(); void notifyPositionUpdate(QuadTreeEntry* entry); virtual void notifyCloseContainer(CreatureObject* player); unsigned int getMovementCounter(); ManagedWeakReference getParent(); void setParent(QuadTreeEntry* entry); ZoneServer* getZoneServer(); ManagedWeakReference getRootParent(); ManagedWeakReference getParentRecursively(unsigned int gameObjectType); bool isASubChildOf(SceneObject* object); ReadWriteLock* getContainerLock(); UnicodeString getCustomObjectName(); String getLoggingName(); virtual bool isPlayerCreature(); bool isVendor(); bool isGCWBase(); bool isTurret(); bool isMinefield(); bool isDetector(); bool isSecurityTerminal(); bool isTurretControlTerminal(); ZoneComponent* getZoneComponent(); ObjectMenuComponent* getObjectMenuComponent(); DataObjectComponentReference* getDataObjectComponent(); void setObjectMenuComponent(const String& name); void setContainerComponent(const String& name); bool isNoTrade(); bool isContainerFull(); bool isShuttleInstallation(); bool isPlayerObject(); virtual bool isActiveArea(); virtual bool isRegion(); virtual bool isCreatureObject(); virtual bool isAiAgent(); virtual bool isShipObject(); virtual bool isVehicleObject(); virtual bool isBuildingObject(); virtual bool isCloningBuildingObject(); bool isGarage(); virtual bool isWeaponObject(); virtual bool isWearableObject(); virtual bool isArmorObject(); virtual bool isRobeObject(); virtual bool isLightsaberCrystalObject(); virtual bool isFireworkObject(); bool isPsgArmorObject(); virtual bool isCellObject(); virtual bool isTangibleObject(); virtual bool isResourceContainer(); virtual bool isResourceSpawn(); virtual bool isComponent(); virtual bool isIntangibleObject(); bool isInstrument(); bool isBazaarTerminal(); bool isLiveSample(); virtual bool isInstallationObject(); virtual bool isHarvesterObject(); virtual bool isGeneratorObject(); virtual bool isCityTerminal(); virtual bool isCityVoteTerminal(); virtual bool isFactory(); virtual bool isFactoryCrate(); bool isFishingPoleObject(); virtual bool isDeedObject(); virtual bool isVehicleDeedObject(); virtual bool isBuildingDeed(); virtual bool isSignObject(); virtual bool isInstallationDeed(); virtual bool isCraftingTool(); virtual bool isCraftingStation(); virtual bool isManufactureSchematic(); virtual bool isStructureObject(); virtual bool isAuctionObject(); bool isFishingBait(); bool isTrapObject(); bool isThrownWeaponObject(); bool isSpecialHeavyWeapon(); bool isRepairTool(); bool isCamoKit(); virtual bool isAttachment(); bool isDiceObject(); bool isCreatureHabitat(); bool isCampKit(); virtual bool isCampStructure(); ContainerPermissions* getContainerPermissions(); void setContainerDefaultAllowPermission(unsigned short perm); void clearContainerDefaultAllowPermission(unsigned short perm); void setContainerDefaultDenyPermission(unsigned short perm); void clearContainerDefaultDenyPermission(unsigned short perm); void setContainerInheritPermissionsFromParent(bool val); void setContainerOwnerID(unsigned long long id); void setContainerAllowPermission(const String& group, unsigned short perm); void setContainerDenyPermission(const String& group, unsigned short perm); void setGameObjectType(unsigned int type); void setClientObjectCRC(unsigned int objCRC); void setServerObjectCRC(unsigned int objCRC); void setZoneProcessServer(ZoneProcessServer* srv); ZoneProcessServer* getZoneProcessServer(); void setZone(Zone* zone); void setObjectName(StringId& stringID); void setDirection(float fw, float fx, float fy, float fz); void setDirection(float headingAngleRadians); void setDirection(const Quaternion& dir); void setMovementCounter(unsigned int count); void incrementMovementCounter(); void setContainmentType(unsigned int type); void setLoggingName(const String& name); void setClientObject(bool val); virtual unsigned int getPlanetCRC(); bool isStaticObject(); virtual bool isContainerObject(); virtual bool isTerminal(); virtual bool isGroupObject(); virtual bool isGuildObject(); virtual bool isControlDevice(); virtual bool isMissionTerminal(); virtual bool isMissionObject(); virtual bool isActorObject(); int getPlanetMapCategoryCRC(); int getPlanetMapSubCategoryCRC(); void setPlanetMapCategory(PlanetMapCategory* pmc); void setPlanetMapSubCategory(PlanetMapCategory* pmc); PlanetMapCategory* getPlanetMapCategory(); PlanetMapCategory* getPlanetMapSubCategory(); SortedVector >* getChildObjects(); bool containsChildObject(SceneObject* obj); SharedObjectTemplate* getObjectTemplate(); SortedVector >* getObservers(unsigned int eventType); virtual void createChildObjects(); Matrix4* getTransformForCollisionMatrix(); bool setTransformForCollisionMatrixIfNull(Matrix4* mat); virtual void initializeChildObject(SceneObject* controllerObject); bool isInWater(); String getDisplayedName(); bool doSendToClient(); void setSendToClient(bool val); WeakReference _this; operator const SceneObject*(); DistributedObjectStub* _getStub(); virtual void readObject(ObjectInputStream* stream); virtual void writeObject(ObjectOutputStream* stream); protected: virtual ~SceneObjectImplementation(); void _initializeImplementation(); void _setStub(DistributedObjectStub* stub); void lock(bool doLock = true); void lock(ManagedObject* obj); void rlock(bool doLock = true); void wlock(bool doLock = true); void wlock(ManagedObject* obj); void unlock(bool doLock = true); void runlock(bool doLock = true); void _serializationHelperMethod(); bool readObjectMember(ObjectInputStream* stream, const uint32& nameHashCode); int writeObjectMembers(ObjectOutputStream* stream); friend class SceneObject; }; class SceneObjectAdapter : public QuadTreeEntryAdapter { public: SceneObjectAdapter(SceneObject* impl); void invokeMethod(sys::uint32 methid, DistributedMethod* method); void finalize(); void initializePrivateData(); void createComponents(); void createContainerComponent(); void initializeTransientMembers(); void notifyLoadFromDatabase(); void info(const String& msg, bool forced); void error(const String& msg); int inRangeObjects(unsigned int gameObjectType, float range); bool isInRange(SceneObject* obj, float range); bool transferObject(SceneObject* object, int containmentType, bool notifyClient); bool removeObject(SceneObject* object, SceneObject* destination, bool notifyClient); void destroyObjectFromWorld(bool sendSelfDestroy); int canAddObject(SceneObject* object, int containmentType, String& errorDescription); int notifyObjectInsertedToChild(SceneObject* object, SceneObject* child, SceneObject* oldParent); int notifyObjectRemovedFromChild(SceneObject* object, SceneObject* child); void synchronizedUIListen(SceneObject* player, int value); void synchronizedUIStopListen(SceneObject* player, int value); void updateToDatabase(); void updateToDatabaseWithoutChildren(); void updateToDatabaseAllObjects(bool startTask); void destroyPlayerCreatureFromDatabase(bool destroyContainedObjects); void destroyObjectFromDatabase(bool destroyContainedObjects); int canBeDestroyed(CreatureObject* player); BaseMessage* link(unsigned long long objectID, unsigned int containmentType); void sendTo(SceneObject* player, bool doClose); void sendWithoutParentTo(SceneObject* player); void sendWithoutContainerObjectsTo(SceneObject* player); void sendDestroyTo(SceneObject* player); void sendBaselinesTo(SceneObject* player); void sendContainerObjectsTo(SceneObject* player); void sendSlottedObjectsTo(SceneObject* player); void sendToOwner(bool doClose); void sendAttributeListTo(CreatureObject* object); void setCustomObjectName(const UnicodeString& name, bool notifyClient); void openContainerTo(CreatureObject* player); void closeContainerTo(CreatureObject* player, bool notify); void notifyInsertToZone(Zone* zone); void switchZone(const String& newTerrainName, float newPostionX, float newPositionZ, float newPositionY, unsigned long long parentID); void teleport(float newPositionX, float newPositionZ, float newPositionY, unsigned long long parentID); void updateDirection(float fw, float fx, float fy, float fz); void updateDirection(float angleHeadingRadians); void notifyRemoveFromZone(); void updateZone(bool lightUpdate, bool sendPackets); void updateZoneWithParent(SceneObject* newParent, bool lightUpdate, bool sendPackets); void broadcastMessage(BasePacket* message, bool sendSelf, bool lockZone); void broadcastMessagePrivate(BasePacket* message, SceneObject* selfObject, bool lockZone); void broadcastObject(SceneObject* object, bool sendSelf); void broadcastObjectPrivate(SceneObject* object, SceneObject* selfObject); void broadcastDestroy(SceneObject* object, bool sendSelf); void broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject); void sendMessage(BasePacket* msg); int compareTo(SceneObject* obj); unsigned long long getParentID(); bool containsPendingTask(const String& name); void showFlyText(const String& file, const String& uax, byte red, byte green, byte blue); int getContainedObjectsRecursive(); int getCountableObjectsRecursive(); Facade* getActiveSession(unsigned int type); void addActiveSession(unsigned int type, Facade* session); bool containsActiveSession(unsigned int type); bool dropActiveSession(unsigned int type); int getActiveSessionsCount(); int handleObjectMenuSelect(CreatureObject* player, byte selectedID); float getDistanceTo(SceneObject* object); void updateVehiclePosition(bool sendPackets); int notifyObjectInserted(SceneObject* object); int notifyObjectRemoved(SceneObject* object); void addActiveArea(ActiveArea* area); void dropActiveArea(ActiveArea* area); bool hasActiveArea(ActiveArea* area); bool hasActiveArea(unsigned long long objectid); int getActiveAreasSize(); ActiveArea* getActiveRegion(); Zone* getZone(); Zone* getLocalZone(); unsigned long long getObjectID(); float getWorldPositionX(); float getWorldPositionY(); float getWorldPositionZ(); float getDirectionX(); float getDirectionZ(); float getDirectionY(); float getDirectionW(); unsigned int getClientObjectCRC(); unsigned int getServerObjectCRC(); bool isWaypointObject(); String getObjectNameStringIdFile(); String getObjectNameStringIdName(); void setDetailedDescription(const String& detail); int getArrangementDescriptorSize(); String getArrangementDescriptor(int idx); String getSlotDescriptor(int idx); bool hasSlotDescriptor(const String& descr); bool hasArrangementDescriptor(const String& descr); SceneObject* getSlottedObject(const String& slot); int getSlotDescriptorSize(); SceneObject* getSlottedObject(int idx); void dropSlottedObject(const String& arrengementDescriptor); void removeSlottedObject(int index); int getContainerObjectsSize(); int getSlottedObjectsSize(); bool hasFullContainerObjects(); unsigned int getContainerVolumeLimit(); SceneObject* getContainerObject(int idx); bool hasObjectInContainer(unsigned long long objectID); bool hasObjectInSlottedContainer(SceneObject* object); SceneObject* getContainerObject(unsigned long long objectID); void removeAllContainerObjects(); void putInContainer(SceneObject* obj, unsigned long long key); void removeFromContainerObjects(int index); void setContainerVolumeLimit(int lim); void setContainerType(int type); unsigned int getContainerType(); ZoneClientSession* getClient(); unsigned int getGameObjectType(); unsigned int getClientGameObjectType(); unsigned int getContainmentType(); float getDirectionAngle(); float getSpecialDirectionAngle(); void rotate(int degrees); void faceObject(SceneObject* obj); void notifySelfPositionUpdate(); void notifyPositionUpdate(QuadTreeEntry* entry); void notifyCloseContainer(CreatureObject* player); unsigned int getMovementCounter(); ManagedWeakReference getParent(); void setParent(QuadTreeEntry* entry); ZoneServer* getZoneServer(); ManagedWeakReference getRootParent(); ManagedWeakReference getParentRecursively(unsigned int gameObjectType); bool isASubChildOf(SceneObject* object); UnicodeString getCustomObjectName(); String getLoggingName(); bool isPlayerCreature(); bool isNoTrade(); bool isContainerFull(); bool isShuttleInstallation(); bool isPlayerObject(); bool isActiveArea(); bool isRegion(); bool isCreatureObject(); bool isAiAgent(); bool isShipObject(); bool isVehicleObject(); bool isBuildingObject(); bool isCloningBuildingObject(); bool isGarage(); bool isWeaponObject(); bool isWearableObject(); bool isArmorObject(); bool isRobeObject(); bool isLightsaberCrystalObject(); bool isFireworkObject(); bool isPsgArmorObject(); bool isCellObject(); bool isTangibleObject(); bool isResourceContainer(); bool isResourceSpawn(); bool isComponent(); bool isIntangibleObject(); bool isInstrument(); bool isBazaarTerminal(); bool isLiveSample(); bool isInstallationObject(); bool isHarvesterObject(); bool isGeneratorObject(); bool isCityTerminal(); bool isCityVoteTerminal(); bool isFactory(); bool isFactoryCrate(); bool isFishingPoleObject(); bool isDeedObject(); bool isVehicleDeedObject(); bool isBuildingDeed(); bool isSignObject(); bool isInstallationDeed(); bool isCraftingTool(); bool isCraftingStation(); bool isManufactureSchematic(); bool isStructureObject(); bool isAuctionObject(); bool isFishingBait(); bool isTrapObject(); bool isThrownWeaponObject(); bool isSpecialHeavyWeapon(); bool isRepairTool(); bool isCamoKit(); bool isAttachment(); bool isDiceObject(); bool isCreatureHabitat(); bool isCampKit(); bool isCampStructure(); void setContainerDefaultAllowPermission(unsigned short perm); void clearContainerDefaultAllowPermission(unsigned short perm); void setContainerDefaultDenyPermission(unsigned short perm); void clearContainerDefaultDenyPermission(unsigned short perm); void setContainerInheritPermissionsFromParent(bool val); void setContainerOwnerID(unsigned long long id); void setContainerAllowPermission(const String& group, unsigned short perm); void setContainerDenyPermission(const String& group, unsigned short perm); void setGameObjectType(unsigned int type); void setClientObjectCRC(unsigned int objCRC); void setServerObjectCRC(unsigned int objCRC); void setZone(Zone* zone); void setDirection(float fw, float fx, float fy, float fz); void setDirection(float headingAngleRadians); void setMovementCounter(unsigned int count); void incrementMovementCounter(); void setContainmentType(unsigned int type); void setLoggingName(const String& name); void setClientObject(bool val); unsigned int getPlanetCRC(); bool isStaticObject(); bool isContainerObject(); bool isTerminal(); bool isGroupObject(); bool isGuildObject(); bool isControlDevice(); bool isMissionTerminal(); bool isMissionObject(); bool isActorObject(); int getPlanetMapCategoryCRC(); int getPlanetMapSubCategoryCRC(); bool containsChildObject(SceneObject* obj); void createChildObjects(); void initializeChildObject(SceneObject* controllerObject); bool isInWater(); String getDisplayedName(); bool doSendToClient(); void setSendToClient(bool val); }; class SceneObjectHelper : public DistributedObjectClassHelper, public Singleton { static SceneObjectHelper* staticInitializer; public: SceneObjectHelper(); void finalizeHelper(); DistributedObject* instantiateObject(); DistributedObjectServant* instantiateServant(); DistributedObjectAdapter* createAdapter(DistributedObjectStub* obj); friend class Singleton; }; } // namespace scene } // namespace objects } // namespace zone } // namespace server using namespace server::zone::objects::scene; #endif /*SCENEOBJECT_H_*/