fix: Adds ISpanFormattable support to Serial (#1065)

This commit is contained in:
Kamron Batman 2022-06-14 18:39:46 -07:00 • committed by GitHub
parent 4b2b7e2277
commit b779d7737f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 269 additions and 204 deletions

View file

@ -394,7 +394,7 @@ namespace Server.Commands.Generic
case 4: // Go there
{
m_From.SendGump(new InterfaceItemGump(m_From, m_Columns, m_List, m_Page, m_Item));
InvokeCommand($"Go {m_Item.Serial.Value}");
InvokeCommand($"Go {m_Item.Serial}");
break;
}
case 5: // Move to target
@ -567,7 +567,7 @@ namespace Server.Commands.Generic
case 4: // Go there
{
m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
InvokeCommand($"Go {m_Mobile.Serial.Value}");
InvokeCommand($"Go {m_Mobile.Serial}");
break;
}
case 5: // Bring them here

View file

@ -46,7 +46,7 @@ namespace Server.Commands
o switch
{
Mobile m => m.Account == null ? $"{m} (no account)" : $"{m} ('{m.Account.Username}')",
Item item => $"0x{item.Serial.Value:X} ({item.GetType().Name})",
Item item => $"{item.Serial} ({item.GetType().Name})",
_ => o
};

View file

@ -35,22 +35,22 @@ namespace Server.Commands
{
var sb = new StringBuilder();
sb.AppendFormat("{0} {1} building ", from.AccessLevel, CommandLogging.Format(from));
sb.Append($"{from.AccessLevel} {CommandLogging.Format(from)} building ");
if (start == end)
{
sb.AppendFormat("at {0} in {1}", start, from.Map);
sb.Append($"at {start} in {from.Map}");
}
else
{
sb.AppendFormat("from {0} to {1} in {2}", start, end, from.Map);
sb.Append($"from {start} to {end} in {from.Map}");
}
sb.Append(':');
for (var i = 0; i < args.Length; ++i)
{
sb.AppendFormat(" \"{0}\"", args[i]);
sb.Append($" \"{args[i]}\"");
}
CommandLogging.WriteLine(from, sb.ToString());
@ -321,7 +321,7 @@ namespace Server.Commands
{
var built = Build(from, ctor, values, props, realProps, ref sendError);
sb.AppendFormat("0x{0:X}; ", built.Serial.Value);
sb.Append($"{built.Serial}; ");
if (built is Item item)
{
@ -353,7 +353,7 @@ namespace Server.Commands
var built = Build(from, ctor, values, props, realProps, ref sendError);
sb.AppendFormat("0x{0:X}; ", built.Serial.Value);
sb.Append($"{built.Serial}; ");
if (built is Item item)
{