Compare commits

..

5 Commits

Author SHA1 Message Date
sk 1d52b88bdd Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2025-01-08 15:09:34 +08:00
sk a92a04a81d add 推币机活动 2025-01-08 14:46:29 +08:00
sk cf196814e0 解决冲突 2025-01-08 11:25:17 +08:00
sk 88e548bf6a 解决冲突 2025-01-08 11:19:04 +08:00
sk 88f2bf7f7c add 推币机活动 2025-01-08 11:15:24 +08:00
35 changed files with 5057 additions and 3036 deletions

View File

@ -119,6 +119,7 @@ const (
GameDifFruits = "306" // 水果机
GameDifRichblessed = "307" // 多彩多福
GameDifClawdoll = "608" // 娃娃机
GameDifPushCoin = "609" // 推币机
)
// IsTienLenYuLe TienLen娱乐
@ -344,6 +345,10 @@ const (
GainWayNianGain_EveryDayTask = 132 //年兽活动每日任务
GainWayNianGain_Task = 133 //年兽活动任务
GainWayConsume = 134 //累消活动获得
GainWayPushCoinExchangeCost = 135 // 推币机兑换消耗
GainWatPushCoinExchangeGain = 136 // 推币机兑换获得
GainWayPushCoinGain = 137 // 推币机掉落获得
GainWayPushCoinCost = 138 // 推币机消耗
)
// 后台选择 金币变化类型 的充值 类型id号起始
@ -599,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,5 +1,5 @@
"ˇŤ"˘Ťd"ąę
"ąę"ˇŤ"˘Ťd
"¡<>"¢<>d"¸ê
"¡<>"¢<>d"¸ê
"¡<>"¢<>d
@ -14,7 +14,7 @@
  "¡<>"¢<>]
  "¢<>\"¡<>
  "¡<>"¢<>[
"ˇŤ"˘ŤZ
"˘ŤZ"ˇŤ
"¡<>"¢<>Y
"¡<>"¢<>X
"¡<>"¢<>W
@ -27,54 +27,54 @@
"¡<>"¢<>P
"¡<>"¢<>O
"¡<>"¢<>N
"ˇŤ"˘ŤM
"ˇŤ"˘ŤL
"˘ŤM"ˇŤ
"˘ŤL"ˇŤ
"¡<>"¢<>K
"¡<>"¢<>J
"¡<>"¢<>I
  "ˇŤ"˘ŤH
  "˘ŤH"ˇŤ
!!"¡<>"¢<>G
"""¡<>"¢<>F
##"¡<>"¢<>E
$$"¡<>"¢<>D
%%"¡<>"¢<>C
&&"˘ŤB"ˇŤ
&&"ˇŤ"˘ŤB
''"¡<>"¢<>A
(("˘Ť@"ˇŤ
(("ˇŤ"˘Ť@
)"¡<>"¢<>d"¹ê
*"¡<>"¢<>d"¸ê
+"˘Ťd"¸ę"ˇŤ
+"ˇŤ"˘Ťd"¸ę
,"¡<>"¢<>d
-"¡<>"¢<>c
."¡<>"¢<>b
/"ˇŤ"˘Ťa
/"˘Ťa"ˇŤ
0"¡<>"¢<>`
1 "ˇŤ"˘Ť_
1 "˘Ť_"ˇŤ
2
"¡<>"¢<>^
3 "¡<>"¢<>]
4 "¡<>"¢<>\
5 "¡<>"¢<>[
6"ˇŤ"˘ŤZ
6"˘ŤZ"ˇŤ
7"¡<>"¢<>Y
8"¢<>X"¡<>
9"˘ŤW"ˇŤ
9"ˇŤ"˘ŤW
:"¡<>"¢<>V
;"¡<>"¢<>U
<"¡<>"¢<>T
="¡<>"¢<>S
>"˘ŤR"ˇŤ
?"ˇŤ"˘ŤQ
>"ˇŤ"˘ŤR
?"˘ŤQ"ˇŤ
@"¡<>"¢<>P
A"¡<>"¢<>O
B"¡<>"¢<>N
C"¡<>"¢<>M
D"¡<>"¢<>L
E"¡<>"¢<>K
F"˘ŤJ"ˇŤ
F"ˇŤ"˘ŤJ
G"¡<>"¢<>I
H "¡<>"¢<>H
I!"ˇŤ"˘ŤG
I!"˘ŤG"ˇŤ
J""¡<>"¢<>F
K#"¡<>"¢<>E
L$"¡<>"¢<>D

Binary file not shown.

View File

@ -64,12 +64,70 @@
"100002": 500
}
},
{},
{},
{},
{},
{},
{},
{
"Id": 5,
"Group": 2,
"Cost": {
"50016": 30
},
"Gain": {
"40002": 1
},
"Times": 5
},
{
"Id": 6,
"Group": 2,
"Cost": {
"50016": 10
},
"Gain": {
"100002": 3
},
"Times": 10
},
{
"Id": 7,
"Group": 2,
"Cost": {
"50016": 5
},
"Gain": {
"30001": 15
},
"Times": 15
},
{
"Id": 8,
"Group": 2,
"Cost": {
"50016": 1
},
"Gain": {
"20003": 1
},
"Times": 20
},
{
"Id": 9,
"Group": 2,
"Cost": {
"50016": 1
},
"Gain": {
"100001": 30000
}
},
{
"Id": 10,
"Group": 2,
"Cost": {
"50016": 1
},
"Custom": {
"1": 1
}
},
{},
{},
{},

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

@ -0,0 +1,11 @@
package pushcoin
const (
GameStatePlay = iota
GameStateMax
)
const (
PowerMax = 700000
PowerInit = 400000
)

View File

@ -46,13 +46,6 @@ type ScenePolicy interface {
CanAddCoin(s *Scene, p *Player, val int64) bool
//当前状态能否换桌
CanChangeCoinScene(s *Scene, p *Player) bool
//创建场景扩展数据
CreateSceneExData(s *Scene) interface{}
//创建玩家扩展数据
CreatePlayerExData(s *Scene, p *Player) interface{}
//
PacketGameData(s *Scene) interface{}
InterventionGame(s *Scene, data interface{}) interface{}
//通知分场状态
NotifyGameState(s *Scene)
@ -237,18 +230,14 @@ func (bsp *BaseScenePolicy) OnAudienceDropLine(s *Scene, p *Player) {
}
}
}
func (bsp *BaseScenePolicy) GetSceneState(s *Scene, stateid int) SceneState { return G_BaseSceneState }
func (bsp *BaseScenePolicy) IsCompleted(s *Scene) bool { return false }
func (bsp *BaseScenePolicy) IsCanForceStart(s *Scene) bool { return false }
func (bsp *BaseScenePolicy) ForceStart(s *Scene) {}
func (bsp *BaseScenePolicy) CanAddCoin(s *Scene, p *Player, val int64) bool { return true } /*百人牛牛,百人金华多倍结算,且当前是减币的情况下,需要判断*/
func (bsp *BaseScenePolicy) CanChangeCoinScene(s *Scene, p *Player) bool { return false }
func (bsp *BaseScenePolicy) CreateSceneExData(s *Scene) interface{} { return false }
func (bsp *BaseScenePolicy) CreatePlayerExData(s *Scene, p *Player) interface{} { return false }
func (bsp *BaseScenePolicy) PacketGameData(s *Scene) interface{} { return nil }
func (bsp *BaseScenePolicy) InterventionGame(s *Scene, data interface{}) interface{} { return nil }
func (bsp *BaseScenePolicy) NotifyGameState(s *Scene) {}
func (bsp *BaseScenePolicy) GetJackPotVal(s *Scene) int64 { return 0 }
func (bsp *BaseScenePolicy) GetSceneState(s *Scene, stateid int) SceneState { return G_BaseSceneState }
func (bsp *BaseScenePolicy) IsCompleted(s *Scene) bool { return false }
func (bsp *BaseScenePolicy) IsCanForceStart(s *Scene) bool { return false }
func (bsp *BaseScenePolicy) ForceStart(s *Scene) {}
func (bsp *BaseScenePolicy) CanAddCoin(s *Scene, p *Player, val int64) bool { return true } /*百人牛牛,百人金华多倍结算,且当前是减币的情况下,需要判断*/
func (bsp *BaseScenePolicy) CanChangeCoinScene(s *Scene, p *Player) bool { return false }
func (bsp *BaseScenePolicy) NotifyGameState(s *Scene) {}
func (bsp *BaseScenePolicy) GetJackPotVal(s *Scene) int64 { return 0 }
var G_BaseSceneState = &BaseSceneState{}

View File

@ -0,0 +1,42 @@
package thirteen
import (
"mongo.games.com/game/common"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/protocol/pushcoin"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
)
func init() {
common.Register(int(pushcoin.PushCoinPacketID_PACKET_CSPushCoinPlayerOp), &pushcoin.CSPushCoinPlayerOp{}, CSPushCoinPlayerOp)
}
func CSPushCoinPlayerOp(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSPlayerOpHandler Process recv ", data)
if msg, ok := data.(*pushcoin.CSPushCoinPlayerOp); ok {
p := base.PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warn("CSPlayerOpHandler p == nil")
return nil
}
scene := p.GetScene()
if scene == nil {
logger.Logger.Warn("CSPlayerOpHandler p.scene == nil")
return nil
}
if scene.KeyGameDif != common.GameDifPushCoin {
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
return nil
}
if !scene.HasPlayer(p) {
return nil
}
sp := scene.GetScenePolicy()
if sp != nil {
sp.OnPlayerOp(scene, p, int(msg.GetOpCode()), msg.GetOpParam())
}
return nil
}
return nil
}

View File

@ -0,0 +1,25 @@
package thirteen
import (
"mongo.games.com/game/gamesrv/base"
)
type GameData struct {
Shake int32 // 震动次数
Refresh int64 // 刷新次数
Power int64 // 能量值
Base int64 // 底注
}
type PlayerEx struct {
*base.Player //玩家信息
*GameData
}
func NewPushCoinPlayerData(p *base.Player, data *GameData) *PlayerEx {
playerEx := &PlayerEx{
Player: p,
GameData: data,
}
return playerEx
}

74
gamesrv/pushcoin/scene.go Normal file
View File

@ -0,0 +1,74 @@
package thirteen
import (
"mongo.games.com/game/common"
rule "mongo.games.com/game/gamerule/pushcoin"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/protocol/pushcoin"
"mongo.games.com/game/srvdata"
)
type SceneEx struct {
*base.Scene //场景
}
func NewPushCoinSceneData(s *base.Scene) *SceneEx {
sceneEx := &SceneEx{
Scene: s,
}
return sceneEx
}
func (this *SceneEx) CreateRoomInfoPacket(s *base.Scene, p *base.Player) *pushcoin.SCPushCoinRoomInfo {
playerEx, ok := p.ExtraData.(*PlayerEx)
if !ok {
return nil
}
roomInfo := &pushcoin.SCPushCoinRoomInfo{
RoomId: int32(s.GetSceneId()),
GameId: s.GameId,
RoomMode: int32(s.GetSceneMode()),
Params: common.CopySliceInt64ToInt32(s.GetParams()),
State: int32(s.GetSceneState().GetState()),
TimeOut: int32(s.GetSceneState().GetTimeout(s)),
BetList: s.GetDBGameFree().GetOtherIntParams(),
}
player := pushcoin.PushCoinPlayerData{
Name: p.Name,
SnId: p.SnId,
Head: p.Head,
Sex: p.Sex,
Coin: p.Coin,
Flag: int32(p.Flags),
VIP: p.VIP,
RoleId: p.Roles.ModId,
Level: p.Level,
Exp: p.Exp,
ShakeTimes: playerEx.Shake,
BaseCoin: playerEx.Base,
PowerLine: playerEx.Power,
PowerLineMax: rule.PowerMax,
RefreshTimes: playerEx.Refresh,
}
if p.Roles != nil {
player.RoleId = p.Roles.ModId
}
if p.Skin != nil {
player.SkinId = p.Skin.ModId
}
roomInfo.Players = append(roomInfo.Players, &player)
for _, v := range srvdata.PBDB_PropExchangeMgr.Datas.Arr {
if v.GetGroup() == 2 {
roomInfo.ExchangeList = append(roomInfo.ExchangeList, &pushcoin.ExchangeInfo{
Id: v.GetId(),
})
}
}
return roomInfo
}

View File

@ -0,0 +1,332 @@
package thirteen
import (
"encoding/json"
"time"
"mongo.games.com/goserver/core"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
rule "mongo.games.com/game/gamerule/pushcoin"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/model"
"mongo.games.com/game/protocol/pushcoin"
)
var PolicySingleton = &Policy{}
type Policy struct {
base.BaseScenePolicy
states [rule.GameStateMax]base.SceneState
}
func (this *Policy) OnStart(s *base.Scene) {
logger.Logger.Trace("(this *PushCoinPolicy) OnStart, sceneId=", s.GetSceneId())
sceneEx := NewPushCoinSceneData(s)
if sceneEx != nil {
s.ExtraData = sceneEx
s.ChangeSceneState(rule.GameStatePlay)
}
}
func (this *Policy) OnStop(s *base.Scene) {
logger.Logger.Trace("(this *Policy) OnStop , sceneId=", s.GetSceneId())
}
func (this *Policy) OnTick(s *base.Scene) {
if s == nil {
return
}
if s.SceneState != nil {
s.SceneState.OnTick(s)
}
}
func (this *Policy) OnPlayerEnter(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return
}
data := p.GDatas[s.KeyGamefreeId]
if data == nil {
data = &model.PlayerGameInfo{}
p.GDatas[s.KeyGamefreeId] = data
}
gamedata := &GameData{}
if data.DataEx != nil {
err := json.Unmarshal(data.DataEx, gamedata)
if err != nil {
logger.Logger.Error("OnPlayerEnter, json.Unmarshal error, err=", err)
return
}
} else {
// 底注
baseCoins := s.GetDBGameFree().GetOtherIntParams()
if len(baseCoins) > 0 {
gamedata.Base = baseCoins[0]
} else {
gamedata.Base = 5000
}
gamedata.Power = rule.PowerInit
}
p.ExtraData = NewPushCoinPlayerData(p, gamedata)
//给自己发送房间信息
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
}
func (this *Policy) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
playerEx, ok := p.ExtraData.(*PlayerEx)
if !ok {
return
}
data := p.GDatas[s.KeyGamefreeId]
if data == nil {
data = &model.PlayerGameInfo{}
p.GDatas[s.KeyGamefreeId] = data
}
b, err := json.Marshal(playerEx.GameData)
if err != nil {
logger.Logger.Error("OnPlayerLeave, json.Marshal error, err=", err)
return
}
data.DataEx = b
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
}
func (this *Policy) OnPlayerDropLine(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
}
func (this *Policy) OnPlayerRehold(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return
}
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventRehold, nil)
}
func (this *Policy) OnPlayerReturn(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return
}
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
}
func (this *Policy) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
if s == nil || p == nil {
return false
}
logger.Logger.Trace("(this *Policy) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
if s.SceneState != nil {
p.LastOPTimer = time.Now()
return s.SceneState.OnPlayerOp(s, p, opcode, params)
}
return true
}
func (this *Policy) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
if s.SceneState != nil {
s.SceneState.OnPlayerEvent(s, p, evtcode, params)
}
}
func (this *Policy) OnAudienceEnter(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnAudienceEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
//给自己发送房间信息
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.AudienceEventEnter, nil)
}
}
func (this *Policy) OnAudienceLeave(s *base.Scene, p *base.Player, reason int) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnAudienceLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
s.FirePlayerEvent(p, base.AudienceEventLeave, nil)
}
func (this *Policy) OnAudienceDropLine(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *Policy) OnAudienceDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
s.AudienceLeave(p, common.PlayerLeaveReason_DropLine)
s.FirePlayerEvent(p, base.AudienceEventDropLine, nil)
}
func (this *Policy) OnAudienceSit(s *base.Scene, p *base.Player) {
}
func (this *Policy) IsCompleted(s *base.Scene) bool {
return true
}
func (this *Policy) IsCanForceStart(s *base.Scene) bool {
return true
}
func (this *Policy) ForceStart(s *base.Scene) {
}
func (this *Policy) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
if s == nil || p == nil {
return false
}
if s.SceneState != nil {
return s.SceneState.CanChangeCoinScene(s, p)
}
return false
}
func (this *Policy) SendRoomInfo(s *base.Scene, p *base.Player, sceneEx *SceneEx) {
pack := sceneEx.CreateRoomInfoPacket(s, p)
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinRoomInfo), pack)
}
//=====================================
// StateGaming 游戏中
//=====================================
type StateGaming struct {
}
func (this *StateGaming) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
return true
}
func (this *StateGaming) OnLeave(s *base.Scene) {
}
func (this *StateGaming) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
}
func (this *StateGaming) GetState() int {
return rule.GameStatePlay
}
func (this *StateGaming) CanChangeTo(s base.SceneState) bool {
return true
}
func (this *StateGaming) GetTimeout(s *base.Scene) int {
if sceneEx, ok := s.GetExtraData().(*SceneEx); ok {
return int(time.Now().Sub(sceneEx.StateStartTime) / time.Second)
}
return 0
}
func (this *StateGaming) OnEnter(s *base.Scene) {
}
func (this *StateGaming) OnTick(s *base.Scene) {
}
func (this *StateGaming) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
logger.Logger.Trace("(this *StateGaming) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
_, ok := s.ExtraData.(*SceneEx)
if !ok {
return false
}
_, ok = p.ExtraData.(*PlayerEx)
if !ok {
return false
}
pack := &pushcoin.SCPushCoinPlayerOp{
OpRetCode: pushcoin.OpResultCode_OPRC_Error,
OpCode: pushcoin.OpCodes(opcode),
}
switch pushcoin.OpCodes(opcode) {
case pushcoin.OpCodes_OP_Bet:
case pushcoin.OpCodes_OP_Gain:
case pushcoin.OpCodes_OP_Shake:
case pushcoin.OpCodes_OP_Refresh:
case pushcoin.OpCodes_OP_Exchange:
case pushcoin.OpCodes_OP_Draw:
default:
return true
}
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinPlayerOp), pack)
return true
}
func (this *Policy) RegisteSceneState(state base.SceneState) {
if state == nil {
return
}
id := state.GetState()
if id < 0 || id >= rule.GameStateMax {
return
}
this.states[id] = state
}
func (this *Policy) GetSceneState(s *base.Scene, stateid int) base.SceneState {
if stateid >= 0 && stateid < rule.GameStateMax {
return this.states[stateid]
}
return nil
}
func init() {
PolicySingleton.RegisteSceneState(&StateGaming{})
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
base.RegisteScenePolicy(common.GameId_PushCoin, 0, PolicySingleton)
return nil
})
}

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

@ -557,6 +557,16 @@ type RedPacketData struct {
JN int32 // 参与次数
}
type PushCoinData struct {
Shake int32 // 震动次数
Refresh int64 // 刷新次数
Power int64 // 能量值
Base int64 // 底注
Value int64 // 价值
Exchange map[int32]int32 // 兑换次数 兑换id:兑换次数
Dram int // 抽奖次数
}
type WelfareData struct {
ReliefFundTimes int32 //救济金领取次数
Sign7 *NewSignData //七日签到
@ -575,6 +585,7 @@ type WelfareData struct {
PermitExchange map[int32][]int64 // 赛季通行证兑换次数, 多次的兑换时间
NianData *NianData //年兽活动数据
RedPacket map[int64]*RedPacketData // 红包活动 活动id:领取次数
PushCoin *PushCoinData // 推币机活动
}
func NewWelfareData() *WelfareData {

View File

@ -1,515 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1-devel
// protoc v3.19.4
// source: protocol/activity/actsign.proto
package activity
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//操作结果
type OpResultCode_ActSign int32
const (
OpResultCode_ActSign_OPRC_Activity_Sign_Sucess OpResultCode_ActSign = 0 //成功
OpResultCode_ActSign_OPRC_Activity_Sign_Error OpResultCode_ActSign = 1 //失败
OpResultCode_ActSign_OPRC_Activity_Sign_Close OpResultCode_ActSign = 1001 //活动未开启
OpResultCode_ActSign_OPRC_Activity_Sign_PayNum_Low OpResultCode_ActSign = 1002 //未达到最低充值金额
OpResultCode_ActSign_OPRC_Activity_Sign_Config_Vip_Error OpResultCode_ActSign = 1003 //vip不匹配
OpResultCode_ActSign_OPRC_Activity_Sign_Config_Day_Error OpResultCode_ActSign = 1004 //签到天数不匹配
OpResultCode_ActSign_OPRC_Activity_Sign_Repeat OpResultCode_ActSign = 1005 //重复签到
)
// Enum value maps for OpResultCode_ActSign.
var (
OpResultCode_ActSign_name = map[int32]string{
0: "OPRC_Activity_Sign_Sucess",
1: "OPRC_Activity_Sign_Error",
1001: "OPRC_Activity_Sign_Close",
1002: "OPRC_Activity_Sign_PayNum_Low",
1003: "OPRC_Activity_Sign_Config_Vip_Error",
1004: "OPRC_Activity_Sign_Config_Day_Error",
1005: "OPRC_Activity_Sign_Repeat",
}
OpResultCode_ActSign_value = map[string]int32{
"OPRC_Activity_Sign_Sucess": 0,
"OPRC_Activity_Sign_Error": 1,
"OPRC_Activity_Sign_Close": 1001,
"OPRC_Activity_Sign_PayNum_Low": 1002,
"OPRC_Activity_Sign_Config_Vip_Error": 1003,
"OPRC_Activity_Sign_Config_Day_Error": 1004,
"OPRC_Activity_Sign_Repeat": 1005,
}
)
func (x OpResultCode_ActSign) Enum() *OpResultCode_ActSign {
p := new(OpResultCode_ActSign)
*p = x
return p
}
func (x OpResultCode_ActSign) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OpResultCode_ActSign) Descriptor() protoreflect.EnumDescriptor {
return file_protocol_activity_actsign_proto_enumTypes[0].Descriptor()
}
func (OpResultCode_ActSign) Type() protoreflect.EnumType {
return &file_protocol_activity_actsign_proto_enumTypes[0]
}
func (x OpResultCode_ActSign) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OpResultCode_ActSign.Descriptor instead.
func (OpResultCode_ActSign) EnumDescriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{0}
}
// 签到
type ActSignPacketID int32
const (
ActSignPacketID_PACKET_SignZero ActSignPacketID = 0 // 弃用消息号
ActSignPacketID_PACKET_CSSign ActSignPacketID = 2662 // 签到
ActSignPacketID_PACKET_SCSign ActSignPacketID = 2663
ActSignPacketID_PACKET_CSSignData ActSignPacketID = 2664 // 签到数据
ActSignPacketID_PACKET_SCSignData ActSignPacketID = 2665
)
// Enum value maps for ActSignPacketID.
var (
ActSignPacketID_name = map[int32]string{
0: "PACKET_SignZero",
2662: "PACKET_CSSign",
2663: "PACKET_SCSign",
2664: "PACKET_CSSignData",
2665: "PACKET_SCSignData",
}
ActSignPacketID_value = map[string]int32{
"PACKET_SignZero": 0,
"PACKET_CSSign": 2662,
"PACKET_SCSign": 2663,
"PACKET_CSSignData": 2664,
"PACKET_SCSignData": 2665,
}
)
func (x ActSignPacketID) Enum() *ActSignPacketID {
p := new(ActSignPacketID)
*p = x
return p
}
func (x ActSignPacketID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ActSignPacketID) Descriptor() protoreflect.EnumDescriptor {
return file_protocol_activity_actsign_proto_enumTypes[1].Descriptor()
}
func (ActSignPacketID) Type() protoreflect.EnumType {
return &file_protocol_activity_actsign_proto_enumTypes[1]
}
func (x ActSignPacketID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ActSignPacketID.Descriptor instead.
func (ActSignPacketID) EnumDescriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{1}
}
//PACKET_CSSign
type CSSign struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SignIndex int32 `protobuf:"varint,1,opt,name=SignIndex,proto3" json:"SignIndex,omitempty"`
SignType int32 `protobuf:"varint,2,opt,name=SignType,proto3" json:"SignType,omitempty"` //0.普通签到 1.双倍签到
}
func (x *CSSign) Reset() {
*x = CSSign{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_activity_actsign_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSSign) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSSign) ProtoMessage() {}
func (x *CSSign) ProtoReflect() protoreflect.Message {
mi := &file_protocol_activity_actsign_proto_msgTypes[0]
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 CSSign.ProtoReflect.Descriptor instead.
func (*CSSign) Descriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{0}
}
func (x *CSSign) GetSignIndex() int32 {
if x != nil {
return x.SignIndex
}
return 0
}
func (x *CSSign) GetSignType() int32 {
if x != nil {
return x.SignType
}
return 0
}
//PACKET_SCSign
type SCSign struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SignIndex int32 `protobuf:"varint,1,opt,name=SignIndex,proto3" json:"SignIndex,omitempty"`
SignType int32 `protobuf:"varint,2,opt,name=SignType,proto3" json:"SignType,omitempty"` //0.普通签到 1.双倍签到
OpRetCode OpResultCode_ActSign `protobuf:"varint,3,opt,name=OpRetCode,proto3,enum=activity.OpResultCode_ActSign" json:"OpRetCode,omitempty"`
}
func (x *SCSign) Reset() {
*x = SCSign{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_activity_actsign_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCSign) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCSign) ProtoMessage() {}
func (x *SCSign) ProtoReflect() protoreflect.Message {
mi := &file_protocol_activity_actsign_proto_msgTypes[1]
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 SCSign.ProtoReflect.Descriptor instead.
func (*SCSign) Descriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{1}
}
func (x *SCSign) GetSignIndex() int32 {
if x != nil {
return x.SignIndex
}
return 0
}
func (x *SCSign) GetSignType() int32 {
if x != nil {
return x.SignType
}
return 0
}
func (x *SCSign) GetOpRetCode() OpResultCode_ActSign {
if x != nil {
return x.OpRetCode
}
return OpResultCode_ActSign_OPRC_Activity_Sign_Sucess
}
//PACKET_CSSignData
type CSSignData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CSSignData) Reset() {
*x = CSSignData{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_activity_actsign_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSSignData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSSignData) ProtoMessage() {}
func (x *CSSignData) ProtoReflect() protoreflect.Message {
mi := &file_protocol_activity_actsign_proto_msgTypes[2]
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 CSSignData.ProtoReflect.Descriptor instead.
func (*CSSignData) Descriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{2}
}
//PACKET_SCSignData
type SCSignData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SignCount int32 `protobuf:"varint,1,opt,name=SignCount,proto3" json:"SignCount,omitempty"`
TodaySign int32 `protobuf:"varint,2,opt,name=TodaySign,proto3" json:"TodaySign,omitempty"` //0.未签到 1.已签到
}
func (x *SCSignData) Reset() {
*x = SCSignData{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_activity_actsign_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCSignData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCSignData) ProtoMessage() {}
func (x *SCSignData) ProtoReflect() protoreflect.Message {
mi := &file_protocol_activity_actsign_proto_msgTypes[3]
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 SCSignData.ProtoReflect.Descriptor instead.
func (*SCSignData) Descriptor() ([]byte, []int) {
return file_protocol_activity_actsign_proto_rawDescGZIP(), []int{3}
}
func (x *SCSignData) GetSignCount() int32 {
if x != nil {
return x.SignCount
}
return 0
}
func (x *SCSignData) GetTodaySign() int32 {
if x != nil {
return x.TodaySign
}
return 0
}
var File_protocol_activity_actsign_proto protoreflect.FileDescriptor
var file_protocol_activity_actsign_proto_rawDesc = []byte{
0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x2f, 0x61, 0x63, 0x74, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22, 0x42, 0x0a, 0x06, 0x43,
0x53, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22,
0x80, 0x01, 0x0a, 0x06, 0x53, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69,
0x67, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x53,
0x69, 0x67, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e,
0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x69, 0x67, 0x6e,
0x54, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x5f,
0x41, 0x63, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x53, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x61,
0x22, 0x48, 0x0a, 0x0a, 0x53, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c,
0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09,
0x54, 0x6f, 0x64, 0x61, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x09, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x2a, 0x8a, 0x02, 0x0a, 0x14, 0x4f,
0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x5f, 0x41, 0x63, 0x74, 0x53,
0x69, 0x67, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69,
0x76, 0x69, 0x74, 0x79, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73,
0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01,
0x12, 0x1d, 0x0a, 0x18, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0xe9, 0x07, 0x12,
0x22, 0x0a, 0x1d, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x50, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x5f, 0x4c, 0x6f, 0x77,
0x10, 0xea, 0x07, 0x12, 0x28, 0x0a, 0x23, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69,
0x76, 0x69, 0x74, 0x79, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x5f, 0x56, 0x69, 0x70, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xeb, 0x07, 0x12, 0x28, 0x0a,
0x23, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x53,
0x69, 0x67, 0x6e, 0x5f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x44, 0x61, 0x79, 0x5f, 0x45,
0x72, 0x72, 0x6f, 0x72, 0x10, 0xec, 0x07, 0x12, 0x1e, 0x0a, 0x19, 0x4f, 0x50, 0x52, 0x43, 0x5f,
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5f, 0x52, 0x65,
0x70, 0x65, 0x61, 0x74, 0x10, 0xed, 0x07, 0x2a, 0x7e, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x53, 0x69,
0x67, 0x6e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12,
0x12, 0x0a, 0x0d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x53, 0x69, 0x67, 0x6e,
0x10, 0xe6, 0x14, 0x12, 0x12, 0x0a, 0x0d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
0x53, 0x69, 0x67, 0x6e, 0x10, 0xe7, 0x14, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x43, 0x53, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x10, 0xe8, 0x14, 0x12,
0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x53, 0x69, 0x67, 0x6e,
0x44, 0x61, 0x74, 0x61, 0x10, 0xe9, 0x14, 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 (
file_protocol_activity_actsign_proto_rawDescOnce sync.Once
file_protocol_activity_actsign_proto_rawDescData = file_protocol_activity_actsign_proto_rawDesc
)
func file_protocol_activity_actsign_proto_rawDescGZIP() []byte {
file_protocol_activity_actsign_proto_rawDescOnce.Do(func() {
file_protocol_activity_actsign_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_activity_actsign_proto_rawDescData)
})
return file_protocol_activity_actsign_proto_rawDescData
}
var file_protocol_activity_actsign_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_protocol_activity_actsign_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_protocol_activity_actsign_proto_goTypes = []interface{}{
(OpResultCode_ActSign)(0), // 0: activity.OpResultCode_ActSign
(ActSignPacketID)(0), // 1: activity.ActSignPacketID
(*CSSign)(nil), // 2: activity.CSSign
(*SCSign)(nil), // 3: activity.SCSign
(*CSSignData)(nil), // 4: activity.CSSignData
(*SCSignData)(nil), // 5: activity.SCSignData
}
var file_protocol_activity_actsign_proto_depIdxs = []int32{
0, // 0: activity.SCSign.OpRetCode:type_name -> activity.OpResultCode_ActSign
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_protocol_activity_actsign_proto_init() }
func file_protocol_activity_actsign_proto_init() {
if File_protocol_activity_actsign_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_protocol_activity_actsign_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSSign); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protocol_activity_actsign_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCSign); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protocol_activity_actsign_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSSignData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protocol_activity_actsign_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCSignData); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protocol_activity_actsign_proto_rawDesc,
NumEnums: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_protocol_activity_actsign_proto_goTypes,
DependencyIndexes: file_protocol_activity_actsign_proto_depIdxs,
EnumInfos: file_protocol_activity_actsign_proto_enumTypes,
MessageInfos: file_protocol_activity_actsign_proto_msgTypes,
}.Build()
File_protocol_activity_actsign_proto = out.File
file_protocol_activity_actsign_proto_rawDesc = nil
file_protocol_activity_actsign_proto_goTypes = nil
file_protocol_activity_actsign_proto_depIdxs = nil
}

View File

@ -1,43 +0,0 @@
syntax = "proto3";
package activity;
option go_package = "mongo.games.com/game/protocol/activity";
//
enum OpResultCode_ActSign {
OPRC_Activity_Sign_Sucess = 0; //
OPRC_Activity_Sign_Error = 1; //
OPRC_Activity_Sign_Close = 1001; //
OPRC_Activity_Sign_PayNum_Low = 1002; //
OPRC_Activity_Sign_Config_Vip_Error = 1003; //vip不匹配
OPRC_Activity_Sign_Config_Day_Error = 1004; //
OPRC_Activity_Sign_Repeat = 1005; //
}
//
enum ActSignPacketID {
PACKET_SignZero = 0;//
PACKET_CSSign = 2662;//
PACKET_SCSign = 2663;
PACKET_CSSignData = 2664;//
PACKET_SCSignData = 2665;
}
//PACKET_CSSign
message CSSign {
int32 SignIndex = 1;
int32 SignType = 2; //0. 1.
}
//PACKET_SCSign
message SCSign {
int32 SignIndex = 1;
int32 SignType = 2; //0. 1.
OpResultCode_ActSign OpRetCode = 3;
}
//PACKET_CSSignData
message CSSignData {
}
//PACKET_SCSignData
message SCSignData {
int32 SignCount = 1;
int32 TodaySign = 2; //0. 1.
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,88 @@
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; //
repeated int64 BetList = 3; //
int32 ShakeTimes = 4; //
int64 BaseCoin = 5; //()
int64 PowerLine = 6; //
int64 PowerLineMax = 7; //
int64 RefreshTimes = 8; //
}
message ItemInfo{
int32 ItemId = 1; //id
int32 ItemNum = 2; //
}
message ExchangeInfo{
int32 Id = 1; //id
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
int32 ItemNum = 3; //
int64 Coin = 4; //
}
//
//PACKET_CSPushCoinPlayerOp
message CSPushCoinPlayerOp {
OpCodes OpCode = 1;
int64 OpParam = 2;
repeated ItemInfo OpItem = 3;
}
enum OpCodes {
OP_Zero = 0;
OP_Bet = 1; // OpParam
OP_Gain = 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; //
}
//PACKET_SCPushCoinPlayerOp
message SCPushCoinPlayerOp {
OpResultPushCoinCode OpRetCode = 1;
OpCodes OpCode = 2;
ExchangeInfo Exchange = 3; // ,
}
//
//PACKET_NotifyPowerLine
message NotifyPowerLine {
int64 PowerLine = 1; //
int64 PowerLineMax = 2; //
}

View File

@ -199,6 +199,7 @@ type SCPushCoinRoomInfo struct {
Players []*PushCoinPlayerData `protobuf:"bytes,7,rep,name=Players,proto3" json:"Players,omitempty"` //房间内的玩家信息
ExchangeList []*ExchangeInfo `protobuf:"bytes,8,rep,name=ExchangeList,proto3" json:"ExchangeList,omitempty"` //兑换信息
DrawList []*DrawInfo `protobuf:"bytes,9,rep,name=DrawList,proto3" json:"DrawList,omitempty"` //抽奖信息
BetList []int64 `protobuf:"varint,10,rep,packed,name=BetList,proto3" json:"BetList,omitempty"` //下注金额列表
}
func (x *SCPushCoinRoomInfo) Reset() {
@ -296,6 +297,13 @@ func (x *SCPushCoinRoomInfo) GetDrawList() []*DrawInfo {
return nil
}
func (x *SCPushCoinRoomInfo) GetBetList() []int64 {
if x != nil {
return x.BetList
}
return nil
}
type ItemInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -867,7 +875,7 @@ var File_protocol_pushcoin_pushcoin_proto protoreflect.FileDescriptor
var file_protocol_pushcoin_pushcoin_proto_rawDesc = []byte{
0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63,
0x6f, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x08, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x22, 0xcc, 0x02, 0x0a,
0x74, 0x6f, 0x12, 0x08, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x22, 0xe6, 0x02, 0x0a,
0x12, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x47,
@ -888,102 +896,104 @@ var file_protocol_pushcoin_pushcoin_proto_rawDesc = []byte{
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x44,
0x72, 0x61, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x08, 0x44, 0x72, 0x61, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x08, 0x49,
0x74, 0x65, 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, 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, 0x70, 0x75, 0x73, 0x68, 0x63,
0x6f, 0x69, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x43, 0x6f,
0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x47, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x12, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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, 0xae, 0x03, 0x0a,
0x12, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44,
0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48,
0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x65,
0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x49, 0x50, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x56, 0x49, 0x50, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c,
0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65,
0x6c, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x78, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03,
0x45, 0x78, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x0c, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x53,
0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x53, 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x42,
0x61, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x42,
0x61, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x6f, 0x77, 0x65, 0x72,
0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0f, 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, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x50, 0x6f, 0x77,
0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52,
0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x5f, 0x0a,
0x13, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75,
0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75,
0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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, 0xd1, 0x01, 0x0a, 0x12, 0x53, 0x43,
0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70,
0x12, 0x34, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x4f,
0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69,
0x6e, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x44,
0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x44, 0x72, 0x61, 0x77, 0x2a, 0xad, 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, 0x1e, 0x0a, 0x19,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69,
0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xa6, 0x2c, 0x12, 0x1f, 0x0a, 0x1a,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69,
0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0xa7, 0x2c, 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, 0xa8, 0x2c, 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, 0xa9, 0x2c, 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, 0x30, 0x0a, 0x0c, 0x4f, 0x70,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50,
0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a,
0x4f, 0x50, 0x52, 0x43, 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, 0x70, 0x75,
0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x52, 0x08, 0x44, 0x72, 0x61, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x42,
0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x42, 0x65,
0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x08, 0x49, 0x74, 0x65, 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, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04,
0x47, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x75, 0x73,
0x68, 0x63, 0x6f, 0x69, 0x6e, 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, 0xae, 0x03, 0x0a, 0x12, 0x50, 0x75, 0x73, 0x68, 0x43,
0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78,
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43,
0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12,
0x12, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x46,
0x6c, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20,
0x03, 0x28, 0x09, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x56,
0x49, 0x50, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x56, 0x49, 0x50, 0x12, 0x16, 0x0a,
0x06, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52,
0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x45,
0x78, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x78, 0x70, 0x12, 0x16, 0x0a,
0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53,
0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, 0x68, 0x61, 0x6b, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x69,
0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x42, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x69,
0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0f,
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,
0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65,
0x4d, 0x61, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69,
0x6d, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x53, 0x43, 0x50, 0x75, 0x73,
0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05,
0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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, 0xd1, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f,
0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x12, 0x34, 0x0a, 0x09, 0x4f, 0x70,
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e,
0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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,
0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 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,
0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x04, 0x44, 0x72, 0x61, 0x77, 0x2a, 0xad, 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, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49,
0x6e, 0x66, 0x6f, 0x10, 0xa6, 0x2c, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53,
0x74, 0x61, 0x74, 0x65, 0x10, 0xa7, 0x2c, 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, 0xa8, 0x2c, 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, 0xa9, 0x2c, 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, 0x30, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 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, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -23,6 +23,7 @@ message SCPushCoinRoomInfo {
repeated PushCoinPlayerData Players = 7; //
repeated ExchangeInfo ExchangeList = 8; //
repeated DrawInfo DrawList = 9; //
repeated int64 BetList = 10; //
}
message ItemInfo{

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;
@ -1481,6 +1497,10 @@ message DB_PropExchange {
map<int64, int64> Gain = 4;
map<int64, int64> Custom = 5;
int32 Times = 6;
}
message DB_PropExchangeArray {

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})
}

347
worldsrv/action_pushcoin.go Normal file
View File

@ -0,0 +1,347 @@
package main
import (
"mongo.games.com/game/common"
"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"
"sort"
)
const (
PowerMax = 700000
PowerInit = 400000
ValueInit = 50 * 5000
)
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 {
_, ok := data.(*activity.CSPushCoinInfo)
if !ok {
return nil
}
p := PlayerMgrSington.GetOnlinePlayer(sid)
if p == nil {
logger.Logger.Warn("CSPushCoinInfo p == nil")
return nil
}
if p.WelfData == nil {
logger.Logger.Warn("CSPushCoinInfo p.WelfData == nil")
return nil
}
if p.WelfData.PushCoin == nil {
p.WelfData.PushCoin = &model.PushCoinData{
Power: PowerInit,
Base: BaseCoins[0],
Value: ValueInit,
Exchange: make(map[int32]int32),
}
}
pack := &activity.SCPushCoinInfo{
ShakeTimes: p.WelfData.PushCoin.Shake,
BaseCoin: p.WelfData.PushCoin.Base,
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(),
TotalTimes: int64(v.GetTimes()),
}
for kk, vv := range v.GetCost() {
info.Cost = append(info.Cost, &activity.ItemInfo{
ItemId: int32(kk),
ItemNum: int32(vv),
})
}
sort.Slice(info.Cost, func(i, j int) bool {
return info.Cost[i].ItemId < info.Cost[j].ItemId
})
for kk, vv := range v.GetGain() {
info.Gain = append(info.Gain, &activity.ItemInfo{
ItemId: int32(kk),
ItemNum: int32(vv),
})
}
sort.Slice(info.Gain, func(i, j int) bool {
return info.Gain[i].ItemId < info.Gain[j].ItemId
})
for kk, vv := range v.GetCustom() {
if kk == 1 {
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.

Binary file not shown.