Fixes publishing

This commit is contained in:
Kamron Batman 2019-10-04 22:02:19 -07:00
parent 6119774dc9
commit 58be0d416c
No known key found for this signature in database
GPG key ID: 5C9DFD15804B6BB8
53 changed files with 981 additions and 1225 deletions

View file

@ -101,7 +101,7 @@ namespace Server.Commands
break;
}
Type type = ScriptCompiler.FindTypeByName(name);
Type type = AssemblyHandler.FindTypeByName(name);
if (!IsEntity(type))
{
@ -241,7 +241,7 @@ namespace Server.Commands
try
{
if (IsEnum(type)) return Enum.Parse(type, value, true);
if (IsType(type)) return ScriptCompiler.FindTypeByName(value);
if (IsType(type)) return AssemblyHandler.FindTypeByName(value);
if (IsParsable(type)) return ParseParsable(type, value);
object obj = value;

View file

@ -1016,7 +1016,7 @@ namespace Server.Commands
int indexOf = line.IndexOf(' ');
list.m_Type = ScriptCompiler.FindTypeByName(line.Substring(0, indexOf++), true);
list.m_Type = AssemblyHandler.FindTypeByName(line.Substring(0, indexOf++), true);
if (list.m_Type == null)
throw new ArgumentException($"Type not found for header: '{line}'");

View file

@ -1014,7 +1014,7 @@ namespace Server.Commands
int indexOf = line.IndexOf(' ');
list.m_Type = ScriptCompiler.FindTypeByName(line.Substring(0, indexOf++), true);
list.m_Type = AssemblyHandler.FindTypeByName(line.Substring(0, indexOf++), true);
if (list.m_Type == null)
throw new ArgumentException($"Type not found for header: '{line}'");

View file

@ -667,7 +667,7 @@ namespace Server.Commands
List<Assembly> assemblies = new List<Assembly> { Core.Assembly };
foreach (Assembly asm in ScriptCompiler.Assemblies)
foreach (Assembly asm in AssemblyHandler.Assemblies)
assemblies.Add(asm);
Assembly[] asms = assemblies.ToArray();

View file

@ -144,8 +144,8 @@ namespace Server.Commands
AddTypes(Core.Assembly, types);
for (int i = 0; i < ScriptCompiler.Assemblies.Length; ++i)
AddTypes(ScriptCompiler.Assemblies[i], types);
for (int i = 0; i < AssemblyHandler.Assemblies.Length; ++i)
AddTypes(AssemblyHandler.Assemblies[i], types);
m_RootItems = Load(types, "Data/items.cfg");
m_RootMobiles = Load(types, "Data/mobiles.cfg");
@ -315,7 +315,7 @@ namespace Server.Commands
for (int i = 0; i < split.Length; ++i)
{
Type type = ScriptCompiler.FindTypeByName(split[i].Trim());
Type type = AssemblyHandler.FindTypeByName(split[i].Trim());
if (type == null)
Console.WriteLine("Match type not found ('{0}')", split[i].Trim());

View file

@ -444,7 +444,7 @@ namespace Server.Commands.Generic
{
if (e.Length >= 1)
{
Type t = ScriptCompiler.FindTypeByName(e.GetString(0));
Type t = AssemblyHandler.FindTypeByName(e.GetString(0));
if (t == null)
{
@ -1108,4 +1108,4 @@ namespace Server.Commands.Generic
LogFailure("No house was found.");
}
}
}
}

View file

@ -90,7 +90,7 @@ namespace Server.Commands.Generic
int index = 0;
Type objectType = ScriptCompiler.FindTypeByName(args[offset + index], true);
Type objectType = AssemblyHandler.FindTypeByName(args[offset + index], true);
if (objectType == null)
throw new Exception($"No type with that name ({args[offset + index]}) was found.");

View file

@ -290,7 +290,7 @@ namespace Server.Commands
int count = bin.ReadInt32();
for (int i = 0; i < count; ++i)
types.Add(ScriptCompiler.FindTypeByFullName(bin.ReadString()));
types.Add(AssemblyHandler.FindTypeByFullName(bin.ReadString()));
}
long total = 0;

View file

@ -418,7 +418,7 @@ namespace Server.Commands
else if (IsType(type))
try
{
toSet = ScriptCompiler.FindTypeByName(value);
toSet = AssemblyHandler.FindTypeByName(value);
if (toSet == null)
return "No type with that name was found.";

View file

@ -23,7 +23,7 @@ namespace Server.Engines.BulkOrders
string type = reader.ReadString();
if (type != null)
ItemType = ScriptCompiler.FindTypeByFullName(type);
ItemType = AssemblyHandler.FindTypeByFullName(type);
AmountCur = reader.ReadEncodedInt();
Number = reader.ReadEncodedInt();
@ -53,4 +53,4 @@ namespace Server.Engines.BulkOrders
writer.WriteEncodedInt(Graphic);
}
}
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Engines.BulkOrders
string type = reader.ReadString();
if (type != null)
ItemType = ScriptCompiler.FindTypeByFullName(type);
ItemType = AssemblyHandler.FindTypeByFullName(type);
RequireExceptional = reader.ReadBool();
@ -97,4 +97,4 @@ namespace Server.Engines.BulkOrders
writer.WriteEncodedInt(Price);
}
}
}
}

