Merge branch 'develop' into release

This commit is contained in:
sk 2024-08-19 13:52:37 +08:00
commit 50da2721fb
98 changed files with 10612 additions and 4861 deletions

View File

@ -86,6 +86,7 @@ const (
GameId_CaoThap = 605 //CaoThap
GameId_AngerUncle = 606 // 愤怒大叔
GameId_SmallRoket = 607 // 小火箭
GameId_Clawdoll = 608 // 娃娃机
__GameId_ThrGame_Min__ = 700 //################三方类################
GameId_Thr_Dg = 701 //DG Game
GameId_Thr_XHJ = 901 //DG Game
@ -104,6 +105,7 @@ const (
GameDifTamQuoc = "305" // 百战成神
GameDifFruits = "306" // 水果机
GameDifRichblessed = "307" // 多彩多福
GameDifClawdoll = "608" // 娃娃机
)
// IsTienLenYuLe TienLen娱乐
@ -297,6 +299,8 @@ const (
GainWaySkinUpGrade = 101 // 皮肤升级消耗
GainWayItemFen = 102 // 道具分解消耗
GainWayItemFenGain = 103 // 道具分解获得
GainWayGuide = 104 //新手引导奖励
GainWayVipGift9 = 105 //vip等级礼包
)
// 后台选择 金币变化类型 的充值 类型id号起始
@ -838,3 +842,14 @@ var (
300003: 70,
}
)
const (
AttributeGuideStep = 1 // 引导步骤
AttributeGuideSkip = 2 // 跳过引导
AttributeGuideTest = 3 // 测试引导
)
const (
On = 1 // 开启
Off = 2 // 关闭
)

Binary file not shown.

View File

@ -6390,6 +6390,39 @@
],
"PlayerWaterRate": 100,
"BetWaterRate": 100
},
{
"Id": 6080001,
"Name": "娃娃机",
"Title": "1",
"GameId": 608,
"GameRule": 60800,
"GameType": 1,
"SceneType": 1,
"Desc": "0",
"ShowType": 3,
"ShowId": 60800,
"BaseScore": 1000,
"Turn": 60800,
"BetDec": "1000",
"Ai": [
0
],
"OtherIntParams": [
0
],
"RobotNumRng": [
0
],
"SameIpLimit": 1,
"GameDif": "608",
"GameClass": 2,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
0
],
"PlayerWaterRate": 100,
"BetWaterRate": 100
}
]
}

Binary file not shown.

View File

@ -195,6 +195,11 @@
"Name": "多财多福",
"GameId": 307,
"GameDif": "307"
},
{
"Id": 60800,
"Name": "娃娃机",
"GameId": 608
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,8 +3,8 @@
{
"Name": "不是VIP",
"Privilege1": [
100000,
2
0,
0
],
"Privilege2": [
0,
@ -28,7 +28,12 @@
"获得专属头像框",
"获得专属炮台",
"更多VIP功能正待开发"
]
],
"Privilege9": [
0,
0
],
"PrivilegeShow": 1000
},
{
"Id": 1,
@ -36,8 +41,8 @@
"Count": 1000,
"VipExp": 1000,
"Privilege1": [
100000,
100
0,
0
],
"Privilege2": [
0,
@ -63,7 +68,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 1
"MatchFreeTimes": 1,
"Privilege9": [
0,
0
],
"PrivilegeShow": 2000
},
{
"Id": 2,
@ -71,8 +81,8 @@
"Count": 2000,
"VipExp": 2000,
"Privilege1": [
150000,
150
0,
0
],
"Privilege2": [
0,
@ -98,7 +108,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 2
"MatchFreeTimes": 2,
"Privilege9": [
0,
0
],
"PrivilegeShow": 3000
},
{
"Id": 3,
@ -106,8 +121,8 @@
"Count": 5000,
"VipExp": 5000,
"Privilege1": [
200000,
200
0,
0
],
"Privilege2": [
0,
@ -133,7 +148,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 3
"MatchFreeTimes": 3,
"Privilege9": [
0,
0
],
"PrivilegeShow": 4000
},
{
"Id": 4,
@ -141,8 +161,8 @@
"Count": 10000,
"VipExp": 10000,
"Privilege1": [
300000,
250
0,
0
],
"Privilege2": [
0,
@ -168,7 +188,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 4
"MatchFreeTimes": 4,
"Privilege9": [
0,
0
],
"PrivilegeShow": 5000
},
{
"Id": 5,
@ -176,8 +201,8 @@
"Count": 20000,
"VipExp": 20000,
"Privilege1": [
400000,
300
0,
0
],
"Privilege2": [
0,
@ -203,7 +228,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 5
"MatchFreeTimes": 5,
"Privilege9": [
0,
0
],
"PrivilegeShow": 6000
},
{
"Id": 6,
@ -211,8 +241,8 @@
"Count": 50000,
"VipExp": 50000,
"Privilege1": [
500000,
350
0,
0
],
"Privilege2": [
0,
@ -238,7 +268,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 6
"MatchFreeTimes": 6,
"Privilege9": [
0,
0
],
"PrivilegeShow": 7000
},
{
"Id": 7,
@ -246,8 +281,8 @@
"Count": 100000,
"VipExp": 100000,
"Privilege1": [
600000,
400
0,
0
],
"Privilege2": [
0,
@ -273,7 +308,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 7
"MatchFreeTimes": 7,
"Privilege9": [
0,
0
],
"PrivilegeShow": 8000
},
{
"Id": 8,
@ -281,8 +321,8 @@
"Count": 200000,
"VipExp": 200000,
"Privilege1": [
700000,
450
0,
0
],
"Privilege2": [
0,
@ -308,7 +348,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 8
"MatchFreeTimes": 8,
"Privilege9": [
0,
0
],
"PrivilegeShow": 9000
},
{
"Id": 9,
@ -316,8 +361,8 @@
"Count": 500000,
"VipExp": 500000,
"Privilege1": [
800000,
500
0,
0
],
"Privilege2": [
0,
@ -343,7 +388,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 9
"MatchFreeTimes": 9,
"Privilege9": [
0,
0
],
"PrivilegeShow": 10000
},
{
"Id": 10,
@ -351,8 +401,8 @@
"Count": 1000000,
"VipExp": 1000000,
"Privilege1": [
900000,
550
0,
0
],
"Privilege2": [
0,
@ -378,7 +428,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 10
"MatchFreeTimes": 10,
"Privilege9": [
0,
0
],
"PrivilegeShow": 11000
},
{
"Id": 11,
@ -386,8 +441,8 @@
"Count": 2000000,
"VipExp": 2000000,
"Privilege1": [
1000000,
600
0,
0
],
"Privilege2": [
0,
@ -413,7 +468,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 11
"MatchFreeTimes": 11,
"Privilege9": [
0,
0
],
"PrivilegeShow": 12000
},
{
"Id": 12,
@ -421,8 +481,8 @@
"Count": 5000000,
"VipExp": 5000000,
"Privilege1": [
2000000,
650
0,
0
],
"Privilege2": [
0,
@ -448,7 +508,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 12
"MatchFreeTimes": 12,
"Privilege9": [
0,
0
],
"PrivilegeShow": 13000
},
{
"Id": 13,
@ -456,8 +521,8 @@
"Count": 10000000,
"VipExp": 10000000,
"Privilege1": [
3000000,
700
0,
0
],
"Privilege2": [
0,
@ -483,7 +548,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 13
"MatchFreeTimes": 13,
"Privilege9": [
0,
0
],
"PrivilegeShow": 14000
},
{
"Id": 14,
@ -491,8 +561,8 @@
"Count": 20000000,
"VipExp": 20000000,
"Privilege1": [
4000000,
750
0,
0
],
"Privilege2": [
0,
@ -518,7 +588,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 14
"MatchFreeTimes": 14,
"Privilege9": [
0,
0
],
"PrivilegeShow": 15000
},
{
"Id": 15,
@ -526,8 +601,8 @@
"Count": 50000000,
"VipExp": 50000000,
"Privilege1": [
5000000,
800
0,
0
],
"Privilege2": [
0,
@ -553,7 +628,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 15
"MatchFreeTimes": 15,
"Privilege9": [
0,
0
],
"PrivilegeShow": 16000
},
{
"Id": 16,
@ -561,8 +641,8 @@
"Count": 100000000,
"VipExp": 100000000,
"Privilege1": [
6000000,
850
0,
0
],
"Privilege2": [
0,
@ -588,12 +668,12 @@
"获得专属炮台",
"更多VIP功能正待开发"
],
"MatchFreeTimes": 16
},
{
"ParamName": [
""
]
"MatchFreeTimes": 16,
"Privilege9": [
0,
0
],
"PrivilegeShow": 17000
}
]
}

3
data/DB_VIPShow.dat Normal file
View File

@ -0,0 +1,3 @@



13
data/DB_VIPShow.json Normal file
View File

@ -0,0 +1,13 @@
{
"Arr": [
{
"Id": 1,
"SkinId": 300003
},
{
"Id": 2,
"SkinId": 300004,
"VIPLevel": 3
}
]
}

View File

@ -0,0 +1,19 @@
{
"GameName":"娃娃机",
"GameId":608,
"GameMode":[0],
"SceneType":[1],
"CanForceStart":false,
"MinPlayerCnt":1,
"DefaultPlayerCnt":1,
"MaxIndex":0,
"TimeFreeStart":0,
"TimeFreeEnd":0,
"DependentPlayerCnt":true,
"EnterAfterStart":false,
"PerGameTakeCard":100,
"ViewLogCnt":-1,
"BetState":0,
"Params":[
]
}

View File

@ -6,7 +6,7 @@
"VerifyClientVersion":true,
"SrvMaintain":false,
"WhiteHttpAddr": [],
"HundredScenePreCreate":true,
"HundredScenePreCreate":false,
"WriteEventLog": true,
"SpreadAccountQPT":100,
"FakeVerifyCode":"123456",
@ -23,6 +23,7 @@
"ClosePreCreateRoom": true,
"AgoraAddress": "http://47.105.78.29:8081",
"InviteUrl": "http://47.105.78.29:8000/",
"GuideTs": 1723790567,
"RankTimeout": 2,
"PermitInitScore": 0
}

View File

@ -0,0 +1,36 @@
package mq
import (
"encoding/json"
"mongo.games.com/goserver/core/broker"
"mongo.games.com/goserver/core/broker/rabbitmq"
"mongo.games.com/game/dbproxy/svc"
"mongo.games.com/game/model"
"mongo.games.com/game/mq"
)
func init() {
mq.RegisterSubscriber(mq.DBVipGiftLog, func(e broker.Event) (err error) {
msg := e.Message()
if msg != nil {
defer func() {
e.Ack()
}()
var log model.DbVip
err = json.Unmarshal(msg.Body, &log)
if err != nil {
return
}
c := svc.DbVipLogCollection(log.Platform)
if c != nil {
err = c.Insert(log)
}
return
}
return nil
}, broker.Queue(mq.DBVipGiftLog), broker.DisableAutoAck(), rabbitmq.DurableQueue())
}

View File

@ -2,17 +2,26 @@ package svc
import (
"errors"
"net/rpc"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/dbproxy/mongo"
"mongo.games.com/game/model"
"net/rpc"
)
var (
MatchAwardLogDBErr = errors.New("log_matchawardlog db open failed.")
MatchAwardDBErr = errors.New("log_matchawardlog db open failed")
)
func MatchAwardLogCollection(plt string) *mongo.Collection {
type MatchAwardLog struct {
AwardNum map[string]map[int32]int32 // 奖励数量
Platform string
}
func MatchAwardCollection(plt string) *mongo.Collection {
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, model.MatchAwardLogDBName)
if s != nil {
c, _ := s.DB().C(model.MatchAwardLogCollName)
@ -21,47 +30,55 @@ func MatchAwardLogCollection(plt string) *mongo.Collection {
return nil
}
func InsertOrUpdateMatchAwardLog(logs ...*model.MatchAwardLog) (err error) {
for _, log := range logs {
clog := MatchAwardLogCollection(log.Platform)
if clog == nil {
return
type MatchAwardSvc struct {
}
_, err = clog.Upsert(nil, log)
func (svc *MatchAwardSvc) UpsertMatchAward(req *model.MatchAward, ret *bool) (err error) {
c := MatchAwardCollection(req.Platform)
if c == nil {
return MatchAwardDBErr
}
_, err = c.Upsert(nil, req)
if err != nil {
// 处理错误
logger.Logger.Errorf("UpsertMatchAward err:%v", err)
}
return err
}
}
return
func (svc *MatchAwardSvc) GetMatchAward(plt string, ret *model.MatchAward) (err error) {
c := MatchAwardCollection(plt)
if c == nil {
return MatchAwardDBErr
}
type MatchAwardLogSvc struct {
}
func (svc *MatchAwardLogSvc) InsertOrUpdateMatchAwardLog(args []*model.MatchAwardLog, ret *bool) (err error) {
err = InsertOrUpdateMatchAwardLog(args...)
// 旧数据
old := &MatchAwardLog{}
err = c.Find(bson.M{"platform": "1"}).One(old)
if err == nil {
*ret = true
for k, v := range old.AwardNum {
d := &model.MatchAward{
Platform: k,
Award: make(map[int32]int32),
}
return
for kk, vv := range v {
d.Award[kk] = vv
}
func GetMatchAward(plt string, ret *model.MatchAwardLog) (err error) {
clog := MatchAwardLogCollection(plt)
if clog == nil {
return nil
var b bool
svc.UpsertMatchAward(d, &b)
}
selecter := bson.M{"platform": plt}
err = clog.Find(selecter).One(&ret)
if err != nil {
return nil
c.Remove(bson.M{"platform": "1"})
}
return
// 旧数据
err = nil
err = c.Find(nil).One(ret)
if err != nil && err != mgo.ErrNotFound {
logger.Logger.Errorf("GetMatchAward err:%v", err)
}
func (svc *MatchAwardLogSvc) GetMatchAward(Plt string, ret *model.MatchAwardLog) (err error) {
err = GetMatchAward(Plt, ret)
return err
}
func init() {
rpc.Register(new(MatchAwardLogSvc))
rpc.Register(new(MatchAwardSvc))
}

View File

@ -354,6 +354,11 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
}
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
}
if p.GuideStep >= 0 && p.CreateTime.Unix() < model.GameParamData.GuideTs {
p.GuideStep = -1
param["guidestep"] = p.GuideStep
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
}
}
var code string

View File

@ -38,4 +38,7 @@ const (
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
ETCDKEY_GUIDE = "/game/guide_config" //新手引导配置
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
)

View File

@ -18,6 +18,7 @@ import (
// key:监听的key
// msgType:数据类型
// f:数据变更回调方法, completeKey:完整键, isInit:第一次主动拉取数据,event:事件类型, data:已经反序列化的数据类型为msgType,是指针类型
// **isInit** 为true时表示是第一次主动拉取数据此时允许耗时操作。为false时表示是监听到数据变更此时不允许耗时操作。
func Register(key string, msgType interface{}, f func(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{})) {
createFunc := func() interface{} {
tp := reflect.TypeOf(msgType)

View File

@ -0,0 +1,25 @@
package clawdoll
import "time"
// 场景状态
const (
ClawDollSceneStateWait int = iota //等待状态
ClawDollSceneStateStart //开始倒计时
ClawDollSceneStatePlayGame //游戏中
ClawDollSceneStateBilled //结算
ClawDollSceneStateMax
)
const (
ClawDollSceneWaitTimeout = time.Second * 2 //等待倒计时
ClawDollSceneStartTimeout = time.Second * 6 //开始倒计时
ClawDollSceneBilledTimeout = time.Second * 2 //结算
)
// 玩家操作
const (
ClawDollPlayerOpScore = iota + 1 // 上分
ClawDollPlayerOpGo // 下抓
ClawDollPlayerOpMove // 移动方向
)

View File

@ -0,0 +1,4 @@
package clawdoll
type Logic struct {
}

View File

@ -0,0 +1,25 @@
package action
import (
"mongo.games.com/game/protocol/machine"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
)
var MachineMap = make(map[int]string)
func MSDollMachineList(session *netlib.Session, packetId int, data interface{}) error {
logger.Logger.Tracef("TestHandler %v", data)
MachineMap = make(map[int]string)
if msg, ok := data.(*machine.MSDollMachineList); ok {
for i, info := range msg.Data {
MachineMap[i+1] = info.VideoAddr
logger.Logger.Tracef("MachineMap[%v] = %v", i, info.VideoAddr)
}
}
return nil
}
func init() {
netlib.Register(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), &machine.MSDollMachineList{}, MSDollMachineList)
}

View File

@ -114,7 +114,7 @@ type Player struct {
sparams map[int]string //字符参数
IsLocal bool //是否本地player
Items map[int32]int64 //背包数据
MatchParams []int32 //比赛参数 排名、段位、假snid、假角色
MatchParams []int32 //比赛参数 排名、段位、假snid、假角色、假皮肤
MatchRobotGrades []MatchRobotGrade
TestLog []string // 调试日志
RankScore map[int32]int64 // 段位积分

View File

@ -171,7 +171,7 @@ type DB_FishOutMgrEx struct {
func (this *DB_FishOutMgrEx) InitFishAppear() {
this.FishOutPool = make(map[int32]*AppearFish)
for _, v := range srvdata.PBDB_FishOutMgr.Datas.Arr {
logger.Logger.Tracef("初始化房间出鱼列表 fishId = %v", v.Id)
//logger.Logger.Tracef("初始化房间出鱼列表 fishId = %v", v.Id)
this.FishOutPool[v.Id] = &AppearFish{
FishId: v.Id,
Exp: v.Exp,

View File

@ -1,7 +1,9 @@
package base
import (
"fmt"
"mongo.games.com/game/common"
"mongo.games.com/game/protocol/machine"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/srvlib"
@ -27,6 +29,10 @@ func (this *SrvSessMgr) OnRegiste(s *netlib.Session) {
} else if srvInfo.GetType() == int32(common.RobotServerType) {
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (RobotSrv):", s)
NpcServerAgentSingleton.OnConnected()
} else if srvInfo.GetType() == 10 {
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (Machine):", s)
s.Send(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{})
fmt.Printf("与娃娃机服务器连接成功\n")
}
}
}

View File

@ -0,0 +1,55 @@
package clawdoll
import (
"mongo.games.com/game/common"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/protocol/clawdoll"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
)
type CSPlayerOpPacketFactory struct {
}
type CSPlayerOpHandler struct {
}
func (f *CSPlayerOpPacketFactory) CreatePacket() interface{} {
pack := &clawdoll.CSCLAWDOLLOp{}
return pack
}
func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSPlayerOpHandler Process recv ", data)
if msg, ok := data.(*clawdoll.CSCLAWDOLLOp); 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.GameDifClawdoll {
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.GetParams())
}
return nil
}
return nil
}
func init() {
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpHandler{})
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpPacketFactory{})
}

View File

@ -0,0 +1,71 @@
package clawdoll
import (
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/goserver/core/logger"
)
type PlayerEx struct {
*base.Player //玩家信息
gainCoin int64 // 本局赢的金币
taxCoin int64 // 本局税收
odds int32
}
func (this *PlayerEx) Clear(baseScore int32) {
this.UnmarkFlag(base.PlayerState_WaitNext)
this.UnmarkFlag(base.PlayerState_GameBreak)
this.MarkFlag(base.PlayerState_Ready)
this.gainCoin = 0
this.taxCoin = 0
this.odds = 0
}
func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
if !this.IsGameing() {
logger.Logger.Trace("(this *PlayerEx) CanOp return false ", this.SnId)
return false
}
return true
}
func (this *PlayerEx) CanPayCoinByPos() bool {
return false
}
// 游戏新一局 设置数据
func (this *PlayerEx) ReStartGame() {
this.ReDataStartGame()
this.gainCoin = 0
this.taxCoin = 0
this.odds = 0
}
// 初始化
func (this *PlayerEx) InitData(baseScore int32) {
}
// 重置下注数据
func (this *PlayerEx) ResetData() {
}
// 游戏新一局 设置数据
func (this *PlayerEx) ReDataStartGame() {
}
func (this *PlayerEx) CanPlayerOpInState(sceneState int) bool {
return false
}
// 能否退出游戏
func (this *PlayerEx) CanLeaveScene(sceneState int) bool {
return true
}

View File

@ -0,0 +1,205 @@
package clawdoll
import (
"mongo.games.com/game/protocol/clawdoll"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
rule "mongo.games.com/game/gamerule/clawdoll"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/proto"
)
type PlayerData struct {
SnId int32
Head int32 //头像框
VIP int32 //VIP帐号 等级
Name string //名字
Sex int32 //性别
IsRob bool
Coin int64
gainCoin int64 //本局赢的金币
taxCoin int64 //本局税收
isBilled bool //是否结算
CurIsWin int64 //当局输赢 负数:输 正数:赢
InviterId int32 //邀请人Id
BeUnderAgentCode string //隶属经销商(推广人)
IsPlayerFirst bool
Platform string //平台
Channel string //渠道信息
PackageID string //推广包标识 对应客户端的packagetag
flag int
}
type SceneEx struct {
*base.Scene // 场景
logic *rule.Logic //
players map[int32]*PlayerEx // 玩家信息
PlayerBackup map[int32]*PlayerData // 本局离场玩家数据备份
seats []*PlayerEx // 本局游戏中的玩家状态数据
RoundId int // 局数,第几局
robotNum int // 参与游戏的机器人数量
logid string
}
// 游戏是否能开始
func (this *SceneEx) CanStart() bool {
//人数>=1自动开始
if len(this.players) >= 0 && (this.GetRealPlayerNum() >= 0 || this.IsPreCreateScene()) {
return true
}
return false
}
// 从房间删除玩家
func (this *SceneEx) delPlayer(p *base.Player) {
if p, exist := this.players[p.SnId]; exist {
this.seats[p.GetPos()] = nil
delete(this.players, p.SnId)
}
}
// 广播玩家离开
func (this *SceneEx) BroadcastPlayerLeave(p *base.Player, reason int) {
scLeavePack := &clawdoll.SCCLAWDOLLPlayerLeave{
Pos: proto.Int(p.GetPos()),
}
proto.SetDefaults(scLeavePack)
this.Broadcast(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PlayerLeave), scLeavePack, p.GetSid())
}
// 玩家离开事件
func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) {
this.delPlayer(p)
this.BroadcastPlayerLeave(p, reason)
}
func (this *SceneEx) SceneDestroy(force bool) {
//销毁房间
this.Scene.Destroy(force)
}
func (e *SceneEx) playerOpPack(snId int32, opcode int, opRetCode clawdoll.OpResultCode, params []int64) *clawdoll.SCCLAWDOLLOp {
pack := &clawdoll.SCCLAWDOLLOp{
SnId: proto.Int32(snId),
OpCode: proto.Int32(int32(opcode)),
Params: params,
OpRetCode: clawdoll.OpResultCode_OPRC_Success,
}
proto.SetDefaults(pack)
return pack
}
// OnPlayerSCOp 发送玩家操作情况
func (e *SceneEx) OnPlayerSCOp(p *base.Player, opcode int, opRetCode clawdoll.OpResultCode, params []int64) {
pack := e.playerOpPack(p.SnId, opcode, opRetCode, params)
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PLAYEROP), pack)
logger.Logger.Tracef("OnPlayerSCOp %s", pack)
}
// 房间信息打包
func (this *SceneEx) ClawdollCreateRoomInfoPacket(s *base.Scene, p *base.Player) interface{} {
pack := &clawdoll.SCCLAWDOLLRoomInfo{
RoomId: proto.Int(s.GetSceneId()),
GameId: proto.Int(s.GetGameId()),
RoomMode: proto.Int(s.GetSceneMode()),
Params: common.CopySliceInt64ToInt32(s.Params),
State: proto.Int(s.GetSceneState().GetState()),
TimeOut: proto.Int(s.GetSceneState().GetTimeout(s)),
TotalPlayer: proto.Int(len(this.players)),
RoundId: proto.Int(this.RoundId),
ParamsEx: nil,
GameFreeId: 0,
BaseScore: proto.Int32(this.GetBaseScore()),
}
// 玩家信息
for _, playerEx := range this.players {
if p.SnId == playerEx.SnId {
pd := &clawdoll.CLAWDOLLPlayerData{
SnId: proto.Int32(playerEx.SnId),
Name: proto.String(playerEx.Name),
Head: proto.Int32(playerEx.Head),
Sex: proto.Int32(playerEx.Sex),
Coin: proto.Int64(playerEx.Coin),
Flag: proto.Int(playerEx.GetFlag()),
HeadOutLine: proto.Int32(playerEx.HeadOutLine),
VIP: proto.Int32(playerEx.VIP),
WinCoin: proto.Int64(playerEx.gainCoin),
}
pack.Players = append(pack.Players, pd)
}
}
proto.SetDefaults(pack)
if p != nil {
p.SyncFlag()
}
return pack
}
func NewClawdollSceneData(s *base.Scene) *SceneEx {
sceneEx := &SceneEx{
Scene: s,
logic: new(rule.Logic),
players: make(map[int32]*PlayerEx),
seats: make([]*PlayerEx, s.GetPlayerNum()),
PlayerBackup: make(map[int32]*PlayerData),
}
return sceneEx
}
func (this *SceneEx) init() bool {
this.Clear()
return true
}
// 检查上分是否合法
func (this *SceneEx) CheckPayOp(betVal int64, takeMul int64) bool { //游戏底分
return true
}
func (this *SceneEx) Clear() {
this.robotNum = 0
this.PlayerBackup = make(map[int32]*PlayerData)
this.RoundId = 0
for i := 0; i < this.GetPlayerNum(); i++ {
if this.seats[i] != nil {
this.seats[i].Clear(this.GetBaseScore())
}
}
}
func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
this.PlayerBackup[p.SnId] = &PlayerData{
SnId: p.SnId,
gainCoin: p.gainCoin,
taxCoin: p.taxCoin,
isBilled: isBilled,
IsRob: p.IsRob,
Coin: p.Coin,
Head: p.Head,
flag: p.GetFlag(),
Platform: p.Platform,
Channel: p.Channel,
PackageID: p.PackageID,
CurIsWin: p.CurIsWin,
Name: p.Name,
Sex: p.Sex,
VIP: p.VIP,
InviterId: p.InviterId,
IsPlayerFirst: this.IsPlayerFirst(p.Player),
BeUnderAgentCode: p.BeUnderAgentCode,
}
}

View File

@ -0,0 +1,576 @@
package clawdoll
import (
"mongo.games.com/game/protocol/clawdoll"
"time"
"mongo.games.com/goserver/core"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
rule "mongo.games.com/game/gamerule/clawdoll"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/proto"
)
var PolicyClawdollSingleton = &PolicyClawdoll{}
type PolicyClawdoll struct {
base.BaseScenePolicy
states [rule.ClawDollSceneStateMax]base.SceneState
}
func (this *PolicyClawdoll) CreateSceneExData(s *base.Scene) interface{} {
sceneEx := NewClawdollSceneData(s)
if sceneEx != nil {
if sceneEx.init() {
s.ExtraData = sceneEx
}
}
return sceneEx
}
func (this *PolicyClawdoll) CreatePlayerExData(s *base.Scene, p *base.Player) interface{} {
playerEx := &PlayerEx{Player: p}
if playerEx != nil {
p.ExtraData = playerEx
}
return playerEx
}
func (this *PolicyClawdoll) OnStart(s *base.Scene) {
logger.Logger.Trace("(this *PolicyClawdoll) OnStart, sceneId=", s.GetSceneId())
sceneEx := NewClawdollSceneData(s)
if sceneEx != nil {
if sceneEx.init() {
s.ExtraData = sceneEx
s.ChangeSceneState(rule.ClawDollSceneStateWait)
}
}
}
func (this *PolicyClawdoll) OnStop(s *base.Scene) {
logger.Logger.Trace("(this *PolicyClawdoll) OnStop , sceneId=", s.GetSceneId())
}
func (this *PolicyClawdoll) OnTick(s *base.Scene) {
if s == nil {
return
}
if s.SceneState != nil {
s.SceneState.OnTick(s)
}
}
func (this *PolicyClawdoll) OnPlayerEnter(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
pos := -1
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
if sceneEx.seats[i] == nil {
pos = i
break
}
}
if pos != -1 {
playerEx := &PlayerEx{Player: p}
sceneEx.seats[pos] = playerEx
sceneEx.players[p.SnId] = playerEx
baseScore := sceneEx.GetBaseScore()
p.Pos = pos
p.ExtraData = playerEx
playerEx.Clear(baseScore)
if sceneEx.Gaming {
p.MarkFlag(base.PlayerState_WaitNext)
p.UnmarkFlag(base.PlayerState_Ready)
}
//给自己发送房间信息
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
}
}
}
func (this *PolicyClawdoll) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
if s == nil || p == nil {
return
}
if !this.CanChangeCoinScene(s, p) {
return
}
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return
}
playerEx, ok := p.ExtraData.(*PlayerEx)
if !ok {
return
}
isBilled := false
// 游戏已开始,玩家离开,备份玩家数据
if sceneEx.Gaming {
sceneEx.BackupPlayer(playerEx, isBilled)
}
// 清理玩家数据
sceneEx.OnPlayerLeave(p, reason)
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
}
func (this *PolicyClawdoll) OnPlayerDropLine(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
}
func (this *PolicyClawdoll) OnPlayerRehold(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if _, ok := p.ExtraData.(*PlayerEx); ok {
//发送房间信息给自己
if p.IsGameing() {
p.MarkFlag(base.PlayerState_Ready)
}
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventRehold, nil)
}
}
}
func (this *PolicyClawdoll) OnPlayerReturn(s *base.Scene, p *base.Player) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if _, ok := p.ExtraData.(*PlayerEx); ok {
//发送房间信息给自己
if p.IsGameing() {
p.MarkFlag(base.PlayerState_Ready)
}
this.SendRoomInfo(s, p, sceneEx)
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
}
}
}
func (this *PolicyClawdoll) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
if s == nil || p == nil {
return false
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
if s.SceneState != nil {
p.LastOPTimer = time.Now()
p.Trusteeship = 0
return s.SceneState.OnPlayerOp(s, p, opcode, params)
}
return true
}
func (this *PolicyClawdoll) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
if s == nil || p == nil {
return
}
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
if s.SceneState != nil {
s.SceneState.OnPlayerEvent(s, p, evtcode, params)
}
}
func (this *PolicyClawdoll) IsCompleted(s *base.Scene) bool {
if s == nil {
return false
}
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
return !sceneEx.Gaming
}
return false
}
func (this *PolicyClawdoll) IsCanForceStart(s *base.Scene) bool {
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
return len(s.Players) >= 2 && !sceneEx.Gaming
}
return false
}
func (this *PolicyClawdoll) ForceStart(s *base.Scene) {
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if sceneEx.SceneState.GetState() == rule.ClawDollSceneStateWait {
s.ChangeSceneState(rule.ClawDollSceneStateStart)
}
}
}
// 当前状态能否退出游戏
func (this *PolicyClawdoll) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
if s == nil || p == nil {
return false
}
if s.GetSceneState() != nil {
return s.GetSceneState().CanChangeCoinScene(s, p)
}
return true
}
func (this *PolicyClawdoll) SendRoomInfo(s *base.Scene, p *base.Player, sceneEx *SceneEx) {
pack := sceneEx.ClawdollCreateRoomInfoPacket(s, p)
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_ROOMINFO), pack)
}
// 广播房间状态
func ClawdollBroadcastRoomState(s *base.Scene, params ...float32) {
pack := &clawdoll.SCCLAWDOLLRoomState{
State: proto.Int(s.SceneState.GetState()),
Params: params,
}
s.Broadcast(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_ROOMSTATE), pack, 0)
}
//=====================================
// BaseState 状态基类
//=====================================
type BaseState struct {
}
func (this *BaseState) GetTimeout(s *base.Scene) int {
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
return int(time.Now().Sub(sceneEx.StateStartTime) / time.Second)
}
return 0
}
func (this *BaseState) CanChangeTo(s base.SceneState) bool {
return true
}
func (this *BaseState) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
//playerEx, ok := p.ExtraData.(*PlayerEx)
//if !ok {
// return false
//}
//
//if !playerEx.CanLeaveScene(s.GetSceneState().GetState()) {
// return false
//}
return true
}
func (this *BaseState) OnEnter(s *base.Scene) {
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
sceneEx.StateStartTime = time.Now()
}
}
func (this *BaseState) OnLeave(s *base.Scene) {}
func (this *BaseState) OnTick(s *base.Scene) {
}
func (this *BaseState) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
return false
}
func (this *BaseState) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
}
//=====================================
// StateWait 等待中
//=====================================
type StateWait struct {
BaseState
}
func (this *StateWait) GetState() int {
return rule.ClawDollSceneStateWait
}
func (this *StateWait) CanChangeTo(s base.SceneState) bool {
if s.GetState() == rule.ClawDollSceneStateStart {
return true
}
return false
}
func (this *StateWait) GetTimeout(s *base.Scene) int {
return this.BaseState.GetTimeout(s)
}
func (this *StateWait) OnEnter(s *base.Scene) {
this.BaseState.OnEnter(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if s.Gaming {
s.NotifySceneRoundPause()
}
s.Gaming = false
ClawdollBroadcastRoomState(s, float32(0), float32(0))
if sceneEx.CanStart() {
s.ChangeSceneState(rule.ClawDollSceneStateStart)
}
}
}
// 玩家事件
func (this *StateWait) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
logger.Logger.Trace("(this *StateWait) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
this.BaseState.OnPlayerEvent(s, p, evtcode, params)
if _, ok := s.ExtraData.(*SceneEx); ok {
switch evtcode {
case base.PlayerEventLeave:
case base.PlayerEventEnter:
if !p.IsReady() {
p.MarkFlag(base.PlayerState_Ready)
p.SyncFlag()
}
}
}
}
func (this *StateWait) OnTick(s *base.Scene) {
this.BaseState.OnTick(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if s.CheckNeedDestroy() {
sceneEx.SceneDestroy(true)
return
}
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneWaitTimeout {
//切换到准备开局状态
if sceneEx.CanStart() {
s.ChangeSceneState(rule.ClawDollSceneStateStart)
}
}
}
}
//=====================================
// StateStart 开始倒计时
//=====================================
type StateStart struct {
BaseState
}
func (this *StateStart) GetState() int {
return rule.ClawDollSceneStateStart
}
func (this *StateStart) CanChangeTo(s base.SceneState) bool {
switch s.GetState() {
case rule.ClawDollSceneStatePlayGame:
return true
}
return false
}
func (this *StateStart) OnEnter(s *base.Scene) {
this.BaseState.OnEnter(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
ClawdollBroadcastRoomState(s, float32(0), float32(0))
s.Gaming = false
sceneEx.GameNowTime = time.Now()
sceneEx.NumOfGames++
}
}
func (this *StateStart) OnTick(s *base.Scene) {
this.BaseState.OnTick(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneStartTimeout {
//切换到等待操作状态
if sceneEx.CanStart() {
s.ChangeSceneState(rule.ClawDollSceneStatePlayGame)
} else {
s.ChangeSceneState(rule.ClawDollSceneStateWait)
}
}
}
}
func (this *StateStart) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
if this.BaseState.OnPlayerOp(s, p, opcode, params) {
return true
}
return false
}
func (this *StateStart) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
logger.Logger.Trace("(this *StateStart) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
this.BaseState.OnPlayerEvent(s, p, evtcode, params)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
switch evtcode {
case base.PlayerEventLeave:
if !sceneEx.CanStart() {
s.ChangeSceneState(rule.ClawDollSceneStateWait)
}
case base.PlayerEventEnter:
if !p.IsReady() {
p.MarkFlag(base.PlayerState_Ready)
p.SyncFlag()
}
}
}
}
// =====================================
// PlayGame 游戏中
// =====================================
type PlayGame struct {
BaseState
}
func (this *PlayGame) GetState() int {
return rule.ClawDollSceneStatePlayGame
}
func (this *PlayGame) CanChangeTo(s base.SceneState) bool {
switch s.GetState() {
case rule.ClawDollSceneStateBilled:
return true
}
return false
}
func (this *PlayGame) OnEnter(s *base.Scene) {
logger.Logger.Trace("(this *PlayGame) OnEnter, sceneid=", s.GetSceneId())
this.BaseState.OnEnter(s)
s.Gaming = true
ClawdollBroadcastRoomState(s, float32(0), float32(0))
}
func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
logger.Logger.Trace("StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params)
if this.BaseState.OnPlayerOp(s, p, opcode, params) {
return true
}
return false
}
func (this *PlayGame) OnTick(s *base.Scene) {
this.BaseState.OnTick(s)
}
//=====================================
// StateBilled 结算
//=====================================
type StateBilled struct {
BaseState
}
func (this *StateBilled) GetState() int {
return rule.ClawDollSceneStateBilled
}
func (this *StateBilled) CanChangeTo(s base.SceneState) bool {
switch s.GetState() {
case rule.ClawDollSceneStateStart:
return true
}
return false
}
func (this *StateBilled) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
return false
}
func (this *StateBilled) OnEnter(s *base.Scene) {
logger.Logger.Trace("(this *StateBilled) OnEnter, sceneid=", s.GetSceneId())
this.BaseState.OnEnter(s)
}
func (this *StateBilled) OnLeave(s *base.Scene) {
logger.Logger.Trace("(this *StateBilled) OnLeave, sceneid=", s.GetSceneId())
this.BaseState.OnLeave(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
sceneEx.PlayerBackup = make(map[int32]*PlayerData)
if s.CheckNeedDestroy() {
sceneEx.SceneDestroy(true)
}
}
}
func (this *StateBilled) OnTick(s *base.Scene) {
this.BaseState.OnTick(s)
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneBilledTimeout {
if sceneEx.CanStart() {
s.ChangeSceneState(rule.ClawDollSceneStateStart)
} else {
s.ChangeSceneState(rule.ClawDollSceneStateWait)
}
return
}
}
}
// // //////////////////////////////////////////////////////////////////////////////
func (this *PolicyClawdoll) RegisteSceneState(state base.SceneState) {
if state == nil {
return
}
stateid := state.GetState()
if stateid < 0 || stateid >= rule.ClawDollSceneStateMax {
return
}
this.states[stateid] = state
}
func (this *PolicyClawdoll) GetSceneState(s *base.Scene, stateid int) base.SceneState {
if stateid >= 0 && stateid < rule.ClawDollSceneStateMax {
return this.states[stateid]
}
return nil
}
func init() {
PolicyClawdollSingleton.RegisteSceneState(&StateWait{})
PolicyClawdollSingleton.RegisteSceneState(&StateStart{})
PolicyClawdollSingleton.RegisteSceneState(&PlayGame{})
PolicyClawdollSingleton.RegisteSceneState(&StateBilled{})
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
base.RegisteScenePolicy(common.GameId_Clawdoll, 0, PolicyClawdollSingleton)
return nil
})
}

View File

@ -569,7 +569,7 @@ func (this *TienLenSceneData) SendHandCard_Match() {
}
grades = append(grades, gi)
}
realWin := 0 //-1最差 0正常 1最好
realWin := 1 //-1最差 0正常 1最好
switch realWin {
case -1:
sort.Slice(grades, func(i, j int) bool {

View File

@ -118,6 +118,11 @@ func (this *ScenePolicyTienLen) OnPlayerEnter(s *base.Scene, p *base.Player) {
playerData.CopyRoleId = p.MatchParams[3]
}
}
if len(p.MatchParams) > 4 {
if p.MatchParams[4] != 0 {
playerData.SkinId = p.MatchParams[4]
}
}
}
pack := &tienlen.SCTienLenPlayerEnter{
Data: playerData,
@ -475,6 +480,11 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
pd.CopyRoleId = p.MatchParams[3]
}
}
if len(p.MatchParams) > 4 {
if p.MatchParams[4] != 0 {
pd.SkinId = p.MatchParams[4]
}
}
}
pack.IsOutRecord = playerEx.CanUseRecordItem()
pack.ItemRecExpireTime = playerEx.ItemRecExpireTime
@ -498,6 +508,11 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
pd1.CopyRoleId = nowPlayer.MatchParams[3]
}
}
if len(nowPlayer.MatchParams) > 4 {
if nowPlayer.MatchParams[4] != 0 {
pd1.SkinId = nowPlayer.MatchParams[4]
}
}
}
//手牌
for j := int32(0); j < rule.HandCardNum; j++ {

View File

@ -28,6 +28,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
var platform string
var snid int32
var createTs int64
var p *model.PlayerData
if s != nil {
var pdi = s.GetAttribute(common.ClientSessionAttribute_PlayerData)
@ -42,6 +43,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
if p != nil {
platform = p.Platform
snid = p.SnId
createTs = p.CreateTime.Unix()
}
//LogChannelSingleton.WriteLog(&model.ClientLog{
@ -56,6 +58,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
Platform: platform,
Snid: snid,
Ts: time.Now().Unix(),
CreateTs: createTs,
})
return nil

View File

@ -0,0 +1,105 @@
package action
import (
"fmt"
"mongo.games.com/game/machine/machinedoll"
"mongo.games.com/game/protocol/machine"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"time"
)
// 移动
func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data interface{}) error {
msg, ok := data.(*machine.SMDollMachineoPerate)
if !ok {
return nil
}
conn := machinedoll.ConnMap[int(msg.Id)]
if conn == nil {
return nil
}
if msg.Perate == 1 {
//向前移动
machinedoll.Backward(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.BackwardStop(conn)
} else if msg.Perate == 2 {
//向后移动
machinedoll.Forward(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.ForwardStop(conn)
} else if msg.Perate == 3 {
//向左移动
machinedoll.Left(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.LeftStop(conn)
} else if msg.Perate == 4 {
//向右移动
machinedoll.Right(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.RightStop(conn)
} else if msg.Perate == 5 {
//投币
machinedoll.Coin(conn)
machinedoll.Backward(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.BackwardStop(conn)
}
return nil
}
// 下抓
func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interface{}) error {
msg, ok := data.(*machine.SMDollMachineGrab)
if !ok {
return nil
}
conn := machinedoll.ConnMap[int(msg.Id)]
if conn == nil {
return nil
}
typeId := msg.TypeId
if typeId == 1 {
//弱抓
machinedoll.WeakGrab(conn)
} else if typeId == 2 {
//强力抓
machinedoll.Grab(conn)
} else if typeId == 3 {
//必中抓
machinedoll.SetPower(conn)
time.Sleep(200 * time.Millisecond)
machinedoll.Grab(conn)
}
//返回消息
session.Send(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.MSDollMachineGrab{
Snid: msg.Snid,
Id: msg.GetId(),
Result: 1,
})
return nil
}
// 与游戏服务器连接成功,向游戏服务器推送所有娃娃机连接
func SMGameLinkSucceedHandler(session *netlib.Session, packetId int, data interface{}) error {
logger.Logger.Trace("与游戏服务器连接成功!!\n")
fmt.Printf("与游戏服务器连接成功!!\n")
//开始向游戏服务器发送娃娃机连接信息
msg := &machine.MSDollMachineList{}
for i, _ := range machinedoll.ConnMap {
info := &machine.DollMachine{}
info.Id = int32(i)
info.VideoAddr = "www.baidu.com"
msg.Data = append(msg.Data, info)
}
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), msg)
fmt.Printf("开始向游戏服务器发送娃娃机连接信息!\n", msg)
return nil
}
func init() {
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), &machine.SMDollMachineoPerate{}, SMDollMachinePerateHandler)
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.SMDollMachineGrab{}, SMDollMachineGrabHandler)
//链接成功 返回消息
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{}, SMGameLinkSucceedHandler)
}

78
machine/config.json Normal file
View File

@ -0,0 +1,78 @@
{
"netlib": {
"SrvInfo": {
"Name": "MachineServer",
"Type": 10,
"Id": 1001,
"AreaID": 1,
"Banner": [
"=================",
"machine server",
"================="
]
},
"IoServices": [
{
"Id": 1001,
"Type": 10,
"AreaId": 1,
"Name": "Gamesrv",
"Ip": "127.0.0.1",
"Port": 7001,
"Protocol":"tcp",
"Path":"/",
"MaxDone": 20000,
"MaxPend": 20000,
"MaxPacket": 65535,
"MaxConn": 1,
"RcvBuff": 819200,
"SndBuff": 819200,
"WriteTimeout": 300,
"ReadTimeout": 300,
"IsClient": true,
"IsAutoReconn": true,
"IsInnerLink": true,
"NoDelay": true,
"SupportFragment": true,
"AuthKey": "1234567890",
"FilterChain": ["session-filter-auth"],
"HandlerChain": ["session-srv-registe","handler-game-close"]
}
]
},
"module": {
"Options": {
"QueueBacklog": 1024,
"MaxDone": 1024,
"Interval": 100
}
},
"executor": {
"Options": {
"QueueBacklog": 1024,
"MaxDone": 1024,
"Interval": 0
},
"Worker": {
"WorkerCnt": 8,
"Options": {
"QueueBacklog": 1024,
"MaxDone": 1024,
"Interval": 0
}
}
},
"timer": {
"Options": {
"QueueBacklog": 1024,
"MaxDone": 1024,
"Interval": 100
}
},
"cmdline": {
"SupportCmdLine": true
},
"signal": {
"SupportSignal": true
}
}

22
machine/logger.xml Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000" critmsgcount="500" minlevel="info">
<exceptions>
<exception filepattern="test*" minlevel="error"/>
</exceptions>
<outputs formatid="all">
<rollingfile formatid="all" type="size" filename="./all.log" maxsize="50000000" maxrolls="5" />
<filter levels="info,trace,warn,error">
<console formatid="fmtinfo"/>
</filter>
<filter levels="error,critical" formatid="fmterror">
<console/>
<file path="errors.log"/>
</filter>
</outputs>
<formats>
<format id="fmtinfo" format="[%Date][%Time] [%Level] %Msg%n"/>
<format id="fmterror" format="[%Date][%Time] [%LEVEL] [%FuncShort @ %File.%Line] %Msg%n"/>
<format id="all" format="[%Date][%Time] [%Level] [@ %File.%Line] %Msg%n"/>
<format id="criticalemail" format="Critical error on our server!\n %Time %Date %RelFile %Func %Msg \nSent by Seelog"/>
</formats>
</seelog>

View File

@ -0,0 +1,3 @@
[
"192.168.31.221:8800"
]

View File

@ -0,0 +1,381 @@
package machinedoll
import (
"fmt"
"net"
)
// 向前aa 05 01 50 01 01 54 dd
func Forward(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x01, 0x01}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向前停止aa 05 01 50 01 00 55 dd
func ForwardStop(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x01, 0x00}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向后
// aa 05 01 50 02 01 57 dd
func Backward(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x02, 0x01}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向后停止aa 05 01 50 02 00 56 dd
func BackwardStop(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x02, 0x00}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向左aa 05 01 50 03 01 56 dd
func Left(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x03, 0x01}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向左停止aa 05 01 50 03 00 57 dd
func LeftStop(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x03, 0x00}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向右
func Right(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x04, 0x01}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 向右停止aa 05 01 50 04 00 50 dd
func RightStop(conn net.Conn) {
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x04, 0x00}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 强抓下抓
func Grab(conn net.Conn) {
instruction := []byte{0xAA, 0x05, 0x01, 0x50, 0x06, 0x01}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
_, err = conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
}
// 弱抓aa 05 01 50 06 00 52 dd
func WeakGrab(conn net.Conn) {
instruction := []byte{0xAA, 0x05, 0x01, 0x50, 0x06, 0x00}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 投币
func Coin(conn net.Conn) {
moveCommand := []byte{0xaa, 0x08, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00}
moveCommand = calculateChecksum(moveCommand)
// 发送指令到服务端
_, err := conn.Write(moveCommand)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
if buf[4] == 1 {
fmt.Println("上分成功n = ", n)
}
if buf[4] == 0 {
fmt.Println("上分失败!!!")
}
}
// 剩余局数清零
func ClearRemainingGames(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x32}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 计算校验码
func calculateChecksum(data []byte) []byte {
var value = byte(0)
for i, datum := range data {
if i > 0 {
value ^= datum
}
}
fmt.Println("校验码 value = ", value)
data = append(data, value, 0xdd)
return data
}
// 开启音乐
func OpenMusic(conn net.Conn) {
data[43] = 0x01
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
instruction = append(instruction, data...)
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 关闭音乐
func CloseMusic(conn net.Conn) {
data[43] = 0x00
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
instruction = append(instruction, data...)
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 恢复出厂设置
func RestoreFactorySettings(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x38}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 重启主板
func Reboot(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x39}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 暂停服务
func StopServer(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x37}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 开启服务
func StartServer(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x36}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
}
// 查询基础参数
func queryBaseParam(conn net.Conn) {
instruction := []byte{0xAA, 0x03, 0x01, 0x05}
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
// 设置强力
func SetPower(conn net.Conn) {
data[3] = 0x00
data[16] = 0x01
data[17] = 0xE0
data[18] = 0x13
data[19] = 0x88
fmt.Println("data.len = ", len(data))
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
instruction = append(instruction, data...)
instruction = calculateChecksum(instruction)
_, err := conn.Write(instruction)
if err != nil {
fmt.Println("Failed to send command to server:", err)
return
}
// 读取服务端的响应
buf := make([]byte, 1024)
n, err := conn.Read(buf)
if err != nil {
fmt.Println("Failed to read response from server:", err)
return
}
fmt.Println("n", n)
}
var data = []byte{
0x65,
0x00,
0x0F,
0x02,
0x0F,
0x00,
0x01,
0x00,
0x00,
0x01,
0xC8,
0x00,
0x7C,
0x01,
0x5A,
0x00,
0xE0,
0x01,
0xC8,
0x00,
0x14,
0x32,
0x32,
0x50,
0x34,
0x08,
0x00,
0x00,
0x00,
0x00,
0x78,
0x00,
0x32,
0x02,
0x00,
0x00,
0xC8,
0x00,
0x96,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0F,
0x07,
0x08,
0x00,
}

View File

@ -0,0 +1,255 @@
package machinedoll
import (
"encoding/json"
"fmt"
"mongo.games.com/goserver/core/timer"
"os/signal"
"syscall"
"mongo.games.com/game/protocol/machine"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/srvlib"
"net"
"os"
"path/filepath"
"time"
)
var GameConn *netlib.Session
var ConnMap = make(map[int]net.Conn)
type MachineManager struct {
DelConnMap map[int]string
}
var MachineMgr = &MachineManager{
DelConnMap: make(map[int]string),
}
func (this *MachineManager) ModuleName() string {
return "MachineManager"
}
// 心跳间隔时间(秒)
const heartbeatInterval = 1
func (this *MachineManager) Init() {
var serverAddrs []string
programDir, err := os.Getwd()
if err != nil {
fmt.Println("Error getting working directory:", err)
return
}
configFile := filepath.Join(programDir, "machineIPConfig.json")
fmt.Println("构建配置文件的路径", configFile)
fileData, err := os.ReadFile(configFile)
if err != nil {
logger.Logger.Error("Read robot account file error:", err)
return
} else {
if err = json.Unmarshal(fileData, &serverAddrs); err != nil {
logger.Logger.Error("Unmarshal robot account data error:", err)
return
}
}
//与娃娃机创建连接
// 遍历每个服务器地址,建立连接
for i, addr := range serverAddrs {
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
if err != nil {
fmt.Println("Failed to connect to server:", err)
continue
}
ConnMap[i+1] = conn
go this.StartHeartbeat(i+1, &conn, addr)
}
fmt.Println("Connected to server:\n", ConnMap[1].RemoteAddr())
fmt.Println("投币请按Q")
fmt.Println("w向前s向后a向左d向右 j强力抓取k弱力抓取")
// 监听 WASD 按键事件
/* go listenKeyboardEvents(ConnMap[1])
// 监听中断信号,等待用户退出
waitForUserExit()*/
}
func (this *MachineManager) StartHeartbeat(id int, conn *net.Conn, addr string) {
// 定期发送心跳包
ticker := time.NewTicker(heartbeatInterval * time.Second)
defer ticker.Stop()
for {
select {
case <-ticker.C:
// 发送心跳包
_, err := (*conn).Write([]byte("heartbeat"))
if err != nil {
fmt.Println("Failed to send heartbeat:", err)
delete(ConnMap, id)
this.DelConnMap[id] = addr
//通知游戏服
this.UpdateToGameServer()
fmt.Println("删除链接addr = ", addr)
go timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
this.ReConnect()
return true
}), nil, time.Duration(5)*time.Second, 100)
return
}
}
}
}
// 重连
func (this *MachineManager) ReConnect() bool {
fmt.Println("================重连============")
delIds := []int{}
status := false
for id, addr := range this.DelConnMap {
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
if err != nil {
continue
}
ConnMap[id] = conn
delIds = append(delIds, id)
status = true
}
for _, id := range delIds {
delete(this.DelConnMap, id)
fmt.Println("重新链接成功id = ", id)
}
if status {
this.UpdateToGameServer()
return true
}
return false
}
func (this *MachineManager) UpdateToGameServer() {
msg := &machine.MSDollMachineList{}
for i, _ := range ConnMap {
info := &machine.DollMachine{}
info.Id = int32(i)
info.VideoAddr = "www.baidu.com"
msg.Data = append(msg.Data, info)
}
SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), msg)
}
func SendToGameServer(pid int, msg interface{}) {
if GameConn == nil {
GameConn = srvlib.ServerSessionMgrSington.GetSession(1, 7, 701)
}
if GameConn != nil {
GameConn.Send(pid, msg)
} else {
logger.Logger.Error("GameConn is nil !")
}
}
func init() {
MachineMgr.Init()
}
func listenKeyboardEvents(conn net.Conn) {
for {
// 读取键盘事件
key := readKeyboardEvent()
switch key {
case "w":
Backward(conn)
time.Sleep(200 * time.Millisecond)
BackwardStop(conn)
case "W":
Backward(conn)
time.Sleep(200 * time.Millisecond)
BackwardStop(conn)
case "a":
Left(conn)
time.Sleep(200 * time.Millisecond)
LeftStop(conn)
case "A":
Left(conn)
time.Sleep(200 * time.Millisecond)
LeftStop(conn)
case "s":
Forward(conn)
time.Sleep(200 * time.Millisecond)
ForwardStop(conn)
case "S":
Forward(conn)
time.Sleep(200 * time.Millisecond)
ForwardStop(conn)
case "d":
Right(conn)
time.Sleep(200 * time.Millisecond)
RightStop(conn)
case "D":
Right(conn)
time.Sleep(200 * time.Millisecond)
RightStop(conn)
case "j":
Grab(conn)
case "J":
SetPower(conn)
time.Sleep(200 * time.Millisecond)
Grab(conn)
case "k":
WeakGrab(conn)
case "K":
WeakGrab(conn)
case "q":
Coin(conn)
Backward(conn)
time.Sleep(200 * time.Millisecond)
BackwardStop(conn)
case "Q":
Coin(conn)
Backward(conn)
time.Sleep(150 * time.Millisecond)
BackwardStop(conn)
case "1":
RestoreFactorySettings(conn)
case "2":
OpenMusic(conn)
case "3":
Reboot(conn)
case "4":
StopServer(conn)
case "5":
StartServer(conn)
case "6":
ClearRemainingGames(conn)
case "7":
SetPower(conn)
case "8":
CloseMusic(conn)
}
}
}
func readKeyboardEvent() string {
var b [1]byte
var done uint32
err := syscall.ReadFile(syscall.Stdin, b[:], &done, nil)
if err != nil {
panic(err)
}
return string(b[:])
}
func waitForUserExit() {
// 创建一个信号通道
signalChan := make(chan os.Signal, 1)
// 监听中断信号
signal.Notify(signalChan, os.Interrupt)
// 等待用户按下 Ctrl+C 退出
<-signalChan
fmt.Println("退出程序...")
}

15
machine/main.go Normal file
View File

@ -0,0 +1,15 @@
package main
import (
_ "mongo.games.com/game"
_ "mongo.games.com/game/machine/action"
"mongo.games.com/goserver/core"
"mongo.games.com/goserver/core/module"
)
func main() {
defer core.ClosePackages()
core.LoadPackages("config.json")
w := module.Start()
w.Wait("main()")
}

View File

@ -11,6 +11,14 @@ type ClientLog struct {
Platform string // 平台id
Snid int32 // 玩家id
Ts int64 // 时间戳
CreateTs int64 // 注册时间
}
type CustomData struct {
Event string `json:"event"` // 新手引导 guide
Platform string `json:"platform"` // 平台id
GuideTp int32 `json:"guide_tp"` // 新手引导类型 1完成步骤 2跳过新手引导
N int64 `json:"n"` // 完成步骤的序号,或者跳过新手引导的序号
}
type ClientLogMysql ClientLog

View File

@ -133,6 +133,11 @@ type AllConfig struct {
*webapi.RankTypeConfig
//获奖记录配置
*webapi.AwardLogConfig
// 新手引导配置
*webapi.GuideConfig
MatchAudience map[int32]*webapi.MatchAudience // 比赛观众列表
// 小精灵配置
*webapi.SpiritConfig
}
type GlobalConfig struct {
@ -161,6 +166,7 @@ func (cm *ConfigMgr) GetConfig(platform string) *AllConfig {
EntrySwitch: make(map[int32]*webapi.EntrySwitch),
ShopInfos: make(map[int32]*ShopInfo),
ChannelSwitch: make(map[int32]*webapi.ChannelSwitchConfig),
MatchAudience: make(map[int32]*webapi.MatchAudience),
}
cm.platform[platform] = c
}
@ -354,3 +360,18 @@ func (cm *ConfigMgr) GetSkinSkillMaxLevel(plt string, skinId int32) int32 {
}
return level
}
func (cm *ConfigMgr) AddMatchAudience(d *webapi.MatchAudience) {
cfg := cm.GetConfig(d.Platform)
cfg.MatchAudience[d.GetSnId()] = d
}
func (cm *ConfigMgr) DelMatchAudience(d *webapi.MatchAudience) {
delete(cm.GetConfig(d.Platform).MatchAudience, d.GetSnId())
}
// IsMatchAudience 是不是比赛场观众
func (cm *ConfigMgr) IsMatchAudience(plt string, snId int32) bool {
_, ok := cm.GetConfig(plt).MatchAudience[snId]
return ok
}

View File

@ -82,6 +82,8 @@ type GameParam struct {
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数
PermitInitScore int64 // 赛季通行证初始积分
GuideStepMaxNum int32 // 新手引导步骤最大值
GuideTs int64 // 新手引导时间戳,小于这个时间的玩家不显示新手引导
}
var GameParamPath = "../data/gameparam.json"
@ -209,4 +211,10 @@ func InitGameParam() {
if GameParamData.RankPlayerPermitMaxNum == 0 {
GameParamData.RankPlayerPermitMaxNum = 20
}
if GameParamData.GuideStepMaxNum == 0 {
GameParamData.GuideStepMaxNum = 4
}
if GameParamData.GuideTs == 0 {
GameParamData.GuideTs = 1724623200
}
}

View File

@ -279,3 +279,18 @@ func Code2Id(code string) (uint64, error) {
}
return id, nil
}
type JybItem struct {
Id int32 `json:"id"`
Num int32 `json:"num"`
}
type JybLog struct {
Platform string `json:"platform"` // 平台
Id string `json:"jybId"` // 礼包id
Ts int64 `json:"ts"` // 时间戳
SnId int32 `json:"snid"` // 玩家id
Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包
Name string `json:"name"` // 礼包名称
Award []*JybItem `json:"award"` // 礼包奖励
}

View File

@ -4,30 +4,29 @@ import (
"time"
)
// 比赛详情
type MatchAwardLog struct {
AwardNum map[string]map[int32]int32 // 奖励数量
Platform string
}
var (
MatchAwardLogDBName = "log"
MatchAwardLogCollName = "log_matchawardlog"
)
func NewMatchAwardLog() *MatchAwardLog {
return &MatchAwardLog{}
type MatchAward struct {
Platform string `bson:"-"`
Award map[int32]int32
}
func InsertOrUpdateMatchAwardLog(logs ...*MatchAwardLog) (err error) {
func UpsertMatchAward(data *MatchAward) error {
if rpcCli == nil {
return ErrRPClientNoConn
}
var ret bool
return rpcCli.CallWithTimeout("MatchAwardLogSvc.InsertOrUpdateMatchAwardLog", logs, &ret, time.Second*30)
return rpcCli.CallWithTimeout("MatchAwardSvc.UpsertMatchAward", data, &ret, time.Second*30)
}
func GetMatchAwardLog(platform string) (ret MatchAwardLog, err error) {
err = rpcCli.CallWithTimeout("MatchAwardLogSvc.GetMatchAward", platform, &ret, time.Second*30)
return ret, err
func GetMatchAward(platform string) (ret *MatchAward, err error) {
if rpcCli == nil {
return nil, ErrRPClientNoConn
}
ret = new(MatchAward)
err = rpcCli.CallWithTimeout("MatchAwardSvc.GetMatchAward", platform, ret, time.Second*30)
return
}

View File

@ -494,6 +494,7 @@ type PlayerData struct {
DiamondLotteryScore int64 //钻石抽奖幸运值
VCardCost int64 // 消耗v卡数量
MoneyTotal int64 // 现金总充值金额,不包含api加币时的现金
GuideStep int32 // 引导步骤;跳过引导后,该值会置为-1
}
// 七日签到数据
@ -533,7 +534,7 @@ type WelfareData struct {
ContinuousPayTickets int64 //连续充值 时间戳
BlindBoxId int32 //已经领取盲盒序号
ContPayDay int32 //首充 从1开始
VIPBag map[int32]map[int32]int32 //VIP充值礼包 key1-vipLevel key2 - shopId value- shopType (每日礼包 shopId的写死为0 value = 1)
VIPBag map[int32]map[int32]int32 //VIP充值礼包 vip等级:商品id:商品获得类型;特殊用法, 商品id为0代表vip每日礼包 1代表vip等级礼包
Task map[int32]*TaskData // 任务
PhoneLotteryTask map[int32]*TaskData // 抽手机任务
PigBank *PigBankData // 存钱罐

View File

@ -14,7 +14,7 @@ type DbVip struct {
Platform string //平台
SnId int32 //玩家id
VipLevel int32 //领取礼包的VIP等级
Type int32 //领取类型 0-每日礼包 1-每日金币礼包 2-固定礼包
Type int32 //领取类型 0-每日礼包 1-每日金币礼包 2-固定礼包 9-等级礼包
ConsumeType int32 //消耗类型
ConsumeNum int64 //消耗数量
ItemInfo []ItemInfo //道具 获得

View File

@ -1,6 +1,7 @@
package mq
// 后台消息
const (
BackBankrupt = "log_bankrupt"
BackClientLog = "log_clientlog_mysql"
@ -15,7 +16,11 @@ const (
BackSystemPermitExchange = "back_permitexchange"
BackSystemPermitJoin = "back_permitjoin"
BackSystemPermitTask = "back_permittask"
BackSystemJyb = "back_jyblog"
)
// dbproxy 消息
const ()
const (
DBVipGiftLog = "db_vipgift"
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,103 @@
syntax = "proto3";
package clawdoll;
option go_package = "mongo.games.com/game/protocol/clawdoll";
//
enum CLAWDOLLPacketID {
PACKET_CLAWDOLL_ZERO = 0; //
PACKET_SC_CLAWDOLL_ROOMINFO = 5601; //
PACKET_CS_CLAWDOLL_PLAYEROP = 5602; //->
PACKET_SC_CLAWDOLL_PLAYEROP = 5603; //->
PACKET_SC_CLAWDOLL_ROOMSTATE = 5604; //
PACKET_SC_CLAWDOLL_GAMEBILLED = 5605; //
PACKET_SC_CLAWDOLL_PlayerEnter = 5606; //
PACKET_SC_CLAWDOLL_PlayerLeave = 5607; //
PACKET_SC_CLAWDOLL_PLAYERINFO = 5608; //
}
//
enum OpResultCode {
OPRC_Success = 0; //
OPRC_Error = 1; //
OPRC_CoinNotEnough = 2; //
OPRC_PosAlReadyPlaying = 3; //
}
message CLAWDOLLPlayerData {
string Name = 1; //
int32 SnId = 2; //
int32 Head = 3; //
int32 Sex = 4; //
int64 Coin = 5; //
int32 HeadOutLine = 6; //
int32 VIP = 7;
int32 Flag = 8; // :线(0:线 1:线) :(0: 1:)
int64 WinCoin = 9; //
}
//
message SCCLAWDOLLRoomInfo {
int32 RoomId = 1; //id
int32 GameId = 2; //id
int32 RoomMode = 3; //
repeated int32 Params = 4; //
int32 State = 5; //
int32 TimeOut = 6; // :
repeated CLAWDOLLPlayerData Players = 7; //
int32 TotalPlayer = 8; //
int32 RoundId = 9; //ID
repeated int32 ParamsEx = 10; //
int32 GameFreeId = 15;
int32 BaseScore = 16; //
}
//
message CSCLAWDOLLOp {
int32 OpCode = 1;
repeated int64 Params = 2;
}
//
message SCCLAWDOLLOp {
int32 SnId = 1; //ID
int32 OpCode = 2; //
repeated int64 Params = 3; // CSCLAWDOLLOp
OpResultCode OpRetCode = 4; //
}
//
message SCCLAWDOLLRoundGameBilled {
int32 RoundId = 1; //ID
int32 ClowResult = 2; //
int64 Award = 3; //
int64 Balance = 4; //
}
//
message SCCLAWDOLLRoomState {
int32 State = 1; //
repeated float Params = 2;
}
//
message SCCLAWDOLLPlayerInfo {
int32 SnId = 1; //ID
int64 gainCoin = 2; //
int64 Coin = 3; //
}
//
//PACKET_SCCLAWDOLLPlayerEnter
message SCCLAWDOLLPlayerEnter {
CLAWDOLLPlayerData Data = 1;
}
//
//PACKET_SCCLAWDOLLPlayerLeave
message SCCLAWDOLLPlayerLeave {
int32 Pos = 1; //
}

View File

@ -5,6 +5,7 @@
- 2000~4999 client->worldsrv
- 5000~9999 client->gamesrv
- 10000~12000 client->ranksrv
- 20000~29999 gamesrv->machine
--------------------------------------
# worldsrv
@ -65,7 +66,7 @@
- 2720~2739
#### tournament锦标赛
- 2740~2759
- 2740~2779
#### RankMatch 排位赛
- 2780~2800

View File

@ -0,0 +1,537 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1-devel
// protoc v3.19.4
// source: dollmachine.proto
package dollmachine
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)
)
//S-GAME M-娃娃机主机
//娃娃机协议
type DollMachinePacketID int32
const (
DollMachinePacketID_PACKET_SMDollMachineZero DollMachinePacketID = 0
DollMachinePacketID_PACKET_SMDollMachineMove DollMachinePacketID = 3001
DollMachinePacketID_PACKET_SMDollMachineGrab DollMachinePacketID = 3002
DollMachinePacketID_PACKET_MSDollMachineGrab DollMachinePacketID = 3003
DollMachinePacketID_PACKET_MSDollMachineList DollMachinePacketID = 3004
)
// Enum value maps for DollMachinePacketID.
var (
DollMachinePacketID_name = map[int32]string{
0: "PACKET_SMDollMachineZero",
3001: "PACKET_SMDollMachineMove",
3002: "PACKET_SMDollMachineGrab",
3003: "PACKET_MSDollMachineGrab",
3004: "PACKET_MSDollMachineList",
}
DollMachinePacketID_value = map[string]int32{
"PACKET_SMDollMachineZero": 0,
"PACKET_SMDollMachineMove": 3001,
"PACKET_SMDollMachineGrab": 3002,
"PACKET_MSDollMachineGrab": 3003,
"PACKET_MSDollMachineList": 3004,
}
)
func (x DollMachinePacketID) Enum() *DollMachinePacketID {
p := new(DollMachinePacketID)
*p = x
return p
}
func (x DollMachinePacketID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DollMachinePacketID) Descriptor() protoreflect.EnumDescriptor {
return file_dollmachine_proto_enumTypes[0].Descriptor()
}
func (DollMachinePacketID) Type() protoreflect.EnumType {
return &file_dollmachine_proto_enumTypes[0]
}
func (x DollMachinePacketID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DollMachinePacketID.Descriptor instead.
func (DollMachinePacketID) EnumDescriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{0}
}
//移动
type SMDollMachineMove struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Direction int32 `protobuf:"varint,3,opt,name=Direction,proto3" json:"Direction,omitempty"` // 1-前 2-后 3-左 4-右
}
func (x *SMDollMachineMove) Reset() {
*x = SMDollMachineMove{}
if protoimpl.UnsafeEnabled {
mi := &file_dollmachine_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMDollMachineMove) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMDollMachineMove) ProtoMessage() {}
func (x *SMDollMachineMove) ProtoReflect() protoreflect.Message {
mi := &file_dollmachine_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 SMDollMachineMove.ProtoReflect.Descriptor instead.
func (*SMDollMachineMove) Descriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{0}
}
func (x *SMDollMachineMove) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
func (x *SMDollMachineMove) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *SMDollMachineMove) GetDirection() int32 {
if x != nil {
return x.Direction
}
return 0
}
//下抓
type SMDollMachineGrab struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1-弱力抓 2 -强力抓 3-必出抓
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Snid int32 `protobuf:"varint,3,opt,name=Snid,proto3" json:"Snid,omitempty"`
}
func (x *SMDollMachineGrab) Reset() {
*x = SMDollMachineGrab{}
if protoimpl.UnsafeEnabled {
mi := &file_dollmachine_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMDollMachineGrab) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMDollMachineGrab) ProtoMessage() {}
func (x *SMDollMachineGrab) ProtoReflect() protoreflect.Message {
mi := &file_dollmachine_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 SMDollMachineGrab.ProtoReflect.Descriptor instead.
func (*SMDollMachineGrab) Descriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{1}
}
func (x *SMDollMachineGrab) GetTypeId() int32 {
if x != nil {
return x.TypeId
}
return 0
}
func (x *SMDollMachineGrab) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *SMDollMachineGrab) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
//返回下抓结果
type MSDollMachineGrab struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Result int32 `protobuf:"varint,3,opt,name=Result,proto3" json:"Result,omitempty"` //1-中奖 其他未中奖
}
func (x *MSDollMachineGrab) Reset() {
*x = MSDollMachineGrab{}
if protoimpl.UnsafeEnabled {
mi := &file_dollmachine_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MSDollMachineGrab) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MSDollMachineGrab) ProtoMessage() {}
func (x *MSDollMachineGrab) ProtoReflect() protoreflect.Message {
mi := &file_dollmachine_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 MSDollMachineGrab.ProtoReflect.Descriptor instead.
func (*MSDollMachineGrab) Descriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{2}
}
func (x *MSDollMachineGrab) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
func (x *MSDollMachineGrab) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *MSDollMachineGrab) GetResult() int32 {
if x != nil {
return x.Result
}
return 0
}
//返回所有娃娃机连接
type MSDollMachineList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data []*DollMachine `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *MSDollMachineList) Reset() {
*x = MSDollMachineList{}
if protoimpl.UnsafeEnabled {
mi := &file_dollmachine_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MSDollMachineList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MSDollMachineList) ProtoMessage() {}
func (x *MSDollMachineList) ProtoReflect() protoreflect.Message {
mi := &file_dollmachine_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 MSDollMachineList.ProtoReflect.Descriptor instead.
func (*MSDollMachineList) Descriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{3}
}
func (x *MSDollMachineList) GetData() []*DollMachine {
if x != nil {
return x.Data
}
return nil
}
type DollMachine struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=Status,proto3" json:"Status,omitempty"` //1-空闲 2-无法使用
}
func (x *DollMachine) Reset() {
*x = DollMachine{}
if protoimpl.UnsafeEnabled {
mi := &file_dollmachine_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DollMachine) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DollMachine) ProtoMessage() {}
func (x *DollMachine) ProtoReflect() protoreflect.Message {
mi := &file_dollmachine_proto_msgTypes[4]
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 DollMachine.ProtoReflect.Descriptor instead.
func (*DollMachine) Descriptor() ([]byte, []int) {
return file_dollmachine_proto_rawDescGZIP(), []int{4}
}
func (x *DollMachine) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *DollMachine) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
var File_dollmachine_proto protoreflect.FileDescriptor
var file_dollmachine_proto_rawDesc = []byte{
0x0a, 0x11, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x22, 0x55, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
0x65, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x72,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x44, 0x69,
0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c,
0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x16, 0x0a, 0x06,
0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79,
0x70, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x22, 0x4f, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f,
0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x12, 0x0a,
0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69,
0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x41, 0x0a, 0x11, 0x4d, 0x53, 0x44,
0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c,
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64,
0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x0b,
0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x2a, 0xaf, 0x01, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
0x65, 0x4d, 0x6f, 0x76, 0x65, 0x10, 0xb9, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x47, 0x72, 0x61, 0x62, 0x10, 0xba, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
0x72, 0x61, 0x62, 0x10, 0xbb, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69,
0x73, 0x74, 0x10, 0xbc, 0x17, 0x42, 0x2b, 0x5a, 0x29, 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, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69,
0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_dollmachine_proto_rawDescOnce sync.Once
file_dollmachine_proto_rawDescData = file_dollmachine_proto_rawDesc
)
func file_dollmachine_proto_rawDescGZIP() []byte {
file_dollmachine_proto_rawDescOnce.Do(func() {
file_dollmachine_proto_rawDescData = protoimpl.X.CompressGZIP(file_dollmachine_proto_rawDescData)
})
return file_dollmachine_proto_rawDescData
}
var file_dollmachine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_dollmachine_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_dollmachine_proto_goTypes = []interface{}{
(DollMachinePacketID)(0), // 0: dollmachine.DollMachinePacketID
(*SMDollMachineMove)(nil), // 1: dollmachine.SMDollMachineMove
(*SMDollMachineGrab)(nil), // 2: dollmachine.SMDollMachineGrab
(*MSDollMachineGrab)(nil), // 3: dollmachine.MSDollMachineGrab
(*MSDollMachineList)(nil), // 4: dollmachine.MSDollMachineList
(*DollMachine)(nil), // 5: dollmachine.DollMachine
}
var file_dollmachine_proto_depIdxs = []int32{
5, // 0: dollmachine.MSDollMachineList.data:type_name -> dollmachine.DollMachine
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_dollmachine_proto_init() }
func file_dollmachine_proto_init() {
if File_dollmachine_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_dollmachine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMDollMachineMove); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dollmachine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMDollMachineGrab); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dollmachine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MSDollMachineGrab); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dollmachine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MSDollMachineList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dollmachine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DollMachine); 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_dollmachine_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_dollmachine_proto_goTypes,
DependencyIndexes: file_dollmachine_proto_depIdxs,
EnumInfos: file_dollmachine_proto_enumTypes,
MessageInfos: file_dollmachine_proto_msgTypes,
}.Build()
File_dollmachine_proto = out.File
file_dollmachine_proto_rawDesc = nil
file_dollmachine_proto_goTypes = nil
file_dollmachine_proto_depIdxs = nil
}

View File

@ -0,0 +1,43 @@
syntax = "proto3";
package dollmachine;
option go_package = "mongo.games.com/game/protocol/dollmachine";
//S-GAME M-
//
enum DollMachinePacketID {
PACKET_SMDollMachineZero = 0;
PACKET_SMDollMachineMove = 3001;
PACKET_SMDollMachineGrab = 3002;
PACKET_MSDollMachineGrab = 3003;
PACKET_MSDollMachineList = 3004;
}
//
message SMDollMachineMove{
int32 Snid = 1;
int32 Id = 2; //
int32 Direction = 3; // 1- 2- 3- 4-
}
//
message SMDollMachineGrab{
int32 TypeId = 1;//1- 2 - 3-
int32 Id =2; //
int32 Snid = 3;
}
//
message MSDollMachineGrab{
int32 Snid = 1;
int32 Id = 2; //
int32 Result = 3;//1-
}
//
message MSDollMachineList{
repeated DollMachine data = 1;
}
message DollMachine{
int32 Id = 1;
int32 Status = 2; //1- 2-使
}

View File

@ -0,0 +1,594 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1-devel
// protoc v3.19.4
// source: machine.proto
package machine
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 DollMachinePacketID int32
const (
DollMachinePacketID_PACKET_SMDollMachineZero DollMachinePacketID = 0
DollMachinePacketID_PACKET_SMGameLinkSucceed DollMachinePacketID = 20000
DollMachinePacketID_PACKET_SMDollMachinePerate DollMachinePacketID = 20001
DollMachinePacketID_PACKET_SMDollMachineGrab DollMachinePacketID = 20002
DollMachinePacketID_PACKET_MSDollMachineGrab DollMachinePacketID = 20003
DollMachinePacketID_PACKET_MSDollMachineList DollMachinePacketID = 20004
)
// Enum value maps for DollMachinePacketID.
var (
DollMachinePacketID_name = map[int32]string{
0: "PACKET_SMDollMachineZero",
20000: "PACKET_SMGameLinkSucceed",
20001: "PACKET_SMDollMachinePerate",
20002: "PACKET_SMDollMachineGrab",
20003: "PACKET_MSDollMachineGrab",
20004: "PACKET_MSDollMachineList",
}
DollMachinePacketID_value = map[string]int32{
"PACKET_SMDollMachineZero": 0,
"PACKET_SMGameLinkSucceed": 20000,
"PACKET_SMDollMachinePerate": 20001,
"PACKET_SMDollMachineGrab": 20002,
"PACKET_MSDollMachineGrab": 20003,
"PACKET_MSDollMachineList": 20004,
}
)
func (x DollMachinePacketID) Enum() *DollMachinePacketID {
p := new(DollMachinePacketID)
*p = x
return p
}
func (x DollMachinePacketID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DollMachinePacketID) Descriptor() protoreflect.EnumDescriptor {
return file_machine_proto_enumTypes[0].Descriptor()
}
func (DollMachinePacketID) Type() protoreflect.EnumType {
return &file_machine_proto_enumTypes[0]
}
func (x DollMachinePacketID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DollMachinePacketID.Descriptor instead.
func (DollMachinePacketID) EnumDescriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{0}
}
//通知链接成功
type SMGameLinkSucceed struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *SMGameLinkSucceed) Reset() {
*x = SMGameLinkSucceed{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMGameLinkSucceed) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMGameLinkSucceed) ProtoMessage() {}
func (x *SMGameLinkSucceed) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 SMGameLinkSucceed.ProtoReflect.Descriptor instead.
func (*SMGameLinkSucceed) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{0}
}
//操作
type SMDollMachineoPerate struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Perate int32 `protobuf:"varint,3,opt,name=Perate,proto3" json:"Perate,omitempty"` // 1-前 2-后 3-左 4-右 5-投币
}
func (x *SMDollMachineoPerate) Reset() {
*x = SMDollMachineoPerate{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMDollMachineoPerate) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMDollMachineoPerate) ProtoMessage() {}
func (x *SMDollMachineoPerate) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 SMDollMachineoPerate.ProtoReflect.Descriptor instead.
func (*SMDollMachineoPerate) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{1}
}
func (x *SMDollMachineoPerate) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
func (x *SMDollMachineoPerate) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *SMDollMachineoPerate) GetPerate() int32 {
if x != nil {
return x.Perate
}
return 0
}
//下抓
type SMDollMachineGrab struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1-弱力抓 2 -强力抓 3-必出抓
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Snid int32 `protobuf:"varint,3,opt,name=Snid,proto3" json:"Snid,omitempty"`
}
func (x *SMDollMachineGrab) Reset() {
*x = SMDollMachineGrab{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SMDollMachineGrab) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SMDollMachineGrab) ProtoMessage() {}
func (x *SMDollMachineGrab) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 SMDollMachineGrab.ProtoReflect.Descriptor instead.
func (*SMDollMachineGrab) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{2}
}
func (x *SMDollMachineGrab) GetTypeId() int32 {
if x != nil {
return x.TypeId
}
return 0
}
func (x *SMDollMachineGrab) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *SMDollMachineGrab) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
//返回下抓结果
type MSDollMachineGrab struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
Result int32 `protobuf:"varint,3,opt,name=Result,proto3" json:"Result,omitempty"` //1-中奖 其他未中奖
}
func (x *MSDollMachineGrab) Reset() {
*x = MSDollMachineGrab{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MSDollMachineGrab) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MSDollMachineGrab) ProtoMessage() {}
func (x *MSDollMachineGrab) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 MSDollMachineGrab.ProtoReflect.Descriptor instead.
func (*MSDollMachineGrab) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{3}
}
func (x *MSDollMachineGrab) GetSnid() int32 {
if x != nil {
return x.Snid
}
return 0
}
func (x *MSDollMachineGrab) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *MSDollMachineGrab) GetResult() int32 {
if x != nil {
return x.Result
}
return 0
}
//返回所有娃娃机连接
type MSDollMachineList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data []*DollMachine `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *MSDollMachineList) Reset() {
*x = MSDollMachineList{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MSDollMachineList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MSDollMachineList) ProtoMessage() {}
func (x *MSDollMachineList) ProtoReflect() protoreflect.Message {
mi := &file_machine_proto_msgTypes[4]
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 MSDollMachineList.ProtoReflect.Descriptor instead.
func (*MSDollMachineList) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{4}
}
func (x *MSDollMachineList) GetData() []*DollMachine {
if x != nil {
return x.Data
}
return nil
}
type DollMachine struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
VideoAddr string `protobuf:"bytes,2,opt,name=VideoAddr,proto3" json:"VideoAddr,omitempty"`
}
func (x *DollMachine) Reset() {
*x = DollMachine{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DollMachine) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DollMachine) ProtoMessage() {}
func (x *DollMachine) ProtoReflect() protoreflect.Message {
mi := &file_machine_proto_msgTypes[5]
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 DollMachine.ProtoReflect.Descriptor instead.
func (*DollMachine) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{5}
}
func (x *DollMachine) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *DollMachine) GetVideoAddr() string {
if x != nil {
return x.VideoAddr
}
return ""
}
var File_machine_proto protoreflect.FileDescriptor
var file_machine_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x4d, 0x47, 0x61,
0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x22, 0x52, 0x0a,
0x14, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50,
0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x65, 0x72,
0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x50, 0x65, 0x72, 0x61, 0x74,
0x65, 0x22, 0x4f, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69,
0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e,
0x69, 0x64, 0x22, 0x4f, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x2e, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61,
0x74, 0x61, 0x22, 0x3b, 0x0a, 0x0b, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x2a,
0xd5, 0x01, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50,
0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a,
0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65,
0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72,
0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
0x72, 0x61, 0x62, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c,
0x69, 0x73, 0x74, 0x10, 0xa4, 0x9c, 0x01, 0x42, 0x27, 0x5a, 0x25, 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, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_machine_proto_rawDescOnce sync.Once
file_machine_proto_rawDescData = file_machine_proto_rawDesc
)
func file_machine_proto_rawDescGZIP() []byte {
file_machine_proto_rawDescOnce.Do(func() {
file_machine_proto_rawDescData = protoimpl.X.CompressGZIP(file_machine_proto_rawDescData)
})
return file_machine_proto_rawDescData
}
var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_machine_proto_goTypes = []interface{}{
(DollMachinePacketID)(0), // 0: machine.DollMachinePacketID
(*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed
(*SMDollMachineoPerate)(nil), // 2: machine.SMDollMachineoPerate
(*SMDollMachineGrab)(nil), // 3: machine.SMDollMachineGrab
(*MSDollMachineGrab)(nil), // 4: machine.MSDollMachineGrab
(*MSDollMachineList)(nil), // 5: machine.MSDollMachineList
(*DollMachine)(nil), // 6: machine.DollMachine
}
var file_machine_proto_depIdxs = []int32{
6, // 0: machine.MSDollMachineList.data:type_name -> machine.DollMachine
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_machine_proto_init() }
func file_machine_proto_init() {
if File_machine_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_machine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMGameLinkSucceed); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMDollMachineoPerate); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SMDollMachineGrab); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MSDollMachineGrab); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MSDollMachineList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DollMachine); 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_machine_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_machine_proto_goTypes,
DependencyIndexes: file_machine_proto_depIdxs,
EnumInfos: file_machine_proto_enumTypes,
MessageInfos: file_machine_proto_msgTypes,
}.Build()
File_machine_proto = out.File
file_machine_proto_rawDesc = nil
file_machine_proto_goTypes = nil
file_machine_proto_depIdxs = nil
}

View File

@ -0,0 +1,48 @@
syntax = "proto3";
package machine;
option go_package = "mongo.games.com/game/protocol/machine";
//S-GAME M-
//
enum DollMachinePacketID {
PACKET_SMDollMachineZero = 0;
PACKET_SMGameLinkSucceed = 20000;
PACKET_SMDollMachinePerate = 20001;
PACKET_SMDollMachineGrab = 20002;
PACKET_MSDollMachineGrab = 20003;
PACKET_MSDollMachineList = 20004;
}
//
message SMGameLinkSucceed{
}
//
message SMDollMachineoPerate{
int32 Snid = 1;
int32 Id = 2; //
int32 Perate = 3; // 1- 2- 3- 4- 5-
}
//
message SMDollMachineGrab{
int32 TypeId = 1;//1- 2 - 3-
int32 Id =2; //
int32 Snid = 3;
}
//
message MSDollMachineGrab{
int32 Snid = 1;
int32 Id = 2; //
int32 Result = 3;//1-
}
//
message MSDollMachineList{
repeated DollMachine data = 1;
}
message DollMachine{
int32 Id = 1;
string VideoAddr = 2;
}

File diff suppressed because it is too large Load Diff

View File

@ -75,6 +75,13 @@ enum OpResultCode {
OPRC_Hundred_YouHadBetCannotLeave = 7001; //
OPRC_Hundred_YouHadBankerCannotLeave = 7002; //
OPRC_GuideStep_Finish = 8001; //
OPRC_GuideStep_Front = 8002; //
OPRC_GuideStep_End = 8003; //
OPRC_Guide_Close = 8004; //
OPRC_Guide_Skip = 8005; //
OPRC_Guide_SkipClose = 8006; //
}
//id
@ -197,7 +204,6 @@ enum PlayerPacketID {
PACKET_SCBillList = 2813; //
PACKET_CSSavePlayerInfo = 2814; //
PACKET_SCSavePlayerInfo = 2815; //
PACKET_CS_PhoneLotteryInfo = 2816;//
PACKET_SC_PhoneLotteryInfo = 2817;//
PACKET_CS_PhoneLottery = 2818;//
@ -222,7 +228,10 @@ enum PlayerPacketID {
PACKET_SCAwardLog = 2837; //
PACKET_CSPopUpWindowsConfig = 2838;//
PACKET_SCPopUpWindowsConfig = 2839;//
PACKET_CSUpdateAttribute = 2840;//
PACKET_SCUpdateAttribute = 2841;//
PACKET_SCGuideConfig = 2842;//
PACKET_SCDataConfig = 2843;//
}
//
@ -334,6 +343,7 @@ message PlayerData {
repeated int32 RequestAddFriend = 49;//
int32 UseSkinId = 50; // id
string ChannelID = 51; // ID
int32 GuideStep = 52; // ; 0-1
}
//
@ -977,15 +987,17 @@ message SCVIPBuy {
//VIP领取
//PACKET_CS_DRAWVIPGIFT
message CSVIPDraw {
int32 Id = 1; // 0.
int32 Id = 1; // 0. 1.Privilege9
int32 Vip = 2; //vip等级
}
//VIP领取
//PACKET_SC_DRAWVIPGIFT
message SCVIPDraw {
int32 Id = 1; // 0. 1. 2.VIP礼包
int32 Id = 1; //
int32 Vip = 2; //vip等级
OpResultCode OpRetCode = 3; //
map<int64,int64> Award = 4; //
}
//VIP信息
@ -998,7 +1010,7 @@ message VIPcfg {
repeated ItemInfo Item = 2; //
int32 VipEx = 3; // VIP经验
int64 Price = 4; //
repeated int32 Privilege1 = 5; //
map<int64,int64> Privilege1 = 5; //
repeated int32 LineId = 6; //Id
repeated int32 Privilege2 = 7; //12
repeated int32 Privilege3 = 8;//VIP商城刷新次数和商品数量
@ -1010,8 +1022,10 @@ message VIPcfg {
int32 Privilege8 = 14;//VIP客服标识
int32 ShopId2 = 15;
int32 ShopId7 = 16;
repeated int32 BagStatus = 17;//||VIP礼包 0 1
repeated int32 BagStatus = 17;//||VIP礼包| 0 1
int32 MatchFreeTimes = 18;//
map<int64,int64> Privilege9 = 19; // vip免费礼包vip等级领取一次
int32 PrivilegeShow = 20;// Privilege9
}
//VIP信息
@ -1052,6 +1066,9 @@ message PayItem {
message SCPayGoodsInfo{
repeated int32 Gold = 1;// 0. 1. 3.
repeated PayItem Item = 2;//
int32 ShopId = 3;// id
int64 Money = 4;//
string Name = 5;//
}
//
@ -1312,3 +1329,42 @@ message WindowsInfo{
int32 PartNum = 4;//
int32 GainNum = 5;//
}
//PACKET_CSUpdateAttribute
message CSUpdateAttribute{
int32 Tp = 1; // 1. 2. 3.()
repeated int64 Param = 2;
}
//PACKET_SCUpdateAttribute
message SCUpdateAttribute{
OpResultCode OpRetCode = 1; //
int32 Tp = 2;
repeated int64 Param = 3;
}
//PACKET_SCGuideConfig
message SCGuideConfig{
int32 On = 2; // 1 2
int32 Skip = 3; // 1 2
}
message Config{
// Tp
// 1: On开关 Value地址
// 2: ...
// ...
int32 Tp = 1;
bool On = 2;
string Value = 3;
int64 Num = 4;
repeated string Values = 5;
repeated int64 Nums = 6;
repeated bool Ons = 7;
map<int64,int64> Map = 8;
map<string,string> MapStr = 9;
}
//PACKET_SCDataConfig
message SCDataConfig{
repeated Config Cfg = 1;
}

View File

@ -10496,6 +10496,8 @@ type DB_VIP struct {
Award map[int64]int64 `protobuf:"bytes,18,rep,name=Award,proto3" json:"Award,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
ParamName []string `protobuf:"bytes,19,rep,name=ParamName,proto3" json:"ParamName,omitempty"`
MatchFreeTimes int32 `protobuf:"varint,20,opt,name=MatchFreeTimes,proto3" json:"MatchFreeTimes,omitempty"`
Privilege9 []int32 `protobuf:"varint,21,rep,packed,name=Privilege9,proto3" json:"Privilege9,omitempty"`
PrivilegeShow int32 `protobuf:"varint,22,opt,name=PrivilegeShow,proto3" json:"PrivilegeShow,omitempty"`
}
func (x *DB_VIP) Reset() {
@ -10670,6 +10672,20 @@ func (x *DB_VIP) GetMatchFreeTimes() int32 {
return 0
}
func (x *DB_VIP) GetPrivilege9() []int32 {
if x != nil {
return x.Privilege9
}
return nil
}
func (x *DB_VIP) GetPrivilegeShow() int32 {
if x != nil {
return x.PrivilegeShow
}
return 0
}
type DB_VIPArray struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -10717,6 +10733,116 @@ func (x *DB_VIPArray) GetArr() []*DB_VIP {
return nil
}
type DB_VIPShow struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
SkinId int32 `protobuf:"varint,2,opt,name=SkinId,proto3" json:"SkinId,omitempty"`
VIPLevel int32 `protobuf:"varint,3,opt,name=VIPLevel,proto3" json:"VIPLevel,omitempty"`
}
func (x *DB_VIPShow) Reset() {
*x = DB_VIPShow{}
if protoimpl.UnsafeEnabled {
mi := &file_pbdata_proto_msgTypes[138]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DB_VIPShow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DB_VIPShow) ProtoMessage() {}
func (x *DB_VIPShow) ProtoReflect() protoreflect.Message {
mi := &file_pbdata_proto_msgTypes[138]
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 DB_VIPShow.ProtoReflect.Descriptor instead.
func (*DB_VIPShow) Descriptor() ([]byte, []int) {
return file_pbdata_proto_rawDescGZIP(), []int{138}
}
func (x *DB_VIPShow) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *DB_VIPShow) GetSkinId() int32 {
if x != nil {
return x.SkinId
}
return 0
}
func (x *DB_VIPShow) GetVIPLevel() int32 {
if x != nil {
return x.VIPLevel
}
return 0
}
type DB_VIPShowArray struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Arr []*DB_VIPShow `protobuf:"bytes,1,rep,name=Arr,proto3" json:"Arr,omitempty"`
}
func (x *DB_VIPShowArray) Reset() {
*x = DB_VIPShowArray{}
if protoimpl.UnsafeEnabled {
mi := &file_pbdata_proto_msgTypes[139]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DB_VIPShowArray) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DB_VIPShowArray) ProtoMessage() {}
func (x *DB_VIPShowArray) ProtoReflect() protoreflect.Message {
mi := &file_pbdata_proto_msgTypes[139]
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 DB_VIPShowArray.ProtoReflect.Descriptor instead.
func (*DB_VIPShowArray) Descriptor() ([]byte, []int) {
return file_pbdata_proto_rawDescGZIP(), []int{139}
}
func (x *DB_VIPShowArray) GetArr() []*DB_VIPShow {
if x != nil {
return x.Arr
}
return nil
}
var File_pbdata_proto protoreflect.FileDescriptor
var file_pbdata_proto_rawDesc = []byte{
@ -12099,7 +12225,7 @@ var file_pbdata_proto_rawDesc = []byte{
0x03, 0x44, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x54, 0x69, 0x70, 0x73, 0x41,
0x72, 0x72, 0x61, 0x79, 0x12, 0x21, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x54, 0x69,
0x70, 0x73, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0x88, 0x06, 0x0a, 0x06, 0x44, 0x42, 0x5f, 0x56,
0x70, 0x73, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0xce, 0x06, 0x0a, 0x06, 0x44, 0x42, 0x5f, 0x56,
0x49, 0x50, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18,
@ -12140,21 +12266,34 @@ var file_pbdata_proto_rawDesc = []byte{
0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x46, 0x72, 0x65, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x46, 0x72, 0x65, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x69,
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x37, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x46, 0x72, 0x65, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x72, 0x69,
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x39, 0x18, 0x15, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x50,
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x39, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x69,
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0d, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x1a,
0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x37, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38,
0x0a, 0x0a, 0x41, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x77, 0x61, 0x72,
0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x22, 0x2f, 0x0a, 0x0b, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x41, 0x72, 0x72, 0x61,
0x79, 0x12, 0x20, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x52, 0x03,
0x41, 0x72, 0x72, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2f, 0x0a, 0x0b, 0x44, 0x42, 0x5f, 0x56,
0x49, 0x50, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x20, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42,
0x5f, 0x56, 0x49, 0x50, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0x50, 0x0a, 0x0a, 0x44, 0x42, 0x5f,
0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x56, 0x49, 0x50, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x56, 0x49, 0x50, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x37, 0x0a, 0x0f, 0x44,
0x42, 0x5f, 0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x24,
0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x52,
0x03, 0x41, 0x72, 0x72, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -12169,7 +12308,7 @@ func file_pbdata_proto_rawDescGZIP() []byte {
return file_pbdata_proto_rawDescData
}
var file_pbdata_proto_msgTypes = make([]protoimpl.MessageInfo, 151)
var file_pbdata_proto_msgTypes = make([]protoimpl.MessageInfo, 153)
var file_pbdata_proto_goTypes = []interface{}{
(*DB_ActSign)(nil), // 0: server.DB_ActSign
(*DB_ActSignArray)(nil), // 1: server.DB_ActSignArray
@ -12309,19 +12448,21 @@ var file_pbdata_proto_goTypes = []interface{}{
(*DB_TipsArray)(nil), // 135: server.DB_TipsArray
(*DB_VIP)(nil), // 136: server.DB_VIP
(*DB_VIPArray)(nil), // 137: server.DB_VIPArray
nil, // 138: server.DB_CollectBox.ItemIDEntry
nil, // 139: server.DB_GameItem.GainEntry
nil, // 140: server.DB_GiftBox.ItemIDEntry
nil, // 141: server.DB_GiftCard.RewardsEntry
nil, // 142: server.DB_GiftCard.DayRewardsEntry
nil, // 143: server.DB_PetSkill.ItemConsumEntry
nil, // 144: server.DB_PropExchange.CostEntry
nil, // 145: server.DB_PropExchange.GainEntry
nil, // 146: server.DB_Skin.UnlockItemEntry
nil, // 147: server.DB_SkinLevel.UpItemEntry
nil, // 148: server.DB_Task.AwardEntry
nil, // 149: server.DB_VIP.Privilege7Entry
nil, // 150: server.DB_VIP.AwardEntry
(*DB_VIPShow)(nil), // 138: server.DB_VIPShow
(*DB_VIPShowArray)(nil), // 139: server.DB_VIPShowArray
nil, // 140: server.DB_CollectBox.ItemIDEntry
nil, // 141: server.DB_GameItem.GainEntry
nil, // 142: server.DB_GiftBox.ItemIDEntry
nil, // 143: server.DB_GiftCard.RewardsEntry
nil, // 144: server.DB_GiftCard.DayRewardsEntry
nil, // 145: server.DB_PetSkill.ItemConsumEntry
nil, // 146: server.DB_PropExchange.CostEntry
nil, // 147: server.DB_PropExchange.GainEntry
nil, // 148: server.DB_Skin.UnlockItemEntry
nil, // 149: server.DB_SkinLevel.UpItemEntry
nil, // 150: server.DB_Task.AwardEntry
nil, // 151: server.DB_VIP.Privilege7Entry
nil, // 152: server.DB_VIP.AwardEntry
}
var file_pbdata_proto_depIdxs = []int32{
0, // 0: server.DB_ActSignArray.Arr:type_name -> server.DB_ActSign
@ -12336,7 +12477,7 @@ var file_pbdata_proto_depIdxs = []int32{
18, // 9: server.DB_ChessMatchRulesArray.Arr:type_name -> server.DB_ChessMatchRules
20, // 10: server.DB_ChessRankArray.Arr:type_name -> server.DB_ChessRank
22, // 11: server.DB_ClientVerArray.Arr:type_name -> server.DB_ClientVer
138, // 12: server.DB_CollectBox.ItemID:type_name -> server.DB_CollectBox.ItemIDEntry
140, // 12: server.DB_CollectBox.ItemID:type_name -> server.DB_CollectBox.ItemIDEntry
24, // 13: server.DB_CollectBoxArray.Arr:type_name -> server.DB_CollectBox
26, // 14: server.DB_CollectBoxGainArray.Arr:type_name -> server.DB_CollectBoxGain
28, // 15: server.DB_CrashSearchArray.Arr:type_name -> server.DB_CrashSearch
@ -12353,7 +12494,7 @@ var file_pbdata_proto_depIdxs = []int32{
50, // 26: server.DB_GamMatchLVArray.Arr:type_name -> server.DB_GamMatchLV
52, // 27: server.DB_GameCoinPoolArray.Arr:type_name -> server.DB_GameCoinPool
54, // 28: server.DB_GameFreeArray.Arr:type_name -> server.DB_GameFree
139, // 29: server.DB_GameItem.Gain:type_name -> server.DB_GameItem.GainEntry
141, // 29: server.DB_GameItem.Gain:type_name -> server.DB_GameItem.GainEntry
56, // 30: server.DB_GameItemArray.Arr:type_name -> server.DB_GameItem
58, // 31: server.DB_GameMatchLevelArray.Arr:type_name -> server.DB_GameMatchLevel
60, // 32: server.DB_GameRuleArray.Arr:type_name -> server.DB_GameRule
@ -12362,10 +12503,10 @@ var file_pbdata_proto_depIdxs = []int32{
66, // 35: server.DB_Game_IntroductionArray.Arr:type_name -> server.DB_Game_Introduction
68, // 36: server.DB_Game_PetArray.Arr:type_name -> server.DB_Game_Pet
70, // 37: server.DB_Game_RoleArray.Arr:type_name -> server.DB_Game_Role
140, // 38: server.DB_GiftBox.ItemID:type_name -> server.DB_GiftBox.ItemIDEntry
142, // 38: server.DB_GiftBox.ItemID:type_name -> server.DB_GiftBox.ItemIDEntry
72, // 39: server.DB_GiftBoxArray.Arr:type_name -> server.DB_GiftBox
141, // 40: server.DB_GiftCard.Rewards:type_name -> server.DB_GiftCard.RewardsEntry
142, // 41: server.DB_GiftCard.DayRewards:type_name -> server.DB_GiftCard.DayRewardsEntry
143, // 40: server.DB_GiftCard.Rewards:type_name -> server.DB_GiftCard.RewardsEntry
144, // 41: server.DB_GiftCard.DayRewards:type_name -> server.DB_GiftCard.DayRewardsEntry
74, // 42: server.DB_GiftCardArray.Arr:type_name -> server.DB_GiftCard
76, // 43: server.DB_IceAgeElementRateArray.Arr:type_name -> server.DB_IceAgeElementRate
78, // 44: server.DB_Legend_OddsArray.Arr:type_name -> server.DB_Legend_Odds
@ -12378,7 +12519,7 @@ var file_pbdata_proto_depIdxs = []int32{
92, // 51: server.DB_NameGirlArray.Arr:type_name -> server.DB_NameGirl
94, // 52: server.DB_NewPlayerArray.Arr:type_name -> server.DB_NewPlayer
96, // 53: server.DB_PassShowArray.Arr:type_name -> server.DB_PassShow
143, // 54: server.DB_PetSkill.ItemConsum:type_name -> server.DB_PetSkill.ItemConsumEntry
145, // 54: server.DB_PetSkill.ItemConsum:type_name -> server.DB_PetSkill.ItemConsumEntry
98, // 55: server.DB_PetSkillArray.Arr:type_name -> server.DB_PetSkill
100, // 56: server.DB_PhoneLotteryArray.Arr:type_name -> server.DB_PhoneLottery
102, // 57: server.DB_PigBank_DiamondArray.Arr:type_name -> server.DB_PigBank_Diamond
@ -12386,31 +12527,32 @@ var file_pbdata_proto_depIdxs = []int32{
106, // 59: server.DB_PlayerExpArray.Arr:type_name -> server.DB_PlayerExp
108, // 60: server.DB_PlayerTypeArray.Arr:type_name -> server.DB_PlayerType
110, // 61: server.DB_PotOddArray.Arr:type_name -> server.DB_PotOdd
144, // 62: server.DB_PropExchange.Cost:type_name -> server.DB_PropExchange.CostEntry
145, // 63: server.DB_PropExchange.Gain:type_name -> server.DB_PropExchange.GainEntry
146, // 62: server.DB_PropExchange.Cost:type_name -> server.DB_PropExchange.CostEntry
147, // 63: server.DB_PropExchange.Gain:type_name -> server.DB_PropExchange.GainEntry
112, // 64: server.DB_PropExchangeArray.Arr:type_name -> server.DB_PropExchange
114, // 65: server.DB_RankCycleArray.Arr:type_name -> server.DB_RankCycle
116, // 66: server.DB_RankLevelArray.Arr:type_name -> server.DB_RankLevel
118, // 67: server.DB_RankRewardArray.Arr:type_name -> server.DB_RankReward
120, // 68: server.DB_Sensitive_WordsArray.Arr:type_name -> server.DB_Sensitive_Words
146, // 69: server.DB_Skin.UnlockItem:type_name -> server.DB_Skin.UnlockItemEntry
148, // 69: server.DB_Skin.UnlockItem:type_name -> server.DB_Skin.UnlockItemEntry
122, // 70: server.DB_SkinArray.Arr:type_name -> server.DB_Skin
147, // 71: server.DB_SkinLevel.UpItem:type_name -> server.DB_SkinLevel.UpItemEntry
149, // 71: server.DB_SkinLevel.UpItem:type_name -> server.DB_SkinLevel.UpItemEntry
124, // 72: server.DB_SkinLevelArray.Arr:type_name -> server.DB_SkinLevel
126, // 73: server.DB_SlotRateWeightArray.Arr:type_name -> server.DB_SlotRateWeight
128, // 74: server.DB_SystemChanceArray.Arr:type_name -> server.DB_SystemChance
148, // 75: server.DB_Task.Award:type_name -> server.DB_Task.AwardEntry
150, // 75: server.DB_Task.Award:type_name -> server.DB_Task.AwardEntry
130, // 76: server.DB_TaskArray.Arr:type_name -> server.DB_Task
132, // 77: server.DB_ThirdPlatformGameMappingArray.Arr:type_name -> server.DB_ThirdPlatformGameMapping
134, // 78: server.DB_TipsArray.Arr:type_name -> server.DB_Tips
149, // 79: server.DB_VIP.Privilege7:type_name -> server.DB_VIP.Privilege7Entry
150, // 80: server.DB_VIP.Award:type_name -> server.DB_VIP.AwardEntry
151, // 79: server.DB_VIP.Privilege7:type_name -> server.DB_VIP.Privilege7Entry
152, // 80: server.DB_VIP.Award:type_name -> server.DB_VIP.AwardEntry
136, // 81: server.DB_VIPArray.Arr:type_name -> server.DB_VIP
82, // [82:82] is the sub-list for method output_type
82, // [82:82] is the sub-list for method input_type
82, // [82:82] is the sub-list for extension type_name
82, // [82:82] is the sub-list for extension extendee
0, // [0:82] is the sub-list for field type_name
138, // 82: server.DB_VIPShowArray.Arr:type_name -> server.DB_VIPShow
83, // [83:83] is the sub-list for method output_type
83, // [83:83] is the sub-list for method input_type
83, // [83:83] is the sub-list for extension type_name
83, // [83:83] is the sub-list for extension extendee
0, // [0:83] is the sub-list for field type_name
}
func init() { file_pbdata_proto_init() }
@ -14075,6 +14217,30 @@ func file_pbdata_proto_init() {
return nil
}
}
file_pbdata_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DB_VIPShow); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pbdata_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DB_VIPShowArray); 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{
@ -14082,7 +14248,7 @@ func file_pbdata_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pbdata_proto_rawDesc,
NumEnums: 0,
NumMessages: 151,
NumMessages: 153,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -1741,9 +1741,27 @@ message DB_VIP {
int32 MatchFreeTimes = 20;
repeated int32 Privilege9 = 21;
int32 PrivilegeShow = 22;
}
message DB_VIPArray {
repeated DB_VIP Arr = 1;
}
message DB_VIPShow {
int32 Id = 1;
int32 SkinId = 2;
int32 VIPLevel = 3;
}
message DB_VIPShowArray {
repeated DB_VIPShow Arr = 1;
}

View File

@ -1262,6 +1262,7 @@ type SCShopExchange struct {
RetCode OpResultCode `protobuf:"varint,1,opt,name=RetCode,proto3,enum=shop.OpResultCode" json:"RetCode,omitempty"`
CreateTs int64 `protobuf:"varint,2,opt,name=CreateTs,proto3" json:"CreateTs,omitempty"` //订单创建日期
OrderId string `protobuf:"bytes,3,opt,name=OrderId,proto3" json:"OrderId,omitempty"` //订单号
GoodsId int32 `protobuf:"varint,4,opt,name=GoodsId,proto3" json:"GoodsId,omitempty"` //商品Id
}
func (x *SCShopExchange) Reset() {
@ -1317,6 +1318,13 @@ func (x *SCShopExchange) GetOrderId() string {
return ""
}
func (x *SCShopExchange) GetGoodsId() int32 {
if x != nil {
return x.GoodsId
}
return 0
}
//PACKET_CS_SHOP_EXCHANGELIST
type CSShopExchangeList struct {
state protoimpl.MessageState
@ -1378,6 +1386,7 @@ type ShopExchangeInfo struct {
NotVipShopLimit int32 `protobuf:"varint,15,opt,name=NotVipShopLimit,proto3" json:"NotVipShopLimit,omitempty"` //非VIP限购总数
ShopType int32 `protobuf:"varint,16,opt,name=ShopType,proto3" json:"ShopType,omitempty"` //商品类型
TelData []*TelChargeData `protobuf:"bytes,17,rep,name=TelData,proto3" json:"TelData,omitempty"`
Items []*ItemInfo `protobuf:"bytes,18,rep,name=Items,proto3" json:"Items,omitempty"` //道具
}
func (x *ShopExchangeInfo) Reset() {
@ -1517,6 +1526,13 @@ func (x *ShopExchangeInfo) GetTelData() []*TelChargeData {
return nil
}
func (x *ShopExchangeInfo) GetItems() []*ItemInfo {
if x != nil {
return x.Items
}
return nil
}
type ExchangeType struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -2585,196 +2601,200 @@ var file_shop_proto_rawDesc = []byte{
0x12, 0x22, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x08, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x0e, 0x53, 0x43,
0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x07,
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e,
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64,
0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64,
0x22, 0x14, 0x0a, 0x12, 0x43, 0x53, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xf7, 0x03, 0x0a, 0x10, 0x53, 0x68, 0x6f, 0x70, 0x45,
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x54,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x50, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x50, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x52, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x75, 0x6c,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x44,
0x61, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0c, 0x44, 0x61, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12,
0x2a, 0x0a, 0x06, 0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54,
0x79, 0x70, 0x65, 0x52, 0x06, 0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54,
0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65,
0x6d, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x12, 0x26, 0x0a, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69,
0x6d, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61,
0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x4e, 0x6f, 0x74,
0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d,
0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d,
0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68,
0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x56,
0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4e,
0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70,
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
0x65, 0x12, 0x2d, 0x0a, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x11, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61,
0x72, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61,
0x22, 0x60, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x61,
0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x44,
0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x68, 0x6f,
0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54,
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x53, 0x68,
0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c,
0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x05,
0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x68,
0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x57, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x68, 0x6f,
0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x06, 0x57, 0x65,
0x69, 0x67, 0x68, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x09, 0x43, 0x53, 0x50, 0x61, 0x79, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x12, 0x14,
0x0a, 0x05, 0x42, 0x75, 0x79, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x42,
0x75, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x45,
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20,
0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d,
0x22, 0x4b, 0x0a, 0x09, 0x53, 0x43, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a,
0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x8e, 0x01, 0x0a, 0x0e, 0x53,
0x43, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2c, 0x0a,
0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12,
0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55,
0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x2a, 0x0a,
0x10, 0x43, 0x53, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 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, 0x03, 0x52, 0x07,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49,
0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
0x64, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54,
0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x4e, 0x75,
0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20,
0x03, 0x28, 0x05, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x49,
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x49,
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a,
0x02, 0x54, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x54, 0x73, 0x22, 0x39, 0x0a,
0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x25, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x11, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x53, 0x50, 0x6c,
0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x41, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x41, 0x64, 0x64, 0x72,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41,
0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x41, 0x64, 0x64, 0x72, 0x73, 0x22, 0x2e,
0x0a, 0x08, 0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x64,
0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x64, 0x64, 0x72, 0x22, 0x11,
0x0a, 0x0f, 0x43, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f,
0x70, 0x22, 0x59, 0x0a, 0x0f, 0x53, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70,
0x53, 0x68, 0x6f, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72,
0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c,
0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x95, 0x02, 0x0a,
0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a,
0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e,
0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x17,
0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45,
0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43, 0x5f,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x03, 0x12,
0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x4f,
0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61,
0x52, 0x74, 0x74, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0x06, 0x12,
0x19, 0x0a, 0x15, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x63, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50,
0x52, 0x43, 0x5f, 0x4a, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67,
0x68, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x69, 0x70, 0x4c,
0x65, 0x76, 0x65, 0x6c, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x09, 0x12,
0x13, 0x0a, 0x0f, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x53, 0x49, 0x4d, 0x43, 0x6f,
0x64, 0x65, 0x10, 0x0a, 0x2a, 0x91, 0x05, 0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x48, 0x4f,
0x50, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10,
0xc4, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f,
0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xc5, 0x13, 0x12, 0x1c, 0x0a, 0x17,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41,
0x44, 0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc6, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x44, 0x4c,
0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc7, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59,
0x53, 0x48, 0x4f, 0x50, 0x10, 0xc8, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59, 0x53,
0x48, 0x4f, 0x50, 0x10, 0xc9, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47,
0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xca, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43,
0x48, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xcb, 0x13, 0x12, 0x1c,
0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50,
0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcc, 0x13, 0x12, 0x1c, 0x0a, 0x17,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45,
0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcd, 0x13, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43,
0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xce, 0x13, 0x12, 0x20, 0x0a, 0x1b,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45,
0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xcf, 0x13, 0x12, 0x1a,
0x0a, 0x15, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x49, 0x56, 0x45, 0x43, 0x4f,
0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd2, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd3,
0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x41,
0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd4, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c,
0x49, 0x53, 0x54, 0x10, 0xd5, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x43, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c, 0x49, 0x53,
0x54, 0x10, 0xd6, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
0x53, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd7, 0x13, 0x12, 0x18,
0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x4c, 0x41, 0x59, 0x45,
0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd8, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49, 0x50,
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xd9, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49, 0x50,
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xda, 0x13, 0x42, 0x24, 0x5a, 0x22, 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, 0x73, 0x68, 0x6f, 0x70, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x43,
0x53, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73,
0x74, 0x22, 0x9d, 0x04, 0x0a, 0x10, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x69,
0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x50, 0x69, 0x63,
0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47,
0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x44, 0x61, 0x79, 0x50, 0x6c, 0x61,
0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x44, 0x61,
0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x45, 0x78,
0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x68, 0x6f,
0x70, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06,
0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61,
0x72, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x54, 0x65, 0x6c, 0x43, 0x68,
0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x0b,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e,
0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c,
0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61,
0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52,
0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d,
0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d,
0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f,
0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70,
0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74,
0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x07,
0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x44, 0x61,
0x74, 0x61, 0x52, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x05, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f,
0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x22, 0x60, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70,
0x65, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43,
0x61, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
0x02, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65,
0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x68,
0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70,
0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70,
0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x53,
0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12,
0x2c, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x43, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a,
0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73,
0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x57,
0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x68,
0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x06, 0x57,
0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x09, 0x43, 0x53, 0x50, 0x61, 0x79, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x20, 0x0a,
0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x12,
0x14, 0x0a, 0x05, 0x42, 0x75, 0x79, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x42, 0x75, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61,
0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12,
0x20, 0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x06,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75,
0x6d, 0x22, 0x4b, 0x0a, 0x09, 0x53, 0x43, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c,
0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x55, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x2a,
0x0a, 0x10, 0x43, 0x53, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 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, 0x03, 0x52,
0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79,
0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x4e,
0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d,
0x65, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04,
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x08,
0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08,
0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e,
0x0a, 0x02, 0x54, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x54, 0x73, 0x22, 0x39,
0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x11, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x53, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54,
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x41, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x6c,
0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x41, 0x64, 0x64,
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e,
0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x41, 0x64, 0x64, 0x72, 0x73, 0x22,
0x2e, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x41,
0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x64, 0x64, 0x72, 0x22,
0x11, 0x0a, 0x0f, 0x43, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x53, 0x68,
0x6f, 0x70, 0x22, 0x59, 0x0a, 0x0f, 0x53, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69,
0x70, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x95, 0x02,
0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f,
0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12,
0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12,
0x17, 0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74,
0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43,
0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x03,
0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14,
0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74,
0x61, 0x52, 0x74, 0x74, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45,
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0x06,
0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x63, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4f,
0x50, 0x52, 0x43, 0x5f, 0x4a, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75,
0x67, 0x68, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x69, 0x70,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x09,
0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x53, 0x49, 0x4d, 0x43,
0x6f, 0x64, 0x65, 0x10, 0x0a, 0x2a, 0x91, 0x05, 0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65,
0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x48,
0x4f, 0x50, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f,
0x10, 0xc4, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xc5, 0x13, 0x12, 0x1c, 0x0a,
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
0x41, 0x44, 0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc6, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x44,
0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc7, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41,
0x59, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xc8, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59,
0x53, 0x48, 0x4f, 0x50, 0x10, 0xc9, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e,
0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xca, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58,
0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xcb, 0x13, 0x12,
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f,
0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcc, 0x13, 0x12, 0x1c, 0x0a,
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcd, 0x13, 0x12, 0x20, 0x0a, 0x1b, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58,
0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xce, 0x13, 0x12, 0x20, 0x0a,
0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xcf, 0x13, 0x12,
0x1a, 0x0a, 0x15, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x49, 0x56, 0x45, 0x43,
0x4f, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd2, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10,
0xd3, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50,
0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd4, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f,
0x4c, 0x49, 0x53, 0x54, 0x10, 0xd5, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x53, 0x43, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c, 0x49,
0x53, 0x54, 0x10, 0xd6, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x43, 0x53, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd7, 0x13, 0x12,
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x4c, 0x41, 0x59,
0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd8, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49,
0x50, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xd9, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49,
0x50, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xda, 0x13, 0x42, 0x24, 0x5a, 0x22, 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, 0x73, 0x68, 0x6f, 0x70, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -2836,19 +2856,20 @@ var file_shop_proto_depIdxs = []int32{
0, // 7: shop.SCShopExchange.RetCode:type_name -> shop.OpResultCode
17, // 8: shop.ShopExchangeInfo.ExType:type_name -> shop.ExchangeType
18, // 9: shop.ShopExchangeInfo.TelData:type_name -> shop.TelChargeData
0, // 10: shop.SCShopExchangeList.RetCode:type_name -> shop.OpResultCode
16, // 11: shop.SCShopExchangeList.Infos:type_name -> shop.ShopExchangeInfo
19, // 12: shop.SCShopExchangeList.Weight:type_name -> shop.ShopWeight
0, // 13: shop.SCPayInfo.RetCode:type_name -> shop.OpResultCode
24, // 14: shop.PayInfoList.ItemInfo:type_name -> shop.ItemInfo
25, // 15: shop.SCGetPayInfoList.Info:type_name -> shop.PayInfoList
29, // 16: shop.SCGetPlayerAddrs.Addrs:type_name -> shop.AddrData
2, // 17: shop.SCUpdateVipShop.info:type_name -> shop.ShopInfo
18, // [18:18] is the sub-list for method output_type
18, // [18:18] is the sub-list for method input_type
18, // [18:18] is the sub-list for extension type_name
18, // [18:18] is the sub-list for extension extendee
0, // [0:18] is the sub-list for field type_name
24, // 10: shop.ShopExchangeInfo.Items:type_name -> shop.ItemInfo
0, // 11: shop.SCShopExchangeList.RetCode:type_name -> shop.OpResultCode
16, // 12: shop.SCShopExchangeList.Infos:type_name -> shop.ShopExchangeInfo
19, // 13: shop.SCShopExchangeList.Weight:type_name -> shop.ShopWeight
0, // 14: shop.SCPayInfo.RetCode:type_name -> shop.OpResultCode
24, // 15: shop.PayInfoList.ItemInfo:type_name -> shop.ItemInfo
25, // 16: shop.SCGetPayInfoList.Info:type_name -> shop.PayInfoList
29, // 17: shop.SCGetPlayerAddrs.Addrs:type_name -> shop.AddrData
2, // 18: shop.SCUpdateVipShop.info:type_name -> shop.ShopInfo
19, // [19:19] is the sub-list for method output_type
19, // [19:19] is the sub-list for method input_type
19, // [19:19] is the sub-list for extension type_name
19, // [19:19] is the sub-list for extension extendee
0, // [0:19] is the sub-list for field type_name
}
func init() { file_shop_proto_init() }

View File

@ -160,6 +160,7 @@ message SCShopExchange{
OpResultCode RetCode = 1;
int64 CreateTs = 2;//
string OrderId = 3;//
int32 GoodsId = 4;//Id
}
//PACKET_CS_SHOP_EXCHANGELIST
@ -183,6 +184,7 @@ message ShopExchangeInfo{
int32 NotVipShopLimit = 15;//VIP限购总数
int32 ShopType = 16; //
repeated TelChargeData TelData = 17;
repeated ItemInfo Items = 18; //
}

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,10 @@ enum TOURNAMENTID{
PACKET_TM_SCTMSeasonRank = 2754;//
PACKET_TM_CSTMSeasonAward = 2755;//
PACKET_TM_SCTMSeasonAward = 2756;//
PACKET_TM_CSMatchList = 2757;//
PACKET_TM_SCMatchList = 2758;//
PACKET_TM_CSRoomList = 2759; //
PACKET_TM_SCRoomList = 2760; //
}
//
//PACKET_TM_CSTMInfo
@ -65,6 +69,7 @@ message TMInfo{
repeated string OnChannelName = 21;//
int32 ShowId = 22; //
int32 AwardNum = 23; //
int32 AudienceSwitch = 27; // 1 2
}
message MatchTypeInfo{
@ -188,3 +193,56 @@ message SCTMSeasonAward {
int32 Lv = 1;//
int32 Code = 2;//0 1
}
//PACKET_TM_CSMatchList
message CSMatchList{
int64 MatchId = 1; // id 0
int32 Tp = 2; // 0 1
}
message MatchPlayer{
int32 SnId = 1; // id
string Name = 2; //
string HeadUrl = 3;//
int32 UseRoleId = 4;//使id
int32 UseSkinId = 5; // id
int32 Rank = 6;//
int32 Score = 7;//
}
message MatchInfo{
int64 MatchId = 1; // id
int64 InstanceId = 2; // id
string Name = 3; //
int32 Round = 4; //
int32 TotalRound = 5; //
int32 RemainNum = 6; //
repeated MatchPlayer Players = 7; //
}
message SCTMMatchList{
repeated MatchInfo List = 1;
int64 MatchId = 2;
int32 Tp = 3;
}
//PACKET_TM_CSRoomList
message CSRoomList{
int64 Id = 1; // id 0
int32 Tp = 2; // 0 1
}
message MatchRoom{
int64 RoomId = 1; // id
int64 MatchId = 2; // id
int64 InstanceId = 3; // id
int32 Round = 4; //
int32 TotalRound = 5; //
repeated MatchPlayer Players = 7; //
}
message SCRoomList{
repeated MatchRoom List = 1;
int64 Id = 2;
int32 Tp = 3;
}

File diff suppressed because it is too large Load Diff

View File

@ -384,6 +384,7 @@ message ExchangeShop {
int32 NotVipShopLimit = 15;//VIP限购总数
int32 ShopType = 16; //
repeated TelChargeData TelData = 17;
repeated ItemInfo Items = 18;
}
message TelChargeData{
@ -489,6 +490,7 @@ message GameMatchDate {
int32 CardType = 24; //
int32 ShowId = 25; //
int32 AwardNum = 26; //
int32 AudienceSwitch = 27; // 1 2
}
// etcd /game/game_match
@ -615,7 +617,7 @@ message VIPcfg {
map<int64,int64> Award = 2; //
int32 VipEx = 3; // VIP经验
int64 Price = 4; //
repeated int32 Privilege1 = 5; //1 VIP比赛场免费次数
map<int64,int64> Privilege1 = 5; //1 VIP比赛场免费次数
repeated int32 Privilege2 = 6; // 0 1
repeated int32 Privilege3 = 7;
int32 Privilege4 = 8;
@ -628,6 +630,7 @@ message VIPcfg {
int32 ShopId2 = 15;
int32 ShopId7 = 16;
int32 MatchFreeTimes = 17; // vip比赛场免费次数
map<int64,int64> Privilege9 = 18; // vip免费礼包vip等级领取一次
}
// etcd /game/VIPcfg VIP配置
@ -881,3 +884,24 @@ message AnnouncerLogInfo{
int32 ItemId = 4; //ID
int32 TypeId = 5; //1- 2-
}
// etcd /game/guide_config
message GuideConfig {
string Platform = 1; //
int32 On = 2; // 1 2
int32 Skip = 3; // 1 2
}
// etcd /game/match_audience
message MatchAudience {
string Platform = 1; //
int32 SnId = 2; // ID
int64 Ts = 3; //
}
// etcd /game/spirit
message SpiritConfig {
string Platform = 1; //
int32 On = 2; // 1 2
string Url = 3;
}

2
public

@ -1 +1 @@
Subproject commit 13589ad17018a4a9d50fdc9d8223e3ccf492a0ce
Subproject commit 07c189d652b84910258fa33eb3214d39c53edec4

77
srvdata/db_vipshow.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_VIPShowMgr = &DB_VIPShowMgr{
Datas: &server.DB_VIPShowArray{},
pool: make(map[int32]*server.DB_VIPShow),
}
type DB_VIPShowMgr struct {
Datas *server.DB_VIPShowArray
pool map[int32]*server.DB_VIPShow
}
func (this *DB_VIPShowMgr) unmarshal(data []byte) error {
err := proto.Unmarshal(data, this.Datas)
if err == nil {
this.arrangeData()
}
return err
}
func (this *DB_VIPShowMgr) reunmarshal(data []byte) error {
newDatas := &server.DB_VIPShowArray{}
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_VIPShowMgr) 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_VIPShowMgr) GetData(id int32) *server.DB_VIPShow {
if data, ok := this.pool[id]; ok {
return data
}
return nil
}
func init() {
DataMgr.register("DB_VIPShow.dat", &ProtobufDataLoader{dh: PBDB_VIPShowMgr})
}

View File

@ -1,31 +0,0 @@
71001,71002,71003,72001,72002,72003,72004,72005,73001,73002,73003,73004,74001,74002,74003,74004,74005,74006,75001,75002,75003,75004,75005,75006,76001,76002,76003,76004,76005,76006,77001,77002,77003,77004,77005,78001,78002,78003,79001,79002,79003,79004,79005,77006
5001,5002,5003,5004,5005,5006
"79003":NumberLong(1),
"73001":NumberLong(24),
"74006":NumberLong(1),
"79005":NumberLong(1),
"76006":NumberLong(16),
"74003":NumberLong(1),
"72004":NumberLong(1),
"73004":NumberLong(1)
"30008":NumberLong(712),
"30009":NumberLong(97),
"30010":NumberLong(20),
"30011":NumberLong(3)
"5001":NumberLong(2),
"5002":NumberLong(18),
"5003":NumberLong(6),
"5004":NumberLong(13),
"5005":NumberLong(13),
"5006":NumberLong(4)
30008 712
30009 97
30010 20
30011 3

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,15 @@ package main
import (
"fmt"
"time"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/game/common"
"mongo.games.com/game/proto"
"mongo.games.com/game/protocol/gamehall"
"mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
)
type CSHundredSceneGetPlayerNumPacketFactory struct {
@ -25,7 +28,7 @@ func (this *CSHundredSceneGetPlayerNumHandler) Process(s *netlib.Session, packet
if msg, ok := data.(*gamehall.CSHundredSceneGetPlayerNum); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p != nil {
nums := HundredSceneMgrSington.GetPlayerNums(p, msg.GetGameId(), msg.GetGameModel())
nums := HundredSceneMgrSingleton.GetPlayerNums(p, msg.GetGameId(), msg.GetGameModel())
pack := &gamehall.SCHundredSceneGetPlayerNum{
Nums: nums,
}
@ -60,7 +63,7 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
}
oldPlatform := p.Platform
switch msg.GetOpType() {
case HundredSceneOp_Enter:
case HundredSceneOPEnter:
//pt := PlatformMgrSingleton.GetPackageTag(p.PackageID)
//if pt != nil && pt.IsForceBind == 1 {
// if p.BeUnderAgentCode == "" || p.BeUnderAgentCode == "0" {
@ -79,13 +82,13 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
params := msg.GetOpParams()
if len(params) != 0 {
roomId = params[0]
name, ok := HundredSceneMgrSington.GetPlatformNameBySceneId(roomId)
platform := SceneMgrSingleton.GetPlatformBySceneId(int(roomId))
if p.IsRob {
//机器人先伪装成对应平台的用户
if ok {
p.Platform = name
if platform != "" {
p.Platform = platform
}
} else if p.GMLevel > 0 && p.Platform == name { //允许GM直接按房间ID进场
} else if p.GMLevel > 0 && p.Platform == platform { //允许GM直接按房间ID进场
roomId = params[0]
}
}
@ -152,7 +155,7 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
}
}
ret = HundredSceneMgrSington.PlayerEnter(p, msg.GetId())
ret = HundredSceneMgrSingleton.PlayerEnter(p, msg.GetId())
if p.scene != nil {
pack.OpParams = append(pack.OpParams, msg.GetId())
//TODO 有房间还进入失败尝试returnroom
@ -161,9 +164,9 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
return nil
}
}
case HundredSceneOp_Leave:
ret = HundredSceneMgrSington.PlayerTryLeave(p)
case HundredSceneOp_Change:
case HundredSceneOPLeave:
ret = HundredSceneMgrSingleton.PlayerTryLeave(p)
case HundredSceneOPChange:
/*var exclude int32
if p.scene != nil {
exclude = int32(p.scene.sceneId)
@ -172,10 +175,10 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
if len(params) != 0 {
exclude = params[0]
}
if HundredSceneMgrSington.PlayerInChanging(p) { //换桌中
if HundredSceneMgrSingleton.PlayerInChanging(p) { //换桌中
return nil
}
ret = HundredSceneMgrSington.PlayerTryChange(p, msg.GetId(), exclude)*/
ret = HundredSceneMgrSingleton.PlayerTryChange(p, msg.GetId(), exclude)*/
}
done:
//机器人要避免身上的平台标记被污染
@ -210,38 +213,38 @@ func (this *CSGameObservePacketFactory) CreatePacket() interface{} {
func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSGameObserveHandler Process recv ", data)
if _, ok := data.(*gamehall.CSGameObserve); ok {
if msg, ok := data.(*gamehall.CSGameObserve); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p != nil {
//if msg.GetStartOrEnd() {
// gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
// pack := &gamehall.SCGameSubList{}
// statePack := &gamehall.SCGameState{}
// scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
// for _, value := range scenes {
// pack.List = append(pack.List, &gamehall.GameSubRecord{
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
// NewLog: proto.Int32(-1),
// LogCnt: proto.Int(len(value.GameLog)),
// TotleLog: value.GameLog,
// })
// leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
// if leftTime < 0 {
// leftTime = 0
// }
// statePack.List = append(statePack.List, &gamehall.GameState{
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
// Ts: proto.Int64(leftTime),
// Sec: proto.Int32(value.StateSec),
// })
// }
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
// logger.Logger.Trace("SCGameSubList:", pack)
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
// logger.Logger.Trace("SCGameState:", statePack)
//} else {
// gameStateMgr.PlayerClear(p)
//}
if msg.GetStartOrEnd() {
gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
pack := &gamehall.SCGameSubList{}
statePack := &gamehall.SCGameState{}
scenes := HundredSceneMgrSingleton.GetPlatformScene(p.Platform, msg.GetGameId())
for _, value := range scenes {
pack.List = append(pack.List, &gamehall.GameSubRecord{
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
NewLog: proto.Int32(-1),
LogCnt: proto.Int(len(value.GameLog)),
TotleLog: value.GameLog,
})
leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
if leftTime < 0 {
leftTime = 0
}
statePack.List = append(statePack.List, &gamehall.GameState{
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
Ts: proto.Int64(leftTime),
Sec: proto.Int32(value.StateSec),
})
}
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
logger.Logger.Trace("SCGameSubList:", pack)
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
logger.Logger.Trace("SCGameState:", statePack)
} else {
gameStateMgr.PlayerClear(p)
}
}
}
return nil
@ -268,7 +271,7 @@ func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data
// // gameid == common.GameId_Avengers || gameid == common.GameId_EasterIsland {
// // gameStateMgr.PlayerRegiste(p, msg.GetGameId(), true)
// // pack := &gamehall.SCHundredSceneGetGameJackpot{}
// // scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
// // scenes := HundredSceneMgrSingleton.GetPlatformScene(p.Platform, msg.GetGameId())
// // for _, v := range scenes {
// // jpfi := &gamehall.GameJackpotFundInfo{
// // GameFreeId: proto.Int32(v.dbGameFree.GetId()),

View File

@ -1748,7 +1748,7 @@ func (this *CSPlayerVIPDrawHandler) Process(s *netlib.Session, packetid int, dat
return nil
}
p.VIPDraw(msg.GetId())
p.VIPDraw(msg.GetId(), msg.GetVip())
}
return nil
}
@ -3027,6 +3027,119 @@ func CSPopUpWindowsConfig(s *netlib.Session, packetId int, data interface{}, sid
}), "Api_PopupWindowsConfig").Start()
return nil
}
func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid int64) error {
logger.Logger.Tracef("CSUpdateAttribute %v", data)
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
return nil
}
msg, ok := data.(*player_proto.CSUpdateAttribute)
if !ok {
return nil
}
stepId := p.GuideStep + 1
pack := &player_proto.SCUpdateAttribute{
OpRetCode: player_proto.OpResultCode_OPRC_Error,
Tp: msg.GetTp(),
Param: msg.GetParam(),
}
send := func() {
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCUpdateAttribute), pack)
logger.Logger.Tracef("SCUpdateAttribute %v", pack)
// 日志
if pack.OpRetCode == player_proto.OpResultCode_OPRC_Sucess {
switch msg.GetTp() {
case common.AttributeGuideStep, common.AttributeGuideSkip:
d := model.CustomData{
Event: "guide",
Platform: p.Platform,
GuideTp: msg.GetTp(),
N: int64(stepId),
}
b, _ := json.Marshal(d)
LogChannelSingleton.WriteLog(&model.ClientLogMysql{
Data: string(b),
Platform: p.Platform,
Snid: p.SnId,
Ts: time.Now().Unix(),
CreateTs: p.CreateTime.Unix(),
})
}
}
}
switch msg.GetTp() {
case common.AttributeGuideStep:
if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 || p.GuideStep < 0 {
return nil
}
if PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.GetOn() != common.On {
pack.OpRetCode = player_proto.OpResultCode_OPRC_Guide_Close
send()
return nil
}
if p.GuideStep >= model.GameParamData.GuideStepMaxNum {
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_End
send()
return nil
}
if int64(p.GuideStep) >= msg.GetParam()[0] {
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_Finish
send()
return nil
}
if int64(p.GuideStep)+1 < msg.GetParam()[0] {
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_Front
send()
return nil
}
p.GuideStep = int32(msg.GetParam()[0])
stepId = p.GuideStep
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
// 获得10v卡
if p.GuideStep == 2 {
BagMgrSingleton.AddItemsV2(&ItemParam{
P: p,
Change: []*Item{
{
ItemId: common.ItemIDVCard,
ItemNum: 10,
},
},
GainWay: common.GainWayGuide,
Operator: "system",
Remark: "新手引导奖励",
})
}
return nil
case common.AttributeGuideSkip:
if PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.GetSkip() != common.On {
pack.OpRetCode = player_proto.OpResultCode_OPRC_Guide_SkipClose
send()
return nil
}
if p.GuideStep >= 0 && p.GuideStep < model.GameParamData.GuideStepMaxNum {
p.GuideStep = -1 // 跳过引导为 -1
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
return nil
}
case common.AttributeGuideTest:
if !common.Config.IsDevMode {
return nil
}
p.GuideStep = int32(msg.GetParam()[0])
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
return nil
}
return nil
}
func init() {
// 用户信息
common.Register(int(player_proto.PlayerPacketID_PACKET_CS_PLAYERDATA), player_proto.CSPlayerData{}, CSPlayerData)
@ -3058,4 +3171,6 @@ func init() {
common.Register(int(player_proto.PlayerPacketID_PACKET_CSAwardLog), player_proto.CS_AwardLog{}, CSAwardLog)
//弹窗配置
common.Register(int(player_proto.PlayerPacketID_PACKET_CSPopUpWindowsConfig), player_proto.CSPopUpWindowsConfig{}, CSPopUpWindowsConfig)
// 更新属性;新手引导阶段
common.Register(int(player_proto.PlayerPacketID_PACKET_CSUpdateAttribute), player_proto.CSUpdateAttribute{}, CSUpdateAttribute)
}

View File

@ -13,32 +13,32 @@ import (
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
gamehall_proto "mongo.games.com/game/protocol/gamehall"
login_proto "mongo.games.com/game/protocol/login"
player_proto "mongo.games.com/game/protocol/player"
server_proto "mongo.games.com/game/protocol/server"
gamehallproto "mongo.games.com/game/protocol/gamehall"
loginproto "mongo.games.com/game/protocol/login"
playerproto "mongo.games.com/game/protocol/player"
serverproto "mongo.games.com/game/protocol/server"
"mongo.games.com/game/srvdata"
)
func init() {
// 销毁房间
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWDestroyScene{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWDestroyScene{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive GWDestroyScene:", pack)
if msg, ok := pack.(*server_proto.GWDestroyScene); ok {
if msg, ok := pack.(*serverproto.GWDestroyScene); ok {
SceneMgrSingleton.DestroyScene(int(msg.GetSceneId()), msg.GetIsCompleted())
}
return nil
}))
// 离开房间
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWPlayerLeave{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWPlayerLeave{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
if msg, ok := pack.(*server_proto.GWPlayerLeave); ok {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
if msg, ok := pack.(*serverproto.GWPlayerLeave); ok {
logger.Logger.Trace("receive GWPlayerLeave:", msg.GetPlayerId())
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
if scene != nil {
@ -68,7 +68,7 @@ func init() {
}
}
case scene.IsHundredScene():
if !HundredSceneMgrSington.PlayerLeave(p, int(msg.GetReason())) {
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]",
p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
}
@ -228,12 +228,12 @@ func init() {
}))
// 观众离开房间
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWPlayerLeave{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWPlayerLeave{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive PACKET_GW_AUDIENCELEAVE GWPlayerLeave:", pack)
if msg, ok := pack.(*server_proto.GWPlayerLeave); ok {
if msg, ok := pack.(*serverproto.GWPlayerLeave); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
if scene != nil {
p := PlayerMgrSington.GetPlayerBySnId(msg.GetPlayerId())
@ -270,12 +270,12 @@ func init() {
}))
// 房间游戏开始
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENESTART), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWSceneStart{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENESTART), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWSceneStart{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENESTART), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENESTART), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTART GWSceneStart:", pack)
if msg, ok := pack.(*server_proto.GWSceneStart); ok {
if msg, ok := pack.(*serverproto.GWSceneStart); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
if scene != nil {
scene.starting = msg.GetStart()
@ -299,12 +299,12 @@ func init() {
// 房间游戏状态
// 捕鱼
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENESTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWSceneState{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENESTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWSceneState{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENESTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENESTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTATE GWSceneState:", pack)
if msg, ok := pack.(*server_proto.GWSceneState); ok {
if msg, ok := pack.(*serverproto.GWSceneState); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
if scene != nil {
scene.state = msg.GetCurrState()
@ -315,12 +315,12 @@ func init() {
}))
// 用户状态同步 flag
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWPlayerFlag{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWPlayerFlag{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive GWPlayerFlag:", pack)
if msg, ok := pack.(*server_proto.GWPlayerFlag); ok {
if msg, ok := pack.(*serverproto.GWPlayerFlag); ok {
player := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
if player != nil {
player.flag = msg.GetFlag()
@ -330,12 +330,12 @@ func init() {
}))
// 房间服务器状态切换
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.ServerStateSwitch{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.ServerStateSwitch{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GB_STATE_SWITCH ServerStateSwitch:", pack)
if sr, ok := pack.(*server_proto.ServerStateSwitch); ok {
if sr, ok := pack.(*serverproto.ServerStateSwitch); ok {
srvid := int(sr.GetSrvId())
gameSess := GameSessMgrSington.GetGameSess(srvid)
if gameSess != nil {
@ -360,13 +360,13 @@ func init() {
// 游戏服务器的系统广播
// 捕鱼
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWNewNotice{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWNewNotice{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session,
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session,
packetid int, pack interface{}) error {
logger.Logger.Trace("receive GWNewNotice:", pack)
if msg, ok := pack.(*server_proto.GWNewNotice); ok {
if msg, ok := pack.(*serverproto.GWNewNotice); ok {
//立即发送改为定期发送,控制下广播包的频度
HorseRaceLampMgrSington.PushGameHorseRaceLamp(msg.GetCh(), msg.GetPlatform(), msg.GetContent(), int32(msg.GetMsgtype()), msg.GetIsrob(), msg.GetPriority())
}
@ -374,13 +374,13 @@ func init() {
}))
// 同步每局游戏那些玩家一起玩的
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWScenePlayerLog{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWScenePlayerLog{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.HandlerWrapper(func(s *netlib.Session,
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.HandlerWrapper(func(s *netlib.Session,
packetid int, pack interface{}) error {
logger.Logger.Trace("receive GWScenePlayerLog:", pack)
if msg, ok := pack.(*server_proto.GWScenePlayerLog); ok {
if msg, ok := pack.(*serverproto.GWScenePlayerLog); ok {
sceneLimitMgr.ReceiveData(msg.GetGameId(), msg.GetSnids())
}
return nil
@ -388,11 +388,11 @@ func init() {
// 强制离开房间
// 返回房间失败
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWPlayerForceLeave{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWPlayerForceLeave{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
if msg, ok := pack.(*server_proto.GWPlayerForceLeave); ok {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
if msg, ok := pack.(*serverproto.GWPlayerForceLeave); ok {
logger.Logger.Warn("receive GWPlayerForceLeave:", msg)
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
if scene != nil {
@ -406,7 +406,7 @@ func init() {
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [coinscene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
}
case scene.IsHundredScene():
if !HundredSceneMgrSington.PlayerLeave(p, int(msg.GetReason())) {
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
}
case scene.IsMatchScene():
@ -438,12 +438,12 @@ func init() {
//1.同步玩家游戏场内的实时金币
//2.触发相关任务:统计有效下注金币数,赢取金币数,牌局次数等
//3.黑名单处理
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWPlayerData{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWPlayerData{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive GWPlayerBet:", pack)
if msg, ok := pack.(*server_proto.GWPlayerData); ok {
if msg, ok := pack.(*serverproto.GWPlayerData); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
if scene == nil {
return nil
@ -573,13 +573,13 @@ func init() {
}))
//推送游戏的状态
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_GAMESTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWGameState{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_GAMESTATE), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWGameState{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_GAMESTATE), netlib.HandlerWrapper(func(s *netlib.Session,
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_GAMESTATE), netlib.HandlerWrapper(func(s *netlib.Session,
packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_GAMESTATE GWGameState:", pack)
if msg, ok := pack.(*server_proto.GWGameState); ok {
if msg, ok := pack.(*serverproto.GWGameState); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
if scene != nil {
scene.State = msg.GetState()
@ -591,38 +591,38 @@ func init() {
if leftTime < 0 {
leftTime = 0
}
pack := &gamehall_proto.SCGameState{}
pack.List = append(pack.List, &gamehall_proto.GameState{
pack := &gamehallproto.SCGameState{}
pack.List = append(pack.List, &gamehallproto.GameState{
GameFreeId: proto.Int32(scene.dbGameFree.GetId()),
Ts: proto.Int64(leftTime),
Sec: proto.Int32(scene.StateSec),
})
gameStateMgr.BrodcastGameState(int32(scene.gameId), scene.limitPlatform.IdStr,
int(gamehall_proto.GameHallPacketID_PACKET_SC_GAMESTATE), pack)
int(gamehallproto.GameHallPacketID_PACKET_SC_GAMESTATE), pack)
}
}
}
return nil
}))
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWGameJackList{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWGameJackList{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTLIST GWGameJackList:", pack)
if msg, ok := pack.(*server_proto.GWGameJackList); ok {
if msg, ok := pack.(*serverproto.GWGameJackList); ok {
FishJackListMgr.Insert(msg.GetCoin(), msg.GetSnId(), msg.GetRoomId(), msg.GetJackType(), msg.GetGameId(),
msg.GetPlatform(), msg.GetChannel(), msg.GetName())
}
return nil
}))
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWGameJackCoin{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWGameJackCoin{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTCOIN GWGameJackCoin:", pack)
if msg, ok := pack.(*server_proto.GWGameJackCoin); ok {
if msg, ok := pack.(*serverproto.GWGameJackCoin); ok {
for i, pl := range msg.Platform {
FishJackpotCoinMgr.Jackpot[pl] = msg.Coin[i]
}
@ -631,12 +631,12 @@ func init() {
}))
//强制换桌
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.GWChangeSceneEvent{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.GWChangeSceneEvent{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
logger.Logger.Trace("receive SSPacketID_PACKET_GW_CHANGESCENEEVENT GWChangeSceneEvent:", pack)
if msg, ok := pack.(*server_proto.GWChangeSceneEvent); ok {
if msg, ok := pack.(*serverproto.GWChangeSceneEvent); ok {
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
if scene != nil {
scene.PlayerTryChange()
@ -646,13 +646,13 @@ func init() {
}))
//玩家中转消息
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.PacketFactoryWrapper(func() interface{} {
return &server_proto.SSRedirectToPlayer{}
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.PacketFactoryWrapper(func() interface{} {
return &serverproto.SSRedirectToPlayer{}
}))
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.HandlerWrapper(func(s *netlib.Session,
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.HandlerWrapper(func(s *netlib.Session,
packetid int, pack interface{}) error {
logger.Logger.Trace("SSRedirectToPlayer Process recv ", pack)
if msg, ok := pack.(*server_proto.SSRedirectToPlayer); ok {
if msg, ok := pack.(*serverproto.SSRedirectToPlayer); ok {
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
if p == nil {
return nil
@ -670,13 +670,13 @@ type CSPMCmdHandler struct {
}
func (this *CSPMCmdPacketFactory) CreatePacket() interface{} {
pack := &player_proto.CSPMCmd{}
pack := &playerproto.CSPMCmd{}
return pack
}
func (this *CSPMCmdHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSPMCmdHandler Process recv ", data)
if msg, ok := data.(*player_proto.CSPMCmd); ok {
if msg, ok := data.(*playerproto.CSPMCmd); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Trace("CSPMCmdHandler p == nil")
@ -729,13 +729,13 @@ type CSRobotChgDataHandler struct {
}
func (this *CSRobotChgDataPacketFactory) CreatePacket() interface{} {
pack := &player_proto.CSRobotChgData{}
pack := &playerproto.CSRobotChgData{}
return pack
}
func (this *CSRobotChgDataHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSRobotChgDataHandler Process recv ", data)
if _, ok := data.(*player_proto.CSRobotChgData); ok {
if _, ok := data.(*playerproto.CSRobotChgData); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Trace("CSRobotChgDataHandler p == nil")
@ -756,13 +756,13 @@ type CSAccountInvalidHandler struct {
}
func (this *CSAccountInvalidPacketFactory) CreatePacket() interface{} {
pack := &login_proto.CSAccountInvalid{}
pack := &loginproto.CSAccountInvalid{}
return pack
}
func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSAccountInvalidHandler Process recv ", data)
if _, ok := data.(*login_proto.CSAccountInvalid); ok {
if _, ok := data.(*loginproto.CSAccountInvalid); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p != nil && p.IsRobot() {
snid := p.SnId
@ -789,12 +789,12 @@ func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, da
}
func init() {
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdPacketFactory{})
common.RegisterHandler(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdHandler{})
netlib.RegisterFactory(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdPacketFactory{})
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataPacketFactory{})
common.RegisterHandler(int(playerproto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataHandler{})
netlib.RegisterFactory(int(playerproto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataPacketFactory{})
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{})
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{})
common.RegisterHandler(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{})
netlib.RegisterFactory(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{})
}

View File

@ -311,6 +311,7 @@ func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data
if !f {
pack := &shop.SCShopExchange{
RetCode: shop.OpResultCode_OPRC_ExchangeLimitAcc,
GoodsId: msg.GetGoodsId(),
}
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
return nil

View File

@ -1,11 +1,11 @@
package main
import (
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/game/common"
"mongo.games.com/game/protocol/tournament"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"sort"
)
func CSTMInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
@ -94,9 +94,135 @@ func CSSignRace(s *netlib.Session, packetid int, data interface{}, sid int64) er
return nil
}
func CSMatchList(s *netlib.Session, packetId int, data interface{}, sid int64) error {
logger.Logger.Trace("CSMatchList ", data)
msg, ok := data.(*tournament.CSMatchList)
if !ok {
return nil
}
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warnf("CSMatchList p == nil.")
return nil
}
pack := &tournament.SCTMMatchList{
MatchId: msg.GetMatchId(),
Tp: msg.GetTp(),
}
audience := msg.GetTp() == 1
list := TournamentMgr.GetTmMatch(p.Platform, int32(msg.GetMatchId()), p.LastChannel, audience, 0)
// 开始时间排序
sort.Slice(list, func(i, j int) bool {
return list[i].StartTime < list[j].StartTime
})
for _, v := range list {
round := TournamentMgr.GetRound(v.SortId)
d := &tournament.MatchInfo{
MatchId: int64(v.TMId),
InstanceId: v.SortId,
Name: v.gmd.MatchName,
Round: round,
TotalRound: v.GetTotalRound(),
RemainNum: TournamentMgr.GetRemainNum(v.SortId),
}
for _, v := range TournamentMgr.GetRemainPlayer(v.SortId) {
var name, headUrl string
p := PlayerMgrSington.GetPlayerBySnId(v.SnId)
if p != nil {
name = p.Name
headUrl = p.HeadUrl
}
d.Players = append(d.Players, &tournament.MatchPlayer{
SnId: v.SnId,
Name: name,
HeadUrl: headUrl,
UseRoleId: v.RoleId,
UseSkinId: v.SkinId,
Rank: v.Rank,
Score: v.Grade,
})
}
sort.Slice(d.Players, func(i, j int) bool {
if d.Players[i].Score > d.Players[j].Score {
return true
}
if d.Players[i].Score < d.Players[j].Score {
return false
}
return d.Players[i].SnId < d.Players[j].SnId
})
pack.List = append(pack.List, d)
}
p.SendToClient(int(tournament.TOURNAMENTID_PACKET_TM_SCMatchList), pack)
logger.Logger.Tracef("SCMatchList %v", pack)
return nil
}
func CSRoomList(s *netlib.Session, packetId int, data interface{}, sid int64) error {
logger.Logger.Trace("CSRoomList ", data)
msg, ok := data.(*tournament.CSRoomList)
if !ok {
return nil
}
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warnf("CSRoomList p == nil.")
return nil
}
pack := &tournament.SCRoomList{
Id: msg.GetId(),
Tp: msg.GetTp(),
}
audience := msg.GetTp() == 1
scenes := TournamentMgr.GetTmRoom(p.Platform, 0, p.LastChannel, audience, msg.GetId())
for _, v := range scenes {
tm := TournamentMgr.GetTm(v.matchId)
if tm == nil {
continue
}
room := &tournament.MatchRoom{
RoomId: int64(v.sceneId),
MatchId: int64(tm.TMId),
InstanceId: tm.SortId,
Round: TournamentMgr.GetRound(tm.SortId),
TotalRound: tm.GetTotalRound(),
}
for _, v := range v.players {
if v.matchCtx == nil {
continue
}
d := &tournament.MatchPlayer{
SnId: v.matchCtx.copySnid,
Name: v.Name,
HeadUrl: v.HeadUrl,
UseRoleId: v.matchCtx.copyRoleId,
UseSkinId: v.matchCtx.copySkinId,
Rank: v.matchCtx.rank,
Score: v.matchCtx.grade,
}
room.Players = append(room.Players, d)
}
pack.List = append(pack.List, room)
}
p.SendToClient(int(tournament.TOURNAMENTID_PACKET_TM_SCRoomList), pack)
logger.Logger.Tracef("SCRoomList %v", pack)
return nil
}
func init() {
// 比赛信息列表
// 比赛配置列表
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSTMInfo), tournament.CSTMInfo{}, CSTMInfo)
// 比赛报名
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSSignRace), tournament.CSSignRace{}, CSSignRace)
// 比赛中比赛列表
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSMatchList), tournament.CSMatchList{}, CSMatchList)
// 比赛中房间列表
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSRoomList), tournament.CSRoomList{}, CSRoomList)
}

View File

@ -128,6 +128,7 @@ func (this *AwardLogManager) Update() {
func (this *AwardLogManager) Shutdown() {
this.Save()
module.UnregisteModule(this)
}
func (this *AwardLogManager) OnHourTimer() {

View File

@ -592,25 +592,47 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
p.dirty = true
}
}
jybLog := &model.JybLog{
Platform: p.Platform,
Id: jyb.JybId.Hex(),
Ts: time.Now().Unix(),
SnId: p.SnId,
Tp: jyb.CodeType,
Name: jyb.Name,
}
for _, v := range jyb.Award.Item {
//if _, code := BagMgrSingleton.UpBagInfo(p.SnId, p.Platform, v.ItemId, v.ItemNum); code == bag.OpResultCode_OPRC_Sucess { // 需修改
pack.GainItem.ItemId = append(pack.GainItem.ItemId, &playerproto.ItemInfo{
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
jybLog.Award = append(jybLog.Award, &model.JybItem{
Id: v.ItemId,
Num: int32(v.ItemNum),
})
}
if jyb.Award.Coin > 0 {
p.AddCoin(jyb.Award.Coin, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
}
jybLog.Award = append(jybLog.Award, &model.JybItem{
Id: common.ItemIDCoin,
Num: int32(jyb.Award.Coin),
})
}
if jyb.Award.Diamond > 0 {
p.AddDiamond(jyb.Award.Diamond, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
}
jybLog.Award = append(jybLog.Award, &model.JybItem{
Id: common.ItemIDDiamond,
Num: int32(jyb.Award.Coin),
})
}
// 领取日志
LogChannelSingleton.WriteLog(jybLog)
p.dirty = true
pack.GainItem.Coin = jyb.Award.Coin
pack.GainItem.Diamond = jyb.Award.Diamond

View File

@ -10,8 +10,9 @@ import (
"mongo.games.com/goserver/core/transact"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
hall_proto "mongo.games.com/game/protocol/gamehall"
hallproto "mongo.games.com/game/protocol/gamehall"
"mongo.games.com/game/protocol/server"
"mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
@ -19,12 +20,7 @@ import (
var CoinSceneMgrSingleton = &CoinSceneMgr{
playerChanging: make(map[int32]int32),
//按平台管理
scenesOfPlatform: make(map[string]map[int32]*CoinScenePool),
platformOfScene: make(map[int]string),
//按组管理
scenesOfGroup: make(map[int32]map[int32]*CoinScenePool),
groupOfScene: make(map[int]int32),
}
type CreateRoomCache struct {
@ -33,16 +29,8 @@ type CreateRoomCache struct {
}
type CoinSceneMgr struct {
playerChanging map[int32]int32 // snid:gamefreeid 换桌中的玩家
//按平台管理
scenesOfPlatform map[string]map[int32]*CoinScenePool // platform:gamefreeid
platformOfScene map[int]string // sceneid:platform; 创建房间后记录房间所在平台
//按组管理
scenesOfGroup map[int32]map[int32]*CoinScenePool // groupid:gamefreeid
groupOfScene map[int]int32 // sceneid:groupid;
scenesOfPlatform map[string]map[int32]*CoinScenePool // 场次房间池 platform:gamefreeid
playerChanging map[int32]int32 // 换桌中的玩家 snid:gamefreeid
//延迟创建房间列表
delayCache []*CreateRoomCache // 待预创建房间
}
@ -50,215 +38,126 @@ type CoinSceneMgr struct {
// GetCoinScenePool 获取一个场景池
// plt 平台id
// id 场次id
func (csm *CoinSceneMgr) GetCoinScenePool(plt string, id int32) *CoinScenePool {
func (m *CoinSceneMgr) GetCoinScenePool(plt string, id int32) *CoinScenePool {
gf := PlatformMgrSingleton.GetGameFree(plt, id)
if gf == nil {
if gf == nil || gf.DbGameFree == nil {
return nil
}
groupId := gf.GetGroupId()
if groupId != 0 {
if _, ok := csm.scenesOfGroup[groupId]; ok {
if csp, ok := csm.scenesOfGroup[groupId][id]; ok {
return csp
}
}
} else {
if ss, ok := csm.scenesOfPlatform[plt]; ok {
if ss, ok := m.scenesOfPlatform[plt]; ok {
if csp, ok := ss[id]; ok && csp != nil {
return csp
}
}
}
if gf.GetDbGameFree() == nil {
return nil
}
// 创建了一个新的
// 应该是走不到这里,因为模块启动时所有场次都创建了房间池
pool := newCoinScenePool(plt, groupId, gf.GetDbGameFree())
if groupId != 0 {
v, ok := csm.scenesOfGroup[groupId]
// 模块启动时所有场次都创建了房间池
pool := newCoinScenePool(plt, gf.GetDbGameFree())
v, ok := m.scenesOfPlatform[plt]
if !ok || v == nil {
csm.scenesOfGroup[groupId] = make(map[int32]*CoinScenePool)
}
csm.scenesOfGroup[groupId][id] = pool
} else {
v, ok := csm.scenesOfPlatform[plt]
if !ok || v == nil {
csm.scenesOfPlatform[plt] = make(map[int32]*CoinScenePool)
}
csm.scenesOfPlatform[plt][id] = pool
m.scenesOfPlatform[plt] = make(map[int32]*CoinScenePool)
}
m.scenesOfPlatform[plt][id] = pool
return pool
}
func (csm *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, groupID int32,
dbGameFree *server.DB_GameFree) {
func (m *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, dbGameFree *server.DB_GameFree) {
gf := PlatformMgrSingleton.GetGameFree(platform, id)
if gf == nil || gf.GetDbGameFree() == nil {
return nil, 0, nil
}
groupId := gf.GetGroupId()
var ss map[int32]*CoinScenePool
var ok bool
if groupId != 0 {
ss, ok = csm.scenesOfGroup[groupId]
if !ok {
ss = make(map[int32]*CoinScenePool)
csm.scenesOfGroup[groupId] = ss
}
return ss, groupId, gf.GetDbGameFree()
return nil, nil
}
ss, ok = csm.scenesOfPlatform[platform]
if !ok {
ss, ok := m.scenesOfPlatform[platform]
if !ok || ss == nil {
ss = make(map[int32]*CoinScenePool)
csm.scenesOfPlatform[platform] = ss
m.scenesOfPlatform[platform] = ss
}
return ss, 0, gf.GetDbGameFree()
return ss, gf.GetDbGameFree()
}
// PlayerEnter 玩家进入房间池
func (csm *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hall_proto.OpResultCode {
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
func (m *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hallproto.OpResultCode {
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
if p.isDelete { //删档用户不让进游戏
return hall_proto.OpResultCode_OPRC_RoomHadClosed
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
// 玩家已经在房间里了
if m.InCoinScene(p) {
logger.Logger.Warnf("CoinSceneMgr PlayerEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
return hallproto.OpResultCode_OPRC_Error
}
//多平台支持
platform := p.GetPlatform()
if platform == nil {
return hall_proto.OpResultCode_OPRC_RoomHadClosed
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
// 玩家已经在房间里了
if p.scene != nil {
logger.Logger.Warnf("(csm *CoinSceneMgr) PlayerEnter snid:%v find in gameId:%v gamefreeid:%v", p.SnId, p.scene.gameId, id)
return hall_proto.OpResultCode_OPRC_Error
}
csp := csm.GetCoinScenePool(platform.IdStr, id)
ret := csp.PlayerEnter(p, roomId, exclude, isChangeRoom)
logger.Logger.Warnf("(csm *CoinSceneMgr) PlayerEnter snid:%v find in id:%v exclude:%v return false", p.SnId, id, exclude)
csp := m.GetCoinScenePool(platform.IdStr, id)
ret := csp.playerEnter(p, roomId, exclude, isChangeRoom)
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v ret:%v", p.SnId, id, ret)
return ret
}
// AudienceEnter 观众进入房间
func (csm *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hall_proto.OpResultCode {
func (m *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hallproto.OpResultCode {
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
if p.isDelete { //删档用户不让进游戏
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
if m.InCoinScene(p) {
logger.Logger.Warnf("CoinSceneMgr AudienceEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
return hallproto.OpResultCode_OPRC_Error
}
//多平台支持
platform := p.GetPlatform()
if platform == nil {
return hall_proto.OpResultCode_OPRC_RoomHadClosed
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
pools, _, _ := csm.findCoinScenePool(platform.IdStr, id)
pools, _ := m.findCoinScenePool(platform.IdStr, id)
if pools == nil {
return hall_proto.OpResultCode_OPRC_RoomHadClosed
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
if len(pools) == 0 {
return hall_proto.OpResultCode_OPRC_NoFindDownTiceRoom
return hallproto.OpResultCode_OPRC_NoFindDownTiceRoom
}
if csp, ok := pools[id]; ok && csp != nil {
ret := csp.AudienceEnter(p, roomId, exclude, ischangeroom)
logger.Logger.Warnf("(csm *CoinSceneMgr) AudienceEnter snid:%v find in id:%v exclude:%v return false", p.SnId, id, exclude)
csp, ok := pools[id]
if !ok || csp == nil {
return hallproto.OpResultCode_OPRC_RoomHadClosed
}
ret := csp.audienceEnter(p, roomId, exclude, ischangeroom)
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v ret:%v", p.SnId, id, ret)
return ret
}
logger.Logger.Warnf("(csm *CoinSceneMgr) AudienceEnter snid:%v find in id:%v exclude:%v csp.AudienceEnter return false", p.SnId, id, exclude)
return hall_proto.OpResultCode_OPRC_Error
}
func (csm *CoinSceneMgr) playerLeave(p *Player, reason int) bool {
if p == nil || p.scene == nil {
return true
}
s := p.scene
if s.groupId != 0 {
if ss, ok := csm.scenesOfGroup[s.groupId]; ok && ss != nil {
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
if !csp.PlayerLeave(p, reason) {
csp.AudienceLeave(p, reason)
}
}
return true
}
}
// 玩家身上平台
if platform := p.GetPlatform(); platform != nil {
if ss, ok := csm.scenesOfPlatform[platform.IdStr]; ok && ss != nil {
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
if !csp.PlayerLeave(p, reason) {
csp.AudienceLeave(p, reason)
}
}
return true
}
}
// 房间所在平台
if s.limitPlatform != nil {
if ss, ok := csm.scenesOfPlatform[s.limitPlatform.IdStr]; ok && ss != nil {
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
if !csp.PlayerLeave(p, reason) {
csp.AudienceLeave(p, reason)
}
}
return true
}
}
return true
}
// PlayerLeave 玩家离开
func (csm *CoinSceneMgr) PlayerLeave(p *Player, reason int) bool {
logger.Logger.Tracef("玩家离开: snid %v, reason %v isAudience %v", p.SnId, reason)
return csm.playerLeave(p, reason)
// 游戏服玩家离开房间消息触发
func (m *CoinSceneMgr) PlayerLeave(p *Player, reason int) bool {
logger.Logger.Tracef("玩家离开: snid %v, reason %v", p.SnId, reason)
if p.scene == nil || p.scene.csp == nil {
return false
}
if p.scene.csp.playerLeave(p, reason) {
return true
}
if p.scene.csp.audienceLeave(p, reason) {
return true
}
return false
}
// OnDestroyScene 解散房间
// 游戏服解散房间消息触发
// sceneId 房间id
func (csm *CoinSceneMgr) OnDestroyScene(sceneId int) {
if platformName, ok := csm.platformOfScene[sceneId]; ok {
if ss, ok := csm.scenesOfPlatform[platformName]; ok {
for _, csp := range ss {
csp.OnDestroyScene(sceneId)
func (m *CoinSceneMgr) OnDestroyScene(sceneId int) {
if s := SceneMgrSingleton.GetScene(sceneId); s != nil && s.csp != nil {
s.csp.onDestroyScene(sceneId)
}
}
delete(csm.platformOfScene, sceneId)
}
if groupId, ok := csm.groupOfScene[sceneId]; ok {
if ss, ok := csm.scenesOfGroup[groupId]; ok {
for _, csp := range ss {
csp.OnDestroyScene(sceneId)
}
}
delete(csm.groupOfScene, sceneId)
}
}
// GetPlatformBySceneId 获取房间所在平台
func (csm *CoinSceneMgr) GetPlatformBySceneId(sceneId int) string {
if platformName, ok := csm.platformOfScene[sceneId]; ok {
return platformName
}
s := SceneMgrSingleton.GetScene(sceneId)
if s != nil && s.limitPlatform != nil {
return s.limitPlatform.IdStr
}
return DefaultPlatform
}
// GetPlayerNums 获取场次人数
func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
func (m *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
//多平台支持
platform := p.GetPlatform()
var nums [10]int32
@ -275,8 +174,7 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
for _, id := range ids {
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
if gps != nil {
if gps.GroupId != 0 {
if ss, exist := csm.scenesOfGroup[gps.GroupId]; exist {
if ss, ok := m.scenesOfPlatform[platform.IdStr]; ok {
if csp, exist := ss[id]; exist {
sceneType := csp.GetSceneType() - 1
if sceneType >= 0 && sceneType < len(nums) {
@ -284,16 +182,6 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
}
}
}
} else {
if ss, ok := csm.scenesOfPlatform[platform.IdStr]; ok {
if csp, exist := ss[id]; exist {
sceneType := csp.GetSceneType() - 1
if sceneType >= 0 && sceneType < len(nums) {
nums[sceneType] += csp.GetPlayerNum() + csp.GetFakePlayerNum()
}
}
}
}
}
}
@ -304,9 +192,9 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
}
// InCoinScene 是否在场次中
func (csm *CoinSceneMgr) InCoinScene(p *Player) bool {
func (m *CoinSceneMgr) InCoinScene(p *Player) bool {
if p == nil {
logger.Logger.Tracef("(csm *CoinSceneMgr) InCoinScene p == nil snid:%v ", p.SnId)
logger.Logger.Tracef("(m *CoinSceneMgr) InCoinScene p == nil")
return false
}
@ -321,10 +209,10 @@ func (csm *CoinSceneMgr) InCoinScene(p *Player) bool {
}
// PlayerTryLeave 通知游戏服务玩家要离开房间
func (csm *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hall_proto.OpResultCode {
if !csm.InCoinScene(p) {
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerTryLeave !csm.InCoinScene(p) snid:%v ", p.SnId)
return hall_proto.OpResultCode_OPRC_Sucess
func (m *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hallproto.OpResultCode {
if !m.InCoinScene(p) {
logger.Logger.Tracef("(m *CoinSceneMgr) PlayerTryLeave !m.InCoinScene(p) snid:%v ", p.SnId)
return hallproto.OpResultCode_OPRC_Sucess
}
// 通知gamesrv
@ -332,46 +220,54 @@ func (csm *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hall_proto.O
if isAudience {
op = common.CoinSceneOp_AudienceLeave
}
pack := &hall_proto.CSCoinSceneOp{
Id: proto.Int32(p.scene.csp.id),
pack := &hallproto.CSCoinSceneOp{
Id: proto.Int32(p.scene.csp.ID()),
OpType: proto.Int32(op),
}
proto.SetDefaults(pack)
common.TransmitToServer(p.sid, int(hall_proto.CoinSceneGamePacketID_PACKET_CS_COINSCENE_OP), pack, p.scene.gameSess.Session)
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerTryLeave snid:%v id:%v", p.SnId, pack.GetId())
return hall_proto.OpResultCode_OPRC_OpYield
common.TransmitToServer(p.sid, int(hallproto.CoinSceneGamePacketID_PACKET_CS_COINSCENE_OP), pack, p.scene.gameSess.Session)
logger.Logger.Tracef("(m *CoinSceneMgr) PlayerTryLeave snid:%v id:%v", p.SnId, pack.GetId())
return hallproto.OpResultCode_OPRC_OpYield
}
func (csm *CoinSceneMgr) PlayerInChanging(p *Player) bool {
_, exist := csm.playerChanging[p.SnId]
// PlayerInChanging 换房中
func (m *CoinSceneMgr) PlayerInChanging(p *Player) bool {
_, exist := m.playerChanging[p.SnId]
return exist
}
func (csm *CoinSceneMgr) ClearPlayerChanging(p *Player) {
delete(csm.playerChanging, p.SnId)
// ClearPlayerChanging 换房结束
func (m *CoinSceneMgr) ClearPlayerChanging(p *Player) {
delete(m.playerChanging, p.SnId)
}
func (csm *CoinSceneMgr) PlayerTryChange(p *Player, id int32, exclude []int32, isAudience bool) hall_proto.OpResultCode {
if csm.InCoinScene(p) {
return csm.StartChangeCoinSceneTransact(p, id, exclude, isAudience)
// PlayerTryChange 换房
// id 场次id
// excludeRoomId 排除的房间id
// isAudience 是否是观众
func (m *CoinSceneMgr) PlayerTryChange(p *Player, id int32, excludeRoomId []int32, isAudience bool) hallproto.OpResultCode {
if m.InCoinScene(p) {
return m.StartChangeCoinSceneTransact(p, id, excludeRoomId, isAudience)
}
// 不在场次中,进入房间观战
if isAudience {
return csm.AudienceEnter(p, id, 0, exclude, true)
return m.AudienceEnter(p, id, 0, excludeRoomId, true)
}
return csm.PlayerEnter(p, id, 0, exclude, true)
// 不在场次中,进入房间
return m.PlayerEnter(p, id, 0, excludeRoomId, true)
}
func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hall_proto.OpResultCode {
func (m *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hallproto.OpResultCode {
if p == nil || p.scene == nil {
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
return hall_proto.OpResultCode_OPRC_Error
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
return hallproto.OpResultCode_OPRC_Error
}
tNow := time.Now()
if !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second {
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second snid:%v id:%v", p.SnId, id)
return hall_proto.OpResultCode_OPRC_ChangeRoomTooOften
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second snid:%v id:%v", p.SnId, id)
return hallproto.OpResultCode_OPRC_ChangeRoomTooOften
}
tnp := &transact.TransNodeParam{
@ -391,12 +287,12 @@ func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclu
tNode := transact.DTCModule.StartTrans(tnp, ctx, CoinSceneChangeTimeOut)
if tNode != nil {
tNode.Go(core.CoreObject())
csm.playerChanging[p.SnId] = id
m.playerChanging[p.SnId] = id
p.lastChangeScene = tNow
return hall_proto.OpResultCode_OPRC_Sucess
return hallproto.OpResultCode_OPRC_Sucess
}
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact tNode == nil snid:%v id:%v", p.SnId, id)
return hall_proto.OpResultCode_OPRC_Error
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact tNode == nil snid:%v id:%v", p.SnId, id)
return hallproto.OpResultCode_OPRC_Error
}
// TouchCreateRoom 触发预创建房间
@ -404,44 +300,47 @@ func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclu
// 2.游戏服建立连接后触发
// 3.房间解散后触发
// 4.场次配置更新后
func (csm *CoinSceneMgr) TouchCreateRoom(platform string, gameFreeId int32) {
func (m *CoinSceneMgr) TouchCreateRoom(platform string, gameFreeId int32) {
if model.GameParamData.ClosePreCreateRoom {
return
}
gf := PlatformMgrSingleton.GetGameFree(platform, gameFreeId)
if gf.Status && gf.DbGameFree.GetCreateRoomNum() > 0 {
logger.Logger.Tracef("TouchCreateRoom platform:%v gameFreeId:%v", platform, gameFreeId)
csm.delayCache = append(csm.delayCache, &CreateRoomCache{
m.delayCache = append(m.delayCache, &CreateRoomCache{
platformName: platform,
gameFreeId: gameFreeId,
})
}
}
func (csm *CoinSceneMgr) ModuleName() string {
func (m *CoinSceneMgr) ModuleName() string {
return "CoinSceneMgr"
}
func (csm *CoinSceneMgr) Init() {
func (m *CoinSceneMgr) Init() {
// 房间池初始化
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
if platform.Isolated || platform.IdStr == "" {
for _, v := range srvdata.PBDB_GameFreeMgr.Datas.GetArr() {
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, v.GetId())
if gps != nil {
csm.GetCoinScenePool(platform.IdStr, v.GetId())
csm.TouchCreateRoom(platform.IdStr, v.GetId())
m.GetCoinScenePool(platform.IdStr, v.GetId())
m.TouchCreateRoom(platform.IdStr, v.GetId())
}
}
}
}
}
func (csm *CoinSceneMgr) Update() {
cnt := len(csm.delayCache)
func (m *CoinSceneMgr) Update() {
cnt := len(m.delayCache)
if cnt > 0 {
data := csm.delayCache[cnt-1]
csm.delayCache = csm.delayCache[:cnt-1]
data := m.delayCache[cnt-1]
m.delayCache = m.delayCache[:cnt-1]
gf := PlatformMgrSingleton.GetGameFree(data.platformName, data.gameFreeId)
if gf != nil && gf.DbGameFree != nil {
csp := csm.GetCoinScenePool(data.platformName, data.gameFreeId)
csp := m.GetCoinScenePool(data.platformName, data.gameFreeId)
if csp != nil {
csp.PreCreateRoom()
}
@ -449,22 +348,22 @@ func (csm *CoinSceneMgr) Update() {
}
}
func (csm *CoinSceneMgr) Shutdown() {
module.UnregisteModule(csm)
func (m *CoinSceneMgr) Shutdown() {
module.UnregisteModule(m)
}
//=====================PlatformObserver======================
func (this *CoinSceneMgr) OnPlatformCreate(p *Platform) {
func (m *CoinSceneMgr) OnPlatformCreate(p *Platform) {
}
func (this *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
func (m *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
if p == nil {
return
}
var ids []int
if v, ok := this.scenesOfPlatform[p.IdStr]; ok {
if v, ok := m.scenesOfPlatform[p.IdStr]; ok {
for _, csp := range v {
for _, scene := range csp.scenes {
ids = append(ids, scene.sceneId)
@ -474,24 +373,18 @@ func (this *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
SceneMgrSingleton.DoDelete(ids, true)
}
func (this *CoinSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
func (m *CoinSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
if disabled {
this.OnPlatformDestroy(p)
m.OnPlatformDestroy(p)
}
}
func (this *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *webapi.GameFree) {
func (m *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *webapi.GameFree) {
if p == nil || newCfg == nil {
return
}
var ss map[int32]*CoinScenePool
var ok bool
if oldCfg.GroupId != newCfg.GroupId || oldCfg.GroupId != 0 {
ss, ok = this.scenesOfGroup[oldCfg.GroupId]
} else {
ss, ok = this.scenesOfPlatform[p.IdStr]
}
ss, ok := m.scenesOfPlatform[p.IdStr]
if !ok || ss == nil {
return
}
@ -503,62 +396,36 @@ func (this *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *
ids = append(ids, scene.sceneId)
}
SceneMgrSingleton.DoDelete(ids, true)
this.TouchCreateRoom(p.IdStr, newCfg.DbGameFree.Id)
m.TouchCreateRoom(p.IdStr, newCfg.DbGameFree.Id)
}
}
func (this *CoinSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
func (m *CoinSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
if p == nil {
return
}
if csps, ok := this.scenesOfPlatform[p.IdStr]; ok {
var ids []int
for _, csp := range csps {
if v, ok := m.scenesOfPlatform[p.IdStr]; ok {
for _, csp := range v {
for _, scene := range csp.scenes {
if scene.dbGameFree.Id == gameFreeId {
ids = append(ids, scene.sceneId)
}
}
}
SceneMgrSingleton.DoDelete(ids, true)
}
SceneMgrSingleton.DoDelete(ids, true)
}
//=========================PlatformGameGroupObserver==============================
func (this *CoinSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
if newCfg == nil {
return
}
if scenes, exist := this.scenesOfGroup[newCfg.Id]; exist {
if cps, ok := scenes[newCfg.DbGameFree.Id]; ok {
needDestroy := false
if cps.dbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
cps.dbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
cps.dbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
cps.dbGameFree.GetMaxCoinLimit() != newCfg.DbGameFree.GetMaxCoinLimit() ||
cps.dbGameFree.GetTaxRate() != newCfg.DbGameFree.GetTaxRate() ||
!common.SliceInt64Equal(cps.dbGameFree.GetOtherIntParams(), newCfg.DbGameFree.GetOtherIntParams()) ||
!common.SliceInt64Equal(cps.dbGameFree.GetRobotTakeCoin(), newCfg.DbGameFree.GetRobotTakeCoin()) ||
!common.SliceInt64Equal(cps.dbGameFree.GetRobotLimitCoin(), newCfg.DbGameFree.GetRobotLimitCoin()) {
needDestroy = true
}
//TODO 预创建房间配置更新,unsupport group model
cps.dbGameFree = newCfg.DbGameFree
if needDestroy {
var ids []int
for _, scene := range cps.scenes {
ids = append(ids, scene.sceneId)
}
SceneMgrSingleton.DoDelete(ids, true)
}
}
}
func (m *CoinSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
}
//=========================GameSessionListener======================================
func (csm *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
func (m *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
wildGs := len(gs.gameIds) == 0 || common.InSliceInt32(gs.gameIds, 0) // 是否所有游戏都支持
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
if platform.IdStr == DefaultPlatform {
@ -568,13 +435,13 @@ func (csm *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
gps := PlatformMgrSingleton.GetGameFrees(platform.IdStr)
for _, v := range gps {
if v != nil && (wildGs || common.InSliceInt32(gs.gameIds, v.DbGameFree.GetGameId())) {
csm.TouchCreateRoom(platform.IdStr, v.DbGameFree.Id)
m.TouchCreateRoom(platform.IdStr, v.DbGameFree.Id)
}
}
}
}
func (this *CoinSceneMgr) OnGameSessionUnregiste(gs *GameSession) {
func (m *CoinSceneMgr) OnGameSessionUnregiste(gs *GameSession) {
//todo 游戏服务断开,是否解散房间?
}

View File

@ -1,9 +1,9 @@
package main
import (
"mongo.games.com/game/common"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
gamehallproto "mongo.games.com/game/protocol/gamehall"
serverproto "mongo.games.com/game/protocol/server"
@ -13,8 +13,6 @@ import (
// CoinScenePool 房间池
type CoinScenePool struct {
platform string // 平台id
groupId int32 // 组id
id int32 // 场次id
dbGameFree *serverproto.DB_GameFree // 场次配置
dbGameRule *serverproto.DB_GameRule // 场次配置
scenes map[int]*Scene // 所有房间,房间id
@ -26,7 +24,7 @@ type CoinScenePool struct {
policy ICoinScenePool
}
func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB_GameFree) *CoinScenePool {
func newCoinScenePool(platform string, dbGameFree *serverproto.DB_GameFree) *CoinScenePool {
if dbGameFree == nil {
return nil
}
@ -42,8 +40,6 @@ func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB
csp := &CoinScenePool{
platform: platform,
groupId: groupId,
id: dbGameFree.GetId(),
dbGameFree: dbGameFree,
dbGameRule: dbGameRule,
scenes: make(map[int]*Scene),
@ -59,6 +55,10 @@ func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB
return csp
}
func (csp *CoinScenePool) ID() int32 {
return csp.dbGameFree.Id
}
func (csp *CoinScenePool) GetPlayerNum() int32 {
return int32(len(csp.players))
}
@ -73,7 +73,8 @@ func (csp *CoinScenePool) GetFakePlayerNum() int32 {
return 0
}
// GetSceneType 获取场次id
// GetSceneType 获取场次类型
// 新手场,中级场 ...
func (csp *CoinScenePool) GetSceneType() int {
if csp.dbGameFree != nil {
return int(csp.dbGameFree.GetSceneType())
@ -89,14 +90,79 @@ func (csp *CoinScenePool) CanInviteRob() bool {
return false
}
// CanEnter 检查入场条件
func (csp *CoinScenePool) CanEnter(p *Player) gamehallproto.OpResultCode {
// PreCreateRoom 预创建房间
func (csp *CoinScenePool) PreCreateRoom() {
if csp.platform == DefaultPlatform || model.GameParamData.ClosePreCreateRoom {
return
}
if p := PlatformMgrSingleton.GetPlatform(csp.platform); p == nil || p.Disable {
return
}
preCreateNum := int(csp.dbGameFree.GetCreateRoomNum())
if preCreateNum <= 0 {
return
}
num := preCreateNum - csp.GetRoomNum(common.SceneMode_Public)
if num > 0 {
logger.Logger.Tracef("预创建房间 [inc:%v] platform:%v gameFreeId:%v", num, csp.platform, csp.dbGameFree.Id)
for i := 0; i < num; i++ {
scene := csp.policy.NewPreCreateScene(csp)
if scene != nil {
csp.AddScene(scene)
}
}
}
}
func (csp *CoinScenePool) GetRoomNum(mode ...int) int {
tp := 0
if len(mode) > 0 {
tp = mode[0]
}
var num int
for _, scene := range csp.scenes {
if tp > 0 {
if scene.IsSceneMode(tp) {
num++
}
} else {
num++
}
}
return num
}
// GetHasTruePlayerSceneCnt 有真人的房间数量
func (csp *CoinScenePool) GetHasTruePlayerSceneCnt() int {
cnt := 0
for _, s := range csp.scenes {
if s.GetTruePlayerCnt() != 0 {
cnt++
}
}
return cnt
}
// AddScene 添加房间
// 自定义房间参数的时候创建房间后添加到房间池
// 创建房间后调用AddScene添加到房间池在玩家进入房间之前调用
func (csp *CoinScenePool) AddScene(s *Scene) {
if s == nil {
return
}
csp.scenes[s.sceneId] = s
s.csp = csp
}
// canEnter 检查入场条件
func (csp *CoinScenePool) canEnter(p *Player) gamehallproto.OpResultCode {
if csp.dbGameFree == nil || p == nil {
return gamehallproto.OpResultCode_OPRC_Error
}
//检测房间状态是否开启
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.id)
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.ID())
if gps == nil || !gps.Status {
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
}
@ -119,14 +185,14 @@ func (csp *CoinScenePool) CanEnter(p *Player) gamehallproto.OpResultCode {
return csp.policy.CanEnter(csp, p)
}
// CanAudienceEnter 检查观众入场条件
func (csp *CoinScenePool) CanAudienceEnter(p *Player) gamehallproto.OpResultCode {
// canAudienceEnter 检查观众入场条件
func (csp *CoinScenePool) canAudienceEnter(p *Player) gamehallproto.OpResultCode {
if csp.dbGameFree == nil || p == nil {
return gamehallproto.OpResultCode_OPRC_Error
}
//检测房间状态是否开启
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.id)
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.ID())
if gps == nil {
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
}
@ -139,35 +205,16 @@ func (csp *CoinScenePool) CanAudienceEnter(p *Player) gamehallproto.OpResultCode
return csp.policy.CanAudienceEnter(csp, p)
}
// AddScene 添加房间
func (csp *CoinScenePool) AddScene(s *Scene) {
if s == nil {
return
}
csp.scenes[s.sceneId] = s
s.csp = csp
if csp.groupId != 0 {
CoinSceneMgrSingleton.groupOfScene[s.sceneId] = csp.groupId
} else {
CoinSceneMgrSingleton.platformOfScene[s.sceneId] = csp.platform
}
}
// PlayerEnter 玩家进入房间池
// playerEnter 玩家进入房间池
// exclude 排除的房间id
// isChangeRoom 是否换房
func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
if ret := csp.CanEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter find snid:%v csp.CanEnter coin:%v ret:%v id:%v", p.SnId,
func (csp *CoinScenePool) playerEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
if ret := csp.canEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter find snid:%v csp.canEnter coin:%v ret:%v id:%v", p.SnId,
p.Coin, ret, csp.dbGameFree.GetId())
return ret
}
if p.scene != nil {
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
return gamehallproto.OpResultCode_OPRC_Error
}
var scene *Scene
// 进入房间
// 指定房间id进入忽略排除exclude只有机器人和进入预创建房间才允许
@ -204,15 +251,17 @@ func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32,
if scene == nil {
scene = csp.policy.NewScene(csp, p)
if scene != nil {
logger.Logger.Infof("(csp *CoinScenePool) PlayerEnter create new scene:%v snid:%v gamefreeid:%v", scene.sceneId, p.SnId, csp.ID())
csp.AddScene(scene)
} else {
logger.Logger.Errorf("Create %v scene failed.", csp.id)
logger.Logger.Errorf("Create %v scene failed.", csp.ID())
}
}
if scene != nil {
if scene.PlayerEnter(p, -1, isChangeRoom) {
csp.OnPlayerEnter(p, scene)
logger.Logger.Infof("(csp *CoinScenePool) PlayerEnter snid:%v sceneid:%v gamefreeid:%v success", p.SnId, scene.sceneId, csp.ID())
csp.onPlayerEnter(p, scene)
return gamehallproto.OpResultCode_OPRC_Sucess
}
}
@ -220,18 +269,13 @@ func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32,
return gamehallproto.OpResultCode_OPRC_SceneServerMaintain
}
// AudienceEnter 观众入场
func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
if ret := csp.CanAudienceEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter find snid:%v csp.CanEnter coin:%v ret:%v id:%v", p.SnId, p.Coin, ret, csp.dbGameFree.GetId())
// audienceEnter 观众入场
func (csp *CoinScenePool) audienceEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
if ret := csp.canAudienceEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter find snid:%v csp.canEnter coin:%v ret:%v id:%v", p.SnId, p.Coin, ret, csp.dbGameFree.GetId())
return ret
}
if p.scene != nil {
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
return gamehallproto.OpResultCode_OPRC_Error
}
var scene *Scene
if roomId != 0 {
if s, ok := csp.scenes[int(roomId)]; ok {
@ -261,7 +305,8 @@ func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32
}
if scene.AudienceEnter(p, isChangeRoom) {
csp.OnPlayerEnter(p, scene)
logger.Logger.Infof("(csp *CoinScenePool) AudienceEnter snid:%v sceneid:%v gamefreeid:%v success", p.SnId, scene.sceneId, csp.ID())
csp.onPlayerEnter(p, scene)
return gamehallproto.OpResultCode_OPRC_Sucess
}
@ -269,78 +314,14 @@ func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32
return gamehallproto.OpResultCode_OPRC_NoFindDownTiceRoom
}
// OnPlayerEnter 玩家进入房间完成
func (csp *CoinScenePool) OnPlayerEnter(p *Player, scene *Scene) {
// onPlayerEnter 玩家进入房间完成
func (csp *CoinScenePool) onPlayerEnter(p *Player, scene *Scene) {
csp.players[p.SnId] = struct{}{}
csp.policy.OnPlayerEnter(csp, p, scene)
}
// PlayerLeave 玩家离开房间
func (csp *CoinScenePool) PlayerLeave(p *Player, reason int) bool {
if p.scene == nil {
return true
}
if p.scene.csp != csp && p.scene == csp.scenes[p.scene.sceneId] {
logger.Logger.Error("bug")
}
if p.scene.csp != csp {
return false
}
if p.scene != csp.scenes[p.scene.sceneId] {
logger.Logger.Error("bug")
}
s, ok := csp.scenes[p.scene.sceneId]
if !ok || s == nil {
return false
}
if !s.HasPlayer(p) {
return false
}
if !csp.policy.PlayerLeave(csp, p, reason) {
return false
}
s.PlayerLeave(p, reason)
logger.Logger.Tracef("(csp *CoinScenePool) PlayerLeave snid:%v in scene:%v", p.SnId, s.sceneId)
csp.policy.OnPlayerLeave(csp, s, p)
csp.OnPlayerLeave(s, p)
return true
}
// AudienceLeave 观众离开房间
func (csp *CoinScenePool) AudienceLeave(p *Player, reason int) bool {
if p.scene == nil {
return true
}
if p.scene.csp != csp {
return false
}
s, ok := csp.scenes[p.scene.sceneId]
if !ok || s == nil {
return false
}
if !s.HasAudience(p) {
return false
}
if !csp.policy.AudienceLeave(csp, p, reason) {
return false
}
s.AudienceLeave(p, reason)
logger.Logger.Tracef("(csp *CoinScenePool) AudienceLeave snid:%v in scene:%v", p.SnId, s.sceneId)
csp.policy.OnPlayerLeave(csp, s, p)
csp.OnPlayerLeave(s, p)
return true
}
// OnPlayerLeave 离开房间完成
func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
func (csp *CoinScenePool) onPlayerLeave(s *Scene, p *Player) {
if s == nil || p == nil {
return
}
@ -370,17 +351,68 @@ func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
}
}
// OnDestroyScene 解散房间
// 房间解散一定是游戏服确认的worldsrv收到游戏房间解散消息后解散房间
func (csp *CoinScenePool) OnDestroyScene(sceneId int) {
// playerLeave 玩家离开房间
func (csp *CoinScenePool) playerLeave(p *Player, reason int) bool {
if p.scene != csp.scenes[p.scene.sceneId] {
logger.Logger.Error("bug")
}
s, ok := csp.scenes[p.scene.sceneId]
if !ok || s == nil {
return false
}
if !s.HasPlayer(p) {
return false
}
if !csp.policy.PlayerLeave(csp, p, reason) {
return false
}
s.PlayerLeave(p, reason)
logger.Logger.Tracef("(csp *CoinScenePool) PlayerLeave snid:%v in scene:%v", p.SnId, s.sceneId)
csp.policy.OnPlayerLeave(csp, s, p)
csp.onPlayerLeave(s, p)
return true
}
// audienceLeave 观众离开房间
func (csp *CoinScenePool) audienceLeave(p *Player, reason int) bool {
s, ok := csp.scenes[p.scene.sceneId]
if !ok || s == nil {
return false
}
if !s.HasAudience(p) {
return false
}
if !csp.policy.AudienceLeave(csp, p, reason) {
return false
}
s.AudienceLeave(p, reason)
logger.Logger.Tracef("(csp *CoinScenePool) AudienceLeave snid:%v in scene:%v", p.SnId, s.sceneId)
csp.policy.OnPlayerLeave(csp, s, p)
csp.onPlayerLeave(s, p)
return true
}
// onDestroyScene 解散房间
// 房间解散一定是游戏服确认的worldsrv收到游戏房间解散消息后解散房间此时房间内玩家应该都离开了
// 或者游戏服异常断开触发房间解散,此时房间中还有人
func (csp *CoinScenePool) onDestroyScene(sceneId int) {
scene, ok := csp.scenes[sceneId]
if !ok {
if !ok || scene == nil {
return
}
logger.Logger.Tracef("(csp *CoinScenePool) OnDestroyScene scene:%v", sceneId)
// todo 是否需要优化
// 游戏服异常断开,同步一次金币
for id := range scene.players {
player := PlayerMgrSington.GetPlayerBySnId(id)
if player != nil {
@ -407,96 +439,13 @@ func (csp *CoinScenePool) OnDestroyScene(sceneId int) {
}
csp.policy.OnDestroyScene(csp, sceneId)
for k := range scene.players {
delete(csp.players, k)
}
for k := range scene.audiences {
delete(csp.players, k)
}
scene.csp = nil // 解除关联
delete(csp.scenes, sceneId)
CoinSceneMgrSingleton.TouchCreateRoom(csp.platform, csp.dbGameFree.Id)
}
// PreCreateRoom 预创建房间
func (csp *CoinScenePool) PreCreateRoom() {
if csp.platform == DefaultPlatform {
return
}
if p := PlatformMgrSingleton.GetPlatform(csp.platform); p == nil || p.Disable {
return
}
preCreateNum := int(csp.dbGameFree.GetCreateRoomNum())
if preCreateNum <= 0 || model.GameParamData.ClosePreCreateRoom {
return
}
num := preCreateNum - csp.GetRoomNum(common.SceneMode_Public)
if num > 0 {
logger.Logger.Tracef("预创建房间 [inc:%v] platform:%v gameFreeId:%v", num, csp.platform, csp.dbGameFree.Id)
for i := 0; i < num; i++ {
scene := csp.policy.NewPreCreateScene(csp)
if scene != nil {
csp.AddScene(scene)
}
}
}
}
func (csp *CoinScenePool) GetRoomNum(mode ...int) int {
tp := 0
if len(mode) > 0 {
tp = mode[0]
}
var num int
for _, scene := range csp.scenes {
if tp > 0 {
if scene.IsSceneMode(tp) {
num++
}
} else {
num++
}
}
return num
}
// ListRoom 房间列表
//func (csp *CoinScenePool) ListRoom(p *Player) bool {
// if p.scene != nil {
// logger.Logger.Warnf("(csp *CoinScenePool) PlayerListRoom[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
// return false
// }
//
// if len(csp.scenes) == 0 {
// return false
// }
//
// pack := &gamehallproto.SCCoinSceneListRoom{
// Id: csp.dbGameFree.Id,
// LimitCoin: csp.dbGameFree.LimitCoin,
// MaxCoinLimit: csp.dbGameFree.MaxCoinLimit,
// BaseScore: csp.dbGameFree.BaseScore,
// MaxScore: csp.dbGameFree.MaxChip,
// OtherIntParams: csp.dbGameFree.OtherIntParams,
// }
//
// maxPlayerNum := 0
// for sceneId, s := range csp.scenes {
// data := &gamehallproto.CoinSceneInfo{
// SceneId: proto.Int(sceneId),
// PlayerNum: proto.Int(len(s.players)),
// }
// pack.Datas = append(pack.Datas, data)
// maxPlayerNum = s.playerNum
// }
// pack.MaxPlayerNum = proto.Int(maxPlayerNum)
// proto.SetDefaults(pack)
// p.SendToClient(int(gamehallproto.CoinSceneGamePacketID_PACKET_SC_COINSCENE_LISTROOM), pack)
// return true
//}
// GetHasTruePlayerSceneCnt 有真人的房间数量
func (csp *CoinScenePool) GetHasTruePlayerSceneCnt() int {
cnt := 0
for _, s := range csp.scenes {
if s.GetTruePlayerCnt() != 0 {
cnt++
}
}
return cnt
}

View File

@ -157,7 +157,7 @@ func (this *BaseCoinScenePool) PlayerEnter(pool *CoinScenePool, p *Player, exclu
}
} else { //按类型匹配
//优先真人
if scene == nil && len(scenes) != 0 && matchTrueManRule == MatchTrueManPriority {
if len(scenes) != 0 && matchTrueManRule == MatchTrueManPriority {
var selScene []*Scene
for _, value := range scenes {
if value != nil {
@ -211,14 +211,14 @@ func (this *BaseCoinScenePool) AudienceLeave(pool *CoinScenePool, p *Player, rea
func (this *BaseCoinScenePool) OnPlayerLeave(pool *CoinScenePool, s *Scene, p *Player) {}
func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
gameId := int(pool.dbGameRule.GetGameId())
gameId := int(pool.dbGameFree.GetGameId())
gs := GameSessMgrSington.GetMinLoadSess(gameId)
if gs == nil {
logger.Logger.Warnf("Get %v game min session failed.", gameId)
return nil
}
gameMode := pool.dbGameRule.GetGameMode()
gameMode := pool.dbGameFree.GetGameMode()
params := common.CopySliceInt32ToInt64(pool.dbGameRule.GetParams())
limitPlatform := PlatformMgrSingleton.GetPlatform(pool.platform)
if limitPlatform == nil || !limitPlatform.Isolated {
@ -228,7 +228,7 @@ func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
sceneId := SceneMgrSingleton.GenOneCoinSceneId()
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public,
1, -1, params, gs, limitPlatform, pool.groupId, pool.dbGameFree, pool.id)
1, -1, params, gs, limitPlatform, 0, pool.dbGameFree, pool.ID())
return scene
}

View File

@ -233,7 +233,7 @@ func (l *CoinScenePoolLocal) NewScene(pool *CoinScenePool, p *Player) *Scene {
}
scene := SceneMgrSingleton.CreateLocalGameScene(p.SnId, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
gs, limitPlatform, 0, pool.dbGameFree, baseScore, pool.groupId, pool.id)
gs, limitPlatform, 0, pool.dbGameFree, baseScore, 0, pool.ID())
return scene
}
@ -285,7 +285,7 @@ func (l *CoinScenePoolLocal) NewPreCreateScene(pool *CoinScenePool) *Scene {
}
if baseScore != 0 {
scene = SceneMgrSingleton.CreateLocalGameScene(0, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
gs, limitPlatform, playerNum, pool.dbGameFree, baseScore, pool.groupId, pool.id)
gs, limitPlatform, playerNum, pool.dbGameFree, baseScore, 0, pool.ID())
if scene != nil {
logger.Logger.Tracef("CreateLocalGameScene success.gameId:%v gameSite:%v baseScore:%v randIdx:%v", scene.gameId, scene.gameSite, baseScore, randIdx)
}

View File

@ -5,7 +5,6 @@ import (
"encoding/json"
"strconv"
"strings"
"time"
"go.etcd.io/etcd/client/v3"
"mongo.games.com/goserver/core/basic"
@ -88,6 +87,12 @@ func init() {
etcd.Register(etcd.ETCDKEY_RANK_TYPE, webapi.RankTypeConfig{}, platformConfigEvent)
//获奖记录配置
etcd.Register(etcd.ETCDKEY_AWARD_CONFIG, webapi.AwardLogConfig{}, platformConfigEvent)
// 新手引导
etcd.Register(etcd.ETCDKEY_GUIDE, webapi.GuideConfig{}, platformConfigEvent)
// 比赛观众
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
// 小精灵配置
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
}
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -115,11 +120,7 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
PlatformMgrSingleton.GetConfig(config.Platform).CommonNotices = config
if !isInit {
// 通知公共变更
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
if v != nil && v.IsOnLine() {
v.SendToClient(int(hallproto.GameHallPacketID_PACKET_SC_NoticeChange), &hallproto.SCNoticeChange{})
}
}
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(hallproto.GameHallPacketID_PACKET_SC_NoticeChange), &hallproto.SCNoticeChange{})
}
case *webapi.GameConfigGlobal:
if isInit {
@ -188,17 +189,13 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
PlatformMgrSingleton.GetConfig(config.Platform).ChannelSwitch[config.GetTp()] = config
if !isInit {
// 通知变更
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
if v != nil && v.IsOnLine() {
v.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCExchangeChannel), &playerproto.SCExchangeChannel{
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCExchangeChannel), &playerproto.SCExchangeChannel{
Datas: []*playerproto.ChannelSwitch{{
Tp: config.Tp,
OnChannelName: config.OnChannelName,
}},
})
}
}
}
case *webapi.GameConfigGroup:
PlatformGameGroupMgrSington.UpsertGameGroup(config)
case *webapi.Welfare7SignDateList:
@ -245,10 +242,9 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
PlatformMgrSingleton.GetConfig(config.Platform).PermitStartTs = startTs
PlatformMgrSingleton.GetConfig(config.Platform).PermitEndTs = endTs
}
f := func() {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
f1 := func() {
if st.StartTs <= 0 || st.EndTs <= 0 {
return nil
return
}
b, err := json.Marshal(st)
if err != nil {
@ -260,8 +256,8 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
logger.Logger.Errorf("permit startts update error:%v", err)
}
}
return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
}
f2 := func() {
if st.StartTs > 0 {
LogChannelSingleton.WriteLog(&model.BackendPermitCycle{
Platform: config.Platform,
@ -269,12 +265,17 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
EndTs: st.EndTs - 1,
})
}
})).StartByExecutor("permit_start_ts")
}
if isInit {
time.AfterFunc(time.Second*5, f) //todo 优化
f1()
f2()
} else {
f()
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
f1()
return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
f2()
})).StartByExecutor("permit_start_ts")
}
case *webapi.ItemConfig:
@ -305,15 +306,11 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
})
}
if len(items) > 0 {
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
if v != nil && v.IsOnLine() {
v.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCItem), &playerproto.SCItem{
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCItem), &playerproto.SCItem{
Items: items,
})
}
}
}
}
case *webapi.SkinConfig:
PlatformMgrSingleton.GetConfig(config.Platform).SkinConfig = config
@ -321,10 +318,24 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
PlatformMgrSingleton.GetConfig(config.Platform).RankTypeConfig = config
case *webapi.AwardLogConfig:
PlatformMgrSingleton.GetConfig(config.Platform).AwardLogConfig = config
case *webapi.GuideConfig:
PlatformMgrSingleton.GetConfig(config.Platform).GuideConfig = config
case *webapi.SpiritConfig:
PlatformMgrSingleton.GetConfig(config.Platform).SpiritConfig = config
if !isInit {
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCDataConfig), &playerproto.SCDataConfig{
Cfg: []*playerproto.Config{
{
Tp: 1,
On: config.GetOn() == 1,
Value: config.GetUrl(),
},
},
})
}
default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
}
}
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -389,6 +400,13 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
if isInit || event.Type == clientv3.EventTypePut {
ActMgrSington.AddGiveConfig(config, config.Platform)
}
case *webapi.MatchAudience:
switch event.Type {
case clientv3.EventTypePut:
PlatformMgrSingleton.AddMatchAudience(config)
case clientv3.EventTypeDelete:
PlatformMgrSingleton.DelMatchAudience(config)
}
default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)

View File

@ -66,7 +66,7 @@ func (this *GameSessMgr) OnRegiste(s *netlib.Session) {
}
gs.OnRegiste()
//尝试创建百人场
HundredSceneMgrSington.TryCreateRoom()
HundredSceneMgrSingleton.TryCreateRoom()
}
} else if srvInfo.GetType() == srvlib.GateServiceType {
logger.Logger.Warn("(this *GameSessMgr) OnRegiste (GateSrv):", s)

View File

@ -10,383 +10,193 @@ import (
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
gamehall_proto "mongo.games.com/game/protocol/gamehall"
server_proto "mongo.games.com/game/protocol/server"
gamehallproto "mongo.games.com/game/protocol/gamehall"
serverproto "mongo.games.com/game/protocol/server"
"mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
)
const (
HundredSceneType_Primary int = iota //初级
HundredSceneType_Mid //中级
HundredSceneType_Senior //高级
HundredSceneType_Professor //专家
HundredSceneType_Experience //体验场
HundredSceneType_Max
HundredSceneOPEnter int32 = iota //进入
HundredSceneOPLeave //离开
HundredSceneOPChange //换桌
)
const (
HundredSceneOp_Enter int32 = iota //进入
HundredSceneOp_Leave //离开
HundredSceneOp_Change //换桌
HundredSceneOp_Audience //观战
)
var HundredSceneMgrSington = &HundredSceneMgr{
//分平台管理
var HundredSceneMgrSingleton = &HundredSceneMgr{
scenesOfPlatform: make(map[string]map[int32]*Scene),
platformOfScene: make(map[int32]string),
//分组管理
scenesOfGroup: make(map[int32]map[int32]*Scene),
groupOfScene: make(map[int32]int32),
playerIning: make(map[int32]int32),
}
type HundredSceneMgr struct {
//分平台管理
scenesOfPlatform map[string]map[int32]*Scene // platform:gamefreeid:房间
platformOfScene map[int32]string // sceneid:platform
//分组管理
scenesOfGroup map[int32]map[int32]*Scene // groupid:gamefreeid:房间
groupOfScene map[int32]int32 // sceneid:groupid
playerIning map[int32]int32 // snid:sceneid
}
func (this *HundredSceneMgr) GetPlatformNameBySceneId(sceneid int32) (string, bool) {
if name, exist := this.platformOfScene[sceneid]; exist {
return name, exist
}
if _, exist := this.groupOfScene[sceneid]; exist {
s := SceneMgrSingleton.GetScene(int(sceneid))
if s != nil && s.limitPlatform != nil {
return s.limitPlatform.IdStr, true
}
}
return DefaultPlatform, false
// PlayerEnter 玩家进入场次
// id 场次id
func (this *HundredSceneMgr) PlayerEnter(p *Player, id int32) gamehallproto.OpResultCode_Hundred {
logger.Logger.Tracef("HundredSceneMgr PlayerEnter snid:%v gamefreeid:%v", p.SnId, id)
if p.isDelete {
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
}
func (this *HundredSceneMgr) RebindPlayerSnId(oldSnId, newSnId int32) {
if id, exist := this.playerIning[oldSnId]; exist {
delete(this.playerIning, oldSnId)
this.playerIning[newSnId] = id
}
for _, ss := range this.scenesOfPlatform {
for _, s := range ss {
s.RebindPlayerSnId(oldSnId, newSnId)
}
}
for _, ss := range this.scenesOfGroup {
for _, s := range ss {
s.RebindPlayerSnId(oldSnId, newSnId)
}
}
}
func (this *HundredSceneMgr) PlayerEnter(p *Player, id int32) gamehall_proto.OpResultCode_Hundred {
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter snid:%v id:%v", p.SnId, id)
if oid, exist := this.playerIning[p.SnId]; exist {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter:%v snid:%v find in id:%v PlayerEnter return false", id, p.SnId, oid)
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
}
if p.scene != nil {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter:%v snid:%v find in id:%v PlayerEnter return false", id, p.SnId, p.scene.sceneId)
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
}
if p.isDelete { //删档用户不让进游戏
return gamehall_proto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
if this.InHundredScene(p) {
logger.Logger.Warnf("HundredSceneMgr PlayerEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
return gamehallproto.OpResultCode_Hundred_OPRC_Error_Hundred
}
//多平台支持
var limitPlatform *Platform
platformName := DefaultPlatform
platform := PlatformMgrSingleton.GetPlatform(p.Platform)
if platform != nil && platform.Isolated {
platformName = platform.IdStr
limitPlatform = platform
} else {
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
platform := p.GetPlatform()
if platform == nil {
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
}
gps := PlatformMgrSingleton.GetGameFree(limitPlatform.IdStr, id)
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
if gps == nil {
return gamehall_proto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
}
if gps.GroupId != 0 { //按分组进入场景游戏
pgg := PlatformGameGroupMgrSington.GetGameGroup(gps.GroupId)
if pgg != nil {
if _, ok := this.scenesOfGroup[gps.GroupId]; !ok {
this.scenesOfGroup[gps.GroupId] = make(map[int32]*Scene)
}
if ss, ok := this.scenesOfGroup[gps.GroupId]; ok {
if s, ok := ss[id]; !ok {
s = this.CreateNewScene(id, gps.GroupId, limitPlatform, pgg.DbGameFree)
if s != nil {
ss[id] = s
this.groupOfScene[int32(s.sceneId)] = gps.GroupId
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(groupid=%v) Create %v scene success.", gps.GroupId, id)
} else {
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(groupid=%v) Create %v scene failed.", gps.GroupId, id)
}
}
//尝试进入
if s, ok := ss[id]; ok && s != nil {
if s.PlayerEnter(p, -1, true) {
this.OnPlayerEnter(p, id)
return gamehall_proto.OpResultCode_Hundred_OPRC_Sucess_Hundred
} else {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) enter %v scene failed.", gps.GroupId, id)
}
} else {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) get %v scene failed.", gps.GroupId, id)
}
}
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) snid:%v find in id:%v csp.PlayerEnter return false", gps.GroupId, p.SnId, id)
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
}
}
//没有场景,尝试创建
if _, ok := this.scenesOfPlatform[platformName]; !ok {
this.scenesOfPlatform[platformName] = make(map[int32]*Scene)
if _, ok := this.scenesOfPlatform[platform.IdStr]; !ok {
this.scenesOfPlatform[platform.IdStr] = make(map[int32]*Scene)
}
if ss, ok := this.scenesOfPlatform[platformName]; ok {
if s, ok := ss[id]; !ok {
s = this.CreateNewScene(id, gps.GroupId, limitPlatform, gps.DbGameFree)
ss := this.scenesOfPlatform[platform.IdStr]
if s, ok := ss[id]; !ok || s == nil {
s = this.CreateNewScene(id, gps.GroupId, platform, gps.DbGameFree)
if s != nil {
ss[id] = s
this.platformOfScene[int32(s.sceneId)] = platformName
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(platform=%v) Create %v scene success.", platformName, id)
s.hp = this
logger.Logger.Infof("HundredSceneMgr PlayerEnter(platform=%v snid=%v) Create %v scene success.", platform.IdStr, p.SnId, id)
} else {
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(platform=%v) Create %v scene failed.", platformName, id)
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v snid=%v) Create %v scene failed.", platform.IdStr, p.SnId, id)
}
}
//尝试进入
if s, ok := ss[id]; ok && s != nil {
if s.PlayerEnter(p, -1, true) {
this.OnPlayerEnter(p, id)
return gamehall_proto.OpResultCode_Hundred_OPRC_Sucess_Hundred
logger.Logger.Infof("HundredSceneMgr PlayerEnter(platform=%v snid=%v) enter %v scene success.", platform.IdStr, p.SnId, id)
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred
} else {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) enter %v scene failed.", platformName, id)
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v snid=%v) enter %v scene failed.", platform.IdStr, p.SnId, id)
}
} else {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) get %v scene failed.", platformName, id)
}
}
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) snid:%v find in id:%v csp.PlayerEnter return false", platformName, p.SnId, id)
return gamehall_proto.OpResultCode_Hundred_OPRC_SceneServerMaintain_Hundred
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v) get %v scene failed.", platform.IdStr, id)
}
func (this *HundredSceneMgr) OnPlayerEnter(p *Player, id int32) {
this.playerIning[p.SnId] = id
return gamehallproto.OpResultCode_Hundred_OPRC_SceneServerMaintain_Hundred
}
// PlayerLeave 离开房间
// 游戏服通知玩家离开房间
func (this *HundredSceneMgr) PlayerLeave(p *Player, reason int) bool {
if p == nil {
return false
}
if _, ok := this.playerIning[p.SnId]; ok {
if p.scene != nil {
p.scene.PlayerLeave(p, reason)
} else {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) found scene=nil", p.SnId)
delete(this.playerIning, p.SnId)
}
return true
} else {
if p.scene != nil && p.scene.IsHundredScene() {
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) exception scene=%v gameid=%v", p.SnId, p.scene.sceneId, p.scene.gameId)
p.scene.PlayerLeave(p, reason)
return true
}
}
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) not found in hundred scene", p.SnId)
if p == nil || p.scene == nil || p.scene.hp == nil {
return false
}
func (this *HundredSceneMgr) PlayerTryLeave(p *Player) gamehall_proto.OpResultCode_Hundred {
if p.scene == nil || p.scene.gameSess == nil {
logger.Logger.Tracef("(csm *HundredSceneMgr) PlayerTryLeave p.scene == nil || p.scene.gameSess == nil snid:%v ", p.SnId)
return 1
}
//通知gamesrv托管
if _, ok := this.playerIning[p.SnId]; ok {
pack := &gamehall_proto.CSLeaveRoom{Mode: proto.Int(0)}
proto.SetDefaults(pack)
common.TransmitToServer(p.sid, int(gamehall_proto.GameHallPacketID_PACKET_CS_LEAVEROOM), pack, p.scene.gameSess.Session)
}
return 0
p.scene.PlayerLeave(p, reason)
return false
}
func (this *HundredSceneMgr) OnPlayerLeave(p *Player) {
delete(this.playerIning, p.SnId)
// PlayerTryLeave 玩家尝试离开房间
// 给游戏服发离开消息
func (this *HundredSceneMgr) PlayerTryLeave(p *Player) gamehallproto.OpResultCode_Hundred {
if !this.InHundredScene(p) {
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerTryLeave !csm.InCoinScene(p) snid:%v ", p.SnId)
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred
}
func (this *HundredSceneMgr) OnDestroyScene(sceneid int) {
var s *Scene
if platformName, ok := this.platformOfScene[int32(sceneid)]; ok {
if ss, ok := this.scenesOfPlatform[platformName]; ok {
pack := &gamehallproto.CSLeaveRoom{Mode: proto.Int(0)}
common.TransmitToServer(p.sid, int(gamehallproto.GameHallPacketID_PACKET_CS_LEAVEROOM), pack, p.scene.gameSess.Session)
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred // ???
}
// OnDestroyScene 房间销毁
func (this *HundredSceneMgr) OnDestroyScene(sceneId int) {
s := SceneMgrSingleton.GetScene(sceneId)
if s == nil {
return
}
plt := SceneMgrSingleton.GetPlatformBySceneId(sceneId)
if plt == "" {
return
}
if ss, ok := this.scenesOfPlatform[plt]; ok {
for id, scene := range ss {
if scene.sceneId == sceneid {
s = scene
if scene.sceneId == sceneId {
if scene != s {
logger.Logger.Errorf("bug")
}
//删除玩家
for pid, hid := range this.playerIning {
if hid == id {
delete(this.playerIning, pid)
//TODO 非正常删除房间时,尝试同步金币
player := PlayerMgrSington.GetPlayerBySnId(pid)
if player != nil {
if !player.IsRob {
ctx := scene.GetPlayerGameCtx(player.SnId)
for _, v := range scene.players {
if v != nil {
if !v.IsRob {
ctx := scene.GetPlayerGameCtx(v.SnId)
if ctx != nil {
//发送一个探针,等待ack后同步金币
player.TryRetrieveLostGameCoin(sceneid)
v.TryRetrieveLostGameCoin(sceneId)
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneId, v.SnId)
}
}
}
}
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneid, player.SnId)
}
}
}
}
}
scene.hp = nil
delete(ss, id)
break
}
}
}
}
if groupId, ok := this.groupOfScene[int32(sceneid)]; ok {
if ss, ok := this.scenesOfGroup[groupId]; ok {
for id, scene := range ss {
if scene.sceneId == sceneid {
s = scene
//删除玩家
for pid, hid := range this.playerIning {
if hid == id {
delete(this.playerIning, pid)
//TODO 非正常删除房间时,尝试同步金币
player := PlayerMgrSington.GetPlayerBySnId(pid)
if player != nil {
if !player.IsRob {
ctx := scene.GetPlayerGameCtx(player.SnId)
if ctx != nil {
//发送一个探针,等待ack后同步金币
player.TryRetrieveLostGameCoin(sceneid)
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneid, player.SnId)
}
}
}
}
}
delete(ss, id)
break
}
}
}
}
this.PreCreateGame(s.limitPlatform.IdStr, []int32{s.dbGameFree.Id})
this.tryCreateRoom(plt, s.dbGameFree.Id)
}
func (this *HundredSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
//多平台支持
platformName := DefaultPlatform
platform := PlatformMgrSingleton.GetPlatform(p.Platform)
if platform != nil && platform.Isolated {
platformName = platform.IdStr
} else if p.Platform != DefaultPlatform {
platform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
}
var nums [HundredSceneType_Max]int32
wantNum := []int32{80, 50, 30, 20, 0}
for i := 0; i < HundredSceneType_Max; i++ {
platform := p.GetPlatform()
var nums [10]int32
wantNum := [10]int32{80, 50, 30, 20, 10, 10, 10, 10, 10, 10}
for i := 0; i < 10; i++ {
if wantNum[i]/2 > 0 {
nums[i] = rand.Int31n(wantNum[i]/2) + wantNum[i]
}
}
if platform == nil {
return nums[:]
}
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
for _, id := range ids {
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
if gps != nil {
if gps.GroupId != 0 {
if ss, exist := this.scenesOfGroup[gps.GroupId]; exist {
for _, s := range ss {
if s.paramsEx[0] == id {
dbGame := srvdata.PBDB_GameFreeMgr.GetData(s.paramsEx[0])
sceneType := int(dbGame.GetSceneType()) - 1
if sceneType == -2 {
//体验场
sceneType = HundredSceneType_Experience
}
truePlayerCount := int32(s.GetPlayerCnt())
//获取fake用户数量
var fakePlayerCount int32
//if truePlayerCount >= 21 {
// correctNum := dbGame.GetCorrectNum()
// correctRate := dbGame.GetCorrectRate()
// fakePlayerCount = correctNum + truePlayerCount*correctRate/100 + dbGame.GetDeviation()
//}
if sceneType >= 0 && sceneType < HundredSceneType_Max {
nums[sceneType] += int32(truePlayerCount + fakePlayerCount)
}
break
}
}
}
} else {
if ss, ok := this.scenesOfPlatform[platformName]; ok {
for _, s := range ss {
if s.paramsEx[0] == id {
dbGame := srvdata.PBDB_GameFreeMgr.GetData(s.paramsEx[0])
sceneType := int(dbGame.GetSceneType()) - 1
if sceneType == -2 {
//体验场
sceneType = HundredSceneType_Experience
}
truePlayerCount := int32(s.GetPlayerCnt())
//获取fake用户数量
var fakePlayerCount int32
//if truePlayerCount >= 21 {
// correctNum := dbGame.GetCorrectNum()
// correctRate := dbGame.GetCorrectRate()
// fakePlayerCount = correctNum + truePlayerCount*correctRate/100 + dbGame.GetDeviation()
//}
if sceneType >= 0 && sceneType < HundredSceneType_Max {
nums[sceneType] += int32(truePlayerCount + fakePlayerCount)
}
break
if ss, ok := this.scenesOfPlatform[platform.IdStr]; ok {
if s, exist := ss[id]; exist && s.dbGameFree != nil {
sceneType := s.dbGameFree.GetSceneType() - 1
if sceneType >= 0 && int(sceneType) < len(nums) {
nums[sceneType] += int32(s.GetPlayerCnt())
}
}
}
}
}
if len(ids) <= 10 {
return nums[:len(ids)]
}
return nums[:]
}
func (this *HundredSceneMgr) InHundredScene(p *Player) bool {
if p == nil {
logger.Logger.Tracef("(this *HundredSceneMgr) InHundredScene p == nil snid:%v ", p.SnId)
return false
}
if _, ok := this.playerIning[p.SnId]; ok {
if p.scene == nil {
return false
}
if p.scene.hp == nil {
return false
}
return true
}
logger.Logger.Tracef("(csm *HundredSceneMgr) InHundredScene false snid:%v ", p.SnId)
return false
}
func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Platform, dbGameFree *server_proto.DB_GameFree) *Scene {
func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Platform, dbGameFree *serverproto.DB_GameFree) *Scene {
if dbGameFree != nil {
dbGameRule := srvdata.PBDB_GameRuleMgr.GetData(dbGameFree.GetGameRule())
if dbGameRule != nil {
@ -396,16 +206,11 @@ func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Pl
sceneId := SceneMgrSingleton.GenOneHundredSceneId()
gameMode := dbGameRule.GetGameMode()
params := common.CopySliceInt32ToInt64(dbGameRule.GetParams())
//SceneType := dbGameFree.GetSceneType()
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public, 1, -1, params, gs, limitPlatform, groupId, dbGameFree, id)
if scene != nil {
logger.Logger.Infof("Create hundred scene %v-%v success.", gameId, sceneId)
scene.hallId = id
//移动到SceneMgr中集中处理
//if !scene.IsMatchScene() {
// //平台水池设置
// gs.DetectCoinPoolSetting(limitPlatform.Name, scene.hallId, scene.groupId)
//}
scene.hp = this
return scene
} else {
logger.Logger.Errorf("Create hundred scene %v-%v failed.", gameId, sceneId)
@ -419,134 +224,143 @@ func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Pl
} else {
logger.Logger.Errorf("Game free data %v no found.", id)
}
return nil
}
func (this *HundredSceneMgr) TryCreateRoom() {
if model.GameParamData.HundredScenePreCreate {
arr := srvdata.PBDB_GameFreeMgr.Datas.GetArr()
for _, dbGame := range arr {
if dbGame.GetGameId() <= 0 {
continue
}
if common.IsHundredType(dbGame.GetGameType()) { //百人场
id := dbGame.GetId()
for k, ss := range this.scenesOfPlatform {
if _, exist := ss[id]; !exist {
limitPlatform := PlatformMgrSingleton.GetPlatform(k)
if limitPlatform == nil || !limitPlatform.Isolated {
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
k = DefaultPlatform
continue
}
gps := PlatformMgrSingleton.GetGameFree(limitPlatform.IdStr, id)
if gps != nil && gps.GroupId == 0 && gps.Status {
scene := this.CreateNewScene(id, gps.GroupId, limitPlatform, gps.DbGameFree)
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(platform) ", id, k, scene)
if scene != nil {
this.platformOfScene[int32(scene.sceneId)] = k
ss[id] = scene
}
}
}
}
}
}
}
}
func (this *HundredSceneMgr) PreCreateGame(platform string, createIds []int32) {
limitPlatform := PlatformMgrSingleton.GetPlatform(platform)
func (this *HundredSceneMgr) tryCreateRoom(plt string, id ...int32) {
limitPlatform := PlatformMgrSingleton.GetPlatform(plt)
if limitPlatform == nil || !limitPlatform.Isolated {
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
}
if this.scenesOfPlatform[platform] == nil {
this.scenesOfPlatform[platform] = make(map[int32]*Scene)
if this.scenesOfPlatform[plt] == nil {
this.scenesOfPlatform[plt] = make(map[int32]*Scene)
}
//var platformName string
platformData := PlatformMgrSingleton.GetPlatform(platform)
if platformData != nil && platformData.Isolated {
//platformName = platformData.Name
} else if platform != DefaultPlatform {
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
}
if platformData.IdStr == DefaultPlatform {
if limitPlatform.IdStr == DefaultPlatform {
return
}
if model.GameParamData.HundredScenePreCreate {
//不创建已经存在的场景
for _, id := range createIds {
dbGame := srvdata.PBDB_GameFreeMgr.GetData(id)
if common.IsHundredType(dbGame.GetGameType()) {
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
if gps != nil && gps.Status {
if gps.GroupId != 0 {
if this.scenesOfGroup[gps.GroupId] != nil && this.scenesOfGroup[gps.GroupId][id] != nil {
continue
} else {
scene := this.CreateNewScene(dbGame.GetId(), gps.GroupId, limitPlatform, gps.DbGameFree)
f := func(i int32) {
if this.scenesOfPlatform[plt][i] != nil {
return
}
gps := PlatformMgrSingleton.GetGameFree(plt, i)
if !common.IsHundredType(gps.GetDbGameFree().GetGameType()) {
return
}
scene := this.CreateNewScene(i, gps.GroupId, limitPlatform, gps.DbGameFree)
if scene != nil {
this.scenesOfGroup[gps.GroupId][id] = scene
this.groupOfScene[int32(scene.sceneId)] = gps.GroupId
this.scenesOfPlatform[plt][i] = scene
scene.hp = this
logger.Logger.Infof("HundredSceneMgr PreCreateRoom Platform:%v Id:%v", plt, i)
}
}
if len(id) == 0 {
// 所有百人场
for _, vv := range srvdata.PBDB_GameFreeMgr.Datas.GetArr() {
f(vv.GetId())
}
} else {
if this.scenesOfPlatform[platform] != nil && this.scenesOfPlatform[platform][dbGame.GetId()] != nil {
continue
for _, v := range id {
f(v)
}
}
}
// TryCreateRoom 预创建房间
func (this *HundredSceneMgr) TryCreateRoom() {
if !model.GameParamData.HundredScenePreCreate {
return
}
for _, v := range PlatformMgrSingleton.GetPlatforms() {
this.tryCreateRoom(v.IdStr)
}
}
func (this *HundredSceneMgr) OnPlatformChangeIsolated(p *Platform, isolated bool) {
if p == nil {
return
}
if isolated { //孤立
this.OnPlatformCreate(p) //预创建场景
} else {
scene := this.CreateNewScene(dbGame.GetId(), gps.GroupId, limitPlatform, gps.DbGameFree)
if scene != nil {
this.platformOfScene[int32(scene.sceneId)] = platform
this.scenesOfPlatform[platform][dbGame.GetId()] = scene
this.OnPlatformDestroy(p)
}
}
func (this *HundredSceneMgr) GetPlatformSceneByGameFreeId(platform string, gameFreeIds []int32) []*Scene {
platformName := DefaultPlatform
platformData := PlatformMgrSingleton.GetPlatform(platform)
if platformData != nil && platformData.Isolated {
platformName = platformData.IdStr
} else if platform != DefaultPlatform {
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
}
if platformData == nil {
return nil
}
}
}
}
}
func (this *HundredSceneMgr) OnPlatformCreate(p *Platform) {
if p != nil && p.Isolated && p.IdStr != DefaultPlatform {
if _, exist := this.scenesOfPlatform[p.IdStr]; !exist {
this.scenesOfPlatform[p.IdStr] = make(map[int32]*Scene)
if model.GameParamData.HundredScenePreCreate {
arr := srvdata.PBDB_GameFreeMgr.Datas.GetArr()
for _, dbGame := range arr {
if common.IsHundredType(dbGame.GetGameType()) { //百人场
id := dbGame.GetId()
gps := PlatformMgrSingleton.GetGameFree(p.IdStr, id)
var scenes []*Scene
for _, id := range gameFreeIds {
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
if gps != nil {
if gps.GroupId != 0 {
if ss, ok := this.scenesOfGroup[gps.GroupId]; ok {
if _, exist := ss[id]; !exist {
pgg := PlatformGameGroupMgrSington.GetGameGroup(gps.GroupId)
if pgg != nil {
scene := this.CreateNewScene(id, gps.GroupId, p, pgg.DbGameFree)
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(group) ", id, gps.GroupId, scene)
if scene != nil {
ss[id] = scene
if ss, ok := this.scenesOfPlatform[platformName]; ok {
if s, exist := ss[id]; exist && s != nil {
scenes = append(scenes, s)
}
}
}
}
} else {
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
if _, exist := ss[id]; !exist {
scene := this.CreateNewScene(id, gps.GroupId, p, gps.DbGameFree)
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(platform) ", id, p.Name, scene)
if scene != nil {
ss[id] = scene
return scenes
}
func (this *HundredSceneMgr) GetPlatformScene(platform string, gameId int32) []*Scene {
gameFreeIds := gameStateMgr.gameIds[gameId]
gameScenes := this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
if len(gameScenes) != len(gameFreeIds) {
var createIds []int32
for _, gfi := range gameFreeIds {
bFind := false
for _, s := range gameScenes {
if s.dbGameFree.GetId() == gfi {
bFind = true
break
}
}
if !bFind {
createIds = append(createIds, gfi)
}
}
if len(createIds) > 0 {
this.tryCreateRoom(platform, createIds...)
gameScenes = this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
}
}
return gameScenes
}
func (this *HundredSceneMgr) ModuleName() string {
return "HundredSceneMgr"
}
func (this *HundredSceneMgr) Init() {
this.TryCreateRoom()
}
func (this *HundredSceneMgr) Update() {
}
func (this *HundredSceneMgr) Shutdown() {
module.UnregisteModule(this)
}
func (this *HundredSceneMgr) OnPlatformCreate(p *Platform) {
if model.GameParamData.HundredScenePreCreate {
this.tryCreateRoom(p.IdStr)
}
}
@ -563,34 +377,12 @@ func (this *HundredSceneMgr) OnPlatformDestroy(p *Platform) {
}
}
func (this *HundredSceneMgr) OnPlatformChangeIsolated(p *Platform, isolated bool) {
if p != nil {
if isolated { //孤立
this.OnPlatformCreate(p) //预创建场景
} else {
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
var ids []int
for _, scene := range ss {
ids = append(ids, scene.sceneId)
}
SceneMgrSingleton.DoDelete(ids, true)
}
}
}
}
func (this *HundredSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
if p == nil {
return
}
if disabled {
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
var ids []int
for _, scene := range ss {
ids = append(ids, scene.sceneId)
}
SceneMgrSingleton.DoDelete(ids, true)
}
this.OnPlatformDestroy(p)
}
}
@ -598,14 +390,6 @@ func (this *HundredSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCf
if p == nil || newCfg == nil {
return
}
if oldCfg.GroupId != newCfg.GroupId || oldCfg.GroupId != 0 {
if scenes, exist := this.scenesOfGroup[oldCfg.GroupId]; exist {
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
s.DoDelete(false)
}
}
return
}
if scenes, exist := this.scenesOfPlatform[p.IdStr]; exist {
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
s.DoDelete(false)
@ -614,99 +398,7 @@ func (this *HundredSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCf
}
func (this *HundredSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
if newCfg == nil {
return
}
if scenes, exist := this.scenesOfGroup[newCfg.Id]; exist {
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
needDestroy := false
if s.dbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
s.dbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
s.dbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
s.dbGameFree.GetMaxCoinLimit() != newCfg.DbGameFree.GetMaxCoinLimit() ||
!common.SliceInt64Equal(s.dbGameFree.GetRobotTakeCoin(), newCfg.DbGameFree.GetRobotTakeCoin()) ||
!common.SliceInt64Equal(s.dbGameFree.GetRobotLimitCoin(), newCfg.DbGameFree.GetRobotLimitCoin()) {
needDestroy = true
}
if needDestroy {
SceneMgrSingleton.DoDelete([]int{s.sceneId}, true)
}
}
}
}
func (this *HundredSceneMgr) GetPlatformSceneByGameFreeId(platform string, gameFreeIds []int32) []*Scene {
platformName := DefaultPlatform
platformData := PlatformMgrSingleton.GetPlatform(platform)
if platformData != nil && platformData.Isolated {
platformName = platformData.IdStr
} else if platform != DefaultPlatform {
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
}
gameScenes := []*Scene{}
for _, id := range gameFreeIds {
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
if gps != nil {
if gps.GroupId != 0 {
if ss, exist := this.scenesOfGroup[gps.GroupId]; exist {
if s, exist := ss[id]; exist && s != nil {
gameScenes = append(gameScenes, s)
}
}
} else {
if ss, ok := this.scenesOfPlatform[platformName]; ok {
if s, exist := ss[id]; exist && s != nil {
gameScenes = append(gameScenes, s)
}
}
}
}
}
return gameScenes
}
func (this *HundredSceneMgr) GetPlatformScene(platform string, gameid int32) []*Scene {
gameFreeIds := gameStateMgr.gameIds[gameid]
gameScenes := this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
if len(gameScenes) != len(gameFreeIds) {
createIds := []int32{}
for _, gfi := range gameFreeIds {
bFind := false
for _, s := range gameScenes {
if s.dbGameFree.GetId() == gfi {
bFind = false
break
}
}
if !bFind {
createIds = append(createIds, gfi)
}
}
if len(createIds) > 0 {
this.PreCreateGame(platform, createIds)
gameScenes = this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
}
}
return gameScenes
}
func (this *HundredSceneMgr) ModuleName() string {
return "HundredSceneMgr"
}
func (this *HundredSceneMgr) Init() {
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
if platform.Isolated || platform.IdStr == DefaultPlatform {
this.scenesOfPlatform[platform.IdStr] = make(map[int32]*Scene)
}
}
}
// 撮合
func (this *HundredSceneMgr) Update() {
}
func (this *HundredSceneMgr) Shutdown() {
module.UnregisteModule(this)
}
func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
@ -723,8 +415,9 @@ func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFree
SceneMgrSingleton.DoDelete(ids, true)
}
}
func init() {
module.RegisteModule(HundredSceneMgrSington, time.Second*5, 0)
PlatformMgrSingleton.RegisterObserver(HundredSceneMgrSington)
PlatformGameGroupMgrSington.RegisteObserver(HundredSceneMgrSington)
module.RegisteModule(HundredSceneMgrSingleton, time.Second*5, 0)
PlatformMgrSingleton.RegisterObserver(HundredSceneMgrSingleton)
PlatformGameGroupMgrSington.RegisteObserver(HundredSceneMgrSingleton)
}

View File

@ -69,4 +69,7 @@ func init() {
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitExchange, &model.BackendPermitExchange{})
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitJoin, &model.BackendPermitJoin{})
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitTask, &model.BackendPermitTask{})
LogChannelSingleton.RegisterLogCName(mq.BackClientLog, &model.ClientLogMysql{})
LogChannelSingleton.RegisterLogCName(mq.BackSystemJyb, &model.JybLog{})
LogChannelSingleton.RegisterLogCName(mq.DBVipGiftLog, &model.DbVip{})
}

View File

@ -15,6 +15,7 @@ type PlayerMatchContext struct {
copySnid int32
copyLv int32
copyRoleId int32
copySkinId int32
}
type MatchContextSlice []*PlayerMatchContext
@ -39,22 +40,22 @@ func (p MatchContextSlice) Sort(isFinals bool) {
for i, mc := range p {
mc.rank = int32(i + 1)
}
if isFinals {
// 积分相同名次相同
lastRank := int32(0)
lastGrade := int32(0)
for i := 0; i < len(p); i++ {
mc := p[i]
if i > 0 && mc.grade == lastGrade {
mc.rank = lastRank
}
lastRank = mc.rank
lastGrade = mc.grade
}
}
//if isFinals {
// // 积分相同名次相同
// lastRank := int32(0)
// lastGrade := int32(0)
// for i := 0; i < len(p); i++ {
// mc := p[i]
// if i > 0 && mc.grade == lastGrade {
// mc.rank = lastRank
// }
// lastRank = mc.rank
// lastGrade = mc.grade
// }
//}
}
func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId int32, seq int) *PlayerMatchContext {
func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId, skinId int32, seq int) *PlayerMatchContext {
if !p.IsRob {
snid = p.SnId
}
@ -67,5 +68,6 @@ func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId int32, seq
copySnid: snid,
copyLv: lv,
copyRoleId: roleId,
copySkinId: skinId,
}
}

View File

@ -97,7 +97,6 @@ func (ms *MatchSceneMgr) MatchStart(tm *TmMatch) {
}
// 填充机器人
if scene != nil && !scene.IsFull() {
tm.RobotGradesDecline(1)
needRobotNum := scene.playerNum - len(scene.players)
logger.Logger.Trace("MatchStart 填充机器人", needRobotNum)
pack := &server.WGInviteMatchRob{

View File

@ -129,7 +129,7 @@ func (cfg *GameList) GetGameConfig(gameFreeId int32) *webapiproto.GameFree {
return nil
}
func CompareGameFreeConfigChged(oldCfg, newCfg *webapiproto.GameFree) bool {
func CompareGameFreeConfigChanged(oldCfg, newCfg *webapiproto.GameFree) bool {
if oldCfg.Status != newCfg.Status ||
oldCfg.GroupId != newCfg.GroupId ||
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||

View File

@ -243,7 +243,7 @@ func (pm *PlatformMgr) UpsertGameFree(platform string, data *webapiproto.GameFre
pgc.gameId[data.DbGameFree.Id] = append(pgc.gameId[data.DbGameFree.Id], data)
}
// 新增的场次不会通知
if ok && old != nil && !CompareGameFreeConfigChged(old, data) {
if ok && old != nil && !CompareGameFreeConfigChanged(old, data) {
pm.OnPlatformGameFreeUpdate(p, old, data)
pm.SyncGameFree(p.IdStr, data)
}

View File

@ -340,6 +340,13 @@ func (this *Player) OnLogined() {
this.RandRobotExData()
if !this.IsRob {
if isFirstLogin {
cfg := PlatformMgrSingleton.GetConfig(this.Platform).GuideConfig
if cfg == nil || cfg.GetOn() != common.On {
this.GuideStep = -1
}
}
this.SendJackPotInit()
this.GetPayGoodsInfo()
@ -1594,7 +1601,7 @@ func (this *Player) DgGameLogout() {
}
func (this *Player) ThirdGameLogout() {
_LeaveTransferThird2SystemTask(this)
}
func (this *Player) IsOnLine() bool {
@ -3022,6 +3029,7 @@ func (this *Player) SendPlayerInfo() {
VipShopRefreshCount: proto.Int32(this.VipShopRefreshCount),
Signature: this.Signature,
Age: this.Age,
GuideStep: this.GuideStep,
},
}
if this.Roles != nil {
@ -3088,8 +3096,13 @@ func (this *Player) SendPlayerInfo() {
if this.scene != nil && this.thrscene == 0 {
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
}
this.SCItems()
//this.SendJackpotInfo()
// 后台道具配置
this.SCItems()
// 引导配置
this.SCGuide()
// 小精灵配置
this.SCSpirit()
}
//func (this *Player) SendJackpotInfo() {
@ -3680,8 +3693,6 @@ func (this *Player) TryRetrieveLostGameCoin(sceneid int) {
logProbe.SeqNo = this.GameCoinTs
logProbe.RoomId = int32(sceneid)
LogChannelSingleton.WriteLog(logProbe)
//先把玩家身上的钱清掉
//this.Coin = 0
this.SendDiffData()
}
@ -3766,17 +3777,24 @@ func (this *Player) SCVIPInfo() {
LineId: cfg.RewardOutlineID,
ShopId2: cfg.ShopId2,
ShopId7: cfg.ShopId7,
MatchFreeTimes: cfg.MatchFreeTimes + this.GetSkillAdd(common.SkillIdVipTimes),
MatchFreeTimes: cfg.MatchFreeTimes,
Privilege9: cfg.Privilege9,
}
money := cfg.Privilege1[0]
d := srvdata.PBDB_VIPMgr.GetData(cfg.VipId)
if d != nil {
data.PrivilegeShow = d.GetPrivilegeShow()
}
data.Privilege1 = make(map[int64]int64)
for k, v := range cfg.Privilege1 {
if k == common.ItemIDCoin {
// 皮肤技能加成
add := this.GetSkillAdd(common.SkillIdVipGift)
if add > 0 {
money += int32((float64(money) * float64(add)) / 100.00)
//v += int64((float64(v) * float64(add)) / 100.00)
}
}
data.Privilege1[k] = v
}
data.Privilege1 = make([]int32, len(cfg.Privilege1))
copy(data.Privilege1, cfg.Privilege1)
data.Privilege1[0] = money
for itemId, itemNum := range cfg.Award {
data.Item = append(data.Item, &playerproto.ItemInfo{
ItemId: int32(itemId),
@ -3789,10 +3807,11 @@ func (this *Player) SCVIPInfo() {
ItemNum: itemNum,
})
}
data.BagStatus = make([]int32, 3)
data.BagStatus = make([]int32, 4)
data.BagStatus[0] = 0 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
data.BagStatus[1] = 0 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
data.BagStatus[2] = this.GetPlayerVipBagStatus(cfg.ShopId7, cfg.VipId) //固定VIP礼包 0可领取 1不可领取 可以领取所有VIP等级的奖励
data.BagStatus[3] = this.GetPlayerVipBagStatus(1, cfg.VipId) // 等级礼包 0可领取 1不可领取
if cfg.VipId != this.VIP {
data.BagStatus[0] = 1 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
data.BagStatus[1] = 1 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
@ -3812,70 +3831,124 @@ func (this *Player) SCVIPInfo() {
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
logger.Logger.Tracef("send vipinfo to client:%v", pack)
}
func (this *Player) GetVIPExpByPay(payTotal int32) int32 {
vips := VipMgrSington.GetVIPcfg(this.Platform)
return int32(math.Floor(float64(payTotal) * vips.MoneyRatio / 100))
}
func (this *Player) VIPDraw(id int32) {
//WelfareMgrSington.MonitorWelfData(this)
func (this *Player) VIPDraw(id, vip int32) {
pack := &playerproto.SCVIPDraw{
Id: id,
OpRetCode: playerproto.OpResultCode_OPRC_Error,
Award: make(map[int64]int64),
}
if id != 0 {
send := func() {
pack.Vip = vip
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
logger.Logger.Tracef("send vipdraw to client:%v", pack)
return
}
if this.WelfData.VIPBag == nil {
this.WelfData.VIPBag = make(map[int32]map[int32]int32)
}
if innerMap, ok := this.WelfData.VIPBag[this.VIP]; ok {
if _, ok := innerMap[0]; ok {
switch id {
case 0: // 每日礼包只能领当前VIP等级的
vip = this.VIP
if innerMap, ok := this.WelfData.VIPBag[vip]; ok {
if _, ok := innerMap[id]; ok {
logger.Logger.Trace("VIPDraw VIP is repeat id%v ", id)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
send()
return
}
} else {
this.WelfData.VIPBag[this.VIP] = make(map[int32]int32)
}
case 1: // VIP等级礼包
if this.GetPlayerVipBagStatus(1, vip) == 1 {
send()
return
}
default:
send()
return
}
vips := VipMgrSington.GetVIPcfg(this.Platform)
if vips != nil {
for _, data := range vips.List {
if data.VipId == this.VIP {
if this.WelfData.VIPBag[vip] == nil {
this.WelfData.VIPBag[vip] = make(map[int32]int32)
}
data := VipMgrSington.GetVipCfg(this.Platform, vip)
if data != nil {
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
this.WelfData.VIPBag[this.VIP][0] = 1
//金币数量
money := data.Privilege1[0]
this.WelfData.VIPBag[vip][id] = 1
switch id {
case 0:
var money, addVipExp int64
for k, v := range data.Privilege1 {
switch k {
case common.ItemIDCoin:
money = v
// 皮肤技能加成
add := this.GetSkillAdd(common.SkillIdVipGift)
if add > 0 {
money += int32((float64(money) * float64(add)) / 100.00)
money += int64((float64(money) * float64(add)) / 100.00)
}
//vip经验
addVipExp := int64(float64(data.Privilege1[1]) / vips.MoneyRatio)
this.AddCoin(int64(money), 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
this.AddCoin(money, 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
pack.Award[common.ItemIDCoin] = money
case common.ItemIDVipExp:
vips := VipMgrSington.GetVIPcfg(this.Platform)
addVipExp = int64(float64(v) / vips.MoneyRatio)
this.AddMoneyPayTotal(addVipExp)
pack.Vip = this.VIP
pack.Award[common.ItemIDVipExp] = addVipExp
default:
BagMgrSingleton.AddItemsV2(&ItemParam{
P: this,
Change: []*Item{
{
ItemId: int32(k),
ItemNum: v,
},
},
GainWay: common.GainWay_VIPGift,
Operator: "system",
Remark: "VIP每日礼包",
})
pack.Award[k] += v
}
}
logger.Logger.Tracef("玩家领取VIP每日礼包成功snid = %v,Vip = %v,金币数量 = %vaddVipEx = %v", this.SnId, this.VIP, money, addVipExp)
//VIP礼包统计数据
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
var item []model.ItemInfo
item = append(item, model.ItemInfo{ItemId: 1, ItemNum: int64(money)})
item = append(item, model.ItemInfo{ItemId: 1, ItemNum: money})
log := model.NewDbVip(this.Platform, this.SnId, this.VIP, 0, 0, 0, item, 0, "Vip每日礼包")
return model.InsertDbVipLog(log)
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
if data != nil {
logger.Logger.Errorf("err:", data.(error))
}
}), "VIPDraw").Start()
break
}
}
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
LogChannelSingleton.WriteLog(log)
case 1:
var items []*Item
var itemInfo []model.ItemInfo
for k, v := range data.Privilege9 {
items = append(items, &Item{
ItemId: int32(k),
ItemNum: v,
})
itemInfo = append(itemInfo, model.ItemInfo{ItemId: int32(k), ItemNum: v})
pack.Award[k] = v
}
BagMgrSingleton.AddItemsV2(&ItemParam{
P: this,
Change: items,
GainWay: common.GainWayVipGift9,
Operator: "system",
Remark: "VIP等级礼包",
})
logger.Logger.Tracef("玩家领取VIP等级礼包成功snid = %v,Vip = %v,items %#v", this.SnId, this.VIP, items)
//VIP礼包统计数据
log := model.NewDbVip(this.Platform, this.SnId, this.VIP, 9, 0, 0, itemInfo, 0, "Vip等级礼包")
LogChannelSingleton.WriteLog(log)
}
}
send()
}
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
@ -4060,6 +4133,9 @@ func (this *Player) GetPayGoodsInfo() {
PayGoodsInfo := &playerproto.SCPayGoodsInfo{
Gold: info.Amount,
Item: itemInfo,
ShopId: info.ShopId,
Money: int64(info.ConsumeTypeNum),
Name: info.Remark,
}
proto.SetDefaults(PayGoodsInfo)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo)
@ -4303,16 +4379,11 @@ func (this *Player) UpdatePlayerVipBag(shopId int32) {
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
//VIP金币礼包&VIP固定礼包统计数据
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
var item []model.ItemInfo
item = append(item, model.ItemInfo{ItemId: shopInfo.Type, ItemNum: shopInfo.Amount})
log := model.NewDbVip(this.Platform, this.SnId, shopInfo.VipLevel, shopInfo.Type, shopInfo.ConstType, int64(shopInfo.CostArea[0]), item, shopInfo.Id, shopInfo.Name)
return model.InsertDbVipLog(log)
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
if data != nil {
logger.Logger.Errorf("err:", data.(error))
}
}), "UpdatePlayerVipBag").Start()
log := model.NewDbVip(this.Platform, this.SnId, shopInfo.VipLevel, shopInfo.Type, shopInfo.ConstType,
int64(shopInfo.CostArea[0]), item, shopInfo.Id, shopInfo.Name)
LogChannelSingleton.WriteLog(log)
}
//判断是否是礼包周卡
if shopInfo.Page == ShopPageGift {
@ -4323,7 +4394,7 @@ func (this *Player) UpdatePlayerVipBag(shopId int32) {
// 判断vip特权某个礼包是否领取过 返回值0可领取 1 不可领取
func (this *Player) GetPlayerVipBagStatus(shopId, vipLevel int32) int32 {
if vipLevel > this.VIP {
if vipLevel > this.VIP || vipLevel < 0 {
return 1
}
if this.WelfData == nil || this.WelfData.VIPBag == nil {
@ -4343,14 +4414,16 @@ func (this *Player) UpdateVipShopData() {
this.VipShopRefreshCount = 0
//每日礼包 和每日金币礼包需要初始化
if this.WelfData != nil && this.WelfData.VIPBag != nil {
delKeyList := []int32{}
var delKeyList []int32
for _, data := range this.WelfData.VIPBag {
for shopId, shopType := range data {
if shopId == 0 {
//初始化每日礼包
switch shopId {
case 0: // 每日礼包
delKeyList = append(delKeyList, shopId)
logger.Logger.Trace("初始化VIP每日礼包")
} else {
case 1: // 等级礼包,不需要重置
default:
if shopType == 1 {
delKeyList = append(delKeyList, shopId)
logger.Logger.Trace("初始化VIP每日固定礼包")
@ -4867,3 +4940,31 @@ func (this *Player) AutoSkinUnlock() {
func (this *Player) GetSkillAdd(id int32) int32 {
return this.GetSkillAdd2(id, PlatformMgrSingleton.ConfigMgr)
}
func (this *Player) SCGuide() {
cfg := PlatformMgrSingleton.GetConfig(this.Platform).GuideConfig
pack := &playerproto.SCGuideConfig{
On: cfg.GetOn(),
Skip: cfg.GetSkip(),
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCGuideConfig), pack)
logger.Logger.Tracef("SCGuideConfig: %v", pack)
}
func (this *Player) SCSpirit() {
cfg := PlatformMgrSingleton.GetConfig(this.Platform).SpiritConfig
if cfg == nil {
return
}
pack := &playerproto.SCDataConfig{
Cfg: []*playerproto.Config{
{
Tp: 1,
On: cfg.On == 1,
Value: cfg.Url,
},
},
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCDataConfig), pack)
logger.Logger.Tracef("SCDataConfig: %v", pack)
}

View File

@ -106,6 +106,7 @@ type Scene struct {
matchId int64 //比赛场id
csp *CoinScenePool // 所在场景池
hp *HundredSceneMgr // 百人场房间池
}
// NewScene 创建房间
@ -276,8 +277,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
case this.IsCoinScene():
case this.IsHundredScene():
// todo 删除这个标记
HundredSceneMgrSington.OnPlayerEnter(p, this.paramsEx[0])
case this.IsMatchScene():
}
@ -293,7 +293,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
takeCoin := p.Coin
leaveCoin := int64(0)
gameTimes := rand.Int31n(100)
matchParams := []int32{} //排名、段位、假snid、假角色
matchParams := []int32{} //排名、段位、假snid、假角色、假皮肤
if this.IsMatchScene() && p.matchCtx != nil {
takeCoin = int64(p.matchCtx.grade)
@ -304,7 +304,8 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
matchParams = append(matchParams, 1) //段位默认值
}
matchParams = append(matchParams, p.matchCtx.copySnid) //假snid
matchParams = append(matchParams, p.matchCtx.copyRoleId) //假snid
matchParams = append(matchParams, p.matchCtx.copyRoleId) //假RoleId
matchParams = append(matchParams, p.matchCtx.copySkinId) //假SkinId
} else {
if p.IsRob {
if len(this.paramsEx) > 0 { //机器人携带金币动态调整
@ -629,7 +630,6 @@ func (this *Scene) DelPlayer(p *Player) bool {
switch {
case this.IsHundredScene():
HundredSceneMgrSington.OnPlayerLeave(p)
//case this.IsHallScene():
// PlatformMgrSingleton.OnPlayerLeaveScene(this, p)
// for i := 0; i < this.playerNum; i++ {
@ -663,9 +663,7 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
p.scene = this
this.audiences[p.SnId] = p
this.gameSess.AddPlayer(p)
if this.IsHundredScene() {
HundredSceneMgrSington.OnPlayerEnter(p, this.paramsEx[0])
}
//todo:send add msg to gamesrv
data, err := p.MarshalData(this.gameId)
if err == nil {
@ -748,9 +746,6 @@ func (this *Scene) DelAudience(p *Player) bool {
}
p.scene = nil
SceneMgrSingleton.OnPlayerLeaveScene(this, p)
if this.IsHundredScene() {
HundredSceneMgrSington.OnPlayerLeave(p)
}
//from gameserver, so don't need send msg
return true
}
@ -1023,6 +1018,7 @@ func (this *Scene) GetSceneName() string {
}
return "[unknow scene name]"
}
func (this *Scene) RandRobotCnt() {
if len(this.paramsEx) > 0 {
gps := PlatformMgrSingleton.GetGameFree(this.limitPlatform.IdStr, this.paramsEx[0])
@ -1262,3 +1258,17 @@ func (this *Scene) TryForceDelectMatchInfo() {
}
}
}
// CanAudience 是否允许观战
func (this *Scene) CanAudience() bool {
switch {
case this.matchId > 0: // 比赛场
tm := TournamentMgr.GetTm(this.matchId)
if tm != nil {
return tm.gmd.GetAudienceSwitch() == 1
}
return false
default:
return true
}
}

View File

@ -37,6 +37,14 @@ type SceneMgr struct {
hundredSceneAutoId int // 百人场房间号
}
func (m *SceneMgr) GetPlatformBySceneId(sceneId int) string {
s := m.GetScene(sceneId)
if s != nil && s.limitPlatform != nil {
return s.limitPlatform.IdStr
}
return ""
}
// AllocReplayCode 获取回访码
func (m *SceneMgr) AllocReplayCode() string {
code, _ := model.GetOneReplayId()
@ -115,6 +123,19 @@ func (m *SceneMgr) GetScenesByGameFreeId(gameFreeId int32) []*Scene {
return scenes
}
func (m *SceneMgr) GetMatchRoom(sortId int64) []*Scene {
var scenes []*Scene
for _, value := range m.scenes {
if value.matchId == sortId {
s := m.GetScene(value.sceneId)
if s != nil {
scenes = append(scenes, value)
}
}
}
return scenes
}
// MarshalAllRoom 获取房间列表
func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode, clubId, sceneMode, sceneId int,
gameFreeId, snId int32, start, end, pageSize int32) ([]*webapi2.RoomInfo, int32, int32) {
@ -303,7 +324,7 @@ func (m *SceneMgr) DestroyScene(sceneId int, isCompleted bool) {
CoinSceneMgrSingleton.OnDestroyScene(s.sceneId)
case s.IsHundredScene():
HundredSceneMgrSington.OnDestroyScene(s.sceneId)
HundredSceneMgrSingleton.OnDestroyScene(s.sceneId)
case s.IsMatchScene():
MatchSceneMgrSingleton.OnDestroyScene(s.sceneId)

View File

@ -108,6 +108,7 @@ type ExchangeShopInfo struct {
TelCharge int32 //话费
ShopType int32 //商品类型
TelData []*shop.TelChargeData //运营商配置
Items []*shop.ItemInfo //道具
}
func (this *ShopMgr) ModuleName() string {
@ -777,6 +778,13 @@ func (this *ShopMgr) GetExchangeData(platform string, id int32) *ExchangeShopInf
Url: info.Url,
})
}
var items []*shop.ItemInfo
for _, v := range data.GetItems() {
items = append(items, &shop.ItemInfo{
ItemId: v.GetItemId(),
ItemNum: v.GetItemNum(),
})
}
return &ExchangeShopInfo{
Id: data.Id,
Picture: data.Picture,
@ -788,6 +796,7 @@ func (this *ShopMgr) GetExchangeData(platform string, id int32) *ExchangeShopInf
TelCharge: data.TelCharge,
ShopType: data.ShopType,
TelData: telData,
Items: items,
}
}
}
@ -802,6 +811,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
cdata := this.GetExchangeData(p.Platform, goodsId)
pack := &shop.SCShopExchange{
RetCode: shop.OpResultCode_OPRC_VCoinNotEnough,
GoodsId: goodsId,
}
if cdata == nil {
pack.RetCode = shop.OpResultCode_OPRC_ExchangeSoldOut
@ -904,6 +914,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
pack := &shop.SCShopExchange{
RetCode: shop.OpResultCode_OPRC_Error,
GoodsId: goodsId,
}
as := data.(*webapi_proto.SACreateExchangeOrder) // 必不为空
@ -1036,6 +1047,13 @@ func (this *ShopMgr) ExchangeList(p *Player) (ret bool) {
Url: info.Url,
})
}
var items []*shop.ItemInfo
for _, v := range v.GetItems() {
items = append(items, &shop.ItemInfo{
ItemId: v.GetItemId(),
ItemNum: v.GetItemNum(),
})
}
pack.Infos = append(pack.Infos, &shop.ShopExchangeInfo{
Type: v.Type,
Picture: v.Picture,
@ -1052,6 +1070,7 @@ func (this *ShopMgr) ExchangeList(p *Player) (ret bool) {
NotVipShopLimit: v.NotVipShopLimit,
ShopType: v.ShopType,
TelData: telData,
Items: items,
})
}
}

View File

@ -29,6 +29,7 @@ type TmGradeInfo struct {
copySnid int32
copyLv int32
copyRoleId int32
CopySkinId int32
}
type TmMatch struct {
@ -73,6 +74,8 @@ func (tm *TmMatch) Start() {
tm.BroadcastMessage(int(tournament.TOURNAMENTID_PACKET_TM_SCTMStart), pack)
logger.Logger.Trace("SCTMStart ", pack)
tm.RobotGradesDecline(1)
//创建房间
timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
MatchSceneMgrSingleton.MatchStart(tm)
@ -86,6 +89,10 @@ func (tm *TmMatch) Stop() {
logger.Logger.Trace("(this *TmMatch) Stop()")
}
func (tm *TmMatch) GetTotalRound() int32 {
return int32(len(tm.gmd.GetMatchPromotion()) - 1)
}
func (tm *TmMatch) BroadcastMessage(packetId int, rawPack interface{}) {
mgs := make(map[*netlib.Session][]*srvproto.MCSessionUnion)
for _, tmp := range tm.TmPlayer {
@ -135,7 +142,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
tm.robotGrades[round-1] = []*TmGradeInfo{}
var snids []int32
var lvs []int32
var roleIds []int32
var roleIds, skinIds []int32
for _, player := range PlayerMgrSington.snidMap {
if len(snids) > int(lastPromotionNum) {
break
@ -148,6 +155,9 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
roleId = player.Roles.ModId
}
roleIds = append(roleIds, roleId)
if player.Skin != nil && player.Skin.ModId != 0 {
skinIds = append(skinIds, player.Skin.ModId)
}
}
}
if len(snids) <= int(lastPromotionNum) {
@ -164,6 +174,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
snids = append(snids, tmpSnid)
lvs = append(lvs, 1)
roleIds = append(roleIds, int32(2000001))
skinIds = append(skinIds, 300001)
}
}
for i := 0; i < int(lastPromotionNum); i++ {
@ -172,12 +183,22 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
copySnid: snids[i],
copyLv: lvs[i],
copyRoleId: roleIds[i],
CopySkinId: skinIds[i],
}
tm.robotGrades[round-1] = append(tm.robotGrades[round-1], gradeInfo)
}
}
sort.Slice(tm.robotGrades[round-1], func(i, j int) bool {
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid == 0 {
return true
}
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid > 0 {
return tm.robotGrades[round-1][i].grade > tm.robotGrades[round-1][j].grade
}
if tm.robotGrades[round-1][i].copySnid == 0 && tm.robotGrades[round-1][j].copySnid > 0 {
return false
}
return false
})
// 当前轮数据
@ -209,6 +230,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
copySnid: tm.robotGrades[round-1][index].copySnid,
copyLv: tm.robotGrades[round-1][index].copyLv,
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
CopySkinId: tm.robotGrades[round-1][index].CopySkinId,
}
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
}
@ -235,6 +257,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
copySnid: tm.robotGrades[round-1][index].copySnid,
copyLv: tm.robotGrades[round-1][index].copyLv,
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
CopySkinId: tm.robotGrades[round-1][index].CopySkinId,
}
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
}
@ -283,6 +306,7 @@ func (tm *TmMatch) RobotGradesDecline(round int) {
copySnid: info.copySnid,
copyLv: info.copyLv,
copyRoleId: info.copyRoleId,
CopySkinId: info.CopySkinId,
}
tm.robotGrades[lastRound][i] = gradeInfo
if info.copySnid != 0 {
@ -291,11 +315,11 @@ func (tm *TmMatch) RobotGradesDecline(round int) {
}
}
}
logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
for i, infos := range tm.robotGrades {
logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
for _, info := range infos {
logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
}
}
//logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
//for i, infos := range tm.robotGrades {
// logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
// for _, info := range infos {
// logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
// }
//}
}

View File

@ -24,13 +24,8 @@ import (
"mongo.games.com/game/webapi"
)
func init() {
module.RegisteModule(TournamentMgr, time.Second, 0)
ClockMgrSington.RegisteSinker(TournamentMgr)
}
const (
// 如果这里比赛类型没有,默认是锦标赛
const (
MatchTypeNormal = iota + 1 // 锦标赛
MatchTypeChampion // 冠军赛/实物赛
MatchTypeVIP // vip比赛
@ -54,6 +49,11 @@ const (
DaiDing = 2 // 待定
)
func init() {
module.RegisteModule(TournamentMgr, time.Second, 0)
ClockMgrSington.RegisteSinker(TournamentMgr)
}
var TournamentMgr = NewTournament()
type PerRankInfo struct {
@ -78,8 +78,8 @@ type SignupInfo struct {
type PlayerRoundInfo struct {
players []*PlayerMatchContext // 本轮结算信息
ranks []*PlayerMatchContext // 本排名
num int // 本完成人数
ranks []*PlayerMatchContext // 本排名
num int // 本完成人数
}
type Tournament struct {
@ -91,7 +91,7 @@ type Tournament struct {
playerWaitStart map[int32]int64 // 等待时间 玩家Id:等待时长秒
matches map[int32]map[int64]*TmMatch // 开始比赛的数据比赛配置Id:比赛顺序序号:一场开始的比赛数据
players map[int64]map[int32]*PlayerMatchContext // 比赛中玩家 比赛顺序序号:玩家id:玩家信息
roundPlayers map[int64]map[int32]*PlayerRoundInfo // 每轮比赛数据 比赛顺序序号:第几轮
roundPlayers map[int64]map[int32]*PlayerRoundInfo // 每轮比赛数据备份 比赛顺序序号:第几轮
finalPerRank map[int64][]*PerRankInfo // 本场比赛排名,每淘汰一位记录一位,最后记录决赛玩家 比赛顺序序号
MatchAwardNum map[string]map[int32]int32 // 比赛配置Id:比赛奖励次數
}
@ -137,15 +137,16 @@ func (this *Tournament) checkData(cfg *webapiproto.GameMatchDate) bool {
if num%4 != 0 { //必须是4的整倍数
return false
}
if num <= cfg.MatchPromotion[i+1] { //必须递减
return false
}
//if num <= cfg.MatchPromotion[i+1] { //必须递减
// return false
//}
}
}
return true
}
// 记录淘汰人员
func (this *Tournament) addFinalPlayer(sortId int64, p *PerRankInfo) {
if this.finalPerRank[sortId] == nil {
this.finalPerRank[sortId] = []*PerRankInfo{}
@ -153,6 +154,7 @@ func (this *Tournament) addFinalPlayer(sortId int64, p *PerRankInfo) {
this.finalPerRank[sortId] = append(this.finalPerRank[sortId], p)
}
// 查询一场比赛某轮的历史数据
func (this *Tournament) getRoundPlayer(sortId int64, round int32) *PlayerRoundInfo {
_, ok := this.roundPlayers[sortId]
if !ok {
@ -168,6 +170,96 @@ func (this *Tournament) getRoundPlayer(sortId int64, round int32) *PlayerRoundIn
return v
}
// GetRemainNum 剩余比赛人数
func (this *Tournament) GetRemainNum(sortId int64) int32 {
tm := this.GetTm(sortId)
if tm == nil {
return 0
}
round := this.GetRound(sortId)
l := tm.gmd.GetMatchPromotion()
if round <= int32(len(l)) {
return l[round-1]
}
return 0
}
type MatchPlayerInfo struct {
SnId int32
RoleId int32
SkinId int32
Rank int32
Grade int32
}
// GetRemainPlayer 未淘汰的人
func (this *Tournament) GetRemainPlayer(sortId int64) []*MatchPlayerInfo {
tm := this.GetTm(sortId)
if tm == nil {
return nil
}
round := this.GetRound(sortId)
useRobot := this.IsRobotOn(tm.gmd)
var ret []*MatchPlayerInfo
realPlayer := func() {
for _, v := range tm.TmPlayer {
p := PlayerMgrSington.GetPlayerBySnId(v.SnId)
if p != nil {
ret = append(ret, &MatchPlayerInfo{
SnId: v.SnId,
RoleId: p.GetRoleId(),
SkinId: p.Skin.ModId,
Grade: 1000,
})
}
}
}
robotPlayer := func(n int) {
for _, v := range tm.robotGrades[n] {
ret = append(ret, &MatchPlayerInfo{
SnId: v.copySnid,
RoleId: v.copyRoleId,
SkinId: v.CopySkinId,
Grade: v.grade,
})
}
}
if round <= 1 {
if useRobot {
robotPlayer(0)
realPlayer()
} else {
realPlayer()
}
} else {
if useRobot {
robotPlayer(int(round - 1))
} else {
if this.roundPlayers[sortId] != nil {
d := this.roundPlayers[sortId][round-1]
if d != nil {
for _, v := range d.ranks {
ret = append(ret, &MatchPlayerInfo{
SnId: v.copySnid,
RoleId: v.copyRoleId,
SkinId: v.copySkinId,
Grade: v.grade,
})
}
}
}
}
}
return ret
}
// GetSignUpPlayers 获取报名人员
// id 比赛配置id
func (this *Tournament) GetSignUpPlayers(platform string, id int32) map[int32]*TmPlayer {
v, ok := this.signupPlayers[platform]
if !ok {
@ -194,7 +286,7 @@ func (this *Tournament) UpdateData(init bool, data *webapiproto.GameMatchDateLis
this.FixMatchTimeStamp(v)
configs[v.Id] = v
} else {
logger.Logger.Error("GameMatchDate error: ", v)
logger.Logger.Errorf("GameMatchDate check error: %v", v)
}
}
@ -239,14 +331,6 @@ func (this *Tournament) UpdateData(init bool, data *webapiproto.GameMatchDateLis
}
}
this.GameMatchDateList[data.Platform] = configs
//拉取数据
if this.MatchAwardNum == nil {
ret, err := model.GetMatchAwardLog(data.Platform)
logger.Logger.Tracef("ret = %v,err = %v", ret, err)
if err == nil {
this.MatchAwardNum = ret.AwardNum
}
}
// 通知平台玩家数据更新
if !init {
//todo 优化
@ -784,7 +868,7 @@ func (this *Tournament) CreatePlayerMatchContext(p *Player, m *TmMatch, seq int)
roleId = p.Roles.ModId
}
mc := NewMatchContext(p, m, 1000, p.SnId, 1, roleId, seq)
mc := NewMatchContext(p, m, 1000, p.SnId, 1, roleId, p.Skin.ModId, seq)
if mc != nil {
if this.players[m.SortId] == nil {
this.players[m.SortId] = make(map[int32]*PlayerMatchContext)
@ -796,6 +880,7 @@ func (this *Tournament) CreatePlayerMatchContext(p *Player, m *TmMatch, seq int)
return nil
}
// 是否淘汰
func (this *Tournament) isOut(sortId int64, snid int32) bool {
if this.finalPerRank[sortId] != nil {
for _, info := range this.finalPerRank[sortId] {
@ -959,7 +1044,9 @@ func (this *Tournament) NextRoundStartSingle(sortId int64, playerCtx *PlayerMatc
}
if promotionNum != 1 {
arr = append(arr[:promotionNum])
if int(promotionNum) < len(arr) {
arr = arr[:promotionNum]
}
playerCtx.tm.robotGrades[int(round)] = arr
}
@ -1514,6 +1601,72 @@ func (this *Tournament) GetSCTMInfosPack(platform, channelName string) *tourname
return pack
}
// GetTmMatch 查询比赛中的比赛
func (this *Tournament) GetTmMatch(plt string, matchId int32, channelName string, audience bool, sortId int64) []*TmMatch {
matches := this.GetAllMatchInfo(plt)
if matches == nil {
return nil
}
var ids []int32
for id, info := range matches {
if info == nil || info.MatchSwitch != 1 {
continue
}
if matchId > 0 && id != matchId {
continue
}
if channelName != "" && !common.InMatchChannel(info.OnChannelName, channelName) {
continue
}
if info.GetAudienceSwitch() == 1 != audience {
continue
}
ids = append(ids, id)
}
var ret []*TmMatch
if sortId > 0 {
for _, v := range ids {
d := this.matches[v]
if d != nil {
r, ok := d[sortId]
if ok && r != nil {
return []*TmMatch{r}
}
}
}
return ret
}
for _, v := range ids {
for _, vv := range this.matches[v] {
ret = append(ret, vv)
}
}
return ret
}
func (this *Tournament) GetTmRoom(plt string, matchId int32, channelName string, audience bool, sortId int64) []*Scene {
tm := this.GetTmMatch(plt, matchId, channelName, audience, sortId)
sort.Slice(tm, func(i, j int) bool {
return tm[i].SortId < tm[j].SortId
})
var ret []*Scene
for _, v := range tm {
d := SceneMgrSingleton.GetMatchRoom(v.SortId)
sort.Slice(d, func(i, j int) bool {
return d[i].createTime.Before(d[j].createTime)
})
ret = append(ret, d...)
}
return ret
}
func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64) *model.MatchLog {
gameMatchDate := this.GetMatchInfo(platform, tmId, sortId)
if gameMatchDate == nil {
@ -1606,6 +1759,20 @@ func (this *Tournament) ModuleName() string {
func (this *Tournament) Init() {
logger.Logger.Trace("Tournament Init")
for _, v := range PlatformMgrSingleton.GetPlatforms() {
if v == nil || v.IdStr == "0" {
continue
}
ret, err := model.GetMatchAward(v.IdStr)
if err != nil {
logger.Logger.Warnf("GetMatchAward error %v", err)
continue
}
if this.MatchAwardNum == nil {
this.MatchAwardNum = make(map[string]map[int32]int32)
}
this.MatchAwardNum[v.IdStr] = ret.Award
}
}
func (this *Tournament) Update() {
@ -1648,35 +1815,42 @@ func (this *Tournament) Update() {
}
}
}
func (this *Tournament) OnDayTimer() {
this.MatchAwardNum = make(map[string]map[int32]int32)
this.Save()
logger.Logger.Trace("比赛场每日库存清理!!!")
for k := range this.MatchAwardNum {
this.MatchAwardNum[k] = make(map[int32]int32)
}
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
this.SaveMatchAward()
return nil
}), nil, "save_match_award_times").Start()
}
func (this *Tournament) Shutdown() {
// 保存数据
this.Save()
this.SaveMatchAward()
module.UnregisteModule(this)
}
func (this *Tournament) Save() {
logger.Logger.Info("保存比赛场每日奖励数据!!!!", this.MatchAwardNum)
func (this *Tournament) SaveMatchAward() {
if this.MatchAwardNum == nil {
return
}
for platform, _ := range this.MatchAwardNum {
matchAwardLog := model.NewMatchAwardLog()
matchAwardLog.AwardNum = this.MatchAwardNum
matchAwardLog.Platform = platform
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
err := model.InsertOrUpdateMatchAwardLog(matchAwardLog)
logger.Logger.Tracef("保存比赛场奖励领取次数")
for platform, v := range this.MatchAwardNum {
d := &model.MatchAward{
Platform: platform,
Award: make(map[int32]int32),
}
for k, vv := range v {
d.Award[k] = vv
}
err := model.UpsertMatchAward(d)
if err != nil {
logger.Logger.Error("saveMatchAwardLog error %v", err)
return err
}
return nil
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
})).StartByFixExecutor("saveMatchAwardLogTask")
logger.Logger.Errorf("SaveMatchAward error %v", err)
}
}
}
func (this *Tournament) getWeekDay() int {
getWeekNum := func(t time.Time) int {
strWeek := []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
@ -1709,7 +1883,7 @@ func (this *Tournament) FixMatchTimeStamp(d *webapiproto.GameMatchDate) {
week := this.getWeekDay()
st := time.Unix(d.MatchTimeStamp[0], 0).In(l)
et := time.Unix(d.MatchTimeStamp[1], 0).In(l)
logger.Logger.Tracef("FixMatchTimeStamp 1 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
//logger.Logger.Tracef("FixMatchTimeStamp 1 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
// 重复时间段比赛时间
for _, v := range d.MatchTimeWeek {
if v == int32(week) {
@ -1721,8 +1895,7 @@ func (this *Tournament) FixMatchTimeStamp(d *webapiproto.GameMatchDate) {
st = time.Unix(d.MatchTimeStamp[0], 0).In(l)
et = time.Unix(d.MatchTimeStamp[1], 0).In(l)
logger.Logger.Tracef("FixMatchTimeStamp 2 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
//logger.Logger.Tracef("FixMatchTimeStamp 2 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
break
}
}
@ -1736,6 +1909,8 @@ func (this *Tournament) OnHourTimer() {
}
}
// GetMatchAwardNum 剩余奖励数量
// id 比赛配置id
func (this *Tournament) GetMatchAwardNum(platform string, id int32) int32 {
var num int32
if this.MatchAwardNum != nil && this.MatchAwardNum[platform] != nil {
@ -1759,3 +1934,11 @@ func (this *Tournament) GetMatchAwardNum(platform string, id int32) int32 {
}
return num
}
func (this *Tournament) GetRound(sortId int64) int32 {
d, ok := this.roundPlayers[sortId]
if !ok || d == nil {
return 1
}
return int32(len(d))
}

View File

@ -1964,6 +1964,65 @@ func init() {
pack.Msg = "no any data"
return common.ResponseTag_Ok, pack
}
f := func(plt string, snid int32) {
var alipayAcc, alipayAccName, bankAccount, bankAccName, channelId string
if val, ok := playerMap["AlipayAccount"]; ok {
if str, ok := val.(string); ok {
alipayAcc = str
}
}
if val, ok := playerMap["AlipayAccName"]; ok {
if str, ok := val.(string); ok {
alipayAccName = str
}
}
if val, ok := playerMap["BankAccount"]; ok {
if str, ok := val.(string); ok {
bankAccount = str
}
}
if val, ok := playerMap["BankAccName"]; ok {
if str, ok := val.(string); ok {
bankAccName = str
}
}
if val, ok := playerMap["ChannelId"]; ok {
if str, ok := val.(string); ok {
channelId = str
}
}
if alipayAcc != "" || alipayAccName != "" {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
alipayAccName, alipayAcc, 2)
return nil
}), nil, "NewBankBindLog").Start()
}
if bankAccount != "" || bankAccName != "" {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
bankAccName, bankAccount, 2)
return nil
}), nil, "NewBankBindLog").Start()
}
if channelId != "" {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
a, err := model.GetAccountBySnid(plt, snid)
if err != nil {
logger.Logger.Errorf("GetAccountBySnid error: %v", err)
return nil
}
a.ChannelId = channelId
if err = model.UpdateAccount(a); err != nil {
logger.Logger.Errorf("UpdateAccount error: %v", err)
}
return nil
}), nil).StartByExecutor("UpdateChannelId")
}
}
pack.Tag = webapiproto.TagCode_SUCCESS
player := PlayerMgrSington.GetPlayerBySnId(msg.SnId)
if player != nil {
@ -1985,7 +2044,7 @@ func init() {
if v.FieldByName(k).CanInterface() {
switch f.Type.Kind() {
case reflect.Int64, reflect.Int32:
a, _ := strconv.ParseInt((fmt.Sprintf("%v", n)), 10, 64)
a, _ := strconv.ParseInt(fmt.Sprintf("%v", n), 10, 64)
s.FieldByName(k).SetInt(a)
case reflect.Bool:
s.FieldByName(k).SetBool(n.(bool))
@ -2002,42 +2061,8 @@ func init() {
pd = SetInfo(pd, *pd, playerMap)
player.dirty = true
player.SendDiffData()
var alipayAcc, alipayAccName, bankAccount, bankAccName string
if val, ok := playerMap["AlipayAccount"]; ok {
if str, ok := val.(string); ok {
alipayAcc = str
}
}
if val, ok := playerMap["AlipayAccName"]; ok {
if str, ok := val.(string); ok {
alipayAccName = str
}
}
if val, ok := playerMap["BankAccount"]; ok {
if str, ok := val.(string); ok {
bankAccount = str
}
}
if val, ok := playerMap["BankAccName"]; ok {
if str, ok := val.(string); ok {
bankAccName = str
}
}
if alipayAcc != "" || alipayAccName != "" {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
alipayAccName, alipayAcc, 2)
return nil
}), nil, "NewBankBindLog").Start()
}
if bankAccount != "" || bankAccName != "" {
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
bankAccName, bankAccount, 2)
return nil
}), nil, "NewBankBindLog").Start()
}
pack.Msg = "success"
f(pd.Platform, pd.SnId)
return common.ResponseTag_Ok, pack
}
} else {
@ -2053,35 +2078,7 @@ func init() {
//直接操作数据库
err := model.UpdatePlayerElement(msg.Platform, msg.SnId, playerMap)
if err == nil {
var alipayAcc, alipayAccName, bankAccount, bankAccName string
if val, ok := playerMap["AlipayAccount"]; ok {
if str, ok := val.(string); ok {
alipayAcc = str
}
}
if val, ok := playerMap["AlipayAccName"]; ok {
if str, ok := val.(string); ok {
alipayAccName = str
}
}
if val, ok := playerMap["BankAccount"]; ok {
if str, ok := val.(string); ok {
bankAccount = str
}
}
if val, ok := playerMap["BankAccName"]; ok {
if str, ok := val.(string); ok {
bankAccName = str
}
}
if alipayAcc != "" || alipayAccName != "" {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
alipayAccName, alipayAcc, 2)
}
if bankAccount != "" || bankAccName != "" {
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
bankAccName, bankAccount, 2)
}
f(msg.Platform, msg.SnId)
} else if err != nil {
logger.Logger.Error("UpdatePlayerElement task marshal data error:", err)
}
@ -3730,6 +3727,7 @@ func init() {
})).StartByExecutor(fmt.Sprint(msg.GetSnid()))
return common.ResponseTag_TransactYield, pack
}))
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/player/AddItem", WebAPIHandlerWrapper(
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
pack := &webapiproto.SAAddItemById{}

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
xlsx/DB_VIPShow.xlsx Normal file

Binary file not shown.