fixes TypeCache lookup speed and errors (#95)
This commit is contained in:
parent
e97d2cb131
commit
f8f372ccb9
26 changed files with 101 additions and 109 deletions
|
|
@ -101,7 +101,7 @@ namespace Server.Commands
|
|||
break;
|
||||
}
|
||||
|
||||
Type type = AssemblyHandler.FindTypeByName(name);
|
||||
Type type = AssemblyHandler.FindFirstTypeForName(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 AssemblyHandler.FindTypeByName(value);
|
||||
if (IsType(type)) return AssemblyHandler.FindFirstTypeForName(value);
|
||||
if (IsParsable(type)) return ParseParsable(type, value);
|
||||
object obj = value;
|
||||
|
||||
|
|
|
|||
|
|
@ -1025,7 +1025,7 @@ namespace Server.Commands
|
|||
|
||||
int indexOf = line.IndexOf(' ');
|
||||
|
||||
list.m_Type = AssemblyHandler.FindTypeByName(line.Substring(0, indexOf++), true);
|
||||
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
||||
|
||||
if (list.m_Type == null)
|
||||
throw new ArgumentException($"Type not found for header: '{line}'");
|
||||
|
|
|
|||
|
|
@ -1012,7 +1012,7 @@ namespace Server.Commands
|
|||
|
||||
int indexOf = line.IndexOf(' ');
|
||||
|
||||
list.m_Type = AssemblyHandler.FindTypeByName(line.Substring(0, indexOf++), true);
|
||||
list.m_Type = AssemblyHandler.FindFirstTypeForName(line.Substring(0, indexOf++), true);
|
||||
|
||||
if (list.m_Type == null)
|
||||
throw new ArgumentException($"Type not found for header: '{line}'");
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ namespace Server.Commands
|
|||
|
||||
for (int i = 0; i < split.Length; ++i)
|
||||
{
|
||||
Type type = AssemblyHandler.FindTypeByName(split[i].Trim());
|
||||
Type type = AssemblyHandler.FindFirstTypeForName(split[i].Trim());
|
||||
|
||||
if (type == null)
|
||||
Console.WriteLine("Match type not found ('{0}')", split[i].Trim());
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
if (e.Length >= 1)
|
||||
{
|
||||
Type t = AssemblyHandler.FindTypeByName(e.GetString(0));
|
||||
Type t = AssemblyHandler.FindFirstTypeForName(e.GetString(0));
|
||||
|
||||
if (t == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
int index = 0;
|
||||
|
||||
Type objectType = AssemblyHandler.FindTypeByName(args[offset + index], true);
|
||||
Type objectType = AssemblyHandler.FindFirstTypeForName(args[offset + index], true);
|
||||
|
||||
if (objectType == null)
|
||||
throw new Exception($"No type with that name ({args[offset + index]}) was found.");
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ namespace Server.Commands
|
|||
int count = bin.ReadInt32();
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
types.Add(AssemblyHandler.FindTypeByFullName(bin.ReadString()));
|
||||
types.Add(AssemblyHandler.FindFirstTypeForName(bin.ReadString()));
|
||||
}
|
||||
|
||||
long total = 0;
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ namespace Server.Commands
|
|||
else if (IsType(type))
|
||||
try
|
||||
{
|
||||
toSet = AssemblyHandler.FindTypeByName(value);
|
||||
toSet = AssemblyHandler.FindFirstTypeForName(value);
|
||||
|
||||
if (toSet == null)
|
||||
return "No type with that name was found.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue