Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8b79cd7aae
@ -18,7 +18,7 @@ func (this *apiComp) MatchCheck(session comm.IUserSession, req *pb.EntertainMatc
|
||||
}
|
||||
|
||||
func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) (errdata *pb.ErrorData) {
|
||||
// 随便找个在线的人
|
||||
|
||||
var (
|
||||
//bMatch bool
|
||||
s2 comm.IUserSession
|
||||
@ -48,22 +48,6 @@ func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq)
|
||||
}
|
||||
}
|
||||
|
||||
// if users, err := this.module.ModuleUser.UserOnlineList(); err == nil {
|
||||
// if len(users) > 0 {
|
||||
// bMatch = true
|
||||
// s2, bMatch = this.module.GetUserSession(users[0].Uid)
|
||||
// p2 = &pb.PlayerData{
|
||||
// Uid: s2.GetUserId(),
|
||||
// Name: "",
|
||||
// Score: 0,
|
||||
// Ps: 0,
|
||||
// Cardid: req.Idcard,
|
||||
// }
|
||||
// } else { // 测试用
|
||||
|
||||
// }
|
||||
//
|
||||
// }
|
||||
roomid = this.module.gameMgr.CreateRoom(session, s2, p1, p2)
|
||||
session.SendMsg(string(this.module.GetType()), "match", &pb.EntertainMatchResp{
|
||||
Maych: true,
|
||||
|
@ -107,3 +107,17 @@ func (this *configureComp) GetGameConsumeintegral(key int32) (conf *cfg.GameInte
|
||||
err = comm.NewNotFoundConfErr(moduleName, game_consumehero, key)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetRobotGameConsumeHero() (cardid string) {
|
||||
|
||||
if v, err := this.GetConfigure(game_consumehero); err == nil {
|
||||
if configure, ok := v.(*cfg.GameConsumeHero); ok {
|
||||
for _, v := range configure.GetDataList() {
|
||||
cardid = v.Key
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
107
modules/entertainment/match.go
Normal file
107
modules/entertainment/match.go
Normal file
@ -0,0 +1,107 @@
|
||||
package entertainment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go_dreamfactory/lego/core"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
/*
|
||||
匹配组件
|
||||
*/
|
||||
type matchComp struct {
|
||||
modules.MCompMatch
|
||||
service core.IService
|
||||
module *Entertainment
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *matchComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MCompMatch.Init(service, module, comp, options)
|
||||
this.module = module.(*Entertainment)
|
||||
this.service = service
|
||||
this.PoolName = "entertain"
|
||||
return
|
||||
}
|
||||
|
||||
func (this *matchComp) Start() (err error) {
|
||||
err = this.MCompMatch.Start()
|
||||
return
|
||||
}
|
||||
|
||||
func (this *matchComp) MatchReq(v *pb.DBXXLMatch) (err error) {
|
||||
data, _ := anypb.New(v)
|
||||
this.module.service.Destroy()
|
||||
err = this.module.service.RpcCall(
|
||||
context.Background(),
|
||||
comm.Service_Mainte,
|
||||
string(comm.RPC_JoinMatchPools),
|
||||
&pb.JoinMatchPoolReq{
|
||||
Poolname: this.PoolName,
|
||||
Uid: v.Userinfo.Uid,
|
||||
Data: data,
|
||||
Matchnum: 2, // 匹配数量2
|
||||
Timeout: 10,
|
||||
},
|
||||
&pb.JoinMatchPoolResp{})
|
||||
if err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *matchComp) MatchNotic(players map[string]interface{}) (err error) {
|
||||
var (
|
||||
playerSlice []*pb.DBXXLMatch
|
||||
p1 *pb.PlayerData
|
||||
p2 *pb.PlayerData
|
||||
)
|
||||
playerSlice = make([]*pb.DBXXLMatch, 0, len(players))
|
||||
for _, v := range players {
|
||||
playerSlice = append(playerSlice, v.(*pb.DBXXLMatch))
|
||||
}
|
||||
for pos, v := range playerSlice {
|
||||
if pos == 0 {
|
||||
p1 = &pb.PlayerData{
|
||||
Uid: v.Userinfo.Uid,
|
||||
Name: v.Userinfo.Name,
|
||||
Score: 0,
|
||||
Cardid: v.Cardid,
|
||||
}
|
||||
} else if pos == 1 {
|
||||
p2 = &pb.PlayerData{
|
||||
Uid: v.Userinfo.Uid,
|
||||
Name: v.Userinfo.Name,
|
||||
Score: 0,
|
||||
Cardid: v.Cardid,
|
||||
}
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
if p1 == nil {
|
||||
return
|
||||
}
|
||||
if p2 == nil { // 玩家2 是空 那么构建一个AI 对象
|
||||
if robots, err := this.module.ModuleTools.RandRobotConfig(1); err == nil {
|
||||
if len(robots) > 0 {
|
||||
p2 = &pb.PlayerData{
|
||||
Uid: "999", // AI uid 暂定
|
||||
Name: robots[0].Name,
|
||||
Score: 0,
|
||||
Ps: 0,
|
||||
Cardid: this.module.configure.GetRobotGameConsumeHero(), // 机器人临时数据
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//roomid := this.module.gameMgr.CreateRoom(p1, p2)
|
||||
|
||||
return
|
||||
}
|
@ -2,6 +2,7 @@ package entertainment
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
@ -14,12 +15,13 @@ func NewModule() core.IModule {
|
||||
|
||||
type Entertainment struct {
|
||||
modules.ModuleBase
|
||||
service core.IService
|
||||
service base.IRPCXService
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
model *modelComp
|
||||
gameMgr *gameMgrComp
|
||||
//room *Room
|
||||
match *matchComp
|
||||
}
|
||||
|
||||
// 模块名
|
||||
@ -32,7 +34,7 @@ func (this *Entertainment) Init(service core.IService, module core.IModule, opti
|
||||
if err = this.ModuleBase.Init(service, module, options); err != nil {
|
||||
return
|
||||
}
|
||||
this.service = service
|
||||
this.service = service.(base.IRPCXService)
|
||||
return
|
||||
}
|
||||
|
||||
@ -44,6 +46,7 @@ func (this *Entertainment) OnInstallComp() {
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.gameMgr = this.RegisterComp(new(gameMgrComp)).(*gameMgrComp)
|
||||
//this.room = this.RegisterComp(new(Room)).(*Room)
|
||||
this.match = this.RegisterComp(new(matchComp)).(*matchComp)
|
||||
}
|
||||
|
||||
func (this *Entertainment) Start() (err error) {
|
||||
|
@ -28,10 +28,11 @@ type Room struct {
|
||||
module *Entertainment
|
||||
round int32 // 轮数
|
||||
operatetimer *timewheel.Task //操作倒计时定时器
|
||||
//aiTimer *timewheel.Task //AI操作随机做个延时
|
||||
curPower string // 当前操作的玩家
|
||||
NexPower string // 下一个操作的玩家
|
||||
MaxRound int32
|
||||
curPower string // 当前操作的玩家
|
||||
NexPower string // 下一个操作的玩家
|
||||
MaxRound int32
|
||||
rd1 bool
|
||||
rd2 bool
|
||||
}
|
||||
|
||||
func (this *Room) operateTimeOut(task *timewheel.Task, args ...interface{}) {
|
||||
@ -111,9 +112,9 @@ func (this *Room) AiOperator() {
|
||||
var (
|
||||
curScore int32
|
||||
szMap []*pb.MapData
|
||||
|
||||
oid1 int32
|
||||
oid2 int32
|
||||
bAddPs bool
|
||||
oid1 int32
|
||||
oid2 int32
|
||||
)
|
||||
|
||||
this.module.Debugf("AI 操作\n")
|
||||
@ -124,16 +125,22 @@ func (this *Room) AiOperator() {
|
||||
this.player1.Ps = MaxPs
|
||||
|
||||
// 交换元素
|
||||
curScore, szMap, oid1, oid2 = this.chessboard.AiSwapGirde()
|
||||
curScore, szMap, oid1, oid2, bAddPs = this.chessboard.AiSwapGirde()
|
||||
if this.NexPower != this.curPower {
|
||||
this.round++
|
||||
}
|
||||
for _, v := range szMap { //
|
||||
if v.Xgrid > 0 {
|
||||
this.player2.Energy += v.Xgrid
|
||||
}
|
||||
|
||||
if len(szMap) > 0 {
|
||||
this.player2.Energy += szMap[len(szMap)-1].CurEnergy
|
||||
this.player2.Score += szMap[len(szMap)-1].CurSocre
|
||||
}
|
||||
|
||||
if bAddPs {
|
||||
this.player2.Ps++
|
||||
if this.player2.Ps > MaxPs {
|
||||
this.player2.Ps = MaxPs
|
||||
}
|
||||
}
|
||||
this.player2.Score += curScore
|
||||
// 广播消息
|
||||
if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{
|
||||
@ -169,6 +176,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
oid1 int32 // 唯一id
|
||||
oid2 int32
|
||||
color int32 // 校验消除的颜色
|
||||
bAddPs bool
|
||||
)
|
||||
var szMap []*pb.MapData
|
||||
req := msg.(*pb.EntertainOperatorReq)
|
||||
@ -209,6 +217,36 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
}
|
||||
this.player1.Score += curScore
|
||||
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_EntertainNoEnergy,
|
||||
Title: pb.ErrorCode_EntertainNoEnergy.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
this.NexPower = this.curPower
|
||||
} else {
|
||||
conf, err := this.module.configure.GetGameConsumeHero(this.player2.Cardid)
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_EntertainNoHeroSkill,
|
||||
Title: pb.ErrorCode_EntertainNoHeroSkill.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if this.player2.Energy >= conf.Skillload {
|
||||
this.player2.Energy = 0 // 清零
|
||||
|
||||
if score, m := this.chessboard.SkillUp(conf.Skilleffect, conf.Skillvalue); score > 0 {
|
||||
curScore += score
|
||||
szMap = append(szMap, m...)
|
||||
} else {
|
||||
szMap = append(szMap, &pb.MapData{
|
||||
Data: this.chessboard.GetPalatData(),
|
||||
})
|
||||
}
|
||||
this.player2.Score += curScore
|
||||
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_EntertainNoEnergy,
|
||||
@ -245,9 +283,10 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
return
|
||||
}
|
||||
|
||||
if score, m := this.chessboard.CheckMap(color); score > 0 {
|
||||
if score, m, b := this.chessboard.CheckMap(color); score > 0 {
|
||||
curScore += score
|
||||
szMap = append(szMap, m...)
|
||||
bAddPs = b
|
||||
} else { // 不能消除
|
||||
this.chessboard.SwapGirde(req.Targetid, req.Curid) // 换到原来的位置
|
||||
errdata = &pb.ErrorData{
|
||||
@ -260,31 +299,31 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
if this.curPower == this.player1.Uid { //权限校验
|
||||
this.player1.Score += curScore
|
||||
this.player1.Ps--
|
||||
// if curScore >= 4 {
|
||||
// this.player1.Ps++
|
||||
// if this.player1.Ps > MaxPs {
|
||||
// this.player1.Ps = MaxPs
|
||||
// }
|
||||
// }
|
||||
if bAddPs {
|
||||
this.player1.Ps++
|
||||
if this.player1.Ps > MaxPs {
|
||||
this.player1.Ps = MaxPs
|
||||
}
|
||||
}
|
||||
this.player2.Ps = MaxPs
|
||||
} else { // this.curPower == this.player2.Uid
|
||||
this.player2.Score += curScore
|
||||
this.player2.Ps--
|
||||
// if curScore >= 4 {
|
||||
// this.player2.Ps++
|
||||
// if this.player2.Ps > MaxPs {
|
||||
// this.player2.Ps = MaxPs
|
||||
// }
|
||||
// }
|
||||
if bAddPs {
|
||||
this.player2.Ps++
|
||||
if this.player2.Ps > MaxPs {
|
||||
this.player2.Ps = MaxPs
|
||||
}
|
||||
}
|
||||
this.player1.Ps = MaxPs
|
||||
}
|
||||
for _, v := range szMap { //
|
||||
if v.Xgrid > 0 {
|
||||
if color == 1 {
|
||||
this.player1.Energy += v.Xgrid
|
||||
} else {
|
||||
this.player2.Energy += v.Xgrid
|
||||
}
|
||||
if len(szMap) > 0 {
|
||||
if color == 1 {
|
||||
this.player1.Energy += szMap[len(szMap)-1].CurEnergy
|
||||
this.player1.Score += szMap[len(szMap)-1].CurSocre
|
||||
} else {
|
||||
this.player2.Energy += szMap[len(szMap)-1].CurEnergy
|
||||
this.player2.Score += szMap[len(szMap)-1].CurSocre
|
||||
}
|
||||
}
|
||||
if this.player1.Ps <= 0 { // 权限给下一个人
|
||||
@ -304,15 +343,6 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
}
|
||||
}
|
||||
|
||||
// for _, v := range szMap {
|
||||
// fmt.Printf("======szMap=======\n")
|
||||
// for index := Width - 1; index >= 0; index-- {
|
||||
// for j := 0; j < Height; j++ {
|
||||
// fmt.Printf("%d:%d ", v.Data[index+j*Height].Oid, v.Data[index+j*Height].Color)
|
||||
// }
|
||||
// fmt.Printf("\n")
|
||||
// }
|
||||
// }
|
||||
// 广播消息
|
||||
if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{
|
||||
Mpadata: szMap,
|
||||
@ -349,12 +379,30 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
||||
Mpadata: &pb.MapData{Data: this.chessboard.Plat},
|
||||
Power: this.NexPower,
|
||||
Round: this.round,
|
||||
Roomid: "",
|
||||
Roomid: this.Id, // 房间ID
|
||||
}, this.szSession...); err != nil {
|
||||
this.Errorln(err)
|
||||
}
|
||||
|
||||
this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut)
|
||||
} else {
|
||||
if this.player1.Uid == session.GetUserId() {
|
||||
this.rd1 = true
|
||||
} else if this.player2.Uid == session.GetUserId() {
|
||||
this.rd2 = true
|
||||
}
|
||||
if this.rd1 && this.rd2 { // 两个玩家都准备好了 那么就开始游戏
|
||||
if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{
|
||||
User1: this.player1,
|
||||
User2: this.player2,
|
||||
Mpadata: &pb.MapData{Data: this.chessboard.Plat},
|
||||
Power: this.NexPower,
|
||||
Round: this.round,
|
||||
Roomid: this.Id,
|
||||
}, this.szSession...); err != nil {
|
||||
this.Errorln(err)
|
||||
}
|
||||
this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,7 @@ func (this *MapData) SwapGirde(oldId, newId int32) (bSwap bool) {
|
||||
this.operElem = append(this.operElem, newId)
|
||||
this.operElem = append(this.operElem, oldId)
|
||||
}
|
||||
this.Debugf()
|
||||
//this.CheckMap(color)
|
||||
//this.Debugf()
|
||||
return
|
||||
}
|
||||
|
||||
@ -89,10 +88,10 @@ func (this *MapData) SetMap() {
|
||||
1, 1, 2, 5, 1, 5, 2,
|
||||
3, 2, 3, 1, 2, 4, 4,
|
||||
2, 1, 1, 3, 6, 4, 1,
|
||||
1, 3, 1, 4, 3, 6, 3,
|
||||
1, 3, 3, 5, 1, 6, 1,
|
||||
5, 1, 2, 5, 1, 3, 1,
|
||||
1, 1, 5, 1, 2, 1, 4,
|
||||
4, 1, 1, 4, 3, 6, 3,
|
||||
4, 3, 4, 5, 1, 6, 1,
|
||||
5, 4, 2, 5, 1, 3, 1,
|
||||
4, 1, 5, 1, 2, 1, 4,
|
||||
}
|
||||
var pos int
|
||||
for index := Width - 1; index >= 0; index-- {
|
||||
@ -440,33 +439,36 @@ func (this *MapData) Check3X(color int32) (bEliminate bool, score int32, count i
|
||||
}
|
||||
|
||||
// 校验地图可消除的 判断各组上面2个和右边两个是否三个相等
|
||||
func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData) {
|
||||
// xc 判断用来是否加体力
|
||||
func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData, xc bool) {
|
||||
var curScore int32
|
||||
var energy int32
|
||||
for {
|
||||
curScore = 0
|
||||
var count int32
|
||||
if bRet, s, c := this.Check5X(color); bRet {
|
||||
fmt.Printf("=====检测消除5x===========\n")
|
||||
//fmt.Printf("=====检测消除5x===========\n")
|
||||
curScore += s
|
||||
count += c
|
||||
energy += c
|
||||
xc = true // 只要有 4x 5x 就标记ture
|
||||
}
|
||||
if bRet, s, c := this.Check4X(color); bRet {
|
||||
fmt.Printf("=====检测消除4x===========\n")
|
||||
//fmt.Printf("=====检测消除4x===========\n")
|
||||
curScore += s
|
||||
count += c
|
||||
energy += c
|
||||
xc = true
|
||||
}
|
||||
if bRet, s, c := this.Check3X(color); bRet {
|
||||
fmt.Printf("=====检测消除3x===========\n")
|
||||
//fmt.Printf("=====检测消除3x===========\n")
|
||||
curScore += s
|
||||
count += c
|
||||
energy += c
|
||||
}
|
||||
|
||||
score += curScore // 总分
|
||||
if this.DropGirde() {
|
||||
szMap = append(szMap, &pb.MapData{
|
||||
Data: this.GetPalatData(),
|
||||
CurSocre: curScore,
|
||||
Xgrid: count,
|
||||
Data: this.GetPalatData(),
|
||||
CurSocre: score,
|
||||
CurEnergy: energy,
|
||||
})
|
||||
}
|
||||
|
||||
@ -476,7 +478,6 @@ func (this *MapData) CheckMap(color int32) (score int32, szMap []*pb.MapData) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@ -522,7 +523,7 @@ func (this *MapData) GetPalatData() (data []*pb.GirdeData) {
|
||||
}
|
||||
|
||||
// ai操作
|
||||
func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32, oid2 int32) {
|
||||
func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32, oid2 int32, bAddPs bool) {
|
||||
|
||||
for pos := 0; pos < Total; pos++ {
|
||||
y := pos % Height
|
||||
@ -530,7 +531,7 @@ func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32
|
||||
if b := this.SwapGirde(int32(pos), int32(pos+1)); b {
|
||||
oid1 = this.Plat[pos+1].Oid
|
||||
oid2 = this.Plat[pos].Oid
|
||||
if s, m := this.CheckMap(2); s == 0 {
|
||||
if s, m, b := this.CheckMap(2); s == 0 {
|
||||
this.SwapGirde(int32(pos+1), int32(pos))
|
||||
this.operElem = []int32{}
|
||||
oid1 = 0
|
||||
@ -538,7 +539,7 @@ func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32
|
||||
} else {
|
||||
score += s
|
||||
szMap = append(szMap, m...)
|
||||
|
||||
bAddPs = b
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -547,7 +548,7 @@ func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32
|
||||
if b := this.SwapGirde(int32(pos), int32(pos+Width)); b {
|
||||
oid1 = this.Plat[pos+Width].Oid
|
||||
oid2 = this.Plat[pos].Oid
|
||||
if s, m := this.CheckMap(2); s == 0 {
|
||||
if s, m, b := this.CheckMap(2); s == 0 {
|
||||
this.SwapGirde(int32(pos+Width), int32(pos))
|
||||
this.operElem = []int32{}
|
||||
oid1 = 0
|
||||
@ -555,6 +556,7 @@ func (this *MapData) AiSwapGirde() (score int32, szMap []*pb.MapData, oid1 int32
|
||||
} else {
|
||||
szMap = append(szMap, m...)
|
||||
score += s
|
||||
bAddPs = b
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -571,7 +573,7 @@ func (this *MapData) SkillUp(skillid int32, value int32) (score int32, szMap []*
|
||||
this.Plat[id] = &pb.GirdeData{}
|
||||
}
|
||||
if this.DropGirde() {
|
||||
score, szMap = this.CheckMap(1)
|
||||
score, szMap, _ = this.CheckMap(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func Test_Main(t *testing.T) {
|
||||
|
||||
m.DropGirde()
|
||||
|
||||
if score, m := m.CheckMap(1); score > 0 {
|
||||
if score, m, _ := m.CheckMap(1); score > 0 {
|
||||
|
||||
szMap = append(szMap, m...)
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ type MapData struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据
|
||||
CurSocre int32 `protobuf:"varint,2,opt,name=curSocre,proto3" json:"curSocre"` // 本轮得分
|
||||
Xgrid int32 `protobuf:"varint,3,opt,name=xgrid,proto3" json:"xgrid"` // 本次掉落消除的格子(客户端不用)
|
||||
Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据
|
||||
CurSocre int32 `protobuf:"varint,2,opt,name=curSocre,proto3" json:"curSocre"` // 本次地图更新得分
|
||||
CurEnergy int32 `protobuf:"varint,3,opt,name=curEnergy,proto3" json:"curEnergy"` // 本次掉落获得的能量
|
||||
}
|
||||
|
||||
func (x *MapData) Reset() {
|
||||
@ -77,9 +77,9 @@ func (x *MapData) GetCurSocre() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *MapData) GetXgrid() int32 {
|
||||
func (x *MapData) GetCurEnergy() int32 {
|
||||
if x != nil {
|
||||
return x.Xgrid
|
||||
return x.CurEnergy
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -251,34 +251,97 @@ func (x *PlayerData) GetEnergy() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// 消消乐匹配数据
|
||||
type DBXXLMatch struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Userinfo *BaseUserInfo `protobuf:"bytes,1,opt,name=userinfo,proto3" json:"userinfo"`
|
||||
Cardid string `protobuf:"bytes,2,opt,name=cardid,proto3" json:"cardid"` // 选择的卡片ID
|
||||
}
|
||||
|
||||
func (x *DBXXLMatch) Reset() {
|
||||
*x = DBXXLMatch{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_db_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBXXLMatch) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBXXLMatch) ProtoMessage() {}
|
||||
|
||||
func (x *DBXXLMatch) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_db_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 DBXXLMatch.ProtoReflect.Descriptor instead.
|
||||
func (*DBXXLMatch) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_db_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *DBXXLMatch) GetUserinfo() *BaseUserInfo {
|
||||
if x != nil {
|
||||
return x.Userinfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBXXLMatch) GetCardid() string {
|
||||
if x != nil {
|
||||
return x.Cardid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_entertain_entertain_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entertain_entertain_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x1c, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x65,
|
||||
0x72, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b,
|
||||
0x0a, 0x07, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44,
|
||||
0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72,
|
||||
0x53, 0x6f, 0x63, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72,
|
||||
0x53, 0x6f, 0x63, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x78, 0x67, 0x72, 0x69, 0x64, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x78, 0x67, 0x72, 0x69, 0x64, 0x22, 0x75, 0x0a, 0x09, 0x47,
|
||||
0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f,
|
||||
0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63,
|
||||
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63,
|
||||
0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69,
|
||||
0x61, 0x6c, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74,
|
||||
0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x70, 0x73, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63,
|
||||
0x61, 0x72, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x72, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a,
|
||||
0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x07, 0x4d, 0x61,
|
||||
0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, 0x72,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, 0x72,
|
||||
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22,
|
||||
0x75, 0x0a, 0x09, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73,
|
||||
0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
||||
0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x70,
|
||||
0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65,
|
||||
0x72, 0x67, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67,
|
||||
0x79, 0x22, 0x4f, 0x0a, 0x0a, 0x44, 0x42, 0x58, 0x58, 0x4c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12,
|
||||
0x29, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61,
|
||||
0x72, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64,
|
||||
0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -293,19 +356,22 @@ func file_entertain_entertain_db_proto_rawDescGZIP() []byte {
|
||||
return file_entertain_entertain_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entertain_entertain_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_entertain_entertain_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_entertain_entertain_db_proto_goTypes = []interface{}{
|
||||
(*MapData)(nil), // 0: MapData
|
||||
(*GirdeData)(nil), // 1: GirdeData
|
||||
(*PlayerData)(nil), // 2: PlayerData
|
||||
(*MapData)(nil), // 0: MapData
|
||||
(*GirdeData)(nil), // 1: GirdeData
|
||||
(*PlayerData)(nil), // 2: PlayerData
|
||||
(*DBXXLMatch)(nil), // 3: DBXXLMatch
|
||||
(*BaseUserInfo)(nil), // 4: BaseUserInfo
|
||||
}
|
||||
var file_entertain_entertain_db_proto_depIdxs = []int32{
|
||||
1, // 0: MapData.data:type_name -> GirdeData
|
||||
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
|
||||
4, // 1: DBXXLMatch.userinfo:type_name -> BaseUserInfo
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_entertain_entertain_db_proto_init() }
|
||||
@ -313,6 +379,7 @@ func file_entertain_entertain_db_proto_init() {
|
||||
if File_entertain_entertain_db_proto != nil {
|
||||
return
|
||||
}
|
||||
file_comm_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entertain_entertain_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MapData); i {
|
||||
@ -350,6 +417,18 @@ func file_entertain_entertain_db_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBXXLMatch); 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{
|
||||
@ -357,7 +436,7 @@ func file_entertain_entertain_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_entertain_entertain_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user