优化
This commit is contained in:
parent
41c5ad951a
commit
1ea7fb31bb
@ -50,14 +50,7 @@ func (this *Entertainment) Start() (err error) {
|
|||||||
if err = this.ModuleBase.Start(); err != nil {
|
if err = this.ModuleBase.Start(); err != nil {
|
||||||
return
|
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)
|
|
||||||
// this.xxl.CheckMap()
|
|
||||||
// this.xxl.DropGirde()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ type Room struct {
|
|||||||
power string // 谁的权限
|
power string // 谁的权限
|
||||||
round int32 // 轮数
|
round int32 // 轮数
|
||||||
operatetimer *timewheel.Task //操作倒计时定时器
|
operatetimer *timewheel.Task //操作倒计时定时器
|
||||||
|
aiTimer *timewheel.Task //AI操作随机做个延时
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Room) operateTimeOut(task *timewheel.Task, args ...interface{}) {
|
func (this *Room) operateTimeOut(task *timewheel.Task, args ...interface{}) {
|
||||||
@ -55,7 +56,7 @@ func (this *Room) InitRoom(module *Entertainment, s1 comm.IUserSession, s2 comm.
|
|||||||
this.chessboard.InitMap() // 初始化棋盘
|
this.chessboard.InitMap() // 初始化棋盘
|
||||||
|
|
||||||
this.szSession = append(this.szSession, s1)
|
this.szSession = append(this.szSession, s1)
|
||||||
if p2.Uid != "" { // 是否是机器人
|
if p2.Uid != "999" { // 是否是机器人
|
||||||
this.szSession = append(this.szSession, s2)
|
this.szSession = append(this.szSession, s2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +72,47 @@ func (this *Room) InitRoom(module *Entertainment, s1 comm.IUserSession, s2 comm.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AI 操作了
|
||||||
|
func (this *Room) AiTimeOut(task *timewheel.Task, args ...interface{}) {
|
||||||
|
var (
|
||||||
|
curScore int32
|
||||||
|
szMap []*pb.MapData
|
||||||
|
)
|
||||||
|
this.player2.Ps--
|
||||||
|
if this.player2.Ps <= 0 { // 权限给下一个人
|
||||||
|
this.power = this.player1.Uid
|
||||||
|
this.round++
|
||||||
|
}
|
||||||
|
this.player1.Ps = MaxPs
|
||||||
|
if this.aiTimer != nil {
|
||||||
|
timewheel.Remove(this.aiTimer)
|
||||||
|
}
|
||||||
|
// 交换元素
|
||||||
|
bSwap := this.chessboard.AiSwapGirde() // 交换格子
|
||||||
|
if !bSwap {
|
||||||
|
this.module.Errorf("AiSwapGirde fialed")
|
||||||
|
}
|
||||||
|
szMap = append(szMap, &pb.MapData{
|
||||||
|
Data: this.chessboard.Plat,
|
||||||
|
})
|
||||||
|
if score, m := this.chessboard.CheckMap(); score > 0 {
|
||||||
|
curScore += score
|
||||||
|
szMap = append(szMap, m...)
|
||||||
|
}
|
||||||
|
this.player2.Score += curScore
|
||||||
|
// 广播消息
|
||||||
|
if err := this.SendMsgToSession(string(this.module.GetType()), "operatorrst", &pb.EntertainOperatorRstPush{
|
||||||
|
Mpadata: szMap,
|
||||||
|
Power: this.power,
|
||||||
|
Score: curScore,
|
||||||
|
Round: this.round,
|
||||||
|
User1: this.player1,
|
||||||
|
User2: this.player2,
|
||||||
|
}, this.szSession...); err != nil {
|
||||||
|
this.Errorln(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg proto.Message) (errdata *pb.ErrorData) {
|
func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg proto.Message) (errdata *pb.ErrorData) {
|
||||||
switch stype {
|
switch stype {
|
||||||
case "opertor": // 操作消息
|
case "opertor": // 操作消息
|
||||||
@ -88,10 +130,20 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
this.player1.Ps--
|
this.player1.Ps--
|
||||||
if this.player1.Ps <= 0 { // 权限给下一个人
|
if this.player1.Ps <= 0 { // 权限给下一个人
|
||||||
this.power = this.player2.Uid
|
this.power = this.player2.Uid
|
||||||
|
|
||||||
|
if len(this.szSession) == 1 { // 校验2号玩家是不是AI
|
||||||
|
// 起一个定时器
|
||||||
|
if this.aiTimer != nil {
|
||||||
|
timewheel.Remove(this.aiTimer)
|
||||||
|
}
|
||||||
|
this.operatetimer = timewheel.Add(time.Second*3, this.AiTimeOut)
|
||||||
|
}
|
||||||
this.round++
|
this.round++
|
||||||
}
|
}
|
||||||
this.player2.Ps = MaxPs
|
this.player2.Ps = MaxPs
|
||||||
|
|
||||||
} else if this.power == this.player2.Uid {
|
} else if this.power == this.player2.Uid {
|
||||||
|
|
||||||
this.player2.Ps--
|
this.player2.Ps--
|
||||||
if this.player2.Ps <= 0 { // 权限给下一个人
|
if this.player2.Ps <= 0 { // 权限给下一个人
|
||||||
this.power = this.player1.Uid
|
this.power = this.player1.Uid
|
||||||
@ -106,11 +158,11 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
szMap = append(szMap, &pb.MapData{
|
szMap = append(szMap, &pb.MapData{
|
||||||
Data: this.chessboard.Plat,
|
Data: this.chessboard.Plat,
|
||||||
})
|
})
|
||||||
this.chessboard.CheckMap()
|
if score, m := this.chessboard.CheckMap(); score > 0 {
|
||||||
if score, m := this.chessboard.DropGirde(); score > 0 {
|
|
||||||
curScore += score
|
curScore += score
|
||||||
szMap = append(szMap, m...)
|
szMap = append(szMap, m...)
|
||||||
}
|
}
|
||||||
|
this.player2.Score += curScore
|
||||||
// 开启新的定时器
|
// 开启新的定时器
|
||||||
if this.operatetimer != nil {
|
if this.operatetimer != nil {
|
||||||
timewheel.Remove(this.operatetimer)
|
timewheel.Remove(this.operatetimer)
|
||||||
@ -127,6 +179,8 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr
|
|||||||
Power: this.power,
|
Power: this.power,
|
||||||
Score: curScore,
|
Score: curScore,
|
||||||
Round: this.round,
|
Round: this.round,
|
||||||
|
User1: this.player1,
|
||||||
|
User2: this.player2,
|
||||||
}, this.szSession...); err != nil {
|
}, this.szSession...); err != nil {
|
||||||
this.Errorln(err)
|
this.Errorln(err)
|
||||||
}
|
}
|
||||||
@ -152,7 +206,7 @@ func (this *Room) StartGame() (errdata *pb.ErrorData) {
|
|||||||
User1: this.player1,
|
User1: this.player1,
|
||||||
User2: this.player2,
|
User2: this.player2,
|
||||||
Mpadata: &pb.MapData{
|
Mpadata: &pb.MapData{
|
||||||
//Data: this.chessboard.Data,
|
Data: this.chessboard.Plat,
|
||||||
},
|
},
|
||||||
Power: this.power,
|
Power: this.power,
|
||||||
Round: this.round,
|
Round: this.round,
|
||||||
@ -169,7 +223,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) {
|
|||||||
User1: this.player1,
|
User1: this.player1,
|
||||||
User2: this.player2,
|
User2: this.player2,
|
||||||
Mpadata: &pb.MapData{
|
Mpadata: &pb.MapData{
|
||||||
//Data: this.chessboard.Data,
|
Data: this.chessboard.Plat,
|
||||||
},
|
},
|
||||||
Power: "",
|
Power: "",
|
||||||
Round: this.round,
|
Round: this.round,
|
||||||
|
@ -80,17 +80,16 @@ func (this *MapData) SwapGirde(oldId, newId int32) bool {
|
|||||||
var (
|
var (
|
||||||
bSwap bool // 能否交换
|
bSwap bool // 能否交换
|
||||||
)
|
)
|
||||||
if oldId+1 < Total && oldId+1 == newId ||
|
// x = int32(i/Width), y = int32(i%Height)
|
||||||
oldId%Height > 0 && oldId%Height == newId ||
|
if (oldId%Height != Total-1 && oldId+1 == newId) ||
|
||||||
oldId+Width < Total && oldId+Width == newId ||
|
(oldId%Height > 0 && oldId-1 == newId) ||
|
||||||
oldId-Width > 0 && oldId-Width == newId {
|
(oldId+Width < Total && oldId+Width == newId) ||
|
||||||
|
(oldId-Width > 0 && oldId-Width == newId) {
|
||||||
bSwap = true
|
bSwap = true
|
||||||
|
|
||||||
tmp := new(pb.GirdeData)
|
tmp := new(pb.GirdeData)
|
||||||
*tmp = *this.Plat[newId]
|
*tmp = *this.Plat[newId]
|
||||||
this.Plat[newId] = this.Plat[oldId]
|
this.Plat[newId] = this.Plat[oldId]
|
||||||
this.Plat[oldId] = tmp
|
this.Plat[oldId] = tmp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Debugf()
|
this.Debugf()
|
||||||
@ -99,11 +98,11 @@ func (this *MapData) SwapGirde(oldId, newId int32) bool {
|
|||||||
|
|
||||||
func (this *MapData) SetMap() {
|
func (this *MapData) SetMap() {
|
||||||
sz2 := []int32{
|
sz2 := []int32{
|
||||||
5, 1, 0, 5, 1, 5, 2,
|
5, 1, 2, 5, 1, 5, 2,
|
||||||
3, 1, 5, 4, 2, 4, 4,
|
3, 1, 5, 4, 2, 4, 4,
|
||||||
4, 4, 0, 1, 6, 4, 1,
|
4, 4, 2, 1, 6, 4, 1,
|
||||||
6, 3, 1, 1, 3, 6, 3,
|
6, 3, 1, 4, 3, 6, 3,
|
||||||
6, 3, 0, 1, 1, 6, 1,
|
6, 3, 3, 1, 1, 6, 1,
|
||||||
5, 6, 5, 5, 1, 3, 1,
|
5, 6, 5, 5, 1, 3, 1,
|
||||||
6, 5, 5, 1, 2, 1, 4,
|
6, 5, 5, 1, 2, 1, 4,
|
||||||
}
|
}
|
||||||
@ -266,6 +265,7 @@ func (this *MapData) Check3X() (bEliminate bool, score int32) {
|
|||||||
bEliminate = true
|
bEliminate = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if k+2*Width < Total {
|
if k+2*Width < Total {
|
||||||
k1 := this.Plat[k].Color
|
k1 := this.Plat[k].Color
|
||||||
k2 := this.Plat[k+Width].Color
|
k2 := this.Plat[k+Width].Color
|
||||||
@ -288,59 +288,33 @@ func (this *MapData) Check3X() (bEliminate bool, score int32) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// func (this *MapData) CheckSwape(g1, g2 int32) (bEliminate bool) {
|
|
||||||
|
|
||||||
// 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+2 < Height {
|
|
||||||
// k1 := int32((i+1)*10 + j)
|
|
||||||
// k2 := int32((i+2)*10 + j)
|
|
||||||
// i1 := this.Data[k1]
|
|
||||||
// i2 := this.Data[k2]
|
|
||||||
// if i1.Itype == i2.Itype && i1.Itype == iType {
|
|
||||||
// if g1 == key || k1 == g1 || k2 == g1 ||
|
|
||||||
// g2 == key || k1 == g2 || k2 == g2 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if i+2 < Width {
|
|
||||||
// k1 := int32(i*10 + j + 1)
|
|
||||||
// k2 := int32(i*10 + j + 2)
|
|
||||||
// i1 := this.Data[k1]
|
|
||||||
// i2 := this.Data[k2]
|
|
||||||
// if i1.Itype == i2.Itype && i1.Itype == iType {
|
|
||||||
// if g1 == key || k1 == g1 || k2 == g1 ||
|
|
||||||
// g2 == key || k1 == g2 || k2 == g2 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 校验地图可消除的 判断各组上面2个和右边两个是否三个相等
|
// 校验地图可消除的 判断各组上面2个和右边两个是否三个相等
|
||||||
func (this *MapData) CheckMap() (score int32) {
|
func (this *MapData) CheckMap() (score int32, szMap []*pb.MapData) {
|
||||||
score = 0
|
for {
|
||||||
|
var curScore int32
|
||||||
if bRet, s := this.Check5X(); !bRet {
|
if bRet, s := this.Check5X(); !bRet {
|
||||||
fmt.Printf("=====检测消除5x===========\n")
|
fmt.Printf("=====检测消除5x===========\n")
|
||||||
score += s
|
curScore += s
|
||||||
}
|
}
|
||||||
if bRet, s := this.Check4X(); !bRet {
|
if bRet, s := this.Check4X(); !bRet {
|
||||||
fmt.Printf("=====检测消除4x===========\n")
|
fmt.Printf("=====检测消除4x===========\n")
|
||||||
score += s
|
curScore += s
|
||||||
}
|
}
|
||||||
if bRet, s := this.Check3X(); !bRet {
|
if bRet, s := this.Check3X(); !bRet {
|
||||||
fmt.Printf("=====检测消除3x===========\n")
|
fmt.Printf("=====检测消除3x===========\n")
|
||||||
score += s
|
curScore += s
|
||||||
|
}
|
||||||
|
score += curScore // 总分
|
||||||
|
if curScore == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
//szMap = append(szMap, this.DropGirde()...)
|
||||||
|
this.DropGirde()
|
||||||
|
|
||||||
|
szMap = append(szMap, &pb.MapData{
|
||||||
|
Data: this.Plat,
|
||||||
|
CurSocre: curScore,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.Debugf()
|
//this.Debugf()
|
||||||
@ -348,7 +322,7 @@ func (this *MapData) CheckMap() (score int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 下落 生成新的格子 (返回掉落所获得的分数)
|
// 下落 生成新的格子 (返回掉落所获得的分数)
|
||||||
func (this *MapData) DropGirde() (score int32, szMap []*pb.MapData) {
|
func (this *MapData) DropGirde() {
|
||||||
|
|
||||||
for i := 0; i < Width; i++ {
|
for i := 0; i < Width; i++ {
|
||||||
for j := 0; j < Height; j++ {
|
for j := 0; j < Height; j++ {
|
||||||
@ -376,9 +350,28 @@ func (this *MapData) DropGirde() (score int32, szMap []*pb.MapData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
szMap = append(szMap, &pb.MapData{
|
|
||||||
Data: this.Plat,
|
|
||||||
})
|
|
||||||
this.Debugf()
|
this.Debugf()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func (this *MapData) AiSwapGirde() bool {
|
||||||
|
var (
|
||||||
|
bSwap bool // 能否交换
|
||||||
|
)
|
||||||
|
for pos := 0; pos < Total; pos++ {
|
||||||
|
y := pos % Height
|
||||||
|
if y < Height-1 {
|
||||||
|
if this.SwapGirde(int32(pos), int32(pos+1)) {
|
||||||
|
bSwap = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if pos/Width+1 < Width {
|
||||||
|
if this.SwapGirde(int32(pos), int32(pos+1)) {
|
||||||
|
bSwap = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bSwap
|
||||||
|
}
|
||||||
|
@ -77,7 +77,7 @@ func Test_Main(t *testing.T) {
|
|||||||
m.DropGirde()
|
m.DropGirde()
|
||||||
m.CheckMap()
|
m.CheckMap()
|
||||||
m.SwapGirde(1, 11)
|
m.SwapGirde(1, 11)
|
||||||
fmt.Printf("得分:%d\n", m.CheckMap())
|
//fmt.Printf("得分:%d\n", m.CheckMap())
|
||||||
m.DropGirde()
|
m.DropGirde()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ func (this *configureComp) getGameFastDataByType(itype int32) (conf map[int32]*c
|
|||||||
defer this.hlock.RUnlock()
|
defer this.hlock.RUnlock()
|
||||||
if itype == 1 {
|
if itype == 1 {
|
||||||
conf = this.tyep1
|
conf = this.tyep1
|
||||||
} else if itype == 1 {
|
} else if itype == 2 {
|
||||||
conf = this.tyep2
|
conf = this.tyep2
|
||||||
}
|
}
|
||||||
if conf == nil {
|
if conf == nil {
|
||||||
|
@ -140,14 +140,14 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
|
|||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
event.TriggerEvent(comm.EventUserLogin, session)
|
event.TriggerEvent(comm.EventUserLogin, session)
|
||||||
this.module.ModuleFriend.ResetFriend(user.Uid)
|
|
||||||
this.module.modelSign.UserSign(session)
|
|
||||||
this.module.ModuleItems.InitItemBagData(session)
|
|
||||||
this.module.ModuleHero.CheckPeachReward(session, user.Ctime)
|
|
||||||
if len(tasks) > 0 {
|
if len(tasks) > 0 {
|
||||||
this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
||||||
}
|
}
|
||||||
if firstLogin {
|
if firstLogin {
|
||||||
|
this.module.ModuleFriend.ResetFriend(user.Uid)
|
||||||
|
this.module.modelSign.UserSign(session)
|
||||||
|
this.module.ModuleHero.CheckPeachReward(session, user.Ctime)
|
||||||
|
this.module.ModuleItems.InitItemBagData(session)
|
||||||
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session) // 检查月卡每日邮件奖励发放
|
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session) // 检查月卡每日邮件奖励发放
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -27,6 +27,7 @@ type MapData struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据
|
Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据
|
||||||
|
CurSocre int32 `protobuf:"varint,2,opt,name=curSocre,proto3" json:"curSocre"` // 本轮得分
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *MapData) Reset() {
|
func (x *MapData) Reset() {
|
||||||
@ -68,6 +69,13 @@ func (x *MapData) GetData() []*GirdeData {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *MapData) GetCurSocre() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.CurSocre
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// 消消乐
|
// 消消乐
|
||||||
type GirdeData struct {
|
type GirdeData struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -231,26 +239,27 @@ var File_entertain_entertain_db_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_entertain_entertain_db_proto_rawDesc = []byte{
|
var file_entertain_entertain_db_proto_rawDesc = []byte{
|
||||||
0x0a, 0x1c, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x65,
|
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, 0x29,
|
0x72, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45,
|
||||||
0x0a, 0x07, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
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, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44,
|
||||||
0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x75, 0x0a, 0x09, 0x47, 0x69, 0x72,
|
0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72,
|
||||||
0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20,
|
0x53, 0x6f, 0x63, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72,
|
||||||
0x01, 0x28, 0x05, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f,
|
0x53, 0x6f, 0x63, 0x72, 0x65, 0x22, 0x75, 0x0a, 0x09, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61,
|
||||||
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10,
|
0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64,
|
0x03, 0x6f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20,
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69,
|
||||||
0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61,
|
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05,
|
||||||
0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c,
|
0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f,
|
||||||
0x22, 0x70, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10,
|
0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20,
|
||||||
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
|
0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x22, 0x70, 0x0a, 0x0a,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20,
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
|
||||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x73,
|
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61,
|
0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x72, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64,
|
0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
0x28, 0x05, 0x52, 0x02, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64,
|
||||||
0x6f, 0x33,
|
0x18, 0x05, 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 (
|
var (
|
||||||
|
@ -445,6 +445,8 @@ type EntertainOperatorRstPush struct {
|
|||||||
Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power"` // 该谁操作了
|
Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power"` // 该谁操作了
|
||||||
Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` // 获得积分
|
Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` // 获得积分
|
||||||
Round int32 `protobuf:"varint,4,opt,name=round,proto3" json:"round"` // 轮数
|
Round int32 `protobuf:"varint,4,opt,name=round,proto3" json:"round"` // 轮数
|
||||||
|
User1 *PlayerData `protobuf:"bytes,5,opt,name=user1,proto3" json:"user1"` // 玩家数据也需要同步
|
||||||
|
User2 *PlayerData `protobuf:"bytes,6,opt,name=user2,proto3" json:"user2"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *EntertainOperatorRstPush) Reset() {
|
func (x *EntertainOperatorRstPush) Reset() {
|
||||||
@ -507,6 +509,20 @@ func (x *EntertainOperatorRstPush) GetRound() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *EntertainOperatorRstPush) GetUser1() *PlayerData {
|
||||||
|
if x != nil {
|
||||||
|
return x.User1
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *EntertainOperatorRstPush) GetUser2() *PlayerData {
|
||||||
|
if x != nil {
|
||||||
|
return x.User2
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// 游戏结束推送
|
// 游戏结束推送
|
||||||
type EntertainGameOverPush struct {
|
type EntertainGameOverPush struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -632,7 +648,7 @@ var file_entertain_entertain_msg_proto_rawDesc = []byte{
|
|||||||
0x15, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
|
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,
|
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,
|
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,
|
0x22, 0xc6, 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,
|
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,
|
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,
|
0x2e, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74,
|
||||||
@ -640,19 +656,23 @@ var file_entertain_entertain_msg_proto_rawDesc = []byte{
|
|||||||
0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65,
|
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,
|
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,
|
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,
|
0x75, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x18, 0x05, 0x20, 0x01,
|
||||||
0x6e, 0x47, 0x61, 0x6d, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x21, 0x0a,
|
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||||
0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50,
|
0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x18,
|
||||||
0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31,
|
0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61,
|
||||||
0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x22, 0xad, 0x01, 0x0a, 0x15, 0x45, 0x6e,
|
||||||
0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x75, 0x73,
|
0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50,
|
||||||
0x65, 0x72, 0x32, 0x12, 0x22, 0x0a, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
|
0x75, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07,
|
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||||
0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72,
|
0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x18,
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x14, 0x0a,
|
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61,
|
||||||
0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f,
|
0x74, 0x61, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x32, 0x12, 0x22, 0x0a, 0x07, 0x6d, 0x70, 0x61,
|
||||||
0x75, 0x6e, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x61, 0x70,
|
||||||
0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
@ -687,14 +707,16 @@ var file_entertain_entertain_msg_proto_depIdxs = []int32{
|
|||||||
9, // 2: EntertainStartGamePush.user2:type_name -> PlayerData
|
9, // 2: EntertainStartGamePush.user2:type_name -> PlayerData
|
||||||
10, // 3: EntertainStartGamePush.mpadata:type_name -> MapData
|
10, // 3: EntertainStartGamePush.mpadata:type_name -> MapData
|
||||||
10, // 4: EntertainOperatorRstPush.mpadata:type_name -> MapData
|
10, // 4: EntertainOperatorRstPush.mpadata:type_name -> MapData
|
||||||
9, // 5: EntertainGameOverPush.user1:type_name -> PlayerData
|
9, // 5: EntertainOperatorRstPush.user1:type_name -> PlayerData
|
||||||
9, // 6: EntertainGameOverPush.user2:type_name -> PlayerData
|
9, // 6: EntertainOperatorRstPush.user2:type_name -> PlayerData
|
||||||
10, // 7: EntertainGameOverPush.mpadata:type_name -> MapData
|
9, // 7: EntertainGameOverPush.user1:type_name -> PlayerData
|
||||||
8, // [8:8] is the sub-list for method output_type
|
9, // 8: EntertainGameOverPush.user2:type_name -> PlayerData
|
||||||
8, // [8:8] is the sub-list for method input_type
|
10, // 9: EntertainGameOverPush.mpadata:type_name -> MapData
|
||||||
8, // [8:8] is the sub-list for extension type_name
|
10, // [10:10] is the sub-list for method output_type
|
||||||
8, // [8:8] is the sub-list for extension extendee
|
10, // [10:10] is the sub-list for method input_type
|
||||||
0, // [0:8] is the sub-list for field type_name
|
10, // [10:10] is the sub-list for extension type_name
|
||||||
|
10, // [10:10] is the sub-list for extension extendee
|
||||||
|
0, // [0:10] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_entertain_entertain_msg_proto_init() }
|
func init() { file_entertain_entertain_msg_proto_init() }
|
||||||
|
Loading…
Reference in New Issue
Block a user