fix: Update LabelTo, SendMessage, etc to Interpolated Strings (#1283)
This commit is contained in:
parent
0facd73842
commit
537526a328
94 changed files with 514 additions and 769 deletions
|
|
@ -48,15 +48,14 @@ namespace Server.Commands
|
|||
if (command == null)
|
||||
{
|
||||
e.Mobile.SendMessage(
|
||||
"That is either an invalid command name or one that does not support this modifier: {0}.",
|
||||
commandString
|
||||
$"That is either an invalid command name or one that does not support this modifier: {commandString}."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Mobile.AccessLevel < command.AccessLevel)
|
||||
{
|
||||
e.Mobile.SendMessage("You do not have access to that command: {0}.", commandString);
|
||||
e.Mobile.SendMessage($"You do not have access to that command: {commandString}.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,13 +13,27 @@ namespace Server.Commands
|
|||
{
|
||||
if (e.Length == 0)
|
||||
{
|
||||
e.Mobile.SendMessage("Drag effects are currently {0}.", Mobile.DragEffects ? "enabled" : "disabled");
|
||||
if (Mobile.DragEffects)
|
||||
{
|
||||
e.Mobile.SendMessage($"Drag effects are currently enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage($"Drag effects are currently disabled.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Mobile.DragEffects = e.GetBoolean(0);
|
||||
|
||||
e.Mobile.SendMessage("Drag effects have been {0}.", Mobile.DragEffects ? "enabled" : "disabled");
|
||||
if (Mobile.DragEffects)
|
||||
{
|
||||
e.Mobile.SendMessage($"Drag effects have been enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage($"Drag effects have been disabled.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,12 +86,7 @@ namespace Server.Commands
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} duping {2} (inBag={3}; amount={4})",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(targ),
|
||||
m_InBag,
|
||||
m_Amount
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} duping {CommandLogging.Format(targ)} (inBag={m_InBag}; amount={m_Amount})"
|
||||
);
|
||||
|
||||
var copy = (Item)targ;
|
||||
|
|
@ -123,7 +118,7 @@ namespace Server.Commands
|
|||
|
||||
try
|
||||
{
|
||||
from.SendMessage("Duping {0}...", m_Amount);
|
||||
from.SendMessage($"Duping {m_Amount}...");
|
||||
for (var i = 0; i < m_Amount; i++)
|
||||
{
|
||||
if (c.Invoke(args) is Item newItem)
|
||||
|
|
@ -146,11 +141,7 @@ namespace Server.Commands
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} duped {2} creating {3}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(targ),
|
||||
CommandLogging.Format(newItem)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} duped {CommandLogging.Format(targ)} creating {CommandLogging.Format(newItem)}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Commands
|
|||
var remove = new List<Item>();
|
||||
var count = 0;
|
||||
|
||||
e.Mobile.SendMessage("Exporting all static items to \"{0}\"...", ExportFile);
|
||||
e.Mobile.SendMessage($"Exporting all static items to \"{ExportFile}\"...");
|
||||
e.Mobile.SendMessage("This will delete all static items in the world. Please make a backup.");
|
||||
|
||||
foreach (var item in World.Items.Values)
|
||||
|
|
@ -60,7 +60,7 @@ namespace Server.Commands
|
|||
item.Delete();
|
||||
}
|
||||
|
||||
e.Mobile.SendMessage("Export complete. Exported {0} statics.", count);
|
||||
e.Mobile.SendMessage($"Export complete. Exported {count} statics.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
if (echo)
|
||||
{
|
||||
gm.SendMessage("{0} : has opened their web browser to : {1}", from.Name, url);
|
||||
gm.SendMessage($"{from.Name} : has opened their web browser to : {url}");
|
||||
}
|
||||
|
||||
from.LaunchBrowser(url);
|
||||
|
|
@ -243,7 +243,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
if (echo)
|
||||
{
|
||||
gm.SendMessage("{0} : has chosen not to open their web browser to : {1}", from.Name, url);
|
||||
gm.SendMessage($"{from.Name} : has chosen not to open their web browser to : {url}");
|
||||
}
|
||||
|
||||
from.SendMessage("You have chosen not to open your web browser.");
|
||||
|
|
@ -271,11 +271,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} requesting to open web browser of {2} to {3}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(mob),
|
||||
url
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} requesting to open web browser of {CommandLogging.Format(mob)} to {url}"
|
||||
);
|
||||
|
||||
if (echo)
|
||||
|
|
@ -386,11 +382,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} playing sound {2} for {3}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
index,
|
||||
CommandLogging.Format(mob)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} playing sound {index} for {CommandLogging.Format(mob)}"
|
||||
);
|
||||
mob.SendSound(index);
|
||||
}
|
||||
|
|
@ -434,12 +426,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} {2} {3} \"{4}\"",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
m_InGump ? "messaging" : "telling",
|
||||
CommandLogging.Format(mob),
|
||||
e.ArgString
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} {(m_InGump ? "messaging" : "telling")} {CommandLogging.Format(mob)} \"{e.ArgString}\""
|
||||
);
|
||||
|
||||
if (m_InGump)
|
||||
|
|
@ -642,10 +629,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} dismounting {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(mob)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} dismounting {CommandLogging.Format(mob)}"
|
||||
);
|
||||
|
||||
var takenAction = false;
|
||||
|
|
@ -713,10 +697,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
e.Mobile,
|
||||
"{0} {1} restocking {2}",
|
||||
e.Mobile.AccessLevel,
|
||||
CommandLogging.Format(e.Mobile),
|
||||
CommandLogging.Format(vendor)
|
||||
$"{e.Mobile.AccessLevel} {CommandLogging.Format(e.Mobile)} restocking {CommandLogging.Format(vendor)}"
|
||||
);
|
||||
|
||||
vendor.Restock();
|
||||
|
|
@ -955,10 +936,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
e.Mobile,
|
||||
"{0} {1} deleting {2}",
|
||||
e.Mobile.AccessLevel,
|
||||
CommandLogging.Format(e.Mobile),
|
||||
CommandLogging.Format(item)
|
||||
$"{e.Mobile.AccessLevel} {CommandLogging.Format(e.Mobile)} deleting {CommandLogging.Format(item)}"
|
||||
);
|
||||
item.Delete();
|
||||
AddResponse("The item has been deleted.");
|
||||
|
|
@ -967,10 +945,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
e.Mobile,
|
||||
"{0} {1} deleting {2}",
|
||||
e.Mobile.AccessLevel,
|
||||
CommandLogging.Format(e.Mobile),
|
||||
CommandLogging.Format(mobile)
|
||||
$"{e.Mobile.AccessLevel} {CommandLogging.Format(e.Mobile)} deleting {CommandLogging.Format(mobile)}"
|
||||
);
|
||||
mobile.Delete();
|
||||
AddResponse("The mobile has been deleted.");
|
||||
|
|
@ -1026,10 +1001,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} killing {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(mob)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} killing {CommandLogging.Format(mob)}"
|
||||
);
|
||||
mob.Kill();
|
||||
|
||||
|
|
@ -1044,10 +1016,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} resurrecting {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(mob)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} resurrecting {CommandLogging.Format(mob)}"
|
||||
);
|
||||
|
||||
bc.PlaySound(0x214);
|
||||
|
|
@ -1062,10 +1031,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} resurrecting {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(mob)
|
||||
$"{ from.AccessLevel} {CommandLogging.Format(from)} resurrecting {CommandLogging.Format(mob)}"
|
||||
);
|
||||
|
||||
mob.PlaySound(0x214);
|
||||
|
|
@ -1114,11 +1080,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
e.Mobile,
|
||||
"{0} {1} {2} {3}",
|
||||
e.Mobile.AccessLevel,
|
||||
CommandLogging.Format(e.Mobile),
|
||||
m_Value ? "hiding" : "unhiding",
|
||||
CommandLogging.Format(m)
|
||||
$"{e.Mobile.AccessLevel} {CommandLogging.Format(e.Mobile)} {(m_Value ? "hiding" : "unhiding")} {CommandLogging.Format(m)}"
|
||||
);
|
||||
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13);
|
||||
|
|
@ -1170,10 +1132,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} firewalling {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(targ)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} firewalling {CommandLogging.Format(targ)}"
|
||||
);
|
||||
|
||||
try
|
||||
|
|
@ -1233,14 +1192,10 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} {2} {3}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
m_Ban ? "banning" : "kicking",
|
||||
CommandLogging.Format(targ)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} {(m_Ban ? "banning" : "kicking")} {(CommandLogging.Format(targ))}"
|
||||
);
|
||||
|
||||
targ.Say("I've been {0}!", m_Ban ? "banned" : "kicked");
|
||||
targ.Say(m_Ban ? "I've been banned." : "I've been kicked");
|
||||
|
||||
AddResponse($"They have been {(m_Ban ? "banned" : "kicked")}.");
|
||||
|
||||
|
|
|
|||
|
|
@ -382,10 +382,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
m_From,
|
||||
"{0} {1} deleting {2}",
|
||||
m_From.AccessLevel,
|
||||
CommandLogging.Format(m_From),
|
||||
CommandLogging.Format(m_Item)
|
||||
$"{m_From.AccessLevel} {CommandLogging.Format(m_From)} deleting {CommandLogging.Format(m_Item)}"
|
||||
);
|
||||
m_Item.Delete();
|
||||
m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Item));
|
||||
|
|
@ -553,10 +550,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
m_From,
|
||||
"{0} {1} deleting {2}",
|
||||
m_From.AccessLevel,
|
||||
CommandLogging.Format(m_From),
|
||||
CommandLogging.Format(m_Mobile)
|
||||
$"{m_From.AccessLevel} {CommandLogging.Format(m_From)} deleting {CommandLogging.Format(m_Mobile)}"
|
||||
);
|
||||
m_Mobile.Delete();
|
||||
m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace Server.Commands
|
|||
var from = e.Mobile;
|
||||
var map = from.Map;
|
||||
|
||||
from.SendMessage("You are at {0} {1} {2} in {3}.", from.X, from.Y, from.Z, map);
|
||||
from.SendMessage($"You are at {from.X} {from.Y} {from.Z} in {map}.");
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
|
|
@ -124,7 +124,7 @@ namespace Server.Commands
|
|||
reg = reg.Parent;
|
||||
}
|
||||
|
||||
from.SendMessage("Your region is {0}.", builder.ToString());
|
||||
from.SendMessage($"Your region is {builder}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -192,11 +192,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} deleting {2} object{3}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
list.Count,
|
||||
list.Count == 1 ? "" : "s"
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} deleting {list.Count} object{(list.Count == 1 ? "" : "s")}"
|
||||
);
|
||||
|
||||
NetState.FlushAll();
|
||||
|
|
@ -206,7 +202,14 @@ namespace Server.Commands
|
|||
list[i].Delete();
|
||||
}
|
||||
|
||||
from.SendMessage("You have deleted {0} object{1}.", list.Count, list.Count == 1 ? "" : "s");
|
||||
if (list.Count == 1)
|
||||
{
|
||||
from.SendMessage($"You have deleted {list.Count} object.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"You have deleted {list.Count} objects.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -249,12 +252,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} starting facet clear of {2} ({3} object{4})",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
map,
|
||||
list.Count,
|
||||
list.Count == 1 ? "" : "s"
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} starting facet clear of {map} ({list.Count} object{(list.Count == 1 ? "" : "s")})"
|
||||
);
|
||||
|
||||
from.SendGump(
|
||||
|
|
@ -293,13 +291,17 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} getting all followers of {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(pm)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} getting all followers of {CommandLogging.Format(pm)}"
|
||||
);
|
||||
|
||||
from.SendMessage("That player has {0} pet{1}.", pets.Count, pets.Count != 1 ? "s" : "");
|
||||
if (pets.Count == 1)
|
||||
{
|
||||
from.SendMessage($"That player has {pets.Count} pet.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"That player has {pets.Count} pets.");
|
||||
}
|
||||
|
||||
for (var i = 0; i < pets.Count; ++i)
|
||||
{
|
||||
|
|
@ -337,13 +339,17 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} getting all followers of {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(master)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} getting all followers of {CommandLogging.Format(master)}"
|
||||
);
|
||||
|
||||
from.SendMessage("That player has {0} pet{1}.", pets.Count, pets.Count != 1 ? "s" : "");
|
||||
if (pets.Count == 1)
|
||||
{
|
||||
from.SendMessage($"That player has {pets.Count} pet.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"That player has {pets.Count} pets.");
|
||||
}
|
||||
|
||||
for (var i = 0; i < pets.Count; ++i)
|
||||
{
|
||||
|
|
@ -405,11 +411,7 @@ namespace Server.Commands
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
m,
|
||||
"{0} {1} playing sound {2} (toAll={3})",
|
||||
m.AccessLevel,
|
||||
CommandLogging.Format(m),
|
||||
index,
|
||||
toAll
|
||||
$"{m.AccessLevel} {CommandLogging.Format(m)} playing sound {index} (toAll={toAll})"
|
||||
);
|
||||
|
||||
Span<byte> buffer = stackalloc byte[OutgoingEffectPackets.SoundPacketLength].InitializePacket();
|
||||
|
|
@ -773,7 +775,14 @@ namespace Server.Commands
|
|||
|
||||
m.AutoPageNotify = !m.AutoPageNotify;
|
||||
|
||||
m.SendMessage("Your auto-page-notify has been turned {0}.", m.AutoPageNotify ? "on" : "off");
|
||||
if (m.AutoPageNotify)
|
||||
{
|
||||
m.SendMessage($"Your auto-page-notify has been turned on.");
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage($"Your auto-page-notify has been turned off.");
|
||||
}
|
||||
}
|
||||
|
||||
[Usage("Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>"),
|
||||
|
|
@ -843,9 +852,9 @@ namespace Server.Commands
|
|||
[Description("View some stats about the server.")]
|
||||
public static void Stats_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
e.Mobile.SendMessage("Open Connections: {0}", TcpServer.Instances.Count);
|
||||
e.Mobile.SendMessage("Mobiles: {0}", World.Mobiles.Count);
|
||||
e.Mobile.SendMessage("Items: {0}", World.Items.Count);
|
||||
e.Mobile.SendMessage($"Open Connections: {TcpServer.Instances.Count}");
|
||||
e.Mobile.SendMessage($"Mobiles: {World.Mobiles.Count}");
|
||||
e.Mobile.SendMessage($"Items: {World.Items.Count}");
|
||||
}
|
||||
|
||||
private class ViewEqTarget : Target
|
||||
|
|
@ -892,10 +901,7 @@ namespace Server.Commands
|
|||
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} viewing equipment of {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(m)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} viewing equipment of {CommandLogging.Format(m)}"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -934,11 +940,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
state.Mobile,
|
||||
"{0} {1} moving equipment item {2} of {3}",
|
||||
state.Mobile.AccessLevel,
|
||||
CommandLogging.Format(state.Mobile),
|
||||
CommandLogging.Format(m_Item),
|
||||
CommandLogging.Format(m_Mobile)
|
||||
$"{state.Mobile.AccessLevel} {CommandLogging.Format(state.Mobile)} moving equipment item {CommandLogging.Format(m_Item)} of {CommandLogging.Format(m_Mobile)}"
|
||||
);
|
||||
state.Mobile.Target = new MoveTarget(m_Item);
|
||||
}
|
||||
|
|
@ -946,11 +948,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
state.Mobile,
|
||||
"{0} {1} deleting equipment item {2} of {3}",
|
||||
state.Mobile.AccessLevel,
|
||||
CommandLogging.Format(state.Mobile),
|
||||
CommandLogging.Format(m_Item),
|
||||
CommandLogging.Format(m_Mobile)
|
||||
$"{state.Mobile.AccessLevel} {CommandLogging.Format(state.Mobile)} deleting equipment item {CommandLogging.Format(m_Item)} of {CommandLogging.Format(m_Mobile)}"
|
||||
);
|
||||
m_Item.Delete();
|
||||
}
|
||||
|
|
@ -958,11 +956,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
state.Mobile,
|
||||
"{0} {1} opening properties for equipment item {2} of {3}",
|
||||
state.Mobile.AccessLevel,
|
||||
CommandLogging.Format(state.Mobile),
|
||||
CommandLogging.Format(m_Item),
|
||||
CommandLogging.Format(m_Mobile)
|
||||
$"{state.Mobile.AccessLevel} {CommandLogging.Format(state.Mobile)} opening properties for equipment item {CommandLogging.Format(m_Item)} of {CommandLogging.Format(m_Mobile)}"
|
||||
);
|
||||
state.Mobile.SendGump(new PropertiesGump(state.Mobile, m_Item));
|
||||
}
|
||||
|
|
@ -987,10 +981,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} opening bank box of {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(m)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} opening bank box of {CommandLogging.Format(m)}"
|
||||
);
|
||||
|
||||
if (from == m)
|
||||
|
|
@ -1022,10 +1013,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} opening client menu of {2}",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
CommandLogging.Format(targ)
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} opening client menu of {CommandLogging.Format(targ)}"
|
||||
);
|
||||
from.SendGump(new ClientGump(from, targ.NetState));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,16 +50,6 @@ namespace Server.Commands
|
|||
_ => o
|
||||
};
|
||||
|
||||
public static void WriteLine(Mobile from, string format, params object[] args)
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WriteLine(from, string.Format(format, args));
|
||||
}
|
||||
|
||||
public static void WriteLine(Mobile from, string text)
|
||||
{
|
||||
if (!Enabled)
|
||||
|
|
@ -132,27 +122,13 @@ namespace Server.Commands
|
|||
|
||||
public static void EventSink_Command(CommandEventArgs e)
|
||||
{
|
||||
WriteLine(
|
||||
e.Mobile,
|
||||
"{0} {1} used command '{2} {3}'",
|
||||
e.Mobile.AccessLevel,
|
||||
Format(e.Mobile),
|
||||
e.Command,
|
||||
e.ArgString
|
||||
);
|
||||
var from = e.Mobile;
|
||||
WriteLine(from, $"{from.AccessLevel} {Format(from)} used command '{e.Command} {e.ArgString}'");
|
||||
}
|
||||
|
||||
public static void LogChangeProperty(Mobile from, object o, string name, string value)
|
||||
{
|
||||
WriteLine(
|
||||
from,
|
||||
"{0} {1} set property '{2}' of {3} to '{4}'",
|
||||
from.AccessLevel,
|
||||
Format(from),
|
||||
name,
|
||||
Format(o),
|
||||
value
|
||||
);
|
||||
WriteLine(from, $"{from.AccessLevel} {Format(from)} set property '{name}' of {Format(o)} to '{value}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,12 +102,14 @@ namespace Server.Commands
|
|||
if (built > 0)
|
||||
{
|
||||
watch.Stop();
|
||||
from.SendMessage(
|
||||
"{0} object{1} generated in {2:F2} seconds.",
|
||||
built,
|
||||
built != 1 ? "s" : "",
|
||||
watch.Elapsed.TotalSeconds
|
||||
);
|
||||
if (built == 1)
|
||||
{
|
||||
from.SendMessage($"{built} object generated in {watch.Elapsed.TotalSeconds:F2} seconds.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"{built} objects generated in {watch.Elapsed.TotalSeconds:F2} seconds.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -307,7 +309,7 @@ namespace Server.Commands
|
|||
|
||||
if (objectCount >= 20)
|
||||
{
|
||||
from.SendMessage("Constructing {0} objects, please wait.", objectCount);
|
||||
from.SendMessage($"Constructing {objectCount} objects, please wait.");
|
||||
}
|
||||
|
||||
var sendError = true;
|
||||
|
|
@ -467,10 +469,14 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(
|
||||
"Format: {0} <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile"
|
||||
);
|
||||
if (outline)
|
||||
{
|
||||
from.SendMessage($"Format: Outline <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"Format: Tile <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -492,10 +498,14 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(
|
||||
"Format: {0}RXYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile"
|
||||
);
|
||||
if (outline)
|
||||
{
|
||||
e.Mobile.SendMessage($"Format: OutlineRXYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage($"Format: TileRXYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -517,10 +527,14 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage(
|
||||
"Format: {0}XYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile"
|
||||
);
|
||||
if (outline)
|
||||
{
|
||||
e.Mobile.SendMessage($"Format: OutlineXYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]" );
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage($"Format: TileXYZ <x> <y> <w> <h> <z> <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -545,10 +559,14 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(
|
||||
"Format: {0}Z <z> <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile"
|
||||
);
|
||||
if (outline)
|
||||
{
|
||||
from.SendMessage($"Format: OutlineZ <z> <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"Format: TileZ <z> <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -566,10 +584,14 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage(
|
||||
"Format: {0}Avg <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile"
|
||||
);
|
||||
if (outline)
|
||||
{
|
||||
from.SendMessage($"Format: OutlineAvg <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage($"Format: TileAvg <type> [params] [set {{<propertyName> <value> ...}}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Commands
|
|||
Generate("Data/Decoration/Malas", Map.Malas);
|
||||
Generate("Data/Decoration/Tokuno", Map.Tokuno);
|
||||
|
||||
m_Mobile.SendMessage("World generating complete. {0} items were generated.", m_Count);
|
||||
m_Mobile.SendMessage($"World generating complete. {m_Count} items were generated.");
|
||||
}
|
||||
|
||||
public static void Generate(string folder, params Map[] maps)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Server.Commands
|
|||
Generate("Data/Decoration/RuinedMaginciaTram", Map.Trammel);
|
||||
Generate("Data/Decoration/RuinedMaginciaFel", Map.Felucca);
|
||||
|
||||
m_Mobile.SendMessage("World generating complete. {0} items were generated.", m_Count);
|
||||
m_Mobile.SendMessage($"World generating complete. {m_Count} items were generated.");
|
||||
}
|
||||
|
||||
public static void Generate(string folder, params Map[] maps)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,14 @@ namespace Server.Commands
|
|||
Core.Profiling = !Core.Profiling;
|
||||
}
|
||||
|
||||
e.Mobile.SendMessage("Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled");
|
||||
if (Core.Profiling)
|
||||
{
|
||||
e.Mobile.SendMessage($"Profiling has been enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Mobile.SendMessage($"Profiling has been disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
[Usage("DumpTimers"),
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace Server.Commands
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("{0} not found!", cfg);
|
||||
from.SendMessage($"{cfg} not found!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace Server.Commands
|
|||
CommandLogging.LogChangeProperty(from, targ, $"{m_Skill}.Base", m_Value.ToString());
|
||||
}
|
||||
|
||||
from.SendMessage("{0} : {1} (Base: {2})", m_Skill, skill.Value, skill.Base);
|
||||
from.SendMessage($"{m_Skill} : {skill.Value} (Base: {skill.Base})");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,11 +43,18 @@ namespace Server.Commands
|
|||
|
||||
if (list.Count > 0)
|
||||
{
|
||||
pm.SendMessage("You are visible to {0} mobile{1}:", list.Count, list.Count == 1 ? "" : "s");
|
||||
if (list.Count == 1)
|
||||
{
|
||||
pm.SendMessage($"You are visible to {list.Count} mobile:");
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SendMessage($"You are visible to {list.Count} mobiles:");
|
||||
}
|
||||
|
||||
for (var i = 0; i < list.Count; ++i)
|
||||
{
|
||||
pm.SendMessage("#{0}: {1}", i + 1, list[i].Name);
|
||||
pm.SendMessage($"#{i + 1}: {list[i].Name}");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -103,12 +110,12 @@ namespace Server.Commands
|
|||
if (list.Contains(targ))
|
||||
{
|
||||
list.Remove(targ);
|
||||
pm.SendMessage("{0} has been removed from your visibility list.", targ.Name);
|
||||
pm.SendMessage($"{targ.Name} has been removed from your visibility list.");
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(targ);
|
||||
pm.SendMessage("{0} has been added to your visibility list.", targ.Name);
|
||||
pm.SendMessage($"{targ.Name} has been added to your visibility list.");
|
||||
}
|
||||
|
||||
if (Utility.InUpdateRange(targ.Location, from.Location))
|
||||
|
|
|
|||
|
|
@ -61,13 +61,7 @@ namespace Server.Commands
|
|||
{
|
||||
CommandLogging.WriteLine(
|
||||
from,
|
||||
"{0} {1} wiping from {2} to {3} in {5} ({4})",
|
||||
from.AccessLevel,
|
||||
CommandLogging.Format(from),
|
||||
start,
|
||||
end,
|
||||
type,
|
||||
map
|
||||
$"{from.AccessLevel} {CommandLogging.Format(from)} wiping from {start} to {end} in {type} ({map})"
|
||||
);
|
||||
|
||||
var mobiles = (type & WipeType.Mobiles) != 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue