add 推币机活动

This commit is contained in:
sk 2025-01-08 14:46:29 +08:00
parent cf196814e0
commit a92a04a81d
24 changed files with 3384 additions and 2466 deletions

View File

@ -345,8 +345,10 @@ const (
GainWayNianGain_EveryDayTask = 132 //年兽活动每日任务
GainWayNianGain_Task = 133 //年兽活动任务
GainWayConsume = 134 //累消活动获得
GainWayPushCoinCost = 135 // 推币机消耗
GainWayPushCoinGain = 136 // 推币机获得
GainWayPushCoinExchangeCost = 135 // 推币机兑换消耗
GainWatPushCoinExchangeGain = 136 // 推币机兑换获得
GainWayPushCoinGain = 137 // 推币机掉落获得
GainWayPushCoinCost = 138 // 推币机消耗
)
// 后台选择 金币变化类型 的充值 类型id号起始
@ -602,6 +604,7 @@ const (
ItemIDRoomCard = 40002 // 房卡
ItemIDLittleGuaranteed = 50014 //小爆竹
ItemIDBigGuaranteed = 50015 //大爆竹
ItemIDBigCoin = 50017 //大金币
)
func ToItemId(id int32) int32 {

11
data/DB_ACTPushCoin.dat Normal file
View File

@ -0,0 +1,11 @@
 ЎЌ ЁГ
иЎЌ
Р†
ВЎЌ  Ќ
Ь ±к ђN
о±к Р†
ъўЌ  Ќ
иб† Р†
а† °к
 d¶к ЂВЧ/

76
data/DB_ACTPushCoin.json Normal file
View File

@ -0,0 +1,76 @@
{
"Arr": [
{
"Id": 1,
"Rate": 4000,
"Gain": {
"100001": 5
},
"Value": 25000
},
{
"Id": 2,
"Rate": 1000,
"Gain": {
"100001": 10
},
"Value": 50000
},
{
"Id": 3,
"Rate": 450,
"Gain": {
"100001": 20
},
"Value": 100000
},
{
"Id": 4,
"Rate": 1500,
"Gain": {
"30001": 1
},
"Value": 10000
},
{
"Id": 5,
"Rate": 750,
"Gain": {
"30001": 5
},
"Value": 50000
},
{
"Id": 6,
"Rate": 250,
"Gain": {
"100002": 1
},
"Value": 100000
},
{
"Id": 7,
"Rate": 1000,
"Gain": {
"50017": 1
},
"Value": 50000
},
{
"Id": 8,
"Rate": 950,
"Gain": {
"50016": 1
},
"Value": 30000
},
{
"Id": 9,
"Rate": 100,
"Gain": {
"30006": 1
},
"Value": 100000000
}
]
}

Binary file not shown.

View File

@ -7300,6 +7300,81 @@
"CompositionMax": 9999,
"Location": "0",
"Describe": "可在年兽活动中击退年兽,获得奖品"
},
{
"Id": 50016,
"Name": "梅花",
"ShowLocation": [
0,
0,
0
],
"Classify": [
0,
0,
0
],
"Type": 29,
"Effect0": [
0,
0,
0,
0,
0,
0
],
"Effect": [
0,
0,
0,
0,
0,
0
],
"SaleType": 1,
"SaleGold": 5000,
"Composition": 1,
"CompositionMax": 9999,
"Location": "0",
"Describe": "可在推币机活动兑换道具"
},
{
"Id": 50017,
"Name": "大金币",
"ShowLocation": [
0,
0,
0
],
"Classify": [
0,
0,
0
],
"Type": 29,
"Effect0": [
0,
0,
0,
0,
0,
0
],
"Effect": [
0,
0,
0,
0,
0,
0
],
"SaleType": 1,
"SaleGold": 5000,
"Composition": 1,
"CompositionMax": 9999,
"Location": "0",
"Describe": "可在推币机活动兑换道具",
"Num": 10
}
]
}

View File

@ -1,4 +1,4 @@
 (€­β8@΅θ;PdX`c
< ((€­β2ΕΈ2συ@Άθ;JΖΈJσυPdX¬`Η
?<18>ΑΧ/ 2(€­β2ΕΈ2συ@£θ;JσυJΖΈPdXξ`σ
?<18>ΑΧ/ 2(€­β2ΕΈ2συ@£θ;JΖΈJσυPdXξ`σ

Binary file not shown.

Binary file not shown.

View File

@ -34,7 +34,7 @@ const (
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
ETCDKEY_Item = "/game/item" // 道具列表
ETCDKEY_Item = "/game/item/" // 道具列表
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
@ -53,6 +53,7 @@ const (
ETCDKEY_PigBankProp = "/game/pigbank_prop" //存钱罐属性
ETCDKEY_NianConfig = "/game/activity_nian" //年兽活动配置
ETCDKEY_NianRankConfig = "/game/activity_nian_rank" //年兽排行榜配置
KeyRedPacket = "/game/act_redpacket" //红包配置
KeyActConsume = "/game/act_consume" //累计消耗活动配置
KeyRedPacket = "/game/act_redpacket" //红包配置
KeyActConsume = "/game/act_consume" //累计消耗活动配置
KeyActPushCoin = "/game/act_pushcoin" //推金币活动配置
)

View File

@ -286,13 +286,8 @@ func (this *StateGaming) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, p
switch pushcoin.OpCodes(opcode) {
case pushcoin.OpCodes_OP_Bet:
if p.GetCoin() < params[0] {
goto here
}
p.AddCoin(-params[0], common.GainWayPushCoinCost, base.SyncFlag_ToClient, "system", "推币机下注")
case pushcoin.OpCodes_OP_Gain:
p.AddCoin(params[0], common.GainWayPushCoinGain, base.SyncFlag_ToClient, "system", "推币机获得")
case pushcoin.OpCodes_OP_Shake:
@ -306,7 +301,6 @@ func (this *StateGaming) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, p
return true
}
here:
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinPlayerOp), pack)
return true
}

View File

@ -26,6 +26,7 @@ const (
OpCollect = 6
OpNian = 7
OpConsume = 8 // 累计消耗活动
OpPushCoin = 9 // 推金币活动
)
const (
@ -175,6 +176,8 @@ type AllConfig struct {
*webapi.RedPacketConfig
// 累计消耗活动配置
*webapi.ConsumeConfig
// 推金币活动配置
*webapi.PushCoinConfig
}
type GlobalConfig struct {

View File

@ -558,10 +558,13 @@ type RedPacketData struct {
}
type PushCoinData struct {
Shake int32 // 震动次数
Refresh int64 // 刷新次数
Power int64 // 能量值
Base int64 // 底注
Shake int32 // 震动次数
Refresh int64 // 刷新次数
Power int64 // 能量值
Base int64 // 底注
Value int64 // 价值
Exchange map[int32]int32 // 兑换次数 兑换id:兑换次数
Dram int // 抽奖次数
}
type WelfareData struct {

View File

@ -24,27 +24,33 @@ type PushCoinPacketID int32
const (
PushCoinPacketID_PACKET_PushCoin_ZERO PushCoinPacketID = 0 // 弃用消息号
PushCoinPacketID_PACKET_CSPushCoinInfo PushCoinPacketID = 2670 // 信息
PushCoinPacketID_PACKET_SCPushCoinInfo PushCoinPacketID = 2671 // 信息返回
PushCoinPacketID_PACKET_CSPushCoinPlayerOp PushCoinPacketID = 2672 // 玩家操作
PushCoinPacketID_PACKET_SCPushCoinPlayerOp PushCoinPacketID = 2673 // 玩家操作返回
PushCoinPacketID_PACKET_CSPushCoinInfo PushCoinPacketID = 2680 // 信息
PushCoinPacketID_PACKET_SCPushCoinInfo PushCoinPacketID = 2681 // 信息返回
PushCoinPacketID_PACKET_CSPushCoinPlayerOp PushCoinPacketID = 2682 // 玩家操作
PushCoinPacketID_PACKET_SCPushCoinPlayerOp PushCoinPacketID = 2683 // 玩家操作返回
PushCoinPacketID_PACKET_NotifyPowerLine PushCoinPacketID = 2684 // 通知能量值
PushCoinPacketID_PACKET_NotifyDrawInfo PushCoinPacketID = 2685 // 抽奖信息
)
// Enum value maps for PushCoinPacketID.
var (
PushCoinPacketID_name = map[int32]string{
0: "PACKET_PushCoin_ZERO",
2670: "PACKET_CSPushCoinInfo",
2671: "PACKET_SCPushCoinInfo",
2672: "PACKET_CSPushCoinPlayerOp",
2673: "PACKET_SCPushCoinPlayerOp",
2680: "PACKET_CSPushCoinInfo",
2681: "PACKET_SCPushCoinInfo",
2682: "PACKET_CSPushCoinPlayerOp",
2683: "PACKET_SCPushCoinPlayerOp",
2684: "PACKET_NotifyPowerLine",
2685: "PACKET_NotifyDrawInfo",
}
PushCoinPacketID_value = map[string]int32{
"PACKET_PushCoin_ZERO": 0,
"PACKET_CSPushCoinInfo": 2670,
"PACKET_SCPushCoinInfo": 2671,
"PACKET_CSPushCoinPlayerOp": 2672,
"PACKET_SCPushCoinPlayerOp": 2673,
"PACKET_CSPushCoinInfo": 2680,
"PACKET_SCPushCoinInfo": 2681,
"PACKET_CSPushCoinPlayerOp": 2682,
"PACKET_SCPushCoinPlayerOp": 2683,
"PACKET_NotifyPowerLine": 2684,
"PACKET_NotifyDrawInfo": 2685,
}
)
@ -79,12 +85,11 @@ type OpCodes int32
const (
OpCodes_OP_Zero OpCodes = 0
OpCodes_OP_Bet OpCodes = 1 // 下注 [下注金额]
OpCodes_OP_Gain OpCodes = 2 // 得分 [得分金额]
OpCodes_OP_Shake OpCodes = 3 // 震动 [消耗次数]
OpCodes_OP_Refresh OpCodes = 4 // 刷新 [桌面金额]
OpCodes_OP_Exchange OpCodes = 5 // 兑换 [兑换id]
OpCodes_OP_Draw OpCodes = 6 // 抽奖 [抽奖id]
OpCodes_OP_Bet OpCodes = 1 // 下注 OpParam 下注金额
OpCodes_OP_Gain OpCodes = 2 // 得分 OpItem 获得道具
OpCodes_OP_Shake OpCodes = 3 // 震动 OpParam 消耗次数
OpCodes_OP_Refresh OpCodes = 4 // 刷新 OpParam 桌面金额
OpCodes_OP_Exchange OpCodes = 5 // 兑换 OpParam 兑换id
)
// Enum value maps for OpCodes.
@ -96,7 +101,6 @@ var (
3: "OP_Shake",
4: "OP_Refresh",
5: "OP_Exchange",
6: "OP_Draw",
}
OpCodes_value = map[string]int32{
"OP_Zero": 0,
@ -105,7 +109,6 @@ var (
"OP_Shake": 3,
"OP_Refresh": 4,
"OP_Exchange": 5,
"OP_Draw": 6,
}
)
@ -390,6 +393,8 @@ type ExchangeInfo struct {
Cost []*ItemInfo `protobuf:"bytes,2,rep,name=Cost,proto3" json:"Cost,omitempty"` //消耗道具
Gain []*ItemInfo `protobuf:"bytes,3,rep,name=Gain,proto3" json:"Gain,omitempty"` //获得道具
ShakeTimes int32 `protobuf:"varint,4,opt,name=ShakeTimes,proto3" json:"ShakeTimes,omitempty"` //获得震动次数
Times int64 `protobuf:"varint,5,opt,name=Times,proto3" json:"Times,omitempty"` //可兑换次数 -1无限
TotalTimes int64 `protobuf:"varint,6,opt,name=TotalTimes,proto3" json:"TotalTimes,omitempty"` //总共兑换次数 -1无限
}
func (x *ExchangeInfo) Reset() {
@ -452,6 +457,22 @@ func (x *ExchangeInfo) GetShakeTimes() int32 {
return 0
}
func (x *ExchangeInfo) GetTimes() int64 {
if x != nil {
return x.Times
}
return 0
}
func (x *ExchangeInfo) GetTotalTimes() int64 {
if x != nil {
return x.TotalTimes
}
return 0
}
//抽奖信息
//PACKET_NotifyDrawInfo
type DrawInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -530,8 +551,9 @@ type CSPushCoinPlayerOp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
OpCode OpCodes `protobuf:"varint,1,opt,name=OpCode,proto3,enum=activity.OpCodes" json:"OpCode,omitempty"`
OpParam []int64 `protobuf:"varint,2,rep,packed,name=OpParam,proto3" json:"OpParam,omitempty"`
OpCode OpCodes `protobuf:"varint,1,opt,name=OpCode,proto3,enum=activity.OpCodes" json:"OpCode,omitempty"`
OpParam int64 `protobuf:"varint,2,opt,name=OpParam,proto3" json:"OpParam,omitempty"`
OpItem []*ItemInfo `protobuf:"bytes,3,rep,name=OpItem,proto3" json:"OpItem,omitempty"`
}
func (x *CSPushCoinPlayerOp) Reset() {
@ -573,10 +595,17 @@ func (x *CSPushCoinPlayerOp) GetOpCode() OpCodes {
return OpCodes_OP_Zero
}
func (x *CSPushCoinPlayerOp) GetOpParam() []int64 {
func (x *CSPushCoinPlayerOp) GetOpParam() int64 {
if x != nil {
return x.OpParam
}
return 0
}
func (x *CSPushCoinPlayerOp) GetOpItem() []*ItemInfo {
if x != nil {
return x.OpItem
}
return nil
}
@ -589,7 +618,6 @@ type SCPushCoinPlayerOp struct {
OpRetCode OpResultPushCoinCode `protobuf:"varint,1,opt,name=OpRetCode,proto3,enum=activity.OpResultPushCoinCode" json:"OpRetCode,omitempty"`
OpCode OpCodes `protobuf:"varint,2,opt,name=OpCode,proto3,enum=activity.OpCodes" json:"OpCode,omitempty"`
Exchange *ExchangeInfo `protobuf:"bytes,3,opt,name=Exchange,proto3" json:"Exchange,omitempty"` // 兑换信息,加到背包
Draw *DrawInfo `protobuf:"bytes,4,opt,name=Draw,proto3" json:"Draw,omitempty"` // 抽奖信息,掉落到桌面
}
func (x *SCPushCoinPlayerOp) Reset() {
@ -645,11 +673,61 @@ func (x *SCPushCoinPlayerOp) GetExchange() *ExchangeInfo {
return nil
}
func (x *SCPushCoinPlayerOp) GetDraw() *DrawInfo {
if x != nil {
return x.Draw
//通知能量值
//PACKET_NotifyPowerLine
type NotifyPowerLine struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PowerLine int64 `protobuf:"varint,1,opt,name=PowerLine,proto3" json:"PowerLine,omitempty"` // 当前能量值
PowerLineMax int64 `protobuf:"varint,2,opt,name=PowerLineMax,proto3" json:"PowerLineMax,omitempty"` // 能量值上限
}
func (x *NotifyPowerLine) Reset() {
*x = NotifyPowerLine{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_activity_pushcoin_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
return nil
}
func (x *NotifyPowerLine) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NotifyPowerLine) ProtoMessage() {}
func (x *NotifyPowerLine) ProtoReflect() protoreflect.Message {
mi := &file_protocol_activity_pushcoin_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NotifyPowerLine.ProtoReflect.Descriptor instead.
func (*NotifyPowerLine) Descriptor() ([]byte, []int) {
return file_protocol_activity_pushcoin_proto_rawDescGZIP(), []int{7}
}
func (x *NotifyPowerLine) GetPowerLine() int64 {
if x != nil {
return x.PowerLine
}
return 0
}
func (x *NotifyPowerLine) GetPowerLineMax() int64 {
if x != nil {
return x.PowerLineMax
}
return 0
}
var File_protocol_activity_pushcoin_proto protoreflect.FileDescriptor
@ -682,7 +760,7 @@ var file_protocol_activity_pushcoin_proto_rawDesc = []byte{
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a,
0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0xc4, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x43, 0x6f, 0x73, 0x74,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
@ -691,58 +769,69 @@ var file_protocol_activity_pushcoin_proto_rawDesc = []byte{
0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x04, 0x47, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x68, 0x61, 0x6b,
0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, 0x68,
0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x08, 0x44, 0x72, 0x61, 0x77,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x49,
0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0x59, 0x0a, 0x12, 0x43, 0x53,
0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70,
0x12, 0x29, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x11, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4f, 0x70, 0x43, 0x6f,
0x64, 0x65, 0x73, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f,
0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x4f, 0x70,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0xd9, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68,
0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x3c, 0x0a, 0x09,
0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x1e, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52,
0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x4f, 0x70,
0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x61, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x06, 0x4f,
0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x08, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x44, 0x72, 0x61,
0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x44, 0x72, 0x61,
0x77, 0x2a, 0xa4, 0x01, 0x0a, 0x10, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x61,
0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x6d, 0x65,
0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1e,
0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x60,
0x0a, 0x08, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d,
0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04,
0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e,
0x22, 0x85, 0x01, 0x0a, 0x12, 0x43, 0x53, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x2e, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f,
0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x2a, 0x0a, 0x06,
0x4f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x06, 0x4f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x22, 0xb1, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x50,
0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12,
0x3c, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4f, 0x70,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x6f,
0x64, 0x65, 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x29, 0x0a,
0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e,
0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73,
0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x08, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x53, 0x0a, 0x0f,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12,
0x1c, 0x0a, 0x09, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x22, 0x0a,
0x0c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 0x78, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61,
0x78, 0x2a, 0xdd, 0x01, 0x0a, 0x10, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x61,
0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00,
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x75, 0x73,
0x68, 0x43, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xee, 0x14, 0x12, 0x1a, 0x0a, 0x15,
0x68, 0x43, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xf8, 0x14, 0x12, 0x1a, 0x0a, 0x15,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69,
0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xef, 0x14, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xf9, 0x14, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xf0, 0x14, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xfa, 0x14, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xf1, 0x14, 0x2a, 0x6b, 0x0a, 0x07, 0x4f, 0x70, 0x43, 0x6f,
0x64, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x50, 0x5f, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00,
0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x50, 0x5f, 0x42, 0x65, 0x74, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,
0x4f, 0x50, 0x5f, 0x47, 0x61, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x5f,
0x53, 0x68, 0x61, 0x6b, 0x65, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x5f, 0x52, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x5f, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x50, 0x5f, 0x44,
0x72, 0x61, 0x77, 0x10, 0x06, 0x2a, 0x4a, 0x0a, 0x14, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a,
0x15, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43,
0x5f, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10,
0x01, 0x42, 0x28, 0x5a, 0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
0x6f, 0x6c, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xfb, 0x14, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69,
0x6e, 0x65, 0x10, 0xfc, 0x14, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xfd,
0x14, 0x2a, 0x5e, 0x0a, 0x07, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07,
0x4f, 0x50, 0x5f, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x50, 0x5f,
0x42, 0x65, 0x74, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x50, 0x5f, 0x47, 0x61, 0x69, 0x6e,
0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x5f, 0x53, 0x68, 0x61, 0x6b, 0x65, 0x10, 0x03,
0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x5f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x10, 0x04,
0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10,
0x05, 0x2a, 0x4a, 0x0a, 0x14, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x50, 0x75, 0x73,
0x68, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x52,
0x43, 0x5f, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x75, 0x73,
0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x42, 0x28, 0x5a,
0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -758,7 +847,7 @@ func file_protocol_activity_pushcoin_proto_rawDescGZIP() []byte {
}
var file_protocol_activity_pushcoin_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_protocol_activity_pushcoin_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_protocol_activity_pushcoin_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_protocol_activity_pushcoin_proto_goTypes = []interface{}{
(PushCoinPacketID)(0), // 0: activity.PushCoinPacketID
(OpCodes)(0), // 1: activity.OpCodes
@ -770,6 +859,7 @@ var file_protocol_activity_pushcoin_proto_goTypes = []interface{}{
(*DrawInfo)(nil), // 7: activity.DrawInfo
(*CSPushCoinPlayerOp)(nil), // 8: activity.CSPushCoinPlayerOp
(*SCPushCoinPlayerOp)(nil), // 9: activity.SCPushCoinPlayerOp
(*NotifyPowerLine)(nil), // 10: activity.NotifyPowerLine
}
var file_protocol_activity_pushcoin_proto_depIdxs = []int32{
6, // 0: activity.SCPushCoinInfo.ExchangeList:type_name -> activity.ExchangeInfo
@ -777,10 +867,10 @@ var file_protocol_activity_pushcoin_proto_depIdxs = []int32{
5, // 2: activity.ExchangeInfo.Cost:type_name -> activity.ItemInfo
5, // 3: activity.ExchangeInfo.Gain:type_name -> activity.ItemInfo
1, // 4: activity.CSPushCoinPlayerOp.OpCode:type_name -> activity.OpCodes
2, // 5: activity.SCPushCoinPlayerOp.OpRetCode:type_name -> activity.OpResultPushCoinCode
1, // 6: activity.SCPushCoinPlayerOp.OpCode:type_name -> activity.OpCodes
6, // 7: activity.SCPushCoinPlayerOp.Exchange:type_name -> activity.ExchangeInfo
7, // 8: activity.SCPushCoinPlayerOp.Draw:type_name -> activity.DrawInfo
5, // 5: activity.CSPushCoinPlayerOp.OpItem:type_name -> activity.ItemInfo
2, // 6: activity.SCPushCoinPlayerOp.OpRetCode:type_name -> activity.OpResultPushCoinCode
1, // 7: activity.SCPushCoinPlayerOp.OpCode:type_name -> activity.OpCodes
6, // 8: activity.SCPushCoinPlayerOp.Exchange:type_name -> activity.ExchangeInfo
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
@ -878,6 +968,18 @@ func file_protocol_activity_pushcoin_proto_init() {
return nil
}
}
file_protocol_activity_pushcoin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NotifyPowerLine); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -885,7 +987,7 @@ func file_protocol_activity_pushcoin_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protocol_activity_pushcoin_proto_rawDesc,
NumEnums: 3,
NumMessages: 7,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -4,10 +4,12 @@ option go_package = "mongo.games.com/game/protocol/activity";
enum PushCoinPacketID {
PACKET_PushCoin_ZERO = 0;//
PACKET_CSPushCoinInfo = 2670; //
PACKET_SCPushCoinInfo = 2671; //
PACKET_CSPushCoinPlayerOp = 2672; //
PACKET_SCPushCoinPlayerOp = 2673; //
PACKET_CSPushCoinInfo = 2680; //
PACKET_SCPushCoinInfo = 2681; //
PACKET_CSPushCoinPlayerOp = 2682; //
PACKET_SCPushCoinPlayerOp = 2683; //
PACKET_NotifyPowerLine = 2684; //
PACKET_NotifyDrawInfo = 2685; //
}
//
@ -36,8 +38,12 @@ message ExchangeInfo{
repeated ItemInfo Cost = 2; //
repeated ItemInfo Gain = 3; //
int32 ShakeTimes = 4; //
int64 Times = 5; // -1
int64 TotalTimes = 6; // -1
}
//
//PACKET_NotifyDrawInfo
message DrawInfo{
int32 Id = 1; //id
int32 ItemId = 2; //id
@ -49,17 +55,17 @@ message DrawInfo{
//PACKET_CSPushCoinPlayerOp
message CSPushCoinPlayerOp {
OpCodes OpCode = 1;
repeated int64 OpParam = 2;
int64 OpParam = 2;
repeated ItemInfo OpItem = 3;
}
enum OpCodes {
OP_Zero = 0;
OP_Bet = 1; // []
OP_Gain = 2; // []
OP_Shake = 3; // []
OP_Refresh = 4; // []
OP_Exchange = 5; // [id]
OP_Draw = 6; // [id]
OP_Bet = 1; // OpParam
OP_Gain = 2; // OpItem
OP_Shake = 3; // OpParam
OP_Refresh = 4; // OpParam
OP_Exchange = 5; // OpParam id
}
enum OpResultPushCoinCode {
@ -72,5 +78,11 @@ message SCPushCoinPlayerOp {
OpResultPushCoinCode OpRetCode = 1;
OpCodes OpCode = 2;
ExchangeInfo Exchange = 3; // ,
DrawInfo Draw = 4; //
}
//
//PACKET_NotifyPowerLine
message NotifyPowerLine {
int64 PowerLine = 1; //
int64 PowerLineMax = 2; //
}

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,22 @@ syntax = "proto3";
package server;
option go_package = "mongo.games.com/game/protocol/server";
message DB_ACTPushCoin {
int32 Id = 1;
int32 Rate = 2;
map<int64, int64> Gain = 3;
int64 Value = 4;
}
message DB_ACTPushCoinArray {
repeated DB_ACTPushCoin Arr = 1;
}
message DB_ActSign {
int32 Id = 1;

View File

@ -10575,6 +10575,78 @@ func (x *ConsumeConfig) GetEndTime() string {
return ""
}
// etcd /game/act_pushcoin
type PushCoinConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
On int32 `protobuf:"varint,2,opt,name=On,proto3" json:"On,omitempty"` // 活动开关 1.开启 2.关闭
StartTime string `protobuf:"bytes,3,opt,name=StartTime,proto3" json:"StartTime,omitempty"` // 活动开始时间
EndTime string `protobuf:"bytes,4,opt,name=EndTime,proto3" json:"EndTime,omitempty"` // 活动结束时间
}
func (x *PushCoinConfig) Reset() {
*x = PushCoinConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_webapi_common_proto_msgTypes[114]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PushCoinConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PushCoinConfig) ProtoMessage() {}
func (x *PushCoinConfig) ProtoReflect() protoreflect.Message {
mi := &file_protocol_webapi_common_proto_msgTypes[114]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PushCoinConfig.ProtoReflect.Descriptor instead.
func (*PushCoinConfig) Descriptor() ([]byte, []int) {
return file_protocol_webapi_common_proto_rawDescGZIP(), []int{114}
}
func (x *PushCoinConfig) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *PushCoinConfig) GetOn() int32 {
if x != nil {
return x.On
}
return 0
}
func (x *PushCoinConfig) GetStartTime() string {
if x != nil {
return x.StartTime
}
return ""
}
func (x *PushCoinConfig) GetEndTime() string {
if x != nil {
return x.EndTime
}
return ""
}
var File_protocol_webapi_common_proto protoreflect.FileDescriptor
var file_protocol_webapi_common_proto_rawDesc = []byte{
@ -12191,10 +12263,17 @@ var file_protocol_webapi_common_proto_rawDesc = []byte{
0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67,
0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x74, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68,
0x43, 0x6f, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c,
0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x6c,
0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54,
0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74,
0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x26,
0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f,
0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -12209,7 +12288,7 @@ func file_protocol_webapi_common_proto_rawDescGZIP() []byte {
return file_protocol_webapi_common_proto_rawDescData
}
var file_protocol_webapi_common_proto_msgTypes = make([]protoimpl.MessageInfo, 124)
var file_protocol_webapi_common_proto_msgTypes = make([]protoimpl.MessageInfo, 125)
var file_protocol_webapi_common_proto_goTypes = []interface{}{
(*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting
(*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting
@ -12325,32 +12404,33 @@ var file_protocol_webapi_common_proto_goTypes = []interface{}{
(*RedPacketInfo)(nil), // 111: webapi.RedPacketInfo
(*RedInfo)(nil), // 112: webapi.RedInfo
(*ConsumeConfig)(nil), // 113: webapi.ConsumeConfig
nil, // 114: webapi.Platform.BindTelRewardEntry
nil, // 115: webapi.PlayerData.RankScoreEntry
nil, // 116: webapi.ItemShop.AwardEntry
nil, // 117: webapi.VIPcfg.AwardEntry
nil, // 118: webapi.VIPcfg.Privilege1Entry
nil, // 119: webapi.VIPcfg.Privilege7Entry
nil, // 120: webapi.VIPcfg.Privilege9Entry
nil, // 121: webapi.ActInviteConfig.PayScoreEntry
nil, // 122: webapi.SkinLevel.UpItemEntry
nil, // 123: webapi.SkinItem.UnlockParamEntry
(*server.DB_GameFree)(nil), // 124: server.DB_GameFree
(*server.DB_GameItem)(nil), // 125: server.DB_GameItem
(*PushCoinConfig)(nil), // 114: webapi.PushCoinConfig
nil, // 115: webapi.Platform.BindTelRewardEntry
nil, // 116: webapi.PlayerData.RankScoreEntry
nil, // 117: webapi.ItemShop.AwardEntry
nil, // 118: webapi.VIPcfg.AwardEntry
nil, // 119: webapi.VIPcfg.Privilege1Entry
nil, // 120: webapi.VIPcfg.Privilege7Entry
nil, // 121: webapi.VIPcfg.Privilege9Entry
nil, // 122: webapi.ActInviteConfig.PayScoreEntry
nil, // 123: webapi.SkinLevel.UpItemEntry
nil, // 124: webapi.SkinItem.UnlockParamEntry
(*server.DB_GameFree)(nil), // 125: server.DB_GameFree
(*server.DB_GameItem)(nil), // 126: server.DB_GameItem
}
var file_protocol_webapi_common_proto_depIdxs = []int32{
2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch
3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig
4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame
114, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
115, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus
124, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
125, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree
0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting
1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting
1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting
124, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
115, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
125, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
116, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
32, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo
14, // 13: webapi.PlayerData.RoleUnlockList:type_name -> webapi.ModInfo
14, // 14: webapi.PlayerData.PetUnlockList:type_name -> webapi.ModInfo
@ -12363,7 +12443,7 @@ var file_protocol_webapi_common_proto_depIdxs = []int32{
32, // 21: webapi.ExchangeShop.Items:type_name -> webapi.ItemInfo
25, // 22: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop
29, // 23: webapi.ExchangeShopList.Weight:type_name -> webapi.ShopWeight
116, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
117, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
30, // 25: webapi.ItemShopList.List:type_name -> webapi.ItemShop
32, // 26: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo
33, // 27: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward
@ -12384,14 +12464,14 @@ var file_protocol_webapi_common_proto_depIdxs = []int32{
38, // 42: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate
48, // 43: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree
48, // 44: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree
117, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
118, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry
119, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
120, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry
118, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
119, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry
120, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
121, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry
51, // 49: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg
38, // 50: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate
55, // 51: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig
121, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
122, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
62, // 53: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward
62, // 54: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward
62, // 55: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward
@ -12408,12 +12488,12 @@ var file_protocol_webapi_common_proto_depIdxs = []int32{
69, // 66: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo
70, // 67: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers
72, // 68: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData
125, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem
126, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem
32, // 70: webapi.RankAwardInfo.Item:type_name -> webapi.ItemInfo
75, // 71: webapi.RankTypeInfo.Award:type_name -> webapi.RankAwardInfo
76, // 72: webapi.RankTypeConfig.Info:type_name -> webapi.RankTypeInfo
122, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry
123, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry
123, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry
124, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry
78, // 75: webapi.SkinItem.Levels:type_name -> webapi.SkinLevel
79, // 76: webapi.SkinConfig.Items:type_name -> webapi.SkinItem
82, // 77: webapi.AwardLogConfig.AwardLog:type_name -> webapi.AwardLogData
@ -13822,6 +13902,18 @@ func file_protocol_webapi_common_proto_init() {
return nil
}
}
file_protocol_webapi_common_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushCoinConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -13829,7 +13921,7 @@ func file_protocol_webapi_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protocol_webapi_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 124,
NumMessages: 125,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -1166,4 +1166,12 @@ message ConsumeConfig{
int32 On = 2; // 1. 2.
string StartTime = 3; //
string EndTime = 4; //
}
// etcd /game/act_pushcoin
message PushCoinConfig{
string Platform = 1; //
int32 On = 2; // 1. 2.
string StartTime = 3; //
string EndTime = 4; //
}

77
srvdata/db_actpushcoin.go Normal file
View File

@ -0,0 +1,77 @@
// Code generated by xlsx2proto.
// DO NOT EDIT!
package srvdata
import (
"google.golang.org/protobuf/proto"
"mongo.games.com/game/protocol/server"
)
var PBDB_ACTPushCoinMgr = &DB_ACTPushCoinMgr{
Datas: &server.DB_ACTPushCoinArray{},
pool: make(map[int32]*server.DB_ACTPushCoin),
}
type DB_ACTPushCoinMgr struct {
Datas *server.DB_ACTPushCoinArray
pool map[int32]*server.DB_ACTPushCoin
}
func (this *DB_ACTPushCoinMgr) unmarshal(data []byte) error {
err := proto.Unmarshal(data, this.Datas)
if err == nil {
this.arrangeData()
}
return err
}
func (this *DB_ACTPushCoinMgr) reunmarshal(data []byte) error {
newDatas := &server.DB_ACTPushCoinArray{}
err := proto.Unmarshal(data, newDatas)
if err == nil {
for _, item := range newDatas.Arr {
existItem := this.GetData(item.GetId())
if existItem == nil {
this.pool[item.GetId()] = item
this.Datas.Arr = append(this.Datas.Arr, item)
} else {
*existItem = *item
}
}
}
return err
}
func (this *DB_ACTPushCoinMgr) arrangeData() {
if this.Datas == nil {
return
}
dataArr := this.Datas.GetArr()
if dataArr == nil {
return
}
for _, data := range dataArr {
this.pool[data.GetId()] = data
}
}
func (this *DB_ACTPushCoinMgr) GetData(id int32) *server.DB_ACTPushCoin {
if data, ok := this.pool[id]; ok {
return data
}
return nil
}
func init() {
DataMgr.register("DB_ACTPushCoin.dat", &ProtobufDataLoader{dh: PBDB_ACTPushCoinMgr})
}

View File

@ -5,6 +5,7 @@ import (
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/model"
"mongo.games.com/game/protocol/activity"
"mongo.games.com/game/protocol/pushcoin"
"mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
@ -14,6 +15,7 @@ import (
const (
PowerMax = 700000
PowerInit = 400000
ValueInit = 50 * 5000
)
var BaseCoins = []int64{5000, 10000, 15000}
@ -21,6 +23,8 @@ var BaseCoins = []int64{5000, 10000, 15000}
func init() {
// 推币机活动信息
common.Register(int(activity.PushCoinPacketID_PACKET_CSPushCoinInfo), activity.CSPushCoinInfo{}, CSPushCoinInfo)
// 推币机玩家操作
common.Register(int(activity.PushCoinPacketID_PACKET_CSPushCoinPlayerOp), activity.CSPushCoinPlayerOp{}, CSPushCoinPlayerOp)
}
func CSPushCoinInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
@ -29,7 +33,7 @@ func CSPushCoinInfo(s *netlib.Session, packetid int, data interface{}, sid int64
return nil
}
p := base.PlayerMgrSington.GetPlayer(sid)
p := PlayerMgrSington.GetOnlinePlayer(sid)
if p == nil {
logger.Logger.Warn("CSPushCoinInfo p == nil")
return nil
@ -42,10 +46,10 @@ func CSPushCoinInfo(s *netlib.Session, packetid int, data interface{}, sid int64
if p.WelfData.PushCoin == nil {
p.WelfData.PushCoin = &model.PushCoinData{
Shake: 0,
Refresh: 0,
Power: PowerInit,
Base: BaseCoins[0],
Power: PowerInit,
Base: BaseCoins[0],
Value: ValueInit,
Exchange: make(map[int32]int32),
}
}
@ -55,12 +59,14 @@ func CSPushCoinInfo(s *netlib.Session, packetid int, data interface{}, sid int64
PowerLine: p.WelfData.PushCoin.Power,
PowerLineMax: PowerMax,
RefreshTimes: p.WelfData.PushCoin.Refresh,
BetList: BaseCoins,
}
for _, v := range srvdata.PBDB_PropExchangeMgr.Datas.Arr {
if v.GetGroup() == 2 {
info := &activity.ExchangeInfo{
Id: v.GetId(),
Id: v.GetId(),
TotalTimes: int64(v.GetTimes()),
}
for kk, vv := range v.GetCost() {
info.Cost = append(info.Cost, &activity.ItemInfo{
@ -85,10 +91,257 @@ func CSPushCoinInfo(s *netlib.Session, packetid int, data interface{}, sid int64
info.ShakeTimes = int32(vv)
}
}
info.Times = int64(v.GetTimes() - p.WelfData.PushCoin.Exchange[v.Id])
if v.GetTimes() == 0 {
info.Times = -1
info.TotalTimes = -1
}
pack.ExchangeList = append(pack.ExchangeList, info)
}
}
// 转盘
for _, v := range srvdata.PBDB_ACTPushCoinMgr.Datas.Arr {
for kk, vv := range v.GetGain() {
pack.DrawList = append(pack.DrawList, &activity.DrawInfo{
Id: v.GetId(),
ItemId: int32(kk),
ItemNum: int32(vv),
Coin: v.GetValue(),
})
}
}
p.SendToClient(int(activity.PushCoinPacketID_PACKET_SCPushCoinInfo), pack)
logger.Logger.Trace("SCPushCoinInfo: ", pack)
return nil
}
func CSPushCoinPlayerOp(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSPushCoinPlayerOpHandler Process recv ", data)
msg, ok := data.(*activity.CSPushCoinPlayerOp)
if !ok {
return nil
}
p := PlayerMgrSington.GetOnlinePlayer(sid)
if p == nil {
logger.Logger.Warn("CSPushCoinPlayerOp p == nil")
return nil
}
if p.WelfData == nil {
logger.Logger.Warn("CSPushCoinPlayerOp p.WelfData == nil")
return nil
}
if p.WelfData.PushCoin == nil {
logger.Logger.Warn("CSPushCoinPlayerOp p.WelfData.PushCoin == nil")
return nil
}
pack := &activity.SCPushCoinPlayerOp{
OpRetCode: activity.OpResultPushCoinCode_OPRC_PushCoin_Error,
OpCode: msg.GetOpCode(),
}
switch msg.GetOpCode() {
case activity.OpCodes_OP_Bet:
if p.GetCoin() < msg.GetOpParam() {
goto here
}
p.AddCoin(-msg.GetOpParam(), common.GainWayPushCoinCost, base.SyncFlag_ToClient, "system", "推币机下注")
// 增加能量条
AddPower(p, msg.GetOpParam())
case activity.OpCodes_OP_Gain:
// todo校验
for _, v := range msg.GetOpItem() {
BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
SnId: p.SnId,
Change: []*model.Item{{ItemId: v.GetItemId(), ItemNum: int64(v.GetItemNum())}},
GainWay: common.GainWayPushCoinGain,
Operator: "system",
Remark: "推币机掉落获得",
})
}
case activity.OpCodes_OP_Shake:
if p.WelfData.PushCoin.Shake < int32(msg.GetOpParam()) {
goto here
}
p.WelfData.PushCoin.Shake -= int32(msg.GetOpParam())
case activity.OpCodes_OP_Refresh:
p.WelfData.PushCoin.Refresh++
p.WelfData.PushCoin.Value = ValueInit
case activity.OpCodes_OP_Exchange:
d := srvdata.PBDB_PropExchangeMgr.GetData(int32(msg.GetOpParam()))
if d == nil {
goto here
}
// 兑换次数
if d.GetTimes() > 0 && p.WelfData.PushCoin.Exchange[d.Id] >= d.GetTimes() {
goto here
}
pack.Exchange = &activity.ExchangeInfo{
Id: d.Id,
}
var cost, gain []*model.Item
for k, v := range d.GetCost() {
pack.Exchange.Cost = append(pack.Exchange.Cost, &activity.ItemInfo{
ItemId: int32(k),
ItemNum: int32(v),
})
if k == 10001 && p.GetCoin() < v {
goto here
}
cost = append(cost, &model.Item{
ItemId: int32(k),
ItemNum: -v,
})
}
_, _, ok := BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
SnId: p.SnId,
Change: cost,
Add: 0,
GainWay: common.GainWayPushCoinExchangeCost,
Operator: "system",
Remark: "推币机活动兑换消耗",
})
if !ok {
goto here
}
for k, v := range d.GetGain() {
pack.Exchange.Gain = append(pack.Exchange.Gain, &activity.ItemInfo{
ItemId: int32(k),
ItemNum: int32(v),
})
gain = append(gain, &model.Item{
ItemId: int32(k),
ItemNum: v,
})
}
BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform,
SnId: p.SnId,
Change: gain,
Cost: cost,
Add: 0,
GainWay: common.GainWatPushCoinExchangeGain,
Operator: "system",
Remark: "推币机活动兑换获得",
})
for k, v := range d.GetCustom() {
if k == 1 {
pack.Exchange.ShakeTimes = int32(v)
}
}
if p.WelfData.PushCoin.Exchange == nil {
p.WelfData.PushCoin.Exchange = make(map[int32]int32)
}
p.WelfData.PushCoin.Exchange[d.Id]++
default:
return nil
}
pack.OpRetCode = activity.OpResultPushCoinCode_OPRC_PushCoin_Success
here:
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinPlayerOp), pack)
logger.Logger.Trace("SCPushCoinPlayerOp: ", pack)
return nil
}
func AddPower(p *Player, value int64) {
if value < 0 {
return
}
p.WelfData.PushCoin.Power += value
if p.WelfData.PushCoin.Power > PowerMax {
p.WelfData.PushCoin.Power = PowerMax
}
p.SendToClient(int(activity.PushCoinPacketID_PACKET_NotifyPowerLine), &activity.NotifyPowerLine{
PowerLine: p.WelfData.PushCoin.Power,
PowerLineMax: PowerMax,
})
if value <= 0 {
return
}
// 抽奖
Draw(p)
}
func Draw(p *Player) {
if p.WelfData.PushCoin.Power < PowerMax {
return
}
p.WelfData.PushCoin.Power = 0
var index int32 = -1
switch p.WelfData.PushCoin.Dram {
case 0:
// 必中大金币
for _, v := range srvdata.PBDB_ACTPushCoinMgr.Datas.Arr {
for kk := range v.GetGain() {
if kk == common.ItemIDBigCoin {
index = v.GetId()
break
}
}
}
case 1:
// 必中v卡
for _, v := range srvdata.PBDB_ACTPushCoinMgr.Datas.Arr {
for kk := range v.GetGain() {
if kk == common.ItemIDVCard {
index = v.GetId()
break
}
}
}
default:
var n int32
rand := common.RandInt(10000)
for _, v := range srvdata.PBDB_ACTPushCoinMgr.Datas.Arr {
if rand < int(n+v.GetRate()) {
index = v.GetId()
break
}
n += v.GetRate()
}
}
p.WelfData.PushCoin.Dram++
if index >= 0 {
d := srvdata.PBDB_ACTPushCoinMgr.GetData(index)
if d != nil {
pack := &activity.DrawInfo{
Id: d.GetId(),
Coin: d.GetValue(),
}
for k, v := range d.GetGain() {
pack.ItemId = int32(k)
pack.ItemNum = int32(v)
}
if pack.Coin > 0 || pack.ItemId > 0 {
p.SendToClient(int(activity.PushCoinPacketID_PACKET_NotifyDrawInfo), pack)
// 增加能量条
AddPower(p, d.GetValue())
}
}
}
}

View File

@ -117,6 +117,8 @@ func init() {
etcd.Register(etcd.KeyRedPacket, webapi.RedPacketConfig{}, platformConfigEvent)
// 累计消耗活动配置
etcd.Register(etcd.KeyActConsume, webapi.ConsumeConfig{}, platformConfigEvent)
// 推金币活动配置
etcd.Register(etcd.KeyActPushCoin, webapi.PushCoinConfig{}, platformConfigEvent)
}
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -370,6 +372,8 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
WelfareMgrSington.UpdateRedPacket(config, isInit)
case *webapi.ConsumeConfig:
WelfareMgrSington.UpdateConsumeConfig(config)
case *webapi.PushCoinConfig:
WelfareMgrSington.UpdatePushCoinConfig(config)
default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)

View File

@ -930,6 +930,7 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
// WelfareSwitch 通知活动开关状态
func (this *WelfareMgr) WelfareSwitch(p *Player, platform string, op int) {
pack := &player_proto.SCEasyWelfaredInfo{}
now := time.Now()
// 0转盘1盲盒2首冲3连续充值
info := this.GetConfig(platform)
@ -1020,11 +1021,18 @@ func (this *WelfareMgr) WelfareSwitch(p *Player, platform string, op int) {
}
// 累消活动
consumeConfig := info.ConsumeConfig
if consumeConfig != nil {
if consumeConfig != nil && now.Unix() >= common.StrTimeToTs(consumeConfig.StartTime) && now.Unix() < common.StrTimeToTs(consumeConfig.EndTime) {
pack.WelfareSwitch = append(pack.WelfareSwitch, consumeConfig.On) //累消活动开关
} else {
pack.WelfareSwitch = append(pack.WelfareSwitch, model.WelfareClose)
}
// 推币机活动
coinConfig := info.PushCoinConfig
if coinConfig != nil && now.Unix() >= common.StrTimeToTs(coinConfig.StartTime) && now.Unix() < common.StrTimeToTs(coinConfig.EndTime) {
pack.WelfareSwitch = append(pack.WelfareSwitch, coinConfig.On) //推币机活动开关
} else {
pack.WelfareSwitch = append(pack.WelfareSwitch, model.WelfareClose)
}
if model.GameParamData.TestActSwitch {
for k := range pack.WelfareSwitch {
@ -2488,6 +2496,23 @@ func (this *WelfareMgr) UpdateConsumeConfig(conf *webapi_proto.ConsumeConfig) {
}
}
func (this *WelfareMgr) UpdatePushCoinConfig(conf *webapi_proto.PushCoinConfig) {
if model.GameParamData.TestActSwitch {
conf.On = model.WelfareOpen
}
s := int32(0)
info := this.GetConfig(conf.Platform)
if info.PushCoinConfig != nil {
s = info.PushCoinConfig.On
}
this.GetConfig(conf.Platform).PushCoinConfig = conf
//更新活动时间
// 打开关闭要广播给客户端
if s != 0 && s != conf.On {
this.WelfareSwitch(nil, conf.Platform, model.OpPushCoin)
}
}
func (this *WelfareMgr) Update() {
}

BIN
xlsx/DB_ACTPushCoin.xlsx Normal file

Binary file not shown.

Binary file not shown.