fix(codegen): Reverts & Disables codegen (for now) (#625)
After speaking with the C# devs, it is clear that code gen is not ready. I can get around this by doing the following: 1. Creating a library 2. Splitting out the schema writing from the source generator 3. Moving the schema loading to `AdditionalFiles` 4. Writing a new post-build application using Roslyn to write the schema files after building.
This commit is contained in:
parent
6e9108302a
commit
f2d44e0283
84 changed files with 1053 additions and 487 deletions
|
|
@ -1,10 +1,28 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Serializable(0, false)]
|
||||
[Flippable(0x49CC, 0x49D0)]
|
||||
public partial class AnimatedHeartShapedBox : HeartShapedBox
|
||||
public class AnimatedHeartShapedBox : HeartShapedBox
|
||||
{
|
||||
[Constructible]
|
||||
public AnimatedHeartShapedBox() => ItemID = 0x49CC;
|
||||
|
||||
public AnimatedHeartShapedBox(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,62 +4,104 @@ using Server.Network;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Serializable(0, false)]
|
||||
public abstract partial class StValentinesBear : Item
|
||||
public abstract class StValentinesBear : Item
|
||||
{
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _owner;
|
||||
private string m_Line1;
|
||||
private string m_Line2;
|
||||
private string m_Line3;
|
||||
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(1)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _line1;
|
||||
private string m_Owner;
|
||||
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(2)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _line2;
|
||||
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(3)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _line3;
|
||||
|
||||
public StValentinesBear(int itemid, string name) : base(itemid)
|
||||
public StValentinesBear(int itemid, string name)
|
||||
: base(itemid)
|
||||
{
|
||||
_owner = name;
|
||||
m_Owner = name;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override string DefaultName => _owner != null ? $"{_owner}'s St. Valentine Bear" : "St. Valentine Bear";
|
||||
public StValentinesBear(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Owner != null)
|
||||
{
|
||||
return $"{m_Owner}'s St. Valentine Bear";
|
||||
}
|
||||
|
||||
return "St. Valentine Bear";
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Owner
|
||||
{
|
||||
get => m_Owner;
|
||||
set
|
||||
{
|
||||
m_Owner = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Line1
|
||||
{
|
||||
get => m_Line1;
|
||||
set
|
||||
{
|
||||
m_Line1 = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Line2
|
||||
{
|
||||
get => m_Line2;
|
||||
set
|
||||
{
|
||||
m_Line2 = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Line3
|
||||
{
|
||||
get => m_Line3;
|
||||
set
|
||||
{
|
||||
m_Line3 = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime EditLimit { get; set; }
|
||||
|
||||
public bool IsSigned => _line1 != null || _line2 != null || _line3 != null;
|
||||
public bool IsSigned => m_Line1 != null || m_Line2 != null || m_Line3 != null;
|
||||
|
||||
public bool CanSign => !IsSigned || Core.Now <= EditLimit;
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_owner != null)
|
||||
if (m_Owner != null)
|
||||
{
|
||||
list.Add(1150295, _owner); // ~1_NAME~'s St. Valentine Bear
|
||||
list.Add(1150295, m_Owner); // ~1_NAME~'s St. Valentine Bear
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(1150294); // St. Valentine Bear
|
||||
}
|
||||
|
||||
AddLine(list, 1150301, _line1); // [ ~1_LINE0~ ]
|
||||
AddLine(list, 1150302, _line2); // [ ~1_LINE1~ ]
|
||||
AddLine(list, 1150303, _line3); // [ ~1_LINE2~ ]
|
||||
AddLine(list, 1150301, m_Line1); // [ ~1_LINE0~ ]
|
||||
AddLine(list, 1150302, m_Line2); // [ ~1_LINE1~ ]
|
||||
AddLine(list, 1150303, m_Line3); // [ ~1_LINE2~ ]
|
||||
}
|
||||
|
||||
private static void AddLine(ObjectPropertyList list, int cliloc, string line)
|
||||
|
|
@ -74,9 +116,9 @@ namespace Server.Items
|
|||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
ShowLine(from, 1150301, _line1); // [ ~1_LINE0~ ]
|
||||
ShowLine(from, 1150302, _line2); // [ ~1_LINE1~ ]
|
||||
ShowLine(from, 1150303, _line3); // [ ~1_LINE2~ ]
|
||||
ShowLine(from, 1150301, m_Line1); // [ ~1_LINE0~ ]
|
||||
ShowLine(from, 1150302, m_Line2); // [ ~1_LINE1~ ]
|
||||
ShowLine(from, 1150303, m_Line3); // [ ~1_LINE2~ ]
|
||||
}
|
||||
|
||||
private void ShowLine(Mobile from, int cliloc, string line)
|
||||
|
|
@ -103,6 +145,30 @@ namespace Server.Items
|
|||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_Owner);
|
||||
writer.Write(m_Line1);
|
||||
writer.Write(m_Line2);
|
||||
writer.Write(m_Line3);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
m_Owner = Utility.Intern(reader.ReadString());
|
||||
m_Line1 = Utility.Intern(reader.ReadString());
|
||||
m_Line2 = Utility.Intern(reader.ReadString());
|
||||
m_Line3 = Utility.Intern(reader.ReadString());
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly StValentinesBear m_Bear;
|
||||
|
|
@ -190,23 +256,61 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
[Serializable(0, false)]
|
||||
[Flippable(0x48E0, 0x48E1)]
|
||||
public partial class StValentinesPanda : StValentinesBear
|
||||
public class StValentinesPanda : StValentinesBear
|
||||
{
|
||||
[Constructible]
|
||||
public StValentinesPanda(string name = null) : base(0x48E0, name)
|
||||
public StValentinesPanda(string name = null)
|
||||
: base(0x48E0, name)
|
||||
{
|
||||
}
|
||||
|
||||
public StValentinesPanda(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable(0, false)]
|
||||
[Flippable(0x48E2, 0x48E3)]
|
||||
public partial class StValentinesPolarBear : StValentinesBear
|
||||
public class StValentinesPolarBear : StValentinesBear
|
||||
{
|
||||
[Constructible]
|
||||
public StValentinesPolarBear(string name = null) : base(0x48E2, name)
|
||||
public StValentinesPolarBear(string name = null)
|
||||
: base(0x48E2, name)
|
||||
{
|
||||
}
|
||||
|
||||
public StValentinesPolarBear(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,32 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Serializable(0, false)]
|
||||
[Flippable(0x4F7C, 0x4F7D)]
|
||||
public partial class CupidStatue : Item
|
||||
public class CupidStatue : Item
|
||||
{
|
||||
[Constructible]
|
||||
public CupidStatue() : base(0x4F7D) => LootType = LootType.Blessed;
|
||||
public CupidStatue()
|
||||
: base(0x4F7D) =>
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
public CupidStatue(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1099220; // cupid statue
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,49 @@
|
|||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Serializable(0, false)]
|
||||
public partial class CupidsArrow : Item
|
||||
public class CupidsArrow : Item
|
||||
{
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _from;
|
||||
|
||||
[InternString]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(1)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _to;
|
||||
private string m_From;
|
||||
private string m_To;
|
||||
|
||||
[Constructible]
|
||||
public CupidsArrow() : base(0x4F7F) => LootType = LootType.Blessed;
|
||||
public CupidsArrow()
|
||||
: base(0x4F7F) =>
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
public CupidsArrow(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
// TODO: Check messages
|
||||
|
||||
public override int LabelNumber => 1152270; // Cupid's Arrow 2012
|
||||
|
||||
public bool IsSigned => _from != null && _to != null;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string From
|
||||
{
|
||||
get => m_From;
|
||||
set
|
||||
{
|
||||
m_From = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string To
|
||||
{
|
||||
get => m_To;
|
||||
set
|
||||
{
|
||||
m_To = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSigned => m_From != null && m_To != null;
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
|
|
@ -32,7 +51,7 @@ namespace Server.Items
|
|||
|
||||
if (IsSigned)
|
||||
{
|
||||
list.Add(1152273, $"{_from}\t{_to}"); // ~1_val~ is madly in love with ~2_val~
|
||||
list.Add(1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +72,7 @@ namespace Server.Items
|
|||
|
||||
if (IsSigned)
|
||||
{
|
||||
LabelTo(from, 1152273, $"{_from}\t{_to}"); // ~1_val~ is madly in love with ~2_val~
|
||||
LabelTo(from, 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -91,8 +110,8 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
_from = from.Name;
|
||||
_to = m.Name;
|
||||
m_From = from.Name;
|
||||
m_To = m.Name;
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
|
|
@ -103,5 +122,25 @@ namespace Server.Items
|
|||
from.SendMessage("That is not a person.");
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(m_From);
|
||||
writer.Write(m_To);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
m_From = Utility.Intern(reader.ReadString());
|
||||
m_To = Utility.Intern(reader.ReadString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Serializable(0, false)]
|
||||
[Flippable(0x49CA, 0x49CB)]
|
||||
public partial class HeartShapedBox : BaseContainer
|
||||
public class HeartShapedBox : BaseContainer
|
||||
{
|
||||
private static int m_DropSound;
|
||||
|
||||
[Constructible]
|
||||
public HeartShapedBox() : base(0x49CA)
|
||||
public HeartShapedBox()
|
||||
: base(0x49CA)
|
||||
{
|
||||
}
|
||||
|
||||
public HeartShapedBox(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -29,5 +34,19 @@ namespace Server.Items
|
|||
{
|
||||
m_DropSound = from.Female ? 0x430 : 0x320;
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue