game_sync/protocol/bag/bag.proto

158 lines
4.7 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package bag;
option go_package = "mongo.games.com/game/protocol/bag";
//操作结果
enum OpResultCode {
OPRC_Sucess = 0; //成功
OPRC_Error = 1; //未知错误
OPRC_UseUp = 2; //道具不足
OPRC_IdErr = 3; //物品编号不存在
OPRC_DbErr = 4; //存储出错
OPRC_BagFull = 5; //背包已满
OPRC_NotPlayer = 6; //找不到玩家
OPRC_NotChange = 7; //不可兑换
}
// 商城
enum SPacketID {
PACKET_BAG_ZERO = 0; // 弃用消息号
PACKET_ALL_BAG_INFO = 2530; //请求背包数据
PACKET_ALL_BAG_USE = 2531; //使用背包道具
PACKET_SC_SYNCBAGDATA = 2532;//背包数据更新
PACKET_SC_ITEM_EXCHANGE_RES = 2533;//背包道具兑换返回
PACKET_ALL_BAG_END = 2549; //最大消息号
//3000~3099
PACKET_PropExchange = 3000; // 道具兑换
PACKET_ExchangeList = 3001; // 兑换列表
PACKET_CS_DollChange = 3002;//娃娃卡兑换
PACKET_SC_DollChange = 3003;//娃娃卡兑换返回
PACKET_CS_DollChangeLog = 3004;//娃娃卡兑换记录
PACKET_SC_DollChangeLog = 3005;//娃娃卡兑换记录返回
}
//物品信息 后续精简
message ItemInfo{
//数据表数据
int32 ItemId = 1; // 物品ID
int64 ItemNum = 2; // 物品数量
// string Name = 3; // 名称
// repeated int32 ShowLocation = 4; // 分页类型 1道具类 2资源类 3兑换类
// repeated int32 Classify = 5; // 分页类型 1道具类 2资源类 3兑换类
// int32 Type = 6; // 道具种类 1宠物碎片 2角色碎片
// repeated int32 Effect0 = 7; // 竖版道具功能 1使用 2赠送 3出售
// repeated int32 Effect = 8; // 横版道具功能 1使用 2赠送 3出售
// int32 SaleType = 9; // 出售类型
// int32 SaleGold = 10; // 出售金额
// int32 Composition = 11; // 能否叠加 1能 2不能
// int32 CompositionMax = 12; // 叠加上限
// int32 Time = 13; // 道具时效 0为永久
// string Location = 14; // 跳转页面
// string Describe = 15; // 道具描述
int64 ObtainTime = 3; //获取的时间
}
//PACKET_ALL_BAG_INFO
message CSBagInfo {
int32 NowLocation = 1;//0.通用 1.大厅 2.Tienlen 3.捕鱼
int32 Tp = 2;// 道具类型,道具表中的道具类型
}
//PACKET_ALL_BAG_INFO
message SCBagInfo {
OpResultCode RetCode = 1;
repeated ItemInfo Infos = 2; // 商品信息
int32 BagNumMax = 3;//最大格子
}
//PACKET_ALL_BAG_USE
message CSUpBagInfo {
int32 ItemId = 1;//物品ID
int32 ItemNum = 2;//物品数量
int32 Opt = 3;//操作 0.使用 1.赠送 2.出售 3.兑换 4.分解
int32 AcceptSnId = 4;//被赠送玩家id
int32 NowEffect = 5;//0.竖版 1.横版
int64 ShowId = 6;// 邮件显示位置 0 所有大厅都显示 1 主大厅显示 2 len大厅显示 4 fish大厅显示
int32 CardType = 7;//类型
}
//PACKET_ALL_BAG_USE
message SCUpBagInfo {
OpResultCode RetCode = 1;
int32 NowItemId = 2;//当前物品物品ID
int64 NowItemNum = 3;//当前物品剩余数量
//使用道具获得的
int64 Coin = 4;//金币
int64 Diamond = 5;// 钻石
//使用道具获得的
repeated ItemInfo Infos = 6;// 物品信息
int32 Opt = 7;
}
//背包使用兑换返回结果
//PACKET_SC_ITEM_EXCHANGE_RES
message SCItemExChangeRes{
OpResultCode RetCode = 1;
}
//PACKET_SC_SYNCBAGDATA
message SCSyncBagData{
repeated ItemInfo Infos = 1;// 物品信息
}
message PropInfo{
int32 ItemId = 1;//物品ID
int64 ItemNum = 2;//物品数量
}
// PACKET_PropExchange
message CSPropExchange{
int32 Id = 1; // 兑换ID
}
message SCPropExchange{
OpResultCode RetCode = 1; // 错误码
repeated PropInfo Items = 2; // 获得道具
repeated PropInfo RemainItems = 3; // 被消耗的道具剩余数量
}
message ExchangeInfo{
int32 Id = 1; // 兑换ID
repeated PropInfo CostItems = 2; // 消耗道具
repeated PropInfo GainItems = 3; // 获得道具
}
// PACKET_ExchangeList
message CSExchangeList{
int32 Tp = 1; // 兑换类型 1集卡活动
}
message SCExchangeList{
repeated ExchangeInfo Infos = 1; // 兑换列表
int32 Tp = 2; // 兑换类型
}
//娃娃卡兑换
//PACKET_CS_DollChange
message CSDollChange{
repeated PropInfo Items = 1;
string UserName = 2;//姓名
string UserTel = 3;//电话
string Addr = 4;//地址
}
//PACKET_SC_DollChange
message SCDollChange{
OpResultCode RetCode = 1;
}
//娃娃卡兑换记录
//PACKET_CS_DollChangeLog
message CSDollChangeLog{
}
//PACKET_SC_DollChangeLog
message SCDillChangeLog{
repeated DillChangeLogInfo Info =1;
}
message DillChangeLogInfo{
int32 ItemId = 1;
int32 ItemNum = 2;
int32 State = 3; //0待审核 1审核通过、2已发货、3审核不通过、4撤单
string UserName = 4;
string UserTel = 5;
string Addr = 6;
string CreateTs = 7;
string OpTs =8;
string Remark = 9;//备注信息
}