Skip to content

Commit

Permalink
fix: Mono.CecilX namespace to work around Unity 2019 Cecil namespace …
Browse files Browse the repository at this point in the history
…collision (#832)

* fix: Mono.CecilX namespace to work around Unity 2019 Cecil namespace collision

* rename dlls

* change asmdef guid for conflict with hlapi

* rename assemblynames too

* fix: invalid scene id in 2019.1 by ignoring prefabs in NetworkScenePostProcess

* rename projects too
  • Loading branch information
vis2k authored Apr 20, 2019
1 parent 203a823 commit 5262592
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Assets/Mirror/Editor/Weaver/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Mono.Cecil;
using Mono.CecilX;

namespace Mirror.Weaver
{
Expand Down
8 changes: 4 additions & 4 deletions Assets/Mirror/Editor/Weaver/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Mdb;
using Mono.Cecil.Pdb;
using Mono.CecilX;
using Mono.CecilX.Cil;
using Mono.CecilX.Mdb;
using Mono.CecilX.Pdb;

namespace Mirror.Weaver
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirror/Editor/Weaver/Mirror.Weaver.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/CommandProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// all the [Command] code from NetworkBehaviourProcessor in one place
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this class generates OnSerialize/OnDeserialize when inheriting from MessageBase
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// this class only shows warnings in case we use SyncVars etc. for MonoBehaviour.
using Mono.Cecil;
using Mono.CecilX;

namespace Mirror.Weaver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/Mirror/Editor/Weaver/Processors/RpcProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// all the [Rpc] code from NetworkBehaviourProcessor in one place
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;
namespace Mirror.Weaver
{
public static class RpcProcessor
Expand All @@ -10,7 +10,7 @@ public static class RpcProcessor
public static MethodDefinition ProcessRpcInvoke(TypeDefinition td, MethodDefinition md)
{
MethodDefinition rpc = new MethodDefinition(
RpcPrefix + md.Name,
RpcPrefix + md.Name,
MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig,
Weaver.voidType);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this class generates OnSerialize/OnDeserialize for SyncLists
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/SyncEventProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// all the SyncEvent code from NetworkBehaviourProcessor in one place
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/SyncListProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this class generates OnSerialize/OnDeserialize for SyncLists
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SyncObject code
using System;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/SyncVarProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// all the [SyncVar] code from NetworkBehaviourProcessor in one place
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
4 changes: 2 additions & 2 deletions Assets/Mirror/Editor/Weaver/Processors/TargetRpcProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// all the [TargetRpc] code from NetworkBehaviourProcessor in one place
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Mirror/Editor/Weaver/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using Mono.Cecil;
using Mono.CecilX;

namespace Mirror.Weaver
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/Mirror/Editor/Weaver/Readers.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.CecilX;
using Mono.CecilX.Cil;


namespace Mirror.Weaver
Expand Down Expand Up @@ -295,4 +295,4 @@ static MethodDefinition GenerateStructReadFunction(TypeReference variable, int r

}

}
}
2 changes: 1 addition & 1 deletion Assets/Mirror/Editor/Weaver/Resolvers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// value for null otherwise.
// (original FieldType.Resolve returns null if not found too, so
// exceptions would be a bit inconsistent here)
using Mono.Cecil;
using Mono.CecilX;

namespace Mirror.Weaver
{
Expand Down
6 changes: 2 additions & 4 deletions Assets/Mirror/Editor/Weaver/Weaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Mono.Cecil;
using Mono.Cecil.Cil;
using System.Linq;
using Mono.Cecil.Pdb;
using Mono.Cecil.Mdb;
using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down
7 changes: 3 additions & 4 deletions Assets/Mirror/Editor/Weaver/Writers.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Cecil.Cil;

using Mono.CecilX;
using Mono.CecilX.Cil;

namespace Mirror.Weaver
{
Expand Down Expand Up @@ -273,4 +272,4 @@ static MethodDefinition GenerateArrayWriteFunc(TypeReference variable, MethodRef
return writerFunc;
}
}
}
}
Binary file removed Assets/Mirror/Plugins/Mono.Cecil/Mono.Cecil.Pdb.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 5262592

Please sign in to comment.