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:
rodolphito 2019-04-04 00:46:49 -07:00 committed by vis2k
parent df132b6893
commit 46841cdd3f
3 changed files with 12 additions and 12 deletions

View File

@ -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);

View File

@ -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

View File

@ -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