View file

@ -104,7 +104,7 @@ namespace Server.Engines.BulkOrders
string type = reader.ReadString();
if ( type != null )
realType = ScriptCompiler.FindTypeByFullName( type );
realType = AssemblyHandler.FindTypeByFullName( type );
Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() );
}

View file

@ -201,7 +201,7 @@ namespace Server.Engines.BulkOrders
string type = reader.ReadString();
if (type != null)
Type = ScriptCompiler.FindTypeByFullName(type);
Type = AssemblyHandler.FindTypeByFullName(type);
m_Number = reader.ReadInt();
Graphic = reader.ReadInt();

View file

@ -71,7 +71,7 @@ namespace Server.Engines.BulkOrders
if ( split.Length >= 2 )
{
Type type = ScriptCompiler.FindTypeByName( split[0] );
Type type = AssemblyHandler.FindTypeByName( split[0] );
int graphic = Utility.ToInt32( split[split.Length - 1] );
if ( type != null && graphic > 0 )

View file

@ -299,7 +299,7 @@ namespace Server.Engines.Doom
if (TypeName == null)
return;
Type type = ScriptCompiler.FindTypeByName(TypeName, true);
Type type = AssemblyHandler.FindTypeByName(TypeName, true);
if (type == null)
return;

View file

@ -49,12 +49,12 @@ namespace Server.Factions
m_Factions = new List<Faction>();
m_Towns = new List<Town>();
Assembly[] asms = ScriptCompiler.Assemblies;
Assembly[] asms = AssemblyHandler.Assemblies;
for (int i = 0; i < asms.Length; ++i)
{
Assembly asm = asms[i];
TypeCache tc = ScriptCompiler.GetTypeCache(asm);
TypeCache tc = AssemblyHandler.GetTypeCache(asm);
Type[] types = tc.Types;
for (int j = 0; j < types.Length; ++j)
@ -75,4 +75,4 @@ namespace Server.Factions
}
}
}
}
}

View file

@ -88,7 +88,7 @@ namespace Server.Engines.MLQuests.Items
string typeName = reader.ReadString();
if (typeName != null)
m_QuestType = ScriptCompiler.FindTypeByFullName(typeName, false);
m_QuestType = AssemblyHandler.FindTypeByFullName(typeName, false);
Message = TextDefinition.Deserialize(reader);
}
@ -186,7 +186,7 @@ namespace Server.Engines.MLQuests.Items
string typeName = reader.ReadString();
if (typeName != null)
m_TicketType = ScriptCompiler.FindTypeByFullName(typeName, false);
m_TicketType = AssemblyHandler.FindTypeByFullName(typeName, false);
Message = TextDefinition.Deserialize(reader);
}

View file

@ -47,7 +47,7 @@ namespace Server.Engines.MLQuests
string[] split = line.Split('\t');
Type type = ScriptCompiler.FindTypeByName(split[0]);
Type type = AssemblyHandler.FindTypeByName(split[0]);
if (type == null || !baseQuestType.IsAssignableFrom(type))
{
@ -76,7 +76,7 @@ namespace Server.Engines.MLQuests
for (int i = 1; i < split.Length; ++i)
{
Type questerType = ScriptCompiler.FindTypeByName(split[i]);
Type questerType = AssemblyHandler.FindTypeByName(split[i]);
if (questerType == null || !baseQuesterType.IsAssignableFrom(questerType))
{
@ -157,7 +157,7 @@ namespace Server.Engines.MLQuests
return;
}
Type index = ScriptCompiler.FindTypeByName(e.GetString(0));
Type index = AssemblyHandler.FindTypeByName(e.GetString(0));
if (index == null || !Quests.TryGetValue(index, out MLQuest quest))
{
@ -183,7 +183,7 @@ namespace Server.Engines.MLQuests
return;
}
Type index = ScriptCompiler.FindTypeByName(e.GetString(0));
Type index = AssemblyHandler.FindTypeByName(e.GetString(0));
if (index == null || !Quests.TryGetValue(index, out MLQuest quest))
{
@ -638,7 +638,7 @@ namespace Server.Engines.MLQuests
if (typeName == null)
return null; // not serialized
Type questType = ScriptCompiler.FindTypeByFullName(typeName);
Type questType = AssemblyHandler.FindTypeByFullName(typeName);
if (questType == null)
return null; // no longer a type

View file

@ -63,7 +63,7 @@ namespace Server.Engines.Quests
if (fullName == null)
return null;
return ScriptCompiler.FindTypeByFullName(fullName, false);
return AssemblyHandler.FindTypeByFullName(fullName, false);
}
}
}
@ -185,4 +185,4 @@ namespace Server.Engines.Quests
}
}
}
}
}

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{
public static Type GetType(string name)
{
return ScriptCompiler.FindTypeByName(name);
return AssemblyHandler.FindTypeByName(name);
}
}
}
}

View file

@ -133,15 +133,15 @@ namespace Server.Gumps
List<Type> results = new List<Type>();
Type[] types;
Assembly[] asms = ScriptCompiler.Assemblies;
Assembly[] asms = AssemblyHandler.Assemblies;
for (int i = 0; i < asms.Length; ++i)
{
types = ScriptCompiler.GetTypeCache(asms[i]).Types;
types = AssemblyHandler.GetTypeCache(asms[i]).Types;
Match(match, types, results);
}
types = ScriptCompiler.GetTypeCache(Core.Assembly).Types;
types = AssemblyHandler.GetTypeCache(Core.Assembly).Types;
Match(match, types, results);
results.Sort(new TypeNameComparer());

View file

@ -20,7 +20,7 @@ namespace Server.Gumps
Parent = parent;
if (xml.MoveToAttribute("type"))
Type = ScriptCompiler.FindTypeByFullName(xml.Value, false);
Type = AssemblyHandler.FindTypeByFullName(xml.Value, false);
if (xml.MoveToAttribute("gfx"))
ItemID = XmlConvert.ToInt32(xml.Value);

View file

@ -33,7 +33,7 @@ namespace Server.Items
SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
if (GetSaveFlag(flags, SaveFlag.Type))
Type = ScriptCompiler.FindTypeByFullName(reader.ReadString(), false);
Type = AssemblyHandler.FindTypeByFullName(reader.ReadString(), false);
if (GetSaveFlag(flags, SaveFlag.Name))
Name = TextDefinition.Deserialize(reader);

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishDir>../Assemblies</PublishDir>
</PropertyGroup>
</Project>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishDir>../Assemblies</PublishDir>
</PropertyGroup>
</Project>

View file

@ -3,16 +3,11 @@
<PropertyGroup>
<RootNamespace>Server</RootNamespace>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0'">
<DefineConstants>NETCORE;NETSTANDARD</DefineConstants>
<AssemblyName>Scripts.CS</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<OutputPath>..\..\Distribution\Assemblies\</OutputPath>
<OutDir>..\..\Distribution\Assemblies</OutDir>
<WarningsAsErrors />
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>x64</PlatformTarget>
@ -22,8 +17,7 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<OutputPath>..\..\Distribution\Assemblies\</OutputPath>
<OutDir>..\..\Distribution\Assemblies</OutDir>
<PublishDir>..\..\Distribution\Assemblies</PublishDir>
<WarningsAsErrors />
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>x64</PlatformTarget>
@ -32,8 +26,7 @@
<Content Include="SpecialSystems\README.TXT" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Server\Server.csproj">
<Private>false</Private>
<ProjectReference Include="..\Server\Server.csproj" Private="false" PrivateAssets="All" IncludeAssets="None">
<IncludeInPackage>false</IncludeInPackage>
</ProjectReference>
</ItemGroup>

View file

@ -147,7 +147,7 @@ namespace Server.Spells
{
for (int i = 0; i < m_CircleNames.Length; ++i)
{
Type t = ScriptCompiler.FindTypeByFullName($"Server.Spells.{m_CircleNames[i]}.{name}");
Type t = AssemblyHandler.FindTypeByFullName($"Server.Spells.{m_CircleNames[i]}.{name}");
if (t?.IsSubclassOf(typeof(SpecialMove)) == false)
{