Code Cleanup & Fixes Warnings (#74)
This commit is contained in:
parent
e11d1f3ad9
commit
57b14ad690
143 changed files with 2960 additions and 3427 deletions
|
|
@ -426,7 +426,7 @@ namespace Server.Commands
|
|||
from.SendMessage(sb.ToString());
|
||||
}
|
||||
|
||||
private static void TileBox_Callback(Mobile from, Map map, Point3D start, Point3D end, TileState ts)
|
||||
private static void TileBox_Callback(Mobile from, Point3D start, Point3D end, TileState ts)
|
||||
{
|
||||
bool mapAvg = false;
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ namespace Server.Commands
|
|||
|
||||
if (e.Length >= 1)
|
||||
BoundingBoxPicker.Begin(from, (map, start, end) =>
|
||||
TileBox_Callback(from, map, start, end, new TileState(TileZType.Start, 0, e.Arguments, outline)));
|
||||
TileBox_Callback(from, start, end, new TileState(TileZType.Start, 0, e.Arguments, outline)));
|
||||
else
|
||||
from.SendMessage("Format: {0} <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile");
|
||||
|
|
@ -515,7 +515,7 @@ namespace Server.Commands
|
|||
subArgs[i] = e.Arguments[i + 1];
|
||||
|
||||
BoundingBoxPicker.Begin(from, (map, start, end) =>
|
||||
TileBox_Callback(from, map, start, end, new TileState(TileZType.Fixed, e.GetInt32(0), subArgs, outline)));
|
||||
TileBox_Callback(from, start, end, new TileState(TileZType.Fixed, e.GetInt32(0), subArgs, outline)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -530,7 +530,7 @@ namespace Server.Commands
|
|||
|
||||
if (e.Length >= 1)
|
||||
BoundingBoxPicker.Begin(from, (map, start, end) =>
|
||||
TileBox_Callback(from, map, start, end, new TileState(TileZType.MapAverage, 0, e.Arguments, outline)));
|
||||
TileBox_Callback(from, start, end, new TileState(TileZType.MapAverage, 0, e.Arguments, outline)));
|
||||
else
|
||||
from.SendMessage("Format: {0}Avg <type> [params] [set {{<propertyName> <value> ...}}]",
|
||||
outline ? "Outline" : "Tile");
|
||||
|
|
|
|||
|
|
@ -931,8 +931,7 @@ namespace Server.Commands
|
|||
|
||||
for (int j = 0; j < maps.Length; ++j)
|
||||
{
|
||||
if (item == null)
|
||||
item = Construct();
|
||||
item ??= Construct();
|
||||
|
||||
if (item == null)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -929,8 +929,7 @@ namespace Server.Commands
|
|||
|
||||
for (int j = 0; j < maps.Length; ++j)
|
||||
{
|
||||
if (item == null)
|
||||
item = Construct();
|
||||
item ??= Construct();
|
||||
|
||||
if (item == null)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ namespace Server.Commands
|
|||
if (baseInfo == null)
|
||||
m_Types[baseType] = baseInfo = new TypeInfo(baseType);
|
||||
|
||||
if (baseInfo.m_Derived == null)
|
||||
baseInfo.m_Derived = new List<TypeInfo>();
|
||||
baseInfo.m_Derived ??= new List<TypeInfo>();
|
||||
|
||||
baseInfo.m_Derived.Add(info);
|
||||
}
|
||||
|
|
@ -97,8 +96,7 @@ namespace Server.Commands
|
|||
if (decInfo == null)
|
||||
m_Types[decType] = decInfo = new TypeInfo(decType);
|
||||
|
||||
if (decInfo.m_Nested == null)
|
||||
decInfo.m_Nested = new List<TypeInfo>();
|
||||
decInfo.m_Nested ??= new List<TypeInfo>();
|
||||
|
||||
decInfo.m_Nested.Add(info);
|
||||
}
|
||||
|
|
@ -115,8 +113,7 @@ namespace Server.Commands
|
|||
if (ifaceInfo == null)
|
||||
m_Types[iface] = ifaceInfo = new TypeInfo(iface);
|
||||
|
||||
if (ifaceInfo.m_Derived == null)
|
||||
ifaceInfo.m_Derived = new List<TypeInfo>();
|
||||
ifaceInfo.m_Derived ??= new List<TypeInfo>();
|
||||
|
||||
ifaceInfo.m_Derived.Add(info);
|
||||
}
|
||||
|
|
@ -265,20 +262,13 @@ namespace Server.Commands
|
|||
|
||||
typeName = name ?? type.Name;
|
||||
|
||||
if (fnam == null) fileName = $"docs/types/{SanitizeType(type.Name)}.html";
|
||||
else fileName = $"{fnam}.html";
|
||||
fileName = fnam == null ? $"docs/types/{SanitizeType(type.Name)}.html" : $"{fnam}.html";
|
||||
|
||||
if (link == null)
|
||||
{
|
||||
if (DontLink(type)) //if ( DontLink( type.Name ) )
|
||||
linkName = $"<font color=\"blue\">{SanitizeType(type.Name)}</font>";
|
||||
else
|
||||
linkName = $"<a href=\"@directory@{SanitizeType(type.Name)}.html\">{SanitizeType(type.Name)}</a>";
|
||||
}
|
||||
linkName = DontLink(type) ? $"<font color=\"blue\">{SanitizeType(type.Name)}</font>"
|
||||
: $"<a href=\"@directory@{SanitizeType(type.Name)}.html\">{SanitizeType(type.Name)}</a>";
|
||||
else
|
||||
{
|
||||
linkName = link;
|
||||
}
|
||||
|
||||
//Console.WriteLine( typeName+":"+fileName+":"+linkName );
|
||||
}
|
||||
|
|
@ -604,8 +594,7 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
|
||||
if (aliased == null)
|
||||
aliased = realType?.Name ?? "";
|
||||
aliased ??= realType?.Name ?? "";
|
||||
}
|
||||
|
||||
return string.Concat(prepend, aliased, append, name);
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ namespace Server.Commands.Generic
|
|||
FieldAttributes.Private | FieldAttributes.InitOnly
|
||||
);
|
||||
|
||||
// parseMethod.Invoke(null,
|
||||
// parseArgs.Length == 2 ? new object[] {toParse, (int) parseArgs[1]} : new object[] {toParse});
|
||||
// parseMethod.Invoke(null,
|
||||
// parseArgs.Length == 2 ? new object[] {toParse, (int) parseArgs[1]} : new object[] {toParse});
|
||||
|
||||
|
||||
il.Emit(OpCodes.Ldarg_0);
|
||||
|
|
|
|||
|
|
@ -192,8 +192,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
MethodInfo getHashCode = active.GetMethod("GetHashCode", Type.EmptyTypes);
|
||||
|
||||
if (getHashCode == null)
|
||||
getHashCode = typeof(T).GetMethod("GetHashCode", Type.EmptyTypes);
|
||||
getHashCode ??= typeof(T).GetMethod("GetHashCode", Type.EmptyTypes);
|
||||
|
||||
if (active != typeof(int))
|
||||
{
|
||||
|
|
@ -256,4 +255,4 @@ namespace Server.Commands.Generic
|
|||
return (IComparer<T>)Activator.CreateInstance(comparerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ namespace Server.Commands.Generic
|
|||
prop.CheckAccess(from);
|
||||
}
|
||||
|
||||
if (assembly == null)
|
||||
assembly = new AssemblyEmitter("__dynamic");
|
||||
assembly ??= new AssemblyEmitter("__dynamic");
|
||||
|
||||
m_Comparer = DistinctCompiler.Compile<object>(assembly, baseType, m_Properties.ToArray());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ namespace Server.Commands.Generic
|
|||
order.Property.CheckAccess(from);
|
||||
}
|
||||
|
||||
if (assembly == null)
|
||||
assembly = new AssemblyEmitter("__dynamic");
|
||||
assembly ??= new AssemblyEmitter("__dynamic");
|
||||
|
||||
m_Comparer = SortCompiler.Compile<object>(assembly, baseType, m_Orders.ToArray());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
public void Compile(ref AssemblyEmitter emitter)
|
||||
{
|
||||
if (emitter == null)
|
||||
emitter = new AssemblyEmitter("__dynamic");
|
||||
emitter ??= new AssemblyEmitter("__dynamic");
|
||||
|
||||
m_Conditionals = new IConditional[m_Conditions.Length];
|
||||
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ namespace Server.Commands
|
|||
if (IsEnum(type))
|
||||
try
|
||||
{
|
||||
toSet = Enum.Parse(type, value, true);
|
||||
toSet = Enum.Parse(type, value ?? "", true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue