Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 3.24 KB

File metadata and controls

73 lines (45 loc) · 3.24 KB

GameFrameX Logo

GameFrameX.Tools

Version License Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams

📖 Documentation💬 QQ Group: 467608841


🌐 Language: English | 简体中文 | 繁體中文 | 日本語 | 한국어


ProtoExport Tool

A tool for converting Proto protocol files into Server/Unity/TypeScript/Godot code.

Parameter Reference

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.

Command Line Example

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 server sets the run mode to Server.
  • --inputpath ./../../../../../Protobuf sets the .proto protocol file path to ./../../../../../Protobuf.
  • --outputpath ./../../../../../Server/GameFrameX.Proto/Proto sets the output file path to ./../../../../../Server/GameFrameX.Proto/Proto.
  • --namespaceName GameFrameX.Proto.Proto sets the namespace to GameFrameX.Proto.Proto.

You can adjust the command-line parameters to generate the appropriate code for your needs.

Godot Mode Example

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 godot sets the run mode to Godot.
  • --inputpath ./../../../../../Protobuf sets the .proto protocol file path to ./../../../../../Protobuf.
  • --outputpath ./../../../../../Godot/Proto sets the output file path to ./../../../../../Godot/Proto.
  • --namespaceName Hotfix.Proto sets the namespace to Hotfix.Proto. Server-only proto files (ending with -s or _s) are automatically skipped.