fix(core): Fixes buy packet (#453)
- [X] Fixes buy packet - [X] Changes from null to empty string in gump initial text
This commit is contained in:
parent
995149ad01
commit
50e9b367fc
7 changed files with 12 additions and 12 deletions
|
|
@ -48,7 +48,7 @@ namespace Server.Gumps
|
|||
public bool Scrollbar { get; set; }
|
||||
|
||||
public override string Compile(OrderedHashSet<string> strings) =>
|
||||
$"{{ htmlgump {X} {Y} {Width} {Height} {strings.GetOrAdd(Text)} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}";
|
||||
$"{{ htmlgump {X} {Y} {Width} {Height} {strings.GetOrAdd(Text ?? "")} {(Background ? 1 : 0)} {(Scrollbar ? 1 : 0)} }}";
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
|
|
@ -63,7 +63,7 @@ namespace Server.Gumps
|
|||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(Height.ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(strings.GetOrAdd(Text).ToString());
|
||||
writer.WriteAscii(strings.GetOrAdd(Text ?? "").ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(Background ? '1' : '0');
|
||||
writer.WriteAscii(' ');
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ namespace Server.Gumps
|
|||
public int Hue { get; set; }
|
||||
|
||||
public string Text { get; set; }
|
||||
public override string Compile(OrderedHashSet<string> strings) => $"{{ text {X} {Y} {Hue} {strings.GetOrAdd(Text)} }}";
|
||||
public override string Compile(OrderedHashSet<string> strings) => $"{{ text {X} {Y} {Hue} {strings.GetOrAdd(Text ?? "")} }}";
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
|
|
@ -50,7 +50,7 @@ namespace Server.Gumps
|
|||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(Hue.ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(strings.GetOrAdd(Text).ToString());
|
||||
writer.WriteAscii(strings.GetOrAdd(Text ?? "").ToString());
|
||||
writer.Write((ushort)0x207D); // " }"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Server.Gumps
|
|||
public string Text { get; set; }
|
||||
|
||||
public override string Compile(OrderedHashSet<string> strings) =>
|
||||
$"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {strings.GetOrAdd(Text)} }}";
|
||||
$"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {strings.GetOrAdd(Text ?? "")} }}";
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
|
|
@ -62,7 +62,7 @@ namespace Server.Gumps
|
|||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(Hue.ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(strings.GetOrAdd(Text).ToString());
|
||||
writer.WriteAscii(strings.GetOrAdd(Text ?? "").ToString());
|
||||
writer.Write((ushort)0x207D); // " }"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace Server.Gumps
|
|||
public string InitialText { get; set; }
|
||||
|
||||
public override string Compile(OrderedHashSet<string> strings) =>
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText)} }}";
|
||||
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText ?? "")} }}";
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
|
|
@ -67,7 +67,7 @@ namespace Server.Gumps
|
|||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(EntryID.ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(strings.GetOrAdd(InitialText).ToString());
|
||||
writer.WriteAscii(strings.GetOrAdd(InitialText ?? "").ToString());
|
||||
writer.Write((ushort)0x207D); // " }"
|
||||
|
||||
entries++;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Server.Gumps
|
|||
public int Size { get; set; }
|
||||
|
||||
public override string Compile(OrderedHashSet<string> strings) =>
|
||||
$"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText)} {Size} }}";
|
||||
$"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText ?? "")} {Size} }}";
|
||||
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Gumps
|
|||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(EntryID.ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(strings.GetOrAdd(InitialText).ToString());
|
||||
writer.WriteAscii(strings.GetOrAdd(InitialText ?? "").ToString());
|
||||
writer.WriteAscii(' ');
|
||||
writer.WriteAscii(Size.ToString());
|
||||
writer.Write((ushort)0x207D); // " }"
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ namespace Server.Network
|
|||
|
||||
public bool HandleReceive()
|
||||
{
|
||||
if (Connection == null)
|
||||
if (Connection == null || !_running)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Network
|
|||
|
||||
if (!vendor.Deleted && Utility.RangeCheck(vendor.Location, state.Mobile.Location, 10) && flag == 0x02)
|
||||
{
|
||||
var msgSize = reader.Remaining;
|
||||
var msgSize = packetLength - 8; // Remaining bytes
|
||||
|
||||
if (msgSize / 7 > 100)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue