I'm trying to add a new slash command, but not having any luck.
Things I've tried:
Exporting the datatables/command_table.iff and creating a tre file with my new command added into the table.
Added the new tre file to my servers tre location, added it into the config.lua after default_patch.tre
Modfied MMOCoreORB/src/server/zone/managers/objectcontroller/command/CommandConfigManager.cpp with the added headers to include the command class structure.
#include "server/zone/objects/creature/commands/helloWorld.h"
Added
commandFactory.registerCommand<HelloWorldCommand>(String("helloWorld").toLowerCase()); to void CommandConfigManager::registerCommands()
Added #include "helloWorld.h" to MMOCoreORB/src/server/zone/objects/creature/commands/commands.h
Created helloWorld.h in the same directory with the following content
Modified my Clients swgemu_live file with the name of the custom tre file containing the datatable of command_table.iff and custom command with the cppHook reference as the first in load order.
maxSearchPriority=9999
searchTree_00_25=custom.tre
compiled the server successfully no Tre loading errors on run, loaded the client up, logged into the game on an admin character. Type in /helloWorld and I get that its not a mood or chat type error.
Is there some file I'm missing to edit? Or perhaps a step I missed? Any guidance is appreciated thank you!
Things I've tried:
Exporting the datatables/command_table.iff and creating a tre file with my new command added into the table.
Added the new tre file to my servers tre location, added it into the config.lua after default_patch.tre
Modfied MMOCoreORB/src/server/zone/managers/objectcontroller/command/CommandConfigManager.cpp with the added headers to include the command class structure.
#include "server/zone/objects/creature/commands/helloWorld.h"
Added
commandFactory.registerCommand<HelloWorldCommand>(String("helloWorld").toLowerCase()); to void CommandConfigManager::registerCommands()
Added #include "helloWorld.h" to MMOCoreORB/src/server/zone/objects/creature/commands/commands.h
Created helloWorld.h in the same directory with the following content
Code:
#ifndef HELLOWORLDCOMMAND_H_
#define HELLOWORLDCOMMAND_H_
#include "server/zone/objects/scene/SceneObject.h"
class HelloWorldCommand : public QueueCommand {
public:
HelloWorldCommand(const String& name, ZoneProcessServer* server)
: QueueCommand(name, server) {
}
int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) const {
if (!creature->isPlayerCreature()) // If not player, bail
return GENERALERROR;
creature->sendSystemMessage("Hello World!");
return SUCCESS;
}
};
#endif //HELLOWORLDCOMMAND_H_
maxSearchPriority=9999
searchTree_00_25=custom.tre
compiled the server successfully no Tre loading errors on run, loaded the client up, logged into the game on an admin character. Type in /helloWorld and I get that its not a mood or chat type error.
Is there some file I'm missing to edit? Or perhaps a step I missed? Any guidance is appreciated thank you!
Last edited: