mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: OverrideVirtualWithBaseCallsBothVirtualAndBase etc. failing tests because Weaver Cmd/Rpc SubstitueMethods couldn't be accessed by inheriting classes
This commit is contained in:
parent
74ae04d222
commit
ff218adc17
@ -35,11 +35,14 @@ public static MethodDefinition SubstituteMethod(TypeDefinition td, MethodDefinit
|
||||
string newName = RpcPrefix + md.Name;
|
||||
MethodDefinition cmd = new MethodDefinition(newName, md.Attributes, md.ReturnType);
|
||||
|
||||
// force new usercode_cmd to be private.
|
||||
// otherwise the generated User_Cmd could be assigned to UnityEvents in the Inspector
|
||||
// (User_Cmd() is only called by Invoke_Cmd in this class)
|
||||
// force the substitute method to be protected.
|
||||
// -> public would show in the Inspector for UnityEvents as
|
||||
// User_CmdUsePotion() etc. but the user shouldn't use those.
|
||||
// -> private would not allow inheriting classes to call it, see
|
||||
// OverrideVirtualWithBaseCallsBothVirtualAndBase test.
|
||||
// -> IL has no concept of 'protected', it's called IsFamily there.
|
||||
cmd.IsPublic = false;
|
||||
cmd.IsPrivate = true;
|
||||
cmd.IsFamily = true;
|
||||
|
||||
// add parameters
|
||||
foreach (ParameterDefinition pd in md.Parameters)
|
||||
|
Loading…
Reference in New Issue
Block a user