mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-27 06:38:05 +00:00
[World CLI] Refactor world CLI to be easier to reason about (#2441)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "../../common/eqemu_logsys_log_aliases.h"
|
||||
#include "../worlddb.h"
|
||||
|
||||
void WorldserverCLI::CopyCharacter(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
description = "Copies a character into a destination account";
|
||||
|
||||
std::vector<std::string> arguments = {
|
||||
"source_character_name",
|
||||
"destination_character_name",
|
||||
"destination_account_name"
|
||||
};
|
||||
std::vector<std::string> options = {};
|
||||
|
||||
if (cmd[{"-h", "--help"}]) {
|
||||
return;
|
||||
}
|
||||
|
||||
EQEmuCommand::ValidateCmdInput(arguments, options, cmd, argc, argv);
|
||||
|
||||
std::string source_character_name = cmd(2).str();
|
||||
std::string destination_character_name = cmd(3).str();
|
||||
std::string destination_account_name = cmd(4).str();
|
||||
|
||||
LogInfo(
|
||||
"Attempting to copy character [{}] to [{}] via account [{}]",
|
||||
source_character_name,
|
||||
destination_character_name,
|
||||
destination_account_name
|
||||
);
|
||||
|
||||
database.CopyCharacter(
|
||||
source_character_name,
|
||||
destination_character_name,
|
||||
destination_account_name
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user