fixes [decorate and adds timestamp to world save (#87)
This commit is contained in:
parent
d7f0227268
commit
717e192cf7
65 changed files with 261 additions and 118 deletions
|
|
@ -1,11 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Server.Engines.Quests.Haven;
|
||||
using Server.Engines.Quests.Necro;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
@ -339,9 +342,9 @@ namespace Server.Commands
|
|||
}
|
||||
|
||||
if (fill)
|
||||
item = (Item)Activator.CreateInstance(m_Type, content);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type, content);
|
||||
else
|
||||
item = (Item)Activator.CreateInstance(m_Type);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type);
|
||||
}
|
||||
else if (m_Type.IsSubclassOf(typeofBaseDoor))
|
||||
{
|
||||
|
|
@ -359,16 +362,16 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
|
||||
item = (Item)Activator.CreateInstance(m_Type, facing);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type, facing);
|
||||
}
|
||||
else
|
||||
{
|
||||
item = (Item)Activator.CreateInstance(m_Type);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception($"Bad type: {m_Type}", e);
|
||||
throw new TypeInitializationException(m_Type.ToString(), e);
|
||||
}
|
||||
|
||||
if (item is BaseAddon addon)
|
||||
|
|
@ -931,7 +934,16 @@ namespace Server.Commands
|
|||
|
||||
for (int j = 0; j < maps.Length; ++j)
|
||||
{
|
||||
item ??= Construct();
|
||||
|
||||
try
|
||||
{
|
||||
item ??= Construct();
|
||||
}
|
||||
catch(TypeInitializationException e)
|
||||
{
|
||||
Console.WriteLine($"{nameof(Generate)}() failed to load type: {e.TypeName}: {e.InnerException.Message}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item == null)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Server.Engines.Quests.Haven;
|
|||
using Server.Engines.Quests.Necro;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
@ -337,9 +338,9 @@ namespace Server.Commands
|
|||
}
|
||||
|
||||
if (fill)
|
||||
item = (Item)Activator.CreateInstance(m_Type, content);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type, content);
|
||||
else
|
||||
item = (Item)Activator.CreateInstance(m_Type);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type);
|
||||
}
|
||||
else if (m_Type.IsSubclassOf(typeofBaseDoor))
|
||||
{
|
||||
|
|
@ -357,11 +358,11 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
|
||||
item = (Item)Activator.CreateInstance(m_Type, facing);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type, facing);
|
||||
}
|
||||
else
|
||||
{
|
||||
item = (Item)Activator.CreateInstance(m_Type);
|
||||
item = (Item)ActivatorUtil.CreateInstance(m_Type);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
using System.Xml;
|
||||
using Server.Items;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
@ -271,7 +272,7 @@ namespace Server.Commands
|
|||
public CategoryTypeEntry(Type type)
|
||||
{
|
||||
Type = type;
|
||||
Object = Activator.CreateInstance(type);
|
||||
Object = ActivatorUtil.CreateInstance(type);
|
||||
}
|
||||
|
||||
public Type Type{ get; }
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Server.Utilities;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
|
@ -543,7 +544,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
Type conditionalType = typeBuilder.CreateType();
|
||||
|
||||
return (IConditional)Activator.CreateInstance(conditionalType);
|
||||
return (IConditional)ActivatorUtil.CreateInstance(conditionalType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Server.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
|
@ -252,7 +253,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
Type comparerType = typeBuilder.CreateType();
|
||||
|
||||
return (IComparer<T>)Activator.CreateInstance(comparerType);
|
||||
return (IComparer<T>)ActivatorUtil.CreateInstance(comparerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Server.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
|
@ -159,7 +160,7 @@ namespace Server.Commands.Generic
|
|||
#endregion
|
||||
|
||||
Type comparerType = typeBuilder.CreateType();
|
||||
return (IComparer<T>)Activator.CreateInstance(comparerType);
|
||||
return (IComparer<T>)ActivatorUtil.CreateInstance(comparerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue