Git Product home page Git Product logo

mergepbt's Introduction

mergepbt

解决protobuf-net不支持解析文本格式pb数据文件

将pbt合并并转化二进制

参数说明

  • pb 输入带有客户端配置文件pb类型信息的二进制描述文件, 需要配合github.com/davyxu/pbmeta/protoc-gen-meta插件导出

  • msgtype 客户端配置文件pb类型的完整pb类型描述

  • pbtdir 客户端配置文件pb类型中字段对应pbt文件的搜索路径

  • out 输出文件, 格式为pbt

客户端配置文件类型格式

message ClientConfig
{
	optional ItemFile Item = 3;	
	optional AIFile AI = 9;
}

  • 一个pbt文件对应一个字段

  • 字段的名字添加.pbt为输入pbt文件, 例如: Item字段对应Item.pbt

安装方法

go get github.com/davyxu/mergepbt

go install github.com/davyxu/mergepbt

使用方法

  • 使用github.com/davyxu/tabtoy导出各种pbt

  • 根据一个客户端配置文件pb类型描述, 将字段对应的pbt文件合并成1个pbt文件

..\tools\mergepbt.exe --pb=.\obj\game.pb --out=merge.pbt --msgtype=gamedef.ClientConfig --pbtdir=.\obj

  • 利用protoc的编码功能转文本为二进制

type merge.pbt | protoc.exe --encode=gamedef.ClientConfig --proto_path ..\proto ..\proto\sys.proto > config.pbb

链接

备注

感觉不错请star, 谢谢!

博客: http://www.cppblog.com/sunicdavy

知乎: http://www.zhihu.com/people/xu-bo-62-87

邮箱: [email protected]

mergepbt's People

Contributors

davyxu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.