All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
📖 Documentation • 💬 QQ Group: 467608841
🌐 Language: English | 简体中文 | 繁體中文 | 日本語 | 한국어
A tool for converting Proto protocol files into Server/Unity/TypeScript/Godot code.
Below is a detailed description of the command-line parameters for this tool.
--mode
This parameter specifies the run mode. Valid values include Server, Unity, TypeScript, or Godot.
--inputpath
This parameter specifies the path to the .proto protocol files. The program will scan all files ending with .proto under the specified path.
--outputpath
This parameter specifies the output path for the generated files.
--namespaceName
This parameter specifies the namespace. This parameter has no effect in TypeScript mode. In Godot mode, the generated code always uses GameFrameX.Network.Runtime namespace. If you do not want to set a namespace, pass an empty value.
The following command example demonstrates how to convert Proto protocol files into Server code:
--mode server --inputpath ./../../../../../Protobuf --outputpath ./../../../../../Server/GameFrameX.Proto/Proto --namespaceName GameFrameX.Proto.Proto
In the above example:
--mode serversets the run mode to Server.--inputpath ./../../../../../Protobufsets the .proto protocol file path to./../../../../../Protobuf.--outputpath ./../../../../../Server/GameFrameX.Proto/Protosets the output file path to./../../../../../Server/GameFrameX.Proto/Proto.--namespaceName GameFrameX.Proto.Protosets the namespace toGameFrameX.Proto.Proto.
You can adjust the command-line parameters to generate the appropriate code for your needs.
The following command example demonstrates how to convert Proto protocol files into Godot C# code:
--mode godot --inputpath ./../../../../../Protobuf --outputpath ./../../../../../Godot/Proto --namespaceName Hotfix.Proto
In the above example:
--mode godotsets the run mode to Godot.--inputpath ./../../../../../Protobufsets the .proto protocol file path to./../../../../../Protobuf.--outputpath ./../../../../../Godot/Protosets the output file path to./../../../../../Godot/Proto.--namespaceName Hotfix.Protosets the namespace toHotfix.Proto. Server-only proto files (ending with-sor_s) are automatically skipped.
