[Saylinks] Convert all GM Command Saylinks to Silent Saylinks. (#2373)

* [Saylinks] Convert all GM Command Saylinks to Silent Saylinks.
- This cleans up all non-silent GM Command Saylinks that we had before due to the way they worked before. All saylinks like this should be silent now.
- Add source short hand capability for say links with same link as text.

* Defaults to r anyway.

* Spacing.
This commit is contained in:
Kinglykrab
2022-08-13 20:40:22 -04:00
committed by GitHub
parent 597b041d92
commit 216b6ef426
33 changed files with 186 additions and 356 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ void command_databuckets(Client *c, const Seperator *sep)
c->Message(
Chat::White,
"%s : %s",
Saylink::Create(del_saylink, false, "Delete").c_str(),
Saylink::Silent(del_saylink, "Delete").c_str(),
key.c_str(),
" Value: ",
value.c_str());
+4 -4
View File
@@ -560,7 +560,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} | Shows available models in the current zone that you are in",
Saylink::Silent("#door showmodelszone", "#door showmodelszone")
Saylink::Silent("#door showmodelszone")
).c_str()
);
@@ -568,7 +568,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} | Shows available models globally by first listing all global model files",
Saylink::Silent("#door showmodelsglobal", "#door showmodelsglobal")
Saylink::Silent("#door showmodelsglobal")
).c_str()
);
@@ -577,14 +577,14 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} - Brings up editing interface for selected door",
Saylink::Silent("#door edit", "#door edit")
Saylink::Silent("#door edit")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"{} - lists doors in zone",
Saylink::Silent("#list doors", "#list doors")
Saylink::Silent("#list doors")
).c_str()
);
+23 -8
View File
@@ -42,12 +42,19 @@ void command_dz(Client *c, const Seperator *sep)
continue;
}
auto leader_saylink = Saylink::Create(
auto leader_saylink = Saylink::Silent(
fmt::format(
"#goto {}", expedition->GetLeaderName()), false, expedition->GetLeaderName());
auto zone_saylink = Saylink::Create(
"#goto {}",
expedition->GetLeaderName()
),
expedition->GetLeaderName()
);
auto zone_saylink = Saylink::Silent(
fmt::format(
"#zoneinstance {}", dz->GetInstanceID()), false, "zone"
"#zoneinstance {}",
dz->GetInstanceID()
),
"zone"
);
auto seconds = dz->GetSecondsRemaining();
@@ -123,8 +130,12 @@ void command_dz(Client *c, const Seperator *sep)
for (const auto &dz : dynamic_zones) {
auto seconds = dz->GetSecondsRemaining();
auto zone_saylink = Saylink::Create(
fmt::format("#zoneinstance {}", dz->GetInstanceID()), false, "zone"
auto zone_saylink = Saylink::Silent(
fmt::format(
"#zoneinstance {}",
dz->GetInstanceID()
),
"zone"
);
std::string aligned_type = fmt::format(
@@ -159,8 +170,12 @@ void command_dz(Client *c, const Seperator *sep)
bool is_expired = now > expire_time;
if (!is_expired || strcasecmp(sep->arg[2], "all") == 0) {
auto zone_saylink = is_expired ? "zone" : Saylink::Create(
fmt::format("#zoneinstance {}", dz.instance), false, "zone"
auto zone_saylink = is_expired ? "zone" : Saylink::Silent(
fmt::format(
"#zoneinstance {}",
dz.instance
),
"zone"
);
c->Message(
+1 -1
View File
@@ -126,7 +126,7 @@ void command_editmassrespawn(Client *c, const Seperator *sep)
c->Message(
Chat::Yellow, "To apply these changes, click <%s> or type [%s]",
Saylink::Create(saylink, false, "Apply").c_str(),
Saylink::Silent(saylink, "Apply").c_str(),
saylink.c_str()
);
}
+1 -2
View File
@@ -56,9 +56,8 @@ void command_faction(Client *c, const Seperator *sep)
auto faction_id = std::stoul(row[0]);
std::string faction_name = row[1];
std::string faction_value = row[2];
std::string reset_link = Saylink::Create(
std::string reset_link = Saylink::Silent(
fmt::format("#faction reset {}", faction_id),
false,
"Reset"
);
+2 -10
View File
@@ -4,11 +4,7 @@ void command_feature(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (arguments < 2 || !sep->IsNumber(2)) {
auto feature_save_link = Saylink::Create(
"#npcedit featuresave",
false,
"#npcedit featuresave"
);
auto feature_save_link = Saylink::Silent("#npcedit featuresave");
c->Message(Chat::White, "Usage: #feature beard [Beard] - Change your or your target's Beard");
c->Message(Chat::White, "Usage: #feature beardcolor [Beard Color] - Change your or your target's Beard Color");
@@ -67,11 +63,7 @@ void command_feature(Client *c, const Seperator *sep)
!is_tattoo &&
!is_texture
) {
auto feature_save_link = Saylink::Create(
"#npcedit featuresave",
false,
"#npcedit featuresave"
);
auto feature_save_link = Saylink::Silent("#npcedit featuresave");
c->Message(Chat::White, "Usage: #feature beard [Beard] - Change your or your target's Beard");
c->Message(Chat::White, "Usage: #feature beardcolor [Beard Color] - Change your or your target's Beard Color");
+7 -4
View File
@@ -60,10 +60,13 @@ void command_findzone(Client *c, const Seperator *sep)
break;
}
std::string command_zone = Saylink::Create("#zone " + short_name, false, "zone");
std::string command_gmzone = Saylink::Create(
fmt::format("#gmzone {} {}", short_name, version),
false,
std::string command_zone = Saylink::Silent("#zone " + short_name, "zone");
std::string command_gmzone = Saylink::Silent(
fmt::format(
"#gmzone {} {}",
short_name,
version
),
"gmzone"
);
+2 -2
View File
@@ -4,7 +4,7 @@ void command_flagedit(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
auto flags_link = Saylink::Create("#flags", false, "#flags");
auto flags_link = Saylink::Silent("#flags");
c->Message(
Chat::White,
"Usage: #flagedit lock [Zone ID|Zone Short Name] [Flag Name] - Set the specified flag name on the zone, locking the zone"
@@ -48,7 +48,7 @@ void command_flagedit(Client *c, const Seperator *sep)
!is_take &&
!is_unlock
) {
auto flags_link = Saylink::Create("#flags", false, "#flags");
auto flags_link = Saylink::Silent("#flags");
c->Message(
Chat::White,
"Usage: #flagedit lock [Zone ID|Zone Short Name] [Flag Name] - Set the specified flag name on the zone, locking the zone"
+1 -2
View File
@@ -161,9 +161,8 @@ void command_gearup(Client *c, const Seperator *sep)
std::string message;
for (auto row = results.begin(); row != results.end(); ++row) {
int expansion = atoi(row[0]);
message += "[" + Saylink::Create(
message += "[" + Saylink::Silent(
fmt::format("#gearup {}", expansion),
false,
Expansion::ExpansionName[expansion]
) + "] ";
+4 -8
View File
@@ -19,9 +19,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
Saylink::Create(
Saylink::Silent(
"#si " + item_id,
false,
"X"
) +
"] ";
@@ -30,9 +29,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
Saylink::Create(
Saylink::Silent(
"#si " + item_id + " " + stack_size,
false,
stack_size
) +
"]";
@@ -77,9 +75,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
Saylink::Create(
Saylink::Silent(
"#si " + item_id,
false,
"X"
) +
"] ";
@@ -87,9 +84,8 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
Saylink::Create(
Saylink::Silent(
"#si " + item_id + " " + stack_size,
false,
stack_size
) +
"]";
+5 -5
View File
@@ -69,7 +69,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
Saylink::Create(saylink, false, "Goto").c_str(),
Saylink::Silent(saylink, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -110,7 +110,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
Saylink::Create(saylink, false, "Goto").c_str(),
Saylink::Silent(saylink, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -151,7 +151,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
Saylink::Create(saylink, false, "Goto").c_str(),
Saylink::Silent(saylink, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -192,7 +192,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | Entity ID %5d | Door ID %i | %s | x %.0f | y %0.f | z %.0f",
Saylink::Create(saylink, false, "Goto").c_str(),
Saylink::Silent(saylink, "Goto").c_str(),
entity->GetID(),
entity->GetDoorID(),
entity->GetDoorName(),
@@ -234,7 +234,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | Entity ID %5d | Object DBID %i | %s | x %.0f | y %0.f | z %.0f",
Saylink::Create(saylink, false, "Goto").c_str(),
Saylink::Silent(saylink, "Goto").c_str(),
entity->GetID(),
entity->GetDBID(),
entity->GetModelName(),
+1 -5
View File
@@ -184,11 +184,7 @@ void command_logs(Client *c, const Seperator *sep)
next_category_id
);
auto next_list_link = Saylink::Create(
next_list_string,
false,
next_list_string
);
auto next_list_link = Saylink::Silent(next_list_string, next_list_string);
c->Message(
Chat::White,
+1 -1
View File
@@ -223,7 +223,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"Would you like to {} these changes?",
Saylink::Create(saylink, false, "apply")
Saylink::Silent(saylink, "apply")
).c_str()
);
+1 -5
View File
@@ -9,11 +9,7 @@ void command_nudge(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Note: Partial or mixed arguments allowed, example {}.",
Saylink::Create(
"#nudge x=5.0",
false,
"#nudge x=5.0"
)
Saylink::Silent("#nudge x=5.0")
).c_str()
);
return;
+2 -10
View File
@@ -50,11 +50,7 @@ void command_qglobal(Client *c, const Seperator *sep)
return;
}
auto repop_link = Saylink::Create(
"#repop",
false,
"repop"
);
auto repop_link = Saylink::Silent("#repop", "repop");
c->Message(
Chat::White,
@@ -83,11 +79,7 @@ void command_qglobal(Client *c, const Seperator *sep)
return;
}
auto repop_link = Saylink::Create(
"#repop",
false,
"repop"
);
auto repop_link = Saylink::Silent("#repop", "repop");
c->Message(
Chat::White,
+2 -2
View File
@@ -223,7 +223,7 @@ void command_reload(Client *c, const Seperator *sep)
"Zone Header Load {} | Zone: {}",
(
zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion()) ?
"Suceeded" :
"Succeeded" :
"Failed"
),
zone->GetZoneDescription()
@@ -267,7 +267,7 @@ void command_reload(Client *c, const Seperator *sep)
"Zone Header Load {} | Zone: {} ({}){}",
(
zone->LoadZoneCFG(zone_short_name, version) ?
"Suceeded" :
"Succeeded" :
"Failed"
),
zone_long_name,
+1 -1
View File
@@ -127,7 +127,7 @@ void command_scale(Client *c, const Seperator *sep)
c->Message(Chat::Yellow, "Found (%i) NPC's that match this search...", found_count);
c->Message(
Chat::Yellow, "To apply these changes, click <%s> or type %s",
Saylink::Create(saylink, false, "Apply").c_str(),
Saylink::Silent(saylink, "Apply").c_str(),
saylink.c_str()
);
}
+2 -10
View File
@@ -76,22 +76,14 @@ void command_showskills(Client *c, const Seperator *sep)
next_skill_id
);
auto next_list_link = Saylink::Create(
next_list_string,
false,
next_list_string
);
auto next_list_link = Saylink::Silent(next_list_string, next_list_string);
auto next_list_all_string = fmt::format(
"#showskills {} all",
next_skill_id
);
auto next_list_all_link = Saylink::Create(
next_list_all_string,
false,
next_list_all_string
);
auto next_list_all_link = Saylink::Silent(next_list_all_string, next_list_all_string);
c->Message(
Chat::White,
+1 -1
View File
@@ -107,7 +107,7 @@ void command_spawneditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"To apply these changes, click {} or type \"{}\".",
Saylink::Create(edit_link, false, "apply"),
Saylink::Silent(edit_link, "apply"),
edit_link
).c_str()
);
+17 -17
View File
@@ -18,7 +18,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] List active tasks for a client",
Saylink::Create("#task show", false, "show")
Saylink::Silent("#task show", "show")
).c_str()
);
c->Message(Chat::White, "--- update <task_id> <activity_id> [count] | Updates task");
@@ -28,42 +28,42 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Reload all Task information from the database",
Saylink::Create("#task reloadall", false, "reloadall")
Saylink::Silent("#task reloadall", "reloadall")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] <task_id> Reload Task and Activity information for a single task",
Saylink::Create("#task reload task", false, "reload task")
Saylink::Silent("#task reload task", "reload task")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload goal/reward list information",
Saylink::Create("#task reload lists", false, "reload lists")
Saylink::Silent("#task reload lists", "reload lists")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload proximity information",
Saylink::Create("#task reload prox", false, "reload prox")
Saylink::Silent("#task reload prox", "reload prox")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload task set information",
Saylink::Create("#task reload sets", false, "reload sets")
Saylink::Silent("#task reload sets", "reload sets")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Purges targeted characters task timers",
Saylink::Create("#task purgetimers", false, "purgetimers")
Saylink::Silent("#task purgetimers", "purgetimers")
).c_str()
);
@@ -74,7 +74,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Purges all active Shared Tasks in memory and database ",
Saylink::Create("#task sharedpurge", false, "sharedpurge")
Saylink::Silent("#task sharedpurge", "sharedpurge")
).c_str()
);
return;
@@ -112,7 +112,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] List active tasks for a client",
Saylink::Create("#task show", false, "show")
Saylink::Silent("#task show", "show")
).c_str()
);
c->Message(Chat::White, "--- update <task_id> <activity_id> [count] | Updates task");
@@ -122,42 +122,42 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Reload all Task information from the database",
Saylink::Create("#task reloadall", false, "reloadall")
Saylink::Silent("#task reloadall", "reloadall")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] <task_id> Reload Task and Activity information for a single task",
Saylink::Create("#task reload task", false, "reload task")
Saylink::Silent("#task reload task", "reload task")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload goal/reward list information",
Saylink::Create("#task reload lists", false, "reload lists")
Saylink::Silent("#task reload lists", "reload lists")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload proximity information",
Saylink::Create("#task reload prox", false, "reload prox")
Saylink::Silent("#task reload prox", "reload prox")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload task set information",
Saylink::Create("#task reload sets", false, "reload sets")
Saylink::Silent("#task reload sets", "reload sets")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Purges targeted characters task timers",
Saylink::Create("#task purgetimers", false, "purgetimers")
Saylink::Silent("#task purgetimers", "purgetimers")
).c_str()
);
@@ -168,7 +168,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Purges all active Shared Tasks in memory and database ",
Saylink::Create("#task sharedpurge", false, "sharedpurge")
Saylink::Silent("#task sharedpurge", "sharedpurge")
).c_str()
);
return;
@@ -260,7 +260,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"[WARNING] This will purge all active Shared Tasks [{}]?",
Saylink::Create("#task sharedpurge confirm", false, "confirm")
Saylink::Silent("#task sharedpurge confirm", "confirm")
).c_str()
);
+1 -2
View File
@@ -30,7 +30,7 @@ void command_viewzoneloot(Client *c, const Seperator *sep)
std::string npc_name = current_npc->GetCleanName();
uint32 instance_id = zone->GetInstanceID();
uint32 zone_id = zone->GetZoneID();
std::string command_link = Saylink::Create(
std::string command_link = Saylink::Silent(
fmt::format(
"#{} {} {} {} {}",
(instance_id != 0 ? "zoneinstance" : "zone"),
@@ -39,7 +39,6 @@ void command_viewzoneloot(Client *c, const Seperator *sep)
current_npc->GetY(),
current_npc->GetZ()
),
false,
"Goto"
);
npc_link = fmt::format(
+8 -16
View File
@@ -98,12 +98,11 @@ void command_who(Client *c, const Seperator *sep)
std::string displayed_guild_name;
if (guild_name.length()) {
displayed_guild_name = Saylink::Create(
displayed_guild_name = Saylink::Silent(
fmt::format(
"#who \"{}\"",
guild_name
),
false,
fmt::format(
"<{}>",
guild_name
@@ -111,21 +110,19 @@ void command_who(Client *c, const Seperator *sep)
);
}
auto goto_saylink = Saylink::Create(
auto goto_saylink = Saylink::Silent(
fmt::format(
"#goto {}",
player_name
),
false,
"Goto"
);
auto summon_saylink = Saylink::Create(
auto summon_saylink = Saylink::Silent(
fmt::format(
"#summon {}",
player_name
),
false,
"Summon"
);
@@ -134,48 +131,43 @@ void command_who(Client *c, const Seperator *sep)
static_cast<uint8>(player_level)
);
auto class_saylink = Saylink::Create(
auto class_saylink = Saylink::Silent(
fmt::format(
"#who {}",
base_class_name
),
false,
display_class_name
);
auto race_saylink = Saylink::Create(
auto race_saylink = Saylink::Silent(
fmt::format(
"#who %s",
displayed_race_name
),
false,
displayed_race_name
);
auto zone_saylink = Saylink::Create(
auto zone_saylink = Saylink::Silent(
fmt::format(
"#who {}",
zone_short_name
),
false,
zone_long_name
);
auto account_saylink = Saylink::Create(
auto account_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_name
),
false,
account_name
);
auto account_ip_saylink = Saylink::Create(
auto account_ip_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_ip
),
false,
account_ip
);
+1 -1
View File
@@ -43,7 +43,7 @@ void command_zheader(Client *c, const Seperator *sep)
"Zone Header Load {} | Zone: {} ({}){}",
(
zone->LoadZoneCFG(zone_short_name, version) ?
"Suceeded" :
"Succeeded" :
"Failed"
),
zone_long_name,