Coder Social home page Coder Social logo

protoc:load问题 about lua-protobuf HOT 4 CLOSED

starwing avatar starwing commented on May 17, 2024
protoc:load问题

from lua-protobuf.

Comments (4)

starwing avatar starwing commented on May 17, 2024

有错误嘛?我这边用protoc:load没啥问题,另外实际使用的时候还是推荐Protoc.new()然后load,比较灵活和安全,protoc:load主要是为了方便使用,会导致载入的proto的数据在内存中一直存在不会被消除

from lua-protobuf.

yiyucyp avatar yiyucyp commented on May 17, 2024

你试试下面的格式,会报错
`syntax = "proto3";
package protocol;

message get_ping {
}

message get_ping_ret {
}

enum register_result {
enumZero = 0;
registerSuccess = 1; //注册成功
userExists = 2; //用户名已经存在
invalidFormat = 3; //用户名格式不符合规范
invalidServer = 6; //连接游戏服务器失败
}

//登录服务器注册账号
message login_register{
string username = 1; //用户名
string password = 2; //密码
}

//登录服务器注册账号返回
message login_register_ret {
register_result result = 1; //注册结果
int32 uid = 2; //用户id 注册成功返回此字段
string token = 3; //登录令牌 注册成功返回此字段
string gameServer = 4; //返回游戏服务器地址
string msg = 5; //反馈消息 登录失败返回
}

message C2S {
int32 seq = 1; //消息序号
int32 msgType = 2; //消息ID
//-----------------通用接口---------------
get_ping get_ping = 3;

//-----------------登录模块接口---------------
login_register login_register = 6;

}

message S2C {
int32 seq = 1;
int32 msgType = 2; //消息ID
//-----------------通用接口---------------
get_ping_ret get_ping_ret = 3;

//-----------------登录服接口---------------
login_register_ret login_register_ret = 6;

}

//rpc 服务间转发
service RPCService {
rpc request(C2S) returns(S2C);
}`

from lua-protobuf.

starwing avatar starwing commented on May 17, 2024

现在应该好了?

from lua-protobuf.

starwing avatar starwing commented on May 17, 2024

没有后续反馈了,暂时关掉,如果还有问题可以再打开~

from lua-protobuf.

Related Issues (20)

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.