Skip to content

Commit

Permalink
fix: renaming call/invoke prefix for SyncEvent (#2089)
Browse files Browse the repository at this point in the history
* renaming sync event

same reason as #2088

* removing un-used const
  • Loading branch information
James-Frowen committed Jul 13, 2020
1 parent 64f663f commit 18d6957
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void ProcessSiteMethod(TypeDefinition td, MethodDefinition md)

if (md.Name == ".cctor" ||
md.Name == NetworkBehaviourProcessor.ProcessedFunctionName ||
md.Name.StartsWith("InvokeSyn"))
md.Name.StartsWith(Weaver.InvokeRpcPrefix))
return;

if (md.Body != null && md.Body.Instructions != null)
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
Expand Up @@ -27,7 +27,7 @@ public static MethodDefinition ProcessEventInvoke(TypeDefinition td, EventDefini
return null;
}

MethodDefinition cmd = new MethodDefinition("InvokeSyncEvent" + ed.Name, MethodAttributes.Family |
MethodDefinition cmd = new MethodDefinition(Weaver.InvokeRpcPrefix + ed.Name, MethodAttributes.Family |
MethodAttributes.Static |
MethodAttributes.HideBySig,
Weaver.voidType);
Expand Down Expand Up @@ -68,7 +68,7 @@ public static MethodDefinition ProcessEventInvoke(TypeDefinition td, EventDefini
public static MethodDefinition ProcessEventCall(TypeDefinition td, EventDefinition ed, CustomAttribute syncEventAttr)
{
MethodReference invoke = Resolvers.ResolveMethod(ed.EventType, Weaver.CurrentAssembly, "Invoke");
MethodDefinition evt = new MethodDefinition("Call" + ed.Name, MethodAttributes.Public |
MethodDefinition evt = new MethodDefinition(Weaver.SyncEventPrefix + ed.Name, MethodAttributes.Public |
MethodAttributes.HideBySig,
Weaver.voidType);
// add paramters
Expand Down
1 change: 1 addition & 0 deletions Assets/Mirror/Editor/Weaver/Weaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal static class Weaver
{
public static string InvokeRpcPrefix => "InvokeUserCode_";
public static string RpcPrefix => "UserCode_";
public static string SyncEventPrefix => "SendEventMessage_";

public static WeaverLists WeaveLists { get; private set; }
public static AssemblyDefinition CurrentAssembly { get; private set; }
Expand Down

0 comments on commit 18d6957

Please sign in to comment.