Instructions Jenkins Doxygen

[Added] Confirmation text to /set commands for SL skills. Mantis #4567 59/1359/1
authorbluree <bluree@swgemu.com>
Fri, 31 Jan 2014 00:49:07 +0000 (17:49 -0700)
committerbluree <bluree@swgemu.com>
Fri, 31 Jan 2014 00:49:07 +0000 (17:49 -0700)
[Added] profanity/char check to /set SL commands.
[Added] skill check to SL/brawler /set commands.

Change-Id: I9b8fbf9ded60a95efb67a1dde2075f5b7c67de8a

MMOCoreORB/src/server/zone/objects/creature/commands/BoostmoraleCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/FormupCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/RetreatCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetBoostmoraleCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetFormupCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetIntimidateCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetRetreatCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetSteadyaimCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SetWarcryCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SquadLeaderCommand.h
MMOCoreORB/src/server/zone/objects/creature/commands/SteadyaimCommand.h

index 9a4e8f7..bc97b62 100755 (executable)
@@ -83,7 +83,7 @@ public:
                if (!inflictHAM(player, healthCost, actionCost, mindCost))
                        return GENERALERROR;
 
-               shoutCommand(player, group);
+//             shoutCommand(player, group);
 
                int wounds[9] = {0,0,0,0,0,0,0,0,0};
                if (!getWounds(player, group, wounds))
@@ -91,6 +91,11 @@ public:
 
                if (!distributeWounds(player, group, wounds))
                        return GENERALERROR;
+                       
+               if (player->isPlayerCreature() && player->getPlayerObject()->getCommandMessageString(String("boostmorale").hashCode()).isEmpty()==false) {
+                       UnicodeString shout(player->getPlayerObject()->getCommandMessageString(String("boostmorale").hashCode()));
+                       server->getChatManager()->broadcastMessage(player, shout, 0, 0, 80);
+               }                       
 
                return SUCCESS;
        }
index ed2eb73..f35dc2d 100644 (file)
@@ -81,11 +81,15 @@ public:
                if (!inflictHAM(player, healthCost, actionCost, mindCost))
                        return GENERALERROR;
 
-               shoutCommand(player, group);
-
+//             shoutCommand(player, group);
 
                if (!doFormUp(player, group))
                        return GENERALERROR;
+                       
+               if (player->isPlayerCreature() && player->getPlayerObject()->getCommandMessageString(String("formup").hashCode()).isEmpty()==false) {
+                       UnicodeString shout(player->getPlayerObject()->getCommandMessageString(String("formup").hashCode()));
+                       server->getChatManager()->broadcastMessage(player, shout, 0, 0, 80);
+               }                       
 
                return SUCCESS;
        }
index 7db1532..410818c 100644 (file)
@@ -61,7 +61,7 @@ public:
                        return false;
                }
 
-               Zone* zone = creature->getZone();
+               Zone* zone = creature->getZone();               
 
                if (creature->getZone() == NULL) {
                        return false;
@@ -82,7 +82,7 @@ public:
                if (!creature->checkCooldownRecovery("retreat")) {
                        creature->sendSystemMessage("@combat_effects:burst_run_no"); //You cannot burst run right now.
                        return false;
-               }
+               }                       
 
                return true;
        }       
@@ -113,7 +113,7 @@ public:
                if (!inflictHAM(player, 0, actionCost, mindCost))
                        return GENERALERROR;
 
-               shoutCommand(player, group);
+//             shoutCommand(player, group);
 
                for (int i = 1; i < group->getGroupSize(); ++i) {
                        ManagedReference<SceneObject*> member = group->getGroupMember(i);
@@ -128,6 +128,11 @@ public:
                        sendCombatSpam(memberPlayer);
                        doRetreat(memberPlayer);
                }
+               
+               if (player->isPlayerCreature() && player->getPlayerObject()->getCommandMessageString(String("retreat").hashCode()).isEmpty()==false) {
+                       UnicodeString shout(player->getPlayerObject()->getCommandMessageString(String("retreat").hashCode()));
+                       server->getChatManager()->broadcastMessage(player, shout, 0, 0, 80);
+               }               
 
                return SUCCESS;
        }
index cab06b8..21e5c14 100755 (executable)
@@ -65,12 +65,37 @@ public:
 
                if (creature == NULL)
                        return GENERALERROR;
-
-               String message = arguments.toString();
-
-               if (!setCommandMessage(creature, message))
+                       
+               if (!creature->hasSkill("outdoors_squadleader_defense_04")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetBoostmorale command."); //SetBoostmorale isn't a skill...          
                        return GENERALERROR;
-
+               }                       
+                       
+        ManagedReference<CreatureObject*> player = (creature);
+        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();      
+
+               String message = arguments.toString();          
+               
+               if (message.length()>128){
+                       player->sendSystemMessage("Your Boostmorale message can only be up to 128 characters long.");
+                       return false;
+               }       
+               
+               if (NameManager::instance()->isProfane(message)){
+                       player->sendSystemMessage("Your Boostmorale message has failed the profanity filter.");
+                       return false;                           
+               }
+               
+        if(message.isEmpty()) {
+            playerObject->removeCommandMessageString(String("boostmorale").hashCode());
+                       player->sendSystemMessage("Your Boostmorale message has been removed.");
+               } else {
+            playerObject->setCommandMessageString(String("boostmorale").hashCode(), message);
+                       player->sendSystemMessage("Your Boostmorale message was set to :-\n" + message);
+               }
+               
                return SUCCESS;
        }
 
index 7e4a25f..a8b2b97 100755 (executable)
@@ -66,11 +66,35 @@ public:
                if (creature == NULL)
                        return GENERALERROR;
 
-               String message = arguments.toString();
-
-               if (!setCommandMessage(creature, message))
+               if (!creature->hasSkill("outdoors_squadleader_defense_01")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetFormup command."); //SetFormup isn't a skill...            
                        return GENERALERROR;
-
+               }                       
+                       
+        ManagedReference<CreatureObject*> player = (creature);
+        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();      
+
+               String message = arguments.toString();          
+               
+               if (message.length()>128){
+                       player->sendSystemMessage("Your Formup message can only be up to 128 characters long.");
+                       return false;
+               }       
+               
+               if (NameManager::instance()->isProfane(message)){
+                       player->sendSystemMessage("Your Formup message has failed the profanity filter.");
+                       return false;                           
+               }
+               
+        if(message.isEmpty()) {
+            playerObject->removeCommandMessageString(String("formup").hashCode());
+                       player->sendSystemMessage("Your Formup message has been removed.");
+               } else {
+            playerObject->setCommandMessageString(String("formup").hashCode(), message);
+                       player->sendSystemMessage("Your Formup message was set to :-\n" + message);
+               }
                return SUCCESS;
        }
 
index b895580..a811e7f 100755 (executable)
@@ -65,11 +65,18 @@ public:
 
                if (!creature->isPlayerCreature())
                        return GENERALERROR;
+                       
+               if (!creature->hasSkill("combat_brawler_novice")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetIntimidate command."); //SetFormup isn't a skill...                
+                       return GENERALERROR;
+               }                       
 
-               CreatureObject* player = cast<CreatureObject*>(creature);
-
-               PlayerObject* ghost = player->getPlayerObject();
-               String message =arguments.toString();
+               ManagedReference<CreatureObject*> player = cast<CreatureObject*>(creature);
+        ManagedReference<PlayerObject*> ghost = player->getPlayerObject();             
+               
+               String message = arguments.toString();
                if (message.isEmpty()){
                        player->sendSystemMessage("Your Intimidate message has been removed.");
                        ghost->removeCommandMessageString(String("intimidate1").hashCode());
index 1064316..5603fc0 100755 (executable)
@@ -55,7 +55,7 @@ public:
                : SquadLeaderCommand(name, server) {
        }
 
-       int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) {
+       int doQueueCommand(CreatureObject* creature, /*Skill* skill,*/ const uint64& target, const UnicodeString& arguments) {
 
                if (!checkStateMask(creature))
                        return INVALIDSTATE;
@@ -65,11 +65,36 @@ public:
 
                if (creature == NULL)
                        return GENERALERROR;
-
-               String message = arguments.toString();
-
-               if (!setCommandMessage(creature, message))
+               
+               if (!creature->hasSkill("outdoors_squadleader_support_03")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetRetreat command."); //SetRetreat isn't a skill...          
                        return GENERALERROR;
+               }                       
+                       
+        ManagedReference<CreatureObject*> player = (creature);
+        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();      
+
+               String message = arguments.toString();          
+               
+               if (message.length()>128){
+                       player->sendSystemMessage("Your Retreat message can only be up to 128 characters long.");
+                       return false;
+               }       
+               
+               if (NameManager::instance()->isProfane(message)){
+                       player->sendSystemMessage("Your Retreat message has failed the profanity filter.");
+                       return false;                           
+               }
+               
+        if(message.isEmpty()) {
+            playerObject->removeCommandMessageString(String("retreat").hashCode());
+                       player->sendSystemMessage("Your Retreat message has been removed.");
+               } else {
+            playerObject->setCommandMessageString(String("retreat").hashCode(), message);
+                       player->sendSystemMessage("Your Retreat message was set to :-\n" + message);
+               }       
 
                return SUCCESS;
 
index 5eff9d5..1d7dbdf 100755 (executable)
@@ -66,11 +66,36 @@ public:
                if (creature == NULL)
                        return GENERALERROR;
 
-               String message = arguments.toString();
-
-               if (!setCommandMessage(creature, message))
+               if (!creature->hasSkill("outdoors_squadleader_offense_01")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetSteadyaim command."); //SetSteadyaim isn't a skill...              
                        return GENERALERROR;
-
+               }                       
+                       
+        ManagedReference<CreatureObject*> player = (creature);
+        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();      
+
+               String message = arguments.toString();          
+               
+               if (message.length()>128){
+                       player->sendSystemMessage("Your Steadyaim message can only be up to 128 characters long.");
+                       return false;
+               }       
+               
+               if (NameManager::instance()->isProfane(message)){
+                       player->sendSystemMessage("Your Steadyaim message has failed the profanity filter.");
+                       return false;                           
+               }
+               
+        if(message.isEmpty()) {
+            playerObject->removeCommandMessageString(String("steadyaim").hashCode());
+                       player->sendSystemMessage("Your Steadyaim message has been removed.");
+               } else {
+            playerObject->setCommandMessageString(String("steadyaim").hashCode(), message);
+                       player->sendSystemMessage("Your Steadyaim message was set to :-\n" + message);
+               }
+               
                return SUCCESS;
        }
 
index df1459c..d06d5e9 100755 (executable)
@@ -65,11 +65,19 @@ public:
 
                if (!creature->isPlayerCreature())
                        return GENERALERROR;
+                       
+               if (!creature->hasSkill("combat_brawler_novice")) {
+//                     StringIdChatParameter params("@error_message:prose_nsf_skill_cmd"); //You lack sufficient skill to use the %TO command. 
+//                     params.setTO("@skl_n:" + skill->getSkillName());
+                       creature->sendSystemMessage("You lack sufficient skill to use the SetWarcry command."); //SetFormup isn't a skill...            
+                       return GENERALERROR;
+               }                                               
 
-               CreatureObject* player = cast<CreatureObject*>(creature);
-
-               PlayerObject* ghost = player->getPlayerObject();
+               ManagedReference<CreatureObject*> player = cast<CreatureObject*>(creature);
+        ManagedReference<PlayerObject*> ghost = player->getPlayerObject();     
+               
                String message = arguments.toString();
+               
                if (message.isEmpty()){
                        player->sendSystemMessage("Your Warcry message has been removed.");
                        ghost->removeCommandMessageString(String("warcry1").hashCode());
index f206695..633dfe6 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "server/zone/objects/scene/SceneObject.h"
 #include "server/chat/ChatManager.h"
+#include "server/zone/managers/stringid/StringIdManager.h"
 #include "CombatQueueCommand.h"
 
 class SquadLeaderCommand : public CombatQueueCommand {
@@ -55,12 +56,12 @@ public:
                if (group->getLeader() != player) {
                        player->sendSystemMessage("@error_message:not_group_leader");
                        return false;
-               }
+               }       
 
                return true;
        }
 
-       bool shoutCommand(CreatureObject* player, GroupObject* group) {
+/*     bool shoutCommand(CreatureObject* player, GroupObject* group) {
                if (player == NULL || group == NULL)
                        return false;
 
@@ -76,7 +77,7 @@ public:
 
                return true;
        }
-
+*/
        float calculateGroupModifier(GroupObject* group) {
                if (group == NULL)
                        return 0;
@@ -87,7 +88,7 @@ public:
 
                        return modifier;
     }
-    bool inflictHAM(CreatureObject *player, int health, int action, int mind){
+    bool inflictHAM(CreatureObject* player, int health, int action, int mind){
         if (player == NULL)
                        return false;
         if(health < 0 || action < 0 || mind < 0)
@@ -108,7 +109,7 @@ public:
         return true;
     }
        
-    void sendCombatSpam(CreatureObject *player){
+    void sendCombatSpam(CreatureObject* player){
         if (player == NULL)
                        return;
         if(combatSpam == "")
@@ -117,20 +118,33 @@ public:
         player->sendSystemMessage("@cbt_spam:" + combatSpam);
     }
        
-    bool setCommandMessage(CreatureObject *creature, String message){
+/*    bool setCommandMessage(CreatureObject* creature, String message){
         if(!creature->isPlayerCreature())
             return false;
-
+                       
         ManagedReference<CreatureObject*> player = (creature);
-        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();
-        if(message.isEmpty())
+        ManagedReference<PlayerObject*> playerObject = player->getPlayerObject();      
+                       
+               if (message.length()>128){
+                       player->sendSystemMessage("Your message can only be up to 128 characters long.");
+                       return false;
+               }
+               if (NameManager::instance()->isProfane(message)){
+                       player->sendSystemMessage("Your message has failed the profanity filter.");
+                       return false;                           
+               }
+               
+        if(message.isEmpty()) {
             playerObject->removeCommandMessageString(actionCRC);
-        else
+                       player->sendSystemMessage("Your message has been removed.");
+               } else {
             playerObject->setCommandMessageString(actionCRC, message);
-
+                       player->sendSystemMessage("Your message was set to :-\n" + message);
+               }               
+               
         return true;
     }
-       
+*/     
     bool isSquadLeaderCommand(){
         return true;
     }
index 3e2346c..cc47174 100755 (executable)
@@ -82,12 +82,17 @@ public:
                if (!inflictHAM(player, healthCost, actionCost, mindCost))
                        return GENERALERROR;
 
-               shoutCommand(player, group);
+//             shoutCommand(player, group);
 
                int amount = 5 + skillMod;
 
                if (!doSteadyAim(player, group, amount))
                        return GENERALERROR;
+                       
+               if (player->isPlayerCreature() && player->getPlayerObject()->getCommandMessageString(String("steadyaim").hashCode()).isEmpty()==false) {
+                       UnicodeString shout(player->getPlayerObject()->getCommandMessageString(String("steadyaim").hashCode()));
+                       server->getChatManager()->broadcastMessage(player, shout, 0, 0, 80);
+               }                                       
 
                return SUCCESS;
        }