mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Remove k_ prefixes in weaver (#715)
* Rename k_CmdPrefix to CmdPrefix * Rename k_RpcPrefix to RpcPrefix * Rename k_TargetRpcPrefix to TargetRpcPrefix
This commit is contained in:
parent
df132b6893
commit
46841cdd3f
@ -6,7 +6,7 @@ namespace Mirror.Weaver
|
||||
{
|
||||
public static class CommandProcessor
|
||||
{
|
||||
const string k_CmdPrefix = "InvokeCmd";
|
||||
const string CmdPrefix = "InvokeCmd";
|
||||
|
||||
/*
|
||||
// generates code like:
|
||||
@ -72,10 +72,10 @@ public static MethodDefinition ProcessCommandCall(TypeDefinition td, MethodDefin
|
||||
return null;
|
||||
|
||||
string cmdName = md.Name;
|
||||
int index = cmdName.IndexOf(k_CmdPrefix);
|
||||
int index = cmdName.IndexOf(CmdPrefix);
|
||||
if (index > -1)
|
||||
{
|
||||
cmdName = cmdName.Substring(k_CmdPrefix.Length);
|
||||
cmdName = cmdName.Substring(CmdPrefix.Length);
|
||||
}
|
||||
|
||||
// invoke internal send and return
|
||||
@ -105,7 +105,7 @@ protected static void InvokeCmdCmdThrust(NetworkBehaviour obj, NetworkReader rea
|
||||
*/
|
||||
public static MethodDefinition ProcessCommandInvoke(TypeDefinition td, MethodDefinition md)
|
||||
{
|
||||
MethodDefinition cmd = new MethodDefinition(k_CmdPrefix + md.Name,
|
||||
MethodDefinition cmd = new MethodDefinition(CmdPrefix + md.Name,
|
||||
MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig,
|
||||
Weaver.voidType);
|
||||
|
||||
|
@ -5,11 +5,11 @@ namespace Mirror.Weaver
|
||||
{
|
||||
public static class RpcProcessor
|
||||
{
|
||||
public const string k_RpcPrefix = "InvokeRpc";
|
||||
public const string RpcPrefix = "InvokeRpc";
|
||||
|
||||
public static MethodDefinition ProcessRpcInvoke(TypeDefinition td, MethodDefinition md)
|
||||
{
|
||||
MethodDefinition rpc = new MethodDefinition(k_RpcPrefix + md.Name, MethodAttributes.Family |
|
||||
MethodDefinition rpc = new MethodDefinition(RpcPrefix + md.Name, MethodAttributes.Family |
|
||||
MethodAttributes.Static |
|
||||
MethodAttributes.HideBySig,
|
||||
Weaver.voidType);
|
||||
@ -67,10 +67,10 @@ public static MethodDefinition ProcessRpcCall(TypeDefinition td, MethodDefinitio
|
||||
return null;
|
||||
|
||||
var rpcName = md.Name;
|
||||
int index = rpcName.IndexOf(k_RpcPrefix);
|
||||
int index = rpcName.IndexOf(RpcPrefix);
|
||||
if (index > -1)
|
||||
{
|
||||
rpcName = rpcName.Substring(k_RpcPrefix.Length);
|
||||
rpcName = rpcName.Substring(RpcPrefix.Length);
|
||||
}
|
||||
|
||||
// invoke SendInternal and return
|
||||
|
@ -6,7 +6,7 @@ namespace Mirror.Weaver
|
||||
{
|
||||
public static class TargetRpcProcessor
|
||||
{
|
||||
const string k_TargetRpcPrefix = "InvokeTargetRpc";
|
||||
const string TargetRpcPrefix = "InvokeTargetRpc";
|
||||
|
||||
// helper functions to check if the method has a NetworkConnection parameter
|
||||
public static bool HasNetworkConnectionParameter(MethodDefinition md)
|
||||
@ -17,7 +17,7 @@ public static bool HasNetworkConnectionParameter(MethodDefinition md)
|
||||
|
||||
public static MethodDefinition ProcessTargetRpcInvoke(TypeDefinition td, MethodDefinition md)
|
||||
{
|
||||
MethodDefinition rpc = new MethodDefinition(RpcProcessor.k_RpcPrefix + md.Name, MethodAttributes.Family |
|
||||
MethodDefinition rpc = new MethodDefinition(RpcProcessor.RpcPrefix + md.Name, MethodAttributes.Family |
|
||||
MethodAttributes.Static |
|
||||
MethodAttributes.HideBySig,
|
||||
Weaver.voidType);
|
||||
@ -95,10 +95,10 @@ public static MethodDefinition ProcessTargetRpcCall(TypeDefinition td, MethodDef
|
||||
return null;
|
||||
|
||||
var rpcName = md.Name;
|
||||
int index = rpcName.IndexOf(k_TargetRpcPrefix);
|
||||
int index = rpcName.IndexOf(TargetRpcPrefix);
|
||||
if (index > -1)
|
||||
{
|
||||
rpcName = rpcName.Substring(k_TargetRpcPrefix.Length);
|
||||
rpcName = rpcName.Substring(TargetRpcPrefix.Length);
|
||||
}
|
||||
|
||||
// invoke SendInternal and return
|
||||
|
Loading…
Reference in New Issue
Block a user