mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
支持普通协议对象数据结构不加入opcode
支持普通协议对象数据结构不加入opcode
This commit is contained in:
@@ -179,6 +179,8 @@ public sealed class ProtoBufExporter
|
|||||||
|
|
||||||
foreach (var line in protoFileText.Split('\n'))
|
foreach (var line in protoFileText.Split('\n'))
|
||||||
{
|
{
|
||||||
|
bool hadOpCode = true;
|
||||||
|
|
||||||
var currentLine = line.Trim();
|
var currentLine = line.Trim();
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(currentLine))
|
if (string.IsNullOrWhiteSpace(currentLine))
|
||||||
@@ -249,7 +251,11 @@ public sealed class ProtoBufExporter
|
|||||||
{
|
{
|
||||||
file.AppendLine("\n\t{");
|
file.AppendLine("\n\t{");
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(parameter) || parameter == "IMessage")
|
if (string.IsNullOrWhiteSpace(parameter))
|
||||||
|
{
|
||||||
|
hadOpCode = false;
|
||||||
|
}
|
||||||
|
else if(parameter == "IMessage")
|
||||||
{
|
{
|
||||||
opcodeInfo.Code = _opCodeCache.GetOpcodeCache(className, ref _aMessage);
|
opcodeInfo.Code = _opCodeCache.GetOpcodeCache(className, ref _aMessage);
|
||||||
file.AppendLine($"\t\tpublic uint OpCode() {{ return {opCodeName}.{className}; }}");
|
file.AppendLine($"\t\tpublic uint OpCode() {{ return {opCodeName}.{className}; }}");
|
||||||
@@ -328,7 +334,10 @@ public sealed class ProtoBufExporter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hadOpCode)
|
||||||
|
{
|
||||||
_opcodes.Add(opcodeInfo);
|
_opcodes.Add(opcodeInfo);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case "}":
|
case "}":
|
||||||
|
Reference in New Issue
Block a user