mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
remove QSB reference from weaver
This commit is contained in:
parent
fd6519f104
commit
15f68f19ad
@ -7,6 +7,5 @@
|
||||
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
|
||||
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.125" IncludeAssets="compile" />
|
||||
<ProjectReference Include="..\Mirror\Mirror.csproj" />
|
||||
<ProjectReference Include="..\QSB\QSB.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Mono.Cecil;
|
||||
using QSB.Messaging;
|
||||
|
||||
namespace Mirror.Weaver
|
||||
{
|
||||
@ -209,8 +208,21 @@ namespace Mirror.Weaver
|
||||
return null;
|
||||
}
|
||||
|
||||
public static bool IsQSBMessageType(this TypeDefinition typeDefinition) =>
|
||||
typeDefinition.IsDerivedFrom<QSBMessage>() || typeDefinition.IsDerivedFrom<QSBMessageRaw>();
|
||||
public static bool IsQSBMessageType(this TypeDefinition td)
|
||||
{
|
||||
if (!td.IsClass) return false;
|
||||
while (true)
|
||||
{
|
||||
var parent = td.BaseType;
|
||||
if (parent == null) return false;
|
||||
|
||||
if (parent.FullName is "QSB.Messaging.QSBMessage" or "QSB.Messaging.QSBMessageRaw")
|
||||
return true;
|
||||
|
||||
if (!parent.CanBeResolved()) return false;
|
||||
td = parent.Resolve();
|
||||
}
|
||||
}
|
||||
|
||||
// Finds public fields in type and base type
|
||||
public static IEnumerable<FieldDefinition> FindAllPublicFields(this TypeReference variable)
|
||||
|
Loading…
Reference in New Issue
Block a user