public/protocol/activity/pushcoin.proto

95 lines
2.6 KiB
Protocol Buffer

syntax = "proto3";
package activity;
option go_package = "mongo.games.com/game/protocol/activity";
enum PushCoinPacketID {
PACKET_PushCoin_ZERO = 0;// 弃用消息号
PACKET_CSPushCoinInfo = 2680; // 信息
PACKET_SCPushCoinInfo = 2681; // 信息返回
PACKET_CSPushCoinPlayerOp = 2682; // 玩家操作
PACKET_SCPushCoinPlayerOp = 2683; // 玩家操作返回
PACKET_NotifyPowerLine = 2684; // 通知能量值
PACKET_NotifyDrawInfo = 2685; // 抽奖信息
}
//信息
//PACKET_CSPushCoinInfo
message CSPushCoinInfo {
}
//PACKET_SCPushCoinInfo
message SCPushCoinInfo {
repeated ExchangeInfo ExchangeList = 1; //兑换信息
repeated DrawInfo DrawList = 2; //抽奖信息
int32 ShakeTimes = 3; //可震动次数
int64 PowerLine = 4; // 当前能量值
int64 PowerLineMax = 5; // 能量值上限
int64 RefreshTimes = 6; // 刷新次数
repeated ItemInfo Items = 7; // 桌面数据
}
message ItemInfo{
int32 ItemId = 1; //道具id
int64 ItemNum = 2; //道具数量
}
message ExchangeInfo{
int32 Id = 1; //兑换id
repeated ItemInfo Cost = 2; //消耗道具
repeated ItemInfo Gain = 3; //获得道具
int64 Times = 4; //可兑换次数 -1无限
int64 TotalTimes = 5; //总共兑换次数 -1无限
}
message DrawInfo{
int32 Id = 1; //抽奖id
int32 ItemId = 2; //道具id
int64 ItemNum = 3; //道具数量
}
//抽奖信息
//PACKET_NotifyDrawInfo
message NotifyDrawInfo {
DrawInfo Draw = 1; // 中奖信息
repeated DrawInfo Info = 2; // 刷新信息
}
//玩家操作
//PACKET_CSPushCoinPlayerOp
message CSPushCoinPlayerOp {
OpCodes OpCode = 1;
int64 OpParam = 2;
repeated ItemInfo OpItem = 3;
}
enum OpCodes {
OP_Zero = 0;
OP_Bet = 1; // 下注 OpParam 道具id
OP_Gain = 2; // 得分 OpParam 1有效区 2无效区 OpItem 获得道具
OP_Shake = 3; // 震动 OpParam 消耗次数
OP_Refresh = 4; // 刷新 OpParam 桌面金额
OP_Exchange = 5; // 兑换 OpParam 兑换id
}
enum OpResultPushCoinCode {
OPRC_PushCoin_Success = 0; //成功
OPRC_PushCoin_Error = 1; //失败
OPRC_PushCoin_BetNotEnough = 2; //投币,金币不足
OPRC_PushCoin_ExchangeNotEnough = 3; //兑换次数不足
OPRC_PushCoin_ShakeNotEnough = 4; //震动次数不足
OPRC_PushCoin_ItemNotEnough = 5; //兑换消耗道具不足
}
//PACKET_SCPushCoinPlayerOp
message SCPushCoinPlayerOp {
OpResultPushCoinCode OpRetCode = 1;
OpCodes OpCode = 2;
ExchangeInfo Exchange = 3; // 兑换信息,加到背包
int32 BetId = 4; // 金币id
}
//通知能量值
//PACKET_NotifyPowerLine
message NotifyPowerLine {
int64 PowerLine = 1; // 当前能量值
int64 PowerLineMax = 2; // 能量值上限
}