@@ -20,17 +20,19 @@ public static ILPostProcessResult NetworkBehaviourProcess(ICompiledAssembly asse
2020 NetworkBehaviourILPP ilpp = new NetworkBehaviourILPP();
2121 if (ilpp.WillProcess(assembly))
2222 {
23- //Debug.Log("Will Process: " + assembly.Name);
2423
2524 // process it like Unity would
2625 ILPostProcessResult result = ilpp.Process(assembly);
2726
27+
2828 // handle the error messages like Unity would
29+
2930 foreach (DiagnosticMessage message in result.Diagnostics)
3031 {
3132 if (message.DiagnosticType == DiagnosticType.Warning)
3233 {
33- OnWarning(message.MessageData);
34+ // console output
35+ OnWarning(message.MessageData + $"{message.File}:{message.Line}");
3436 }
3537 else if (message.DiagnosticType == DiagnosticType.Error)
3638 {
@@ -58,7 +60,7 @@ public static ILPostProcessResult INetworkMessageProcess(ICompiledAssembly assem
5860 {
5961 if (message.DiagnosticType == DiagnosticType.Warning)
6062 {
61- OnWarning(message.MessageData);
63+ OnWarning(message.MessageData + $"{message.File}:{message.Line}" );
6264 }
6365 else if (message.DiagnosticType == DiagnosticType.Error)
6466 {
@@ -86,7 +88,7 @@ public static ILPostProcessResult INetworkSerializableProcess(ICompiledAssembly
8688 {
8789 if (message.DiagnosticType == DiagnosticType.Warning)
8890 {
89- OnWarning(message.MessageData);
91+ OnWarning(message.MessageData + $"{message.File}:{message.Line}" );
9092 }
9193 else if (message.DiagnosticType == DiagnosticType.Error)
9294 {
@@ -108,21 +110,27 @@ public static void ILPostProcessFile(string assemblyPath, string[] references, A
108110
109111 var result = NetworkBehaviourProcess(assembly, OnWarning, OnError);
110112
111- /* if (result != null)
113+ if (result != null)
112114 {
113- assembly = new CompiledAssemblyFromInMemoryAssembly(result.InMemoryAssembly, assembly.Name);
115+ var newAssembly = new CompiledAssemblyFromInMemoryAssembly(result.InMemoryAssembly, assembly.Name);
116+ newAssembly.References = references;
117+
118+ assembly = newAssembly;
114119 }
115120
116121 result = INetworkMessageProcess(assembly, OnWarning, OnError);
117-
118-
122+
123+
119124 if (result != null)
120125 {
121- assembly = new CompiledAssemblyFromInMemoryAssembly(result.InMemoryAssembly, assembly.Name);
126+ var newAssembly = new CompiledAssemblyFromInMemoryAssembly(result.InMemoryAssembly, assembly.Name);
127+ newAssembly.References = references;
128+
129+ assembly = newAssembly;
122130 }
123131
124132 result = INetworkSerializableProcess(assembly, OnWarning, OnError);
125- */
133+
126134
127135 // save the weaved assembly to file.
128136 // some tests open it and check for certain IL code.
0 commit comments