Instructions Jenkins Doxygen

[Fixed] broadcasting to mounted players 22/1322/4
authorIvojedi <ivojedi@swgemu.com>
Thu, 9 Jan 2014 23:55:00 +0000 (15:55 -0800)
committerIvojedi <ivojedi@swgemu.com>
Fri, 10 Jan 2014 00:36:16 +0000 (16:36 -0800)
[Fixed] server tracking of mount position
[Fixed] teleporting while mounted
[Fixed] speed hack checks while mounted

Change-Id: I4803ee7e3db9109401dca3b74a9e970f0fe57c1b

MMOCoreORB/src/server/zone/ZoneImplementation.cpp
MMOCoreORB/src/server/zone/managers/player/PlayerManagerImplementation.cpp
MMOCoreORB/src/server/zone/objects/building/BuildingObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/player/components/PlayerZoneComponent.cpp
MMOCoreORB/src/server/zone/objects/scene/SceneObjectImplementation.cpp
MMOCoreORB/src/server/zone/objects/scene/components/ZoneComponent.cpp

index d16171e..4869701 100644 (file)
@@ -239,7 +239,7 @@ int ZoneImplementation::getInRangeObjects(float x, float y, float range, SortedV
                                        }
                                        }
                                }
-                       } else if (sceneObject != NULL && sceneObject->isVehicleObject()) {
+                       } else if (sceneObject != NULL && (sceneObject->isVehicleObject() || sceneObject->isMount())) {
                                ManagedReference<SceneObject*> rider = sceneObject->getSlottedObject("rider");
 
                                if (rider != NULL)
index a9f436f..bded218 100644 (file)
@@ -2307,6 +2307,11 @@ int PlayerManagerImplementation::checkSpeedHackFirstTest(CreatureObject* player,
 
                allowedSpeedMod = vehicle->getSpeedMultiplierMod();
                allowedSpeedBase = vehicle->getRunSpeed();
+       } else if (parent != NULL && parent->isMount()){
+               Creature* mount = cast<Creature*>( parent.get());
+
+               allowedSpeedMod = mount->getSpeedMultiplierMod();
+               allowedSpeedBase = mount->getRunSpeed();
        }
 
        float maxAllowedSpeed = allowedSpeedMod * allowedSpeedBase;
index effa265..1fcc968 100644 (file)
@@ -621,7 +621,7 @@ void BuildingObjectImplementation::broadcastCellPermissions() {
 
                if (obj->isPlayerCreature())
                        updateCellPermissionsTo(cast<CreatureObject*>(obj.get()));
-               else if (obj->isVehicleObject()) {
+               else if (obj->isVehicleObject() || obj->isMount()) {
                        SceneObject* rider = obj->getSlottedObject("rider");
 
                        if (rider != NULL) {
@@ -650,7 +650,7 @@ void BuildingObjectImplementation::broadcastCellPermissions(uint64 objectid) {
                if (obj->isPlayerCreature()) {
                        CreatureObject* creo = obj.castTo<CreatureObject*>();
                        cell->sendPermissionsTo(creo, isAllowedEntry(creo));
-               } else if (obj->isVehicleObject()) {
+               } else if (obj->isVehicleObject() || obj->isMount()) {
                        SceneObject* rider = obj->getSlottedObject("rider");
 
                        if (rider != NULL) {
index e8ba48e..109d319 100644 (file)
@@ -83,7 +83,7 @@ void PlayerZoneComponent::switchZone(SceneObject* sceneObject, const String& new
 
                ManagedReference<SceneObject*> par = sceneObject->getParent();
 
-               if (par != NULL && par->isVehicleObject()) {
+               if (par != NULL && (par->isVehicleObject() || par->isMount())) {
                        player->executeObjectControllerAction(String("dismount").hashCode());
                }
 
@@ -109,7 +109,7 @@ void PlayerZoneComponent::teleport(SceneObject* sceneObject, float newPositionX,
        if (player != NULL && sceneObject->getParent() != NULL && parentID != 0) {
                ManagedReference<SceneObject*> par = sceneObject->getParent();
 
-               if (par->isVehicleObject()) {
+               if (par->isVehicleObject() || par->isMount()) {
                        player->executeObjectControllerAction(String("dismount").hashCode());
                }
        }
index 397d193..8ac6e45 100644 (file)
@@ -677,7 +677,7 @@ void SceneObjectImplementation::broadcastObjectPrivate(SceneObject* object, Scen
 
                ManagedReference<ZoneClientSession*> client = scno->getClient();
 
-               if (scno->isVehicleObject() || client != NULL) {
+               if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
                        object->sendTo(scno, true);
                }
        }
@@ -751,7 +751,7 @@ void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, Sce
 
                ManagedReference<ZoneClientSession*> client = scno->getClient();
 
-               if (scno->isVehicleObject() || client != NULL) {
+               if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
                        object->sendDestroyTo(scno);
                }
        }
@@ -866,7 +866,7 @@ void SceneObjectImplementation::broadcastMessagePrivate(BasePacket* message, Sce
 
                ManagedReference<ZoneClientSession*> client = scno->getClient();
 
-               if ((dynamic_cast<VehicleObject*>(scno) != NULL) || client != NULL)
+               if ((dynamic_cast<VehicleObject*>(scno) != NULL) || client != NULL || scno->isMount())
                        scno->sendMessage(message->clone());
        }
 
@@ -958,7 +958,7 @@ void SceneObjectImplementation::broadcastMessagesPrivate(Vector<BasePacket*>* me
 
                ManagedReference<ZoneClientSession*> client = scno->getClient();
 
-               if (scno->isVehicleObject() || client != NULL) {
+               if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
                        for (int j = 0; j < messages->size(); ++j) {
                                BasePacket* msg = messages->get(j);
                                scno->sendMessage(msg->clone());
@@ -1032,7 +1032,7 @@ void SceneObjectImplementation::sendMessage(BasePacket* msg) {
 void SceneObjectImplementation::updateVehiclePosition(bool sendPackets) {
        ManagedReference<SceneObject*> parent = getParent();
 
-       if (parent == NULL || !parent->isVehicleObject())
+       if (parent == NULL || (!parent->isVehicleObject() && !parent->isMount()))
                return;
 
        Locker locker(parent);
index 2b63313..27311cc 100644 (file)
@@ -190,7 +190,7 @@ void ZoneComponent::updateZone(SceneObject* sceneObject, bool lightUpdate, bool
        if (zone == NULL)
                zone = parent->getRootParent().get()->getZone();
 
-       if (parent != NULL && parent->isVehicleObject())
+       if (parent != NULL && (parent->isVehicleObject() || parent->isMount()))
                sceneObject->updateVehiclePosition(sendPackets);
 
        Locker _locker(zone);
@@ -232,7 +232,7 @@ void ZoneComponent::updateZone(SceneObject* sceneObject, bool lightUpdate, bool
                }
 
 
-       if (!isInvis && sendPackets && (parent == NULL || !parent->isVehicleObject())) {
+       if (!isInvis && sendPackets && (parent == NULL || (!parent->isVehicleObject() && !parent->isMount()))) {
                if (lightUpdate) {
                        LightUpdateTransformMessage* message = new LightUpdateTransformMessage(sceneObject);
                        sceneObject->broadcastMessage(message, false, true);