xxl代码
This commit is contained in:
parent
5711dd24ff
commit
c69d00f744
44
modules/entertainment/api_match.go
Normal file
44
modules/entertainment/api_match.go
Normal file
@ -0,0 +1,44 @@
|
||||
package entertainment
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) MatchCheck(session comm.IUserSession, req *pb.EntertainMatchReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) (errdata *pb.ErrorData) {
|
||||
// 随便找个在线的人
|
||||
var (
|
||||
bMatch bool
|
||||
s2 comm.IUserSession
|
||||
//bAI bool // 是否是机器人
|
||||
)
|
||||
if users, err := this.module.ModuleUser.UserOnlineList(); err == nil {
|
||||
if len(users) > 0 {
|
||||
bMatch = true
|
||||
s2, bMatch = this.module.GetUserSession(users[0].Uid)
|
||||
} else { // 测试用
|
||||
if robots, err := this.module.ModuleTools.RandRobotConfig(1); err == nil {
|
||||
s2, bMatch = this.module.GetUserSession(strconv.Itoa(int(robots[0].Robotid)))
|
||||
}
|
||||
//bAI = true
|
||||
}
|
||||
this.module.gameMgr.CreateRoom(session, s2)
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "match", &pb.EntertainMatchResp{
|
||||
Maych: bMatch,
|
||||
Player: &pb.PlayerData{
|
||||
Uid: s2.GetUserId(),
|
||||
Name: "",
|
||||
Score: 0,
|
||||
Ps: 0,
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
24
modules/entertainment/api_operator.go
Normal file
24
modules/entertainment/api_operator.go
Normal file
@ -0,0 +1,24 @@
|
||||
package entertainment
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) OperatorCheck(session comm.IUserSession, req *pb.EntertainOperatorReq) (errdata *pb.ErrorData) {
|
||||
if req.Roomid == "" {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Operator(session comm.IUserSession, req *pb.EntertainOperatorReq) (errdata *pb.ErrorData) {
|
||||
|
||||
this.module.gameMgr.RoomDistribute(req.Roomid, session, "opertor", req)
|
||||
|
||||
return
|
||||
}
|
@ -30,7 +30,7 @@ func (this *gameMgrComp) Init(service core.IService, module core.IModule, comp c
|
||||
|
||||
func (this *gameMgrComp) CreateRoom(s1 comm.IUserSession, s2 comm.IUserSession) {
|
||||
room := new(Room) //初始化房间
|
||||
room.InitRoom(s1, s2)
|
||||
room.InitRoom(this.module, s1, s2)
|
||||
|
||||
this.lock.Lock()
|
||||
this.rooms[room.Id] = room
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func NewModule() core.IModule {
|
||||
@ -18,7 +19,7 @@ type Entertainment struct {
|
||||
configure *configureComp
|
||||
model *modelComp
|
||||
gameMgr *gameMgrComp
|
||||
xxl *MapData
|
||||
//room *Room
|
||||
}
|
||||
|
||||
// 模块名
|
||||
@ -42,14 +43,16 @@ func (this *Entertainment) OnInstallComp() {
|
||||
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.gameMgr = this.RegisterComp(new(gameMgrComp)).(*gameMgrComp)
|
||||
//this.xxl = this.RegisterComp(new(MapData)).(*MapData)
|
||||
//this.room = this.RegisterComp(new(Room)).(*Room)
|
||||
}
|
||||
|
||||
func (this *Entertainment) Start() (err error) {
|
||||
if err = this.ModuleBase.Start(); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// var s1 comm.IUserSession
|
||||
// var s2 comm.IUserSession
|
||||
// this.gameMgr.CreateRoom(s1, s2)
|
||||
// this.xxl = new(MapData)
|
||||
// this.xxl.InitMap()
|
||||
// this.xxl.SwapGirde(1, 0)
|
||||
@ -58,7 +61,12 @@ func (this *Entertainment) Start() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// 匹配完成
|
||||
func (this *Entertainment) MatchingComplete(s1 comm.IUserSession, s2 comm.IUserSession) {
|
||||
this.gameMgr.CreateRoom(s1, s2)
|
||||
func (this *Entertainment) BroadcastRoomMsg(uids ...string) {
|
||||
this.SendMsgToUsers(string(this.GetType()), "message", &pb.EntertainStartGamePush{
|
||||
User1: &pb.PlayerData{},
|
||||
User2: &pb.PlayerData{},
|
||||
Mpadata: &pb.MapData{},
|
||||
Power: "",
|
||||
Round: 0,
|
||||
}, uids...)
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
package entertainment
|
||||
|
||||
type Player struct {
|
||||
uid string
|
||||
operate int32 // 该谁操作
|
||||
score int32 // 玩家积分
|
||||
step int32 // 操作步骤
|
||||
status int32 // 状态
|
||||
}
|
||||
// type Player struct {
|
||||
// uid string
|
||||
// operate int32 // 该谁操作
|
||||
// score int32 // 玩家积分
|
||||
// step int32 // 操作步骤
|
||||
// status int32 // 状态
|
||||
// session comm.IUserSession
|
||||
// }
|
||||
|
@ -2,45 +2,139 @@ package entertainment
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
MaxPs = 2 // 最大体力
|
||||
)
|
||||
|
||||
//游戏房间
|
||||
type Room struct {
|
||||
Id string
|
||||
player1 *Player // 玩家1
|
||||
player2 *Player // 玩家2
|
||||
modules.ModuleBase
|
||||
Id string // 房间id
|
||||
s1 comm.IUserSession
|
||||
s2 comm.IUserSession
|
||||
player1 *pb.PlayerData // 玩家1
|
||||
player2 *pb.PlayerData // 玩家2
|
||||
chessboard *MapData
|
||||
module *Entertainment
|
||||
power string // 谁的权限
|
||||
round int32 // 轮数
|
||||
}
|
||||
|
||||
func (this *Room) InitRoom(s1 comm.IUserSession, s2 comm.IUserSession) *Room {
|
||||
func (this *Room) InitRoom(module *Entertainment, s1 comm.IUserSession, s2 comm.IUserSession) *Room {
|
||||
|
||||
this.chessboard = new(MapData)
|
||||
this.chessboard.InitMap() // 初始化棋盘
|
||||
defer this.StartGame()
|
||||
return &Room{
|
||||
ModuleBase: modules.ModuleBase{},
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
player1: &Player{},
|
||||
player2: &Player{},
|
||||
s1: s1,
|
||||
s2: s2,
|
||||
player1: &pb.PlayerData{
|
||||
Uid: s1.GetUserId(),
|
||||
Name: "",
|
||||
Score: 0,
|
||||
Ps: MaxPs,
|
||||
},
|
||||
player2: &pb.PlayerData{
|
||||
Uid: s2.GetUserId(),
|
||||
Name: "",
|
||||
Score: 0,
|
||||
Ps: MaxPs,
|
||||
},
|
||||
chessboard: this.chessboard,
|
||||
module: module,
|
||||
power: s1.GetUserId(), // 默认1号玩家先
|
||||
round: 1,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, req proto.Message) (errdata *pb.ErrorData) {
|
||||
func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg proto.Message) (errdata *pb.ErrorData) {
|
||||
switch stype {
|
||||
case "opertor": // 操作消息
|
||||
//req1 := req.(*pb.BattleCmd)
|
||||
var (
|
||||
curScore int32
|
||||
)
|
||||
var szMap []*pb.MapData
|
||||
req := msg.(*pb.EntertainOperatorReq)
|
||||
//权限校验
|
||||
if this.power == this.player1.Uid {
|
||||
this.player1.Ps--
|
||||
if this.player1.Ps <= 0 { // 权限给下一个人
|
||||
this.power = this.player2.Uid
|
||||
}
|
||||
this.player2.Ps = MaxPs
|
||||
} else if this.power == this.player2.Uid {
|
||||
this.player2.Ps--
|
||||
if this.player2.Ps <= 0 { // 权限给下一个人
|
||||
this.power = this.player1.Uid
|
||||
this.round++
|
||||
}
|
||||
this.player1.Ps = MaxPs
|
||||
} else { // err 未知权限
|
||||
return
|
||||
}
|
||||
|
||||
// 交换元素
|
||||
this.chessboard.SwapGirde(req.Curid, req.Targetid) // 交换格子
|
||||
for {
|
||||
if b, score := this.chessboard.CheckMap(); b {
|
||||
break
|
||||
} else {
|
||||
curScore += score // 统计积分
|
||||
}
|
||||
|
||||
this.chessboard.DropGirde()
|
||||
szMap = append(szMap, &pb.MapData{
|
||||
Data: this.chessboard.Data,
|
||||
})
|
||||
}
|
||||
// 操作消息返回
|
||||
this.s1.SendMsg(string(this.module.GetType()), "operator", &pb.EntertainOperatorResp{
|
||||
Success: true,
|
||||
})
|
||||
|
||||
// 广播消息
|
||||
if err := this.SendMsgToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{
|
||||
Mpadata: szMap,
|
||||
Power: this.power,
|
||||
Score: curScore,
|
||||
Round: this.round,
|
||||
}, []comm.IUserSession{this.s1, this.s2}...); err != nil {
|
||||
this.Errorln(err)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 玩家操作
|
||||
func (this *Room) Opertor(set int32, iType int32, old int32, new int32) (errdata *pb.ErrorData) {
|
||||
func (this *Room) Opertor(uid string, iType int32, old int32, new int32) (errdata *pb.ErrorData) {
|
||||
if iType == 1 {
|
||||
this.chessboard.SwapGirde(old, new) // 交换格子
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Room) StartGame() (errdata *pb.ErrorData) {
|
||||
|
||||
if err := this.SendMsgToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{
|
||||
User1: this.player1,
|
||||
User2: this.player2,
|
||||
Mpadata: &pb.MapData{
|
||||
Data: this.chessboard.Data,
|
||||
},
|
||||
Power: this.power,
|
||||
Round: this.round,
|
||||
}, []comm.IUserSession{this.s1, this.s2}...); err != nil {
|
||||
this.Errorln(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/pb"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
@ -12,20 +13,20 @@ const (
|
||||
Height = 7
|
||||
)
|
||||
|
||||
type Girde struct {
|
||||
X int32 // x
|
||||
Y int32
|
||||
ID int32
|
||||
Itype int32
|
||||
}
|
||||
// type Girde struct {
|
||||
// X int32 // x
|
||||
// Y int32
|
||||
// ID int32
|
||||
// Itype int32
|
||||
// }
|
||||
|
||||
//地图数据
|
||||
type MapData struct {
|
||||
Data map[int32]*Girde // 地图数据
|
||||
Data map[int32]*pb.GirdeData // 地图数据
|
||||
}
|
||||
|
||||
func (this *MapData) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.Data = make(map[int32]*Girde, Width*Height)
|
||||
this.Data = make(map[int32]*pb.GirdeData, Width*Height)
|
||||
return
|
||||
}
|
||||
|
||||
@ -42,7 +43,7 @@ func (this *MapData) GetKeyType(key int32) int32 {
|
||||
return itype
|
||||
}
|
||||
|
||||
func (this *MapData) GetKeyData(key int32) (data *Girde) {
|
||||
func (this *MapData) GetKeyData(key int32) (data *pb.GirdeData) {
|
||||
if v, ok := this.Data[key]; ok {
|
||||
return v
|
||||
}
|
||||
@ -51,17 +52,19 @@ func (this *MapData) GetKeyData(key int32) (data *Girde) {
|
||||
|
||||
// 初始化地图数据
|
||||
func (this *MapData) InitMap() {
|
||||
this.Data = make(map[int32]*Girde, Width*Height)
|
||||
this.Data = make(map[int32]*pb.GirdeData, Width*Height)
|
||||
for i := 0; i < Width; i++ {
|
||||
for j := 0; j < Height; j++ {
|
||||
tmp := GetRandType()
|
||||
key := int32(i*10 + j)
|
||||
bOk := true // OK 的
|
||||
this.Data[key] = &Girde{
|
||||
this.Data[key] = &pb.GirdeData{
|
||||
X: int32(i),
|
||||
Y: int32(j),
|
||||
ID: key,
|
||||
Id: key,
|
||||
Itype: tmp,
|
||||
Cid: tmp,
|
||||
Score: 1,
|
||||
}
|
||||
// 校验 检查格子的左边的左边 和下边和下下边
|
||||
if j-2 >= 0 {
|
||||
@ -108,14 +111,14 @@ func (this *MapData) InitMap() {
|
||||
index++
|
||||
}
|
||||
}
|
||||
this.Debugf()
|
||||
//this.Debugf()
|
||||
}
|
||||
|
||||
// 交换2个元素(参数 id )
|
||||
func (this *MapData) SwapGirde(i, j int32) bool {
|
||||
var (
|
||||
bSwap bool // 能否交换
|
||||
tmp *Girde
|
||||
tmp *pb.GirdeData
|
||||
)
|
||||
g1 := this.GetKeyData(i)
|
||||
g2 := this.GetKeyData(j)
|
||||
@ -123,7 +126,6 @@ func (this *MapData) SwapGirde(i, j int32) bool {
|
||||
return bSwap
|
||||
}
|
||||
// 校验是不是挨着的
|
||||
|
||||
if g1.X-1 == g2.X {
|
||||
bSwap = true
|
||||
}
|
||||
@ -137,15 +139,15 @@ func (this *MapData) SwapGirde(i, j int32) bool {
|
||||
bSwap = true
|
||||
}
|
||||
// 更新地图数据
|
||||
tmp = &Girde{
|
||||
tmp = &pb.GirdeData{
|
||||
X: g1.X,
|
||||
Y: g1.Y,
|
||||
ID: g1.ID,
|
||||
Id: g1.Id,
|
||||
Itype: g1.Itype,
|
||||
}
|
||||
this.Data[i] = g2
|
||||
this.Data[j] = tmp
|
||||
this.Debugf()
|
||||
//this.Debugf()
|
||||
return bSwap
|
||||
}
|
||||
|
||||
@ -160,13 +162,119 @@ func (this *MapData) Debugf() {
|
||||
}
|
||||
}
|
||||
|
||||
// 校验地图可消除的 判断各组上面2个和右边两个是否三个相等
|
||||
func (this *MapData) CheckMap() {
|
||||
var (
|
||||
del map[int32]struct{}
|
||||
)
|
||||
// 检查5消
|
||||
func (this *MapData) Check5X() (bEliminate bool, score int32) {
|
||||
m := make(map[int32]struct{}, 0)
|
||||
|
||||
del = map[int32]struct{}{}
|
||||
bEliminate = true
|
||||
del := make(map[int32]int32)
|
||||
for i := 0; i < Width; i++ {
|
||||
for j := 0; j < Height; j++ {
|
||||
key := int32(i*10 + j)
|
||||
iType := this.GetKeyType(key)
|
||||
if iType == 0 {
|
||||
continue
|
||||
}
|
||||
curKey := this.Data[key].Itype
|
||||
m[curKey] = struct{}{}
|
||||
if j+4 < Height {
|
||||
i1 := this.Data[int32((i+1)*10+j)]
|
||||
i2 := this.Data[int32((i+2)*10+j)]
|
||||
i3 := this.Data[int32((i+3)*10+j)]
|
||||
i4 := this.Data[int32((i+4)*10+j)]
|
||||
|
||||
m[i1.Itype] = struct{}{}
|
||||
m[i2.Itype] = struct{}{}
|
||||
m[i3.Itype] = struct{}{}
|
||||
m[i4.Itype] = struct{}{}
|
||||
|
||||
if len(m) == 5 {
|
||||
del[int32((i+1)*10+j)] = i1.Score
|
||||
del[int32((i+2)*10+j)] = i2.Score
|
||||
del[int32((i+3)*10+j)] = i3.Score
|
||||
del[int32((i+4)*10+j)] = i4.Score
|
||||
del[key] = this.Data[key].Score
|
||||
}
|
||||
}
|
||||
if i+4 < Width {
|
||||
i1 := this.Data[int32(i*10+j+1)]
|
||||
i2 := this.Data[int32(i*10+j+2)]
|
||||
i3 := this.Data[int32(i*10+j+3)]
|
||||
i4 := this.Data[int32(i*10+j+4)]
|
||||
m[i1.Itype] = struct{}{}
|
||||
m[i2.Itype] = struct{}{}
|
||||
m[i3.Itype] = struct{}{}
|
||||
m[i4.Itype] = struct{}{}
|
||||
if len(m) == 5 {
|
||||
del[int32(i*10+j+1)] = i1.Score
|
||||
del[int32(i*10+j+2)] = i2.Score
|
||||
del[int32(i*10+j+3)] = i3.Score
|
||||
del[int32(i*10+j+4)] = i4.Score
|
||||
del[key] = this.Data[key].Score
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 顺着删除列表删除各组
|
||||
for k, v := range del {
|
||||
this.Data[k].Itype = 0
|
||||
score += v
|
||||
}
|
||||
if len(del) > 0 {
|
||||
bEliminate = false
|
||||
}
|
||||
fmt.Printf("===del:%v", del)
|
||||
return
|
||||
}
|
||||
func (this *MapData) Check4X() (bEliminate bool, score int32) {
|
||||
bEliminate = false
|
||||
del := make(map[int32]int32)
|
||||
for i := 0; i < Width; i++ {
|
||||
for j := 0; j < Height; j++ {
|
||||
key := int32(i*10 + j)
|
||||
iType := this.GetKeyType(key)
|
||||
if iType == 0 {
|
||||
continue
|
||||
}
|
||||
if j+3 < Height {
|
||||
i1 := this.Data[int32((i+1)*10+j)]
|
||||
i2 := this.Data[int32((i+2)*10+j)]
|
||||
i3 := this.Data[int32((i+3)*10+j)]
|
||||
if i1.Itype == i2.Itype && i2.Itype == i3.Itype && i1.Itype == iType {
|
||||
del[int32((i+1)*10+j)] = i1.Score
|
||||
del[int32((i+2)*10+j)] = i2.Score
|
||||
del[int32((i+3)*10+j)] = i3.Score
|
||||
del[key] = this.Data[key].Score
|
||||
}
|
||||
}
|
||||
if i+3 < Width {
|
||||
i1 := this.Data[int32(i*10+j+1)]
|
||||
i2 := this.Data[int32(i*10+j+2)]
|
||||
i3 := this.Data[int32(i*10+j+3)]
|
||||
if i1.Itype == i2.Itype && i2.Itype == i3.Itype && i1.Itype == iType {
|
||||
del[int32(i*10+j+1)] = i1.Score
|
||||
del[int32(i*10+j+2)] = i2.Score
|
||||
del[int32(i*10+j+3)] = i3.Score
|
||||
del[key] = this.Data[key].Score
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 顺着删除列表删除各组
|
||||
for k, v := range del {
|
||||
this.Data[k].Itype = 0
|
||||
score += v
|
||||
}
|
||||
if len(del) > 0 {
|
||||
bEliminate = true
|
||||
}
|
||||
fmt.Printf("===del:%v", del)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *MapData) Check3X() (bEliminate bool, score int32) {
|
||||
bEliminate = true
|
||||
del := make(map[int32]int32)
|
||||
for i := 0; i < Width; i++ {
|
||||
for j := 0; j < Height; j++ {
|
||||
key := int32(i*10 + j)
|
||||
@ -175,36 +283,57 @@ func (this *MapData) CheckMap() {
|
||||
continue
|
||||
}
|
||||
if j+2 < Height {
|
||||
i1 := this.GetKeyType(int32((i+1)*10 + j))
|
||||
i2 := this.GetKeyType(int32((i+2)*10 + j))
|
||||
if i1 == i2 && i1 == iType {
|
||||
del[int32((i+1)*10+j)] = struct{}{}
|
||||
del[int32((i+2)*10+j)] = struct{}{}
|
||||
del[key] = struct{}{}
|
||||
i1 := this.Data[int32((i+1)*10+j)]
|
||||
i2 := this.Data[int32((i+2)*10+j)]
|
||||
if i1.Itype == i2.Itype && i1.Itype == iType {
|
||||
del[int32((i+1)*10+j)] = i1.Score
|
||||
del[int32((i+2)*10+j)] = i1.Score
|
||||
del[key] = i1.Score
|
||||
}
|
||||
}
|
||||
if i+2 < Width {
|
||||
i1 := this.GetKeyType(int32(i*10 + j + 1))
|
||||
i2 := this.GetKeyType(int32(i*10 + j + 2))
|
||||
if i1 == i2 && i1 == iType {
|
||||
del[int32(i*10+j+1)] = struct{}{}
|
||||
del[int32(i*10+j+2)] = struct{}{}
|
||||
del[key] = struct{}{}
|
||||
i1 := this.Data[int32(i*10+j+1)]
|
||||
i2 := this.Data[int32(i*10+j+2)]
|
||||
if i1.Itype == i2.Itype && i1.Itype == iType {
|
||||
del[int32(i*10+j+1)] = i1.Score
|
||||
del[int32(i*10+j+2)] = i1.Score
|
||||
del[key] = i1.Score
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 顺着删除列表删除各组
|
||||
for k := range del {
|
||||
for k, v := range del {
|
||||
this.Data[k].Itype = 0
|
||||
score += v
|
||||
}
|
||||
if len(del) > 0 {
|
||||
bEliminate = false
|
||||
}
|
||||
fmt.Printf("===del:%v", del)
|
||||
this.Debugf()
|
||||
return
|
||||
}
|
||||
|
||||
// 校验地图可消除的 判断各组上面2个和右边两个是否三个相等
|
||||
func (this *MapData) CheckMap() (bEliminate bool, score int32) {
|
||||
if bRet, s := this.Check5X(); !bRet {
|
||||
score += s
|
||||
}
|
||||
if bRet, s := this.Check4X(); !bRet {
|
||||
score += s
|
||||
}
|
||||
if bRet, s := this.Check3X(); !bRet {
|
||||
score += s
|
||||
}
|
||||
if score > 0 {
|
||||
bEliminate = true
|
||||
}
|
||||
//this.Debugf()
|
||||
return
|
||||
}
|
||||
|
||||
// 下落 生成新的格子
|
||||
func (this *MapData) DropGirde() (Data map[int32]*Girde) {
|
||||
func (this *MapData) DropGirde() {
|
||||
for i := 0; i < Width; i++ {
|
||||
for j := 0; j < Height; j++ {
|
||||
key := int32(i*10 + j)
|
||||
@ -233,6 +362,6 @@ func (this *MapData) DropGirde() (Data map[int32]*Girde) {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Debugf()
|
||||
return this.Data
|
||||
//this.Debugf()
|
||||
return
|
||||
}
|
||||
|
349
pb/entertain_db.pb.go
Normal file
349
pb/entertain_db.pb.go
Normal file
@ -0,0 +1,349 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: entertain/entertain_db.proto
|
||||
|
||||
package pb
|
||||
|
||||
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 MapData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data map[int32]*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 地图数据
|
||||
}
|
||||
|
||||
func (x *MapData) Reset() {
|
||||
*x = MapData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_db_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *MapData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MapData) ProtoMessage() {}
|
||||
|
||||
func (x *MapData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_db_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 MapData.ProtoReflect.Descriptor instead.
|
||||
func (*MapData) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_db_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MapData) GetData() map[int32]*GirdeData {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 消消乐
|
||||
type GirdeData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x"`
|
||||
Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y"`
|
||||
Id int32 `protobuf:"varint,3,opt,name=id,proto3" json:"id"`
|
||||
Itype int32 `protobuf:"varint,4,opt,name=itype,proto3" json:"itype"` // 对应配置表color
|
||||
Cid int32 `protobuf:"varint,5,opt,name=cid,proto3" json:"cid"` // 配置表id
|
||||
Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score"` // 对应的积分
|
||||
}
|
||||
|
||||
func (x *GirdeData) Reset() {
|
||||
*x = GirdeData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_db_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GirdeData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GirdeData) ProtoMessage() {}
|
||||
|
||||
func (x *GirdeData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_db_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 GirdeData.ProtoReflect.Descriptor instead.
|
||||
func (*GirdeData) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetX() int32 {
|
||||
if x != nil {
|
||||
return x.X
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetY() int32 {
|
||||
if x != nil {
|
||||
return x.Y
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetItype() int32 {
|
||||
if x != nil {
|
||||
return x.Itype
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetCid() int32 {
|
||||
if x != nil {
|
||||
return x.Cid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GirdeData) GetScore() int32 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PlayerData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` // 昵称
|
||||
Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` // 积分
|
||||
Ps int32 `protobuf:"varint,4,opt,name=ps,proto3" json:"ps"` // 体力
|
||||
}
|
||||
|
||||
func (x *PlayerData) Reset() {
|
||||
*x = PlayerData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_db_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PlayerData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PlayerData) ProtoMessage() {}
|
||||
|
||||
func (x *PlayerData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_db_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 PlayerData.ProtoReflect.Descriptor instead.
|
||||
func (*PlayerData) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_db_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PlayerData) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PlayerData) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PlayerData) GetScore() int32 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PlayerData) GetPs() int32 {
|
||||
if x != nil {
|
||||
return x.Ps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
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, 0x76,
|
||||
0x0a, 0x07, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74,
|
||||
0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x1a, 0x43, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x75, 0x0a, 0x09, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44,
|
||||
0x61, 0x74, 0x61, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01,
|
||||
0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x12,
|
||||
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||
0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x58, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entertain_entertain_db_proto_rawDescOnce sync.Once
|
||||
file_entertain_entertain_db_proto_rawDescData = file_entertain_entertain_db_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entertain_entertain_db_proto_rawDescGZIP() []byte {
|
||||
file_entertain_entertain_db_proto_rawDescOnce.Do(func() {
|
||||
file_entertain_entertain_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_entertain_entertain_db_proto_rawDescData)
|
||||
})
|
||||
return file_entertain_entertain_db_proto_rawDescData
|
||||
}
|
||||
|
||||
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
|
||||
nil, // 3: MapData.DataEntry
|
||||
}
|
||||
var file_entertain_entertain_db_proto_depIdxs = []int32{
|
||||
3, // 0: MapData.data:type_name -> MapData.DataEntry
|
||||
1, // 1: MapData.DataEntry.value:type_name -> GirdeData
|
||||
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() }
|
||||
func file_entertain_entertain_db_proto_init() {
|
||||
if File_entertain_entertain_db_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entertain_entertain_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*MapData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GirdeData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PlayerData); 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_entertain_entertain_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entertain_entertain_db_proto_goTypes,
|
||||
DependencyIndexes: file_entertain_entertain_db_proto_depIdxs,
|
||||
MessageInfos: file_entertain_entertain_db_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entertain_entertain_db_proto = out.File
|
||||
file_entertain_entertain_db_proto_rawDesc = nil
|
||||
file_entertain_entertain_db_proto_goTypes = nil
|
||||
file_entertain_entertain_db_proto_depIdxs = nil
|
||||
}
|
678
pb/entertain_msg.pb.go
Normal file
678
pb/entertain_msg.pb.go
Normal file
@ -0,0 +1,678 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: entertain/entertain_msg.proto
|
||||
|
||||
package pb
|
||||
|
||||
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 EntertainMatchReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *EntertainMatchReq) Reset() {
|
||||
*x = EntertainMatchReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainMatchReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainMatchReq) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainMatchReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainMatchReq.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainMatchReq) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// 匹配结果
|
||||
type EntertainMatchResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Maych bool `protobuf:"varint,1,opt,name=maych,proto3" json:"maych"` // 匹配成功
|
||||
Player *PlayerData `protobuf:"bytes,2,opt,name=player,proto3" json:"player"` // 玩家信息
|
||||
}
|
||||
|
||||
func (x *EntertainMatchResp) Reset() {
|
||||
*x = EntertainMatchResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainMatchResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainMatchResp) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainMatchResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainMatchResp.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainMatchResp) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *EntertainMatchResp) GetMaych() bool {
|
||||
if x != nil {
|
||||
return x.Maych
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *EntertainMatchResp) GetPlayer() *PlayerData {
|
||||
if x != nil {
|
||||
return x.Player
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 游戏开始
|
||||
type EntertainStartGamePush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
User1 *PlayerData `protobuf:"bytes,1,opt,name=user1,proto3" json:"user1"`
|
||||
User2 *PlayerData `protobuf:"bytes,2,opt,name=user2,proto3" json:"user2"`
|
||||
Mpadata *MapData `protobuf:"bytes,3,opt,name=mpadata,proto3" json:"mpadata"` // 地图数据
|
||||
Power string `protobuf:"bytes,4,opt,name=power,proto3" json:"power"` // 操作权
|
||||
Round int32 `protobuf:"varint,5,opt,name=round,proto3" json:"round"` // 回合数
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) Reset() {
|
||||
*x = EntertainStartGamePush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainStartGamePush) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainStartGamePush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainStartGamePush.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainStartGamePush) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) GetUser1() *PlayerData {
|
||||
if x != nil {
|
||||
return x.User1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) GetUser2() *PlayerData {
|
||||
if x != nil {
|
||||
return x.User2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) GetMpadata() *MapData {
|
||||
if x != nil {
|
||||
return x.Mpadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) GetPower() string {
|
||||
if x != nil {
|
||||
return x.Power
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntertainStartGamePush) GetRound() int32 {
|
||||
if x != nil {
|
||||
return x.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 操作
|
||||
type EntertainOperatorReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` // 房间id
|
||||
Itype int32 `protobuf:"varint,2,opt,name=itype,proto3" json:"itype"` // 操作类型 0 默认交换元素
|
||||
Curid int32 `protobuf:"varint,3,opt,name=curid,proto3" json:"curid"` // 当前key
|
||||
Targetid int32 `protobuf:"varint,4,opt,name=targetid,proto3" json:"targetid"` // 目标key
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) Reset() {
|
||||
*x = EntertainOperatorReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainOperatorReq) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainOperatorReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainOperatorReq.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainOperatorReq) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) GetRoomid() string {
|
||||
if x != nil {
|
||||
return x.Roomid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) GetItype() int32 {
|
||||
if x != nil {
|
||||
return x.Itype
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) GetCurid() int32 {
|
||||
if x != nil {
|
||||
return x.Curid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorReq) GetTargetid() int32 {
|
||||
if x != nil {
|
||||
return x.Targetid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 操作返回
|
||||
type EntertainOperatorResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success"` // 操作是否成功
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorResp) Reset() {
|
||||
*x = EntertainOperatorResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainOperatorResp) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainOperatorResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainOperatorResp.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainOperatorResp) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorResp) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 操作结果推送
|
||||
type EntertainOperatorRstPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Mpadata []*MapData `protobuf:"bytes,1,rep,name=mpadata,proto3" json:"mpadata"` // 地图数据
|
||||
Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power"` // 该谁操作了
|
||||
Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` // 获得积分
|
||||
Round int32 `protobuf:"varint,4,opt,name=round,proto3" json:"round"` // 轮数
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) Reset() {
|
||||
*x = EntertainOperatorRstPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainOperatorRstPush) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainOperatorRstPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_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 EntertainOperatorRstPush.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainOperatorRstPush) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) GetMpadata() []*MapData {
|
||||
if x != nil {
|
||||
return x.Mpadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) GetPower() string {
|
||||
if x != nil {
|
||||
return x.Power
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) GetScore() int32 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EntertainOperatorRstPush) GetRound() int32 {
|
||||
if x != nil {
|
||||
return x.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 游戏结束推送
|
||||
type EntertainGameOverPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
User1 *PlayerData `protobuf:"bytes,1,opt,name=user1,proto3" json:"user1"`
|
||||
User2 *PlayerData `protobuf:"bytes,2,opt,name=user2,proto3" json:"user2"`
|
||||
Mpadata *MapData `protobuf:"bytes,3,opt,name=mpadata,proto3" json:"mpadata"` // 地图数据
|
||||
Power string `protobuf:"bytes,4,opt,name=power,proto3" json:"power"` // 操作权
|
||||
Round int32 `protobuf:"varint,5,opt,name=round,proto3" json:"round"` // 回合数
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) Reset() {
|
||||
*x = EntertainGameOverPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntertainGameOverPush) ProtoMessage() {}
|
||||
|
||||
func (x *EntertainGameOverPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_entertain_entertain_msg_proto_msgTypes[6]
|
||||
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 EntertainGameOverPush.ProtoReflect.Descriptor instead.
|
||||
func (*EntertainGameOverPush) Descriptor() ([]byte, []int) {
|
||||
return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) GetUser1() *PlayerData {
|
||||
if x != nil {
|
||||
return x.User1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) GetUser2() *PlayerData {
|
||||
if x != nil {
|
||||
return x.User2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) GetMpadata() *MapData {
|
||||
if x != nil {
|
||||
return x.Mpadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) GetPower() string {
|
||||
if x != nil {
|
||||
return x.Power
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntertainGameOverPush) GetRound() int32 {
|
||||
if x != nil {
|
||||
return x.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_entertain_entertain_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_entertain_entertain_msg_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x65,
|
||||
0x72, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
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, 0x13, 0x0a,
|
||||
0x11, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52,
|
||||
0x65, 0x71, 0x22, 0x4f, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x4d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x79, 0x63,
|
||||
0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x61, 0x79, 0x63, 0x68, 0x12, 0x23,
|
||||
0x0a, 0x06, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b,
|
||||
0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x70, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x22, 0xae, 0x01, 0x0a, 0x16, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x47, 0x61, 0x6d, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x21,
|
||||
0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72,
|
||||
0x31, 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75,
|
||||
0x73, 0x65, 0x72, 0x32, 0x12, 0x22, 0x0a, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||
0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65,
|
||||
0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72,
|
||||
0x6f, 0x75, 0x6e, 0x64, 0x22, 0x76, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x72, 0x6f, 0x6f, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f,
|
||||
0x6f, 0x6d, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75,
|
||||
0x72, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x75, 0x72, 0x69, 0x64,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x15,
|
||||
0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f,
|
||||
0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22,
|
||||
0x80, 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x65,
|
||||
0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x73, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x07,
|
||||
0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e,
|
||||
0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75,
|
||||
0x6e, 0x64, 0x22, 0xad, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e,
|
||||
0x47, 0x61, 0x6d, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x05,
|
||||
0x75, 0x73, 0x65, 0x72, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x6c,
|
||||
0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x12,
|
||||
0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b,
|
||||
0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65,
|
||||
0x72, 0x32, 0x12, 0x22, 0x0a, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d,
|
||||
0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75,
|
||||
0x6e, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_entertain_entertain_msg_proto_rawDescOnce sync.Once
|
||||
file_entertain_entertain_msg_proto_rawDescData = file_entertain_entertain_msg_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_entertain_entertain_msg_proto_rawDescGZIP() []byte {
|
||||
file_entertain_entertain_msg_proto_rawDescOnce.Do(func() {
|
||||
file_entertain_entertain_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_entertain_entertain_msg_proto_rawDescData)
|
||||
})
|
||||
return file_entertain_entertain_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_entertain_entertain_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_entertain_entertain_msg_proto_goTypes = []interface{}{
|
||||
(*EntertainMatchReq)(nil), // 0: EntertainMatchReq
|
||||
(*EntertainMatchResp)(nil), // 1: EntertainMatchResp
|
||||
(*EntertainStartGamePush)(nil), // 2: EntertainStartGamePush
|
||||
(*EntertainOperatorReq)(nil), // 3: EntertainOperatorReq
|
||||
(*EntertainOperatorResp)(nil), // 4: EntertainOperatorResp
|
||||
(*EntertainOperatorRstPush)(nil), // 5: EntertainOperatorRstPush
|
||||
(*EntertainGameOverPush)(nil), // 6: EntertainGameOverPush
|
||||
(*PlayerData)(nil), // 7: PlayerData
|
||||
(*MapData)(nil), // 8: MapData
|
||||
}
|
||||
var file_entertain_entertain_msg_proto_depIdxs = []int32{
|
||||
7, // 0: EntertainMatchResp.player:type_name -> PlayerData
|
||||
7, // 1: EntertainStartGamePush.user1:type_name -> PlayerData
|
||||
7, // 2: EntertainStartGamePush.user2:type_name -> PlayerData
|
||||
8, // 3: EntertainStartGamePush.mpadata:type_name -> MapData
|
||||
8, // 4: EntertainOperatorRstPush.mpadata:type_name -> MapData
|
||||
7, // 5: EntertainGameOverPush.user1:type_name -> PlayerData
|
||||
7, // 6: EntertainGameOverPush.user2:type_name -> PlayerData
|
||||
8, // 7: EntertainGameOverPush.mpadata:type_name -> MapData
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_entertain_entertain_msg_proto_init() }
|
||||
func file_entertain_entertain_msg_proto_init() {
|
||||
if File_entertain_entertain_msg_proto != nil {
|
||||
return
|
||||
}
|
||||
file_entertain_entertain_db_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_entertain_entertain_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainMatchReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainMatchResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainStartGamePush); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainOperatorReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainOperatorResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainOperatorRstPush); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_entertain_entertain_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntertainGameOverPush); 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_entertain_entertain_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_entertain_entertain_msg_proto_goTypes,
|
||||
DependencyIndexes: file_entertain_entertain_msg_proto_depIdxs,
|
||||
MessageInfos: file_entertain_entertain_msg_proto_msgTypes,
|
||||
}.Build()
|
||||
File_entertain_entertain_msg_proto = out.File
|
||||
file_entertain_entertain_msg_proto_rawDesc = nil
|
||||
file_entertain_entertain_msg_proto_goTypes = nil
|
||||
file_entertain_entertain_msg_proto_depIdxs = nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user