Instructions Jenkins Doxygen

[Changed] admins can now check status on any vendor 49/1349/1
authorIvojedi <ivojedi@swgemu.com>
Wed, 22 Jan 2014 08:35:41 +0000 (00:35 -0800)
committerIvojedi <ivojedi@swgemu.com>
Wed, 22 Jan 2014 08:35:41 +0000 (00:35 -0800)
[Added] vendor status window now displays the name of the vendor's owner

Change-Id: I00ee5b272a4cd0f25cbc2bb178923e4665da2257

MMOCoreORB/src/server/zone/managers/vendor/VendorManager.cpp
MMOCoreORB/src/server/zone/objects/tangible/components/vendor/VendorMenuComponent.cpp

index 1800579..ce00f6e 100644 (file)
@@ -86,6 +86,16 @@ void VendorManager::handleDisplayStatus(CreatureObject* player, TangibleObject*
        statusBox->setPromptTitle("@player_structure:vendor_status");
        statusBox->setPromptText("Vendor Status");
 
+       ManagedReference<CreatureObject*> owner = server->getZoneServer()->getObject(vendorData->getOwnerId()).castTo<CreatureObject*>();
+       String ownerName;
+
+       if (owner == NULL)
+               ownerName = "NULL";
+       else
+               ownerName = owner->getFirstName();
+
+       statusBox->addMenuItem("Owner: " + ownerName);
+
        int condition = (((float)vendor->getMaxCondition() - (float)vendor->getConditionDamage()) / (float)vendor->getMaxCondition()) * 100;
        statusBox->addMenuItem("Condition: " + String::valueOf(condition) + "%");
 
index 3d7304b..0a7e390 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "server/zone/objects/creature/CreatureObject.h"
+#include "server/zone/objects/player/PlayerObject.h"
 #include "VendorMenuComponent.h"
 #include "server/zone/objects/scene/components/ObjectMenuComponent.h"
 #include "server/zone/objects/scene/components/DataObjectComponentReference.h"
@@ -37,11 +38,20 @@ void VendorMenuComponent::fillObjectMenuResponse(SceneObject* sceneObject,
                return;
        }
 
-       if(vendorData->getOwnerId() != player->getObjectID())
+       bool owner = vendorData->getOwnerId() == player->getObjectID();
+
+       if(!owner && !player->getPlayerObject()->isPrivileged())
                return;
 
        menuResponse->addRadialMenuItem(70, 3, "@player_structure:vendor_control");
 
+       if (!owner) {
+               if (vendorData->isInitialized())
+                       menuResponse->addRadialMenuItemToRadialID(70, 71, 3, "@player_structure:vendor_status");
+
+               return;
+       }
+
        if (!vendorData->isInitialized()) {
 
                menuResponse->addRadialMenuItemToRadialID(70, 79, 3, "@player_structure:vendor_init");
@@ -98,14 +108,21 @@ int VendorMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject,
                return 0;
        }
 
-       if(vendorData->getOwnerId() != player->getObjectID()) {
-               return TangibleObjectMenuComponent::handleObjectMenuSelect(sceneObject, player, selectedID);
-       }
-
        ManagedReference<TangibleObject*> vendor = cast<TangibleObject*>(sceneObject);
        if(vendor == NULL)
                return 0;
 
+       bool owner = vendorData->getOwnerId() == player->getObjectID();
+
+       if(!owner) {
+               if (player->getPlayerObject()->isPrivileged() && selectedID == 71) {
+                       VendorManager::instance()->handleDisplayStatus(player, vendor);
+                       return 0;
+               }
+
+               return TangibleObjectMenuComponent::handleObjectMenuSelect(sceneObject, player, selectedID);
+       }
+
        switch (selectedID) {
        case 71: {
                VendorManager::instance()->handleDisplayStatus(player, vendor);