Skip to content

Commit 3a9214a

Browse files
committed
fix(ProtoExport): 修正MessageTypeHandler属性格式和位置
统一ProtoBuffUnityHelper和ProtoBuffServerHelper中MessageTypeHandler属性的格式,将模块位移计算用括号明确优先级,并调整属性位置使其位于类定义之前
1 parent fa2cba2 commit 3a9214a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ProtoExport/ProtoBuffServerHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
6969
}
7070
else
7171
{
72-
sb.AppendLine($" [MessageTypeHandler({(messageInfoList.Module << 16) + operationCodeInfo.Opcode})]");
7372
sb.AppendLine($" public sealed class {operationCodeInfo.Name} : MessageObject, {operationCodeInfo.ParentClass}");
73+
sb.AppendLine($"\t[MessageTypeHandler((({messageInfoList.Module}) << 16) + {operationCodeInfo.Opcode})]");
7474
}
7575

7676
sb.AppendLine(" {");

ProtoExport/ProtoBuffUnityHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
5959
}
6060
else
6161
{
62-
sb.AppendLine($"\t[MessageTypeHandler({(messageInfoList.Module << 16) + operationCodeInfo.Opcode})]");
62+
sb.AppendLine($"\t[MessageTypeHandler((({messageInfoList.Module}) << 16) + {operationCodeInfo.Opcode})]");
6363
sb.AppendLine($"\tpublic sealed class {operationCodeInfo.Name} : MessageObject, {operationCodeInfo.ParentClass}");
6464
}
6565

0 commit comments

Comments
 (0)