From b7e0a26fd1564a7a68a618db44c723a44281a5ea Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 26 Oct 2023 17:42:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=8A=AC=E5=85=94?= =?UTF-8?q?=E5=A4=A7=E6=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 9 +- comm/imodule.go | 4 + modules/caninerabbit/api.go | 17 + modules/caninerabbit/api_award.go | 40 + modules/caninerabbit/api_handle.go | 48 ++ modules/caninerabbit/api_info.go | 30 + modules/caninerabbit/api_singleover.go | 61 ++ modules/caninerabbit/configure.go | 132 +++ modules/caninerabbit/core.go | 8 + modules/caninerabbit/model.go | 45 + modules/caninerabbit/module.go | 103 +++ modules/caninerabbit/room.go | 64 ++ modules/caninerabbit/rooms.go | 65 ++ modules/dcolor/api_info.go | 13 +- modules/gameinvite/api_accept.go | 10 + modules/gameinvite/module.go | 13 +- pb/caninerabbit_db.pb.go | 503 +++++++++++ pb/caninerabbit_msg.pb.go | 1088 ++++++++++++++++++++++++ services/worker/main.go | 2 + 19 files changed, 2249 insertions(+), 6 deletions(-) create mode 100644 modules/caninerabbit/api.go create mode 100644 modules/caninerabbit/api_award.go create mode 100644 modules/caninerabbit/api_handle.go create mode 100644 modules/caninerabbit/api_info.go create mode 100644 modules/caninerabbit/api_singleover.go create mode 100644 modules/caninerabbit/configure.go create mode 100644 modules/caninerabbit/core.go create mode 100644 modules/caninerabbit/model.go create mode 100644 modules/caninerabbit/module.go create mode 100644 modules/caninerabbit/room.go create mode 100644 modules/caninerabbit/rooms.go create mode 100644 pb/caninerabbit_db.pb.go create mode 100644 pb/caninerabbit_msg.pb.go diff --git a/comm/const.go b/comm/const.go index 6142158f6..fc1c19b88 100644 --- a/comm/const.go +++ b/comm/const.go @@ -119,6 +119,7 @@ const ( ModuleMatchPool core.M_Modules = "matchpool" //匹配 ModuleTreasureMap core.M_Modules = "treasuremap" //藏宝图 ModuleGameInvite core.M_Modules = "gameinvite" //游戏邀请 + ModuleCanineRabbit core.M_Modules = "caninerabbit" //犬兔游戏 ) // 数据表名定义处 @@ -400,8 +401,14 @@ const ( //游戏邀请 TableGameInvite = "gameinvite" - //推送礼包 + //藏宝图 TablekTreasuremap = "treasuremap" + + //猜颜色 + TablekDColor = "dcolor" + + //猜颜色 + TablekCanineRabbit = "caninerabbit" ) // RPC服务接口定义处 diff --git a/comm/imodule.go b/comm/imodule.go index 492402d39..22a19c9bf 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -668,4 +668,8 @@ type ( IDColor interface { CreateRoom(sessions []IUserSession, rulesStr string) (roomid string, err error) } + //犬兔大战 + ICanineRabbit interface { + CreateRoom(sessions []IUserSession, rulesStr string) (roomid string, err error) + } ) diff --git a/modules/caninerabbit/api.go b/modules/caninerabbit/api.go new file mode 100644 index 000000000..8932ab608 --- /dev/null +++ b/modules/caninerabbit/api.go @@ -0,0 +1,17 @@ +package caninerabbit + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +type apiComp struct { + modules.MCompGate + module *CanineRabbit +} + +func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + _ = this.MCompGate.Init(service, module, comp, options) + this.module = module.(*CanineRabbit) + return +} diff --git a/modules/caninerabbit/api_award.go b/modules/caninerabbit/api_award.go new file mode 100644 index 000000000..b5a1f8e63 --- /dev/null +++ b/modules/caninerabbit/api_award.go @@ -0,0 +1,40 @@ +package caninerabbit + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +func (this *apiComp) AwardCheck(session comm.IUserSession, req *pb.CanineRabbitAwardReq) (errdata *pb.ErrorData) { + return +} + +func (this *apiComp) Award(session comm.IUserSession, req *pb.CanineRabbitAwardReq) (errdata *pb.ErrorData) { + var ( + info *pb.DBCanineRabbit + atno []*pb.UserAtno + ok bool + err error + ) + if errdata = this.AwardCheck(session, req); errdata != nil { + return + } + + if info, err = this.module.model.getModel(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + + if _, ok = info.Award[req.Id]; ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Message: "Allaward Claimed!", + } + } + + session.SendMsg(string(this.module.GetType()), "info", &pb.CanineRabbitAwardResp{Id: req.Id, Award: atno}) + return +} diff --git a/modules/caninerabbit/api_handle.go b/modules/caninerabbit/api_handle.go new file mode 100644 index 000000000..3ea94bd0d --- /dev/null +++ b/modules/caninerabbit/api_handle.go @@ -0,0 +1,48 @@ +package caninerabbit + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//接受切磋 +func (this *apiComp) HandleCheck(session comm.IUserSession, req *pb.CanineRabbitHandleReq) (errdata *pb.ErrorData) { + if req.Roomid == "" { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } + } + return +} + +func (this *apiComp) Handle(session comm.IUserSession, req *pb.CanineRabbitHandleReq) (errdata *pb.ErrorData) { + var ( + room *Room + err error + ) + + if errdata = this.HandleCheck(session, req); errdata != nil { + return + } + + if room, err = this.module.rooms.queryRoom(req.Roomid); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.String(), + Message: err.Error(), + } + return + } + + if err = room.PlayerHandle(session.GetUserId(), req); errdata != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.String(), + Message: err.Error(), + } + return + } + session.SendMsg(string(this.module.GetType()), "handle", &pb.DColorHandleResp{}) + return +} diff --git a/modules/caninerabbit/api_info.go b/modules/caninerabbit/api_info.go new file mode 100644 index 000000000..f7c661aab --- /dev/null +++ b/modules/caninerabbit/api_info.go @@ -0,0 +1,30 @@ +package caninerabbit + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.CanineRabbitInfoReq) (errdata *pb.ErrorData) { + return +} + +func (this *apiComp) Info(session comm.IUserSession, req *pb.CanineRabbitInfoReq) (errdata *pb.ErrorData) { + var ( + info *pb.DBCanineRabbit + err error + ) + if errdata = this.InfoCheck(session, req); errdata != nil { + return + } + if info, err = this.module.model.getModel(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + + session.SendMsg(string(this.module.GetType()), "info", &pb.CanineRabbitInfoResp{Info: info}) + return +} diff --git a/modules/caninerabbit/api_singleover.go b/modules/caninerabbit/api_singleover.go new file mode 100644 index 000000000..3575ce336 --- /dev/null +++ b/modules/caninerabbit/api_singleover.go @@ -0,0 +1,61 @@ +package caninerabbit + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "math" +) + +//接受切磋 + +func (this *apiComp) SingleOverCheck(session comm.IUserSession, req *pb.DColorSingleOverReq) (errdata *pb.ErrorData) { + + return +} + +func (this *apiComp) SingleOver(session comm.IUserSession, req *pb.DColorSingleOverReq) (errdata *pb.ErrorData) { + var ( + info *pb.DBCanineRabbit + conf *cfg.GameGColorGetfractionData + tconf *cfg.GameGColortTmedecayData + err error + ) + if errdata = this.SingleOverCheck(session, req); errdata != nil { + return + } + if info, err = this.module.model.getModel(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + if conf, err = this.module.configure.getGameGColorGetfractionData(int32(req.Difficulty)+1, req.Repeat, len(req.Handles)-1); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Message: err.Error(), + } + return + } + if tconf, err = this.module.configure.getGameGColortTmedecayData(req.Time); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Message: err.Error(), + } + return + } + + info.Integral += int32(math.Floor(float64(conf.Fraction) * float64(tconf.Pro) / float64(1000))) + if err = this.module.model.Change(session.GetUserId(), map[string]interface{}{ + "integral": info.Integral, + }); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: err.Error(), + } + return + } + session.SendMsg(string(this.module.GetType()), "singleover", &pb.DColorSingleOverResp{Integral: info.Integral}) + return +} diff --git a/modules/caninerabbit/configure.go b/modules/caninerabbit/configure.go new file mode 100644 index 000000000..8ba8283d6 --- /dev/null +++ b/modules/caninerabbit/configure.go @@ -0,0 +1,132 @@ +package caninerabbit + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" + "sync" +) + +const ( + game_gcolorgetfraction = "game_gcolorgetfraction.json" + game_gcolorreward = "game_gcolorreward.json" + game_gcolorttmedecay = "game_gcolorttmedecay.json" +) + +type configureComp struct { + modules.MCompConfigure + module *CanineRabbit + lock sync.RWMutex + repeatMap map[int32][]*cfg.GameGColorGetfractionData + norepeatMap map[int32][]*cfg.GameGColorGetfractionData +} + +func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompConfigure.Init(service, module, comp, options) + this.module = module.(*CanineRabbit) + this.repeatMap = make(map[int32][]*cfg.GameGColorGetfractionData) + err = this.LoadMultiConfigure(map[string]interface{}{ + game_gcolorreward: cfg.NewGameGColorReward, + game_gcolorttmedecay: cfg.NewGameGColortTmedecay, + }) + configure.RegisterConfigure(game_gcolorgetfraction, cfg.NewGameGColorGetfraction, this.updateconfigure) + return +} + +// 更新任务配置表 +func (this *configureComp) updateconfigure() { + var ( + v interface{} + conf *cfg.GameGColorGetfraction + ok bool + err error + ) + if v, err = this.GetConfigure(game_gcolorgetfraction); err != nil { + return + } + if conf, ok = v.(*cfg.GameGColorGetfraction); !ok { + this.module.Error("日常任务配置异常!") + return + } + repeatMap := map[int32][]*cfg.GameGColorGetfractionData{} + norepeatMap := map[int32][]*cfg.GameGColorGetfractionData{} + for _, v := range conf.GetDataList() { + if v.Repeat == 1 { + if _, ok = repeatMap[v.Difficulty]; !ok { + repeatMap[v.Difficulty] = make([]*cfg.GameGColorGetfractionData, 0) + } + repeatMap[v.Difficulty] = append(repeatMap[v.Difficulty], v) + } else { + if _, ok = norepeatMap[v.Difficulty]; !ok { + norepeatMap[v.Difficulty] = make([]*cfg.GameGColorGetfractionData, 0) + } + norepeatMap[v.Difficulty] = append(norepeatMap[v.Difficulty], v) + } + } + this.lock.Lock() + this.repeatMap = repeatMap + this.norepeatMap = norepeatMap + this.lock.Unlock() +} + +func (this *configureComp) getGameGColorGetfractionData(dif int32, repeat bool, index int) (conf *cfg.GameGColorGetfractionData, err error) { + var ( + confs map[int32][]*cfg.GameGColorGetfractionData + ok bool + ) + if repeat { + confs = this.repeatMap + } else { + confs = this.norepeatMap + } + + if _, ok = confs[dif]; ok { + if len(confs[dif]) > index { + conf = confs[dif][index] + return + } + } + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_gcolorgetfraction, fmt.Sprintf("dif:%d repeat:%v index:%d", dif, repeat, index)) + return +} + +// 获取伤害对应的评分组 +func (this *configureComp) getGameGColortTmedecayData(time int32) (conf *cfg.GameGColortTmedecayData, err error) { + var ( + v interface{} + ) + + if v, err = this.GetConfigure(game_gcolorttmedecay); err != nil { + return + } else { + for _, v := range v.(*cfg.GameGColortTmedecay).GetDataList() { + if (time >= v.Min || v.Min == -1) && (time <= v.Max || v.Max == -1) { + conf = v + return + } + } + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_gcolorttmedecay, time) + this.module.Errorf("err:%v", err) + } + return +} + +// 获取奖励列表 +func (this *configureComp) getGameGColorRewardData(id int32) (conf *cfg.GameGColorRewardData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_gcolorreward); err != nil { + return + } + if conf, ok = v.(*cfg.GameGColorReward).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_gcolorreward, id) + this.module.Errorln(err) + return + } + return +} diff --git a/modules/caninerabbit/core.go b/modules/caninerabbit/core.go new file mode 100644 index 000000000..36498b9dd --- /dev/null +++ b/modules/caninerabbit/core.go @@ -0,0 +1,8 @@ +package caninerabbit + +import "go_dreamfactory/pb" + +type GameRules struct { + Difficulty pb.DBDColorDifficulty `json:"Difficulty"` + Repeat bool `json:"Repeat"` +} diff --git a/modules/caninerabbit/model.go b/modules/caninerabbit/model.go new file mode 100644 index 000000000..1440f65e1 --- /dev/null +++ b/modules/caninerabbit/model.go @@ -0,0 +1,45 @@ +package caninerabbit + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type modelComp struct { + modules.MCompModel + module *CanineRabbit +} + +func (this *modelComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompModel.Init(service, module, comp, options) + this.TableName = comm.TablekCanineRabbit + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +// 获取用户全部的埋点数据 +func (this *modelComp) getModel(uid string) (info *pb.DBCanineRabbit, err error) { + info = &pb.DBCanineRabbit{} + if err = this.Get(uid, info); err != nil && err != mgo.MongodbNil { + this.module.Errorln(err) + return + } + if err == mgo.MongodbNil { + info = &pb.DBCanineRabbit{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Integral: 0, + } + err = this.Add(uid, info) + } + return +} diff --git a/modules/caninerabbit/module.go b/modules/caninerabbit/module.go new file mode 100644 index 000000000..6d79d11de --- /dev/null +++ b/modules/caninerabbit/module.go @@ -0,0 +1,103 @@ +package caninerabbit + +import ( + "encoding/json" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +func NewModule() core.IModule { + m := new(CanineRabbit) + return m +} + +/* +模块名称:猜颜色 +*/ +type CanineRabbit struct { + modules.ModuleBase + service comm.IService + api *apiComp + configure *configureComp + model *modelComp + rooms *roomsComp + gameInvite comm.IGameInvite +} + +// 模块名 +func (this *CanineRabbit) GetType() core.M_Modules { + return comm.ModuleCanineRabbit +} + +// 模块初始化接口 注册用户创建角色事件 +func (this *CanineRabbit) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + this.service = service.(comm.IService) + return +} + +func (this *CanineRabbit) Start() (err error) { + if err = this.ModuleBase.Start(); err != nil { + return + } + var module core.IModule + if module, err = this.service.GetModule(comm.ModuleGameInvite); err != nil { + return + } + this.gameInvite = module.(comm.IGameInvite) + return +} + +func (this *CanineRabbit) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api = this.RegisterComp(new(apiComp)).(*apiComp) + this.configure = this.RegisterComp(new(configureComp)).(*configureComp) + this.model = this.RegisterComp(new(modelComp)).(*modelComp) + this.rooms = this.RegisterComp(new(roomsComp)).(*roomsComp) +} + +func (this *CanineRabbit) CreateRoom(sessions []comm.IUserSession, rulesStr string) (roomid string, err error) { + var ( + rules *GameRules = &GameRules{} + red *pb.DBUser + blue *pb.DBUser + room *Room + ) + + if err = json.Unmarshal([]byte(rulesStr), rules); err != nil { + this.Error("解析规则json", log.Field{Key: "err", Value: err.Error()}) + return + } + + //发起者 red + red, err = this.ModuleUser.GetUser(sessions[0].GetUserId()) + if err != nil { + this.Error("未找到红方信息", log.Field{Key: "uid", Value: sessions[0].GetUserId()}) + return + } + blue, err = this.ModuleUser.GetUser(sessions[1].GetUserId()) + if err != nil { + this.Error("未找到蓝方信息", log.Field{Key: "uid", Value: sessions[1].GetUserId()}) + return + } + roomid = primitive.NewObjectID().Hex() + if room, err = this.rooms.newRoom(&pb.DBCanineRabbitRoom{ + Rid: roomid, + Red: &pb.DBCanineRabbitRoomPlayer{ + Info: comm.GetUserBaseInfo(red), + }, + Blue: &pb.DBCanineRabbitRoomPlayer{ + Info: comm.GetUserBaseInfo(blue), + }, + }, sessions); err != nil { + this.Error("创建房间错误", log.Field{Key: "err", Value: err.Error()}) + return + } + go room.GameStart() + return +} diff --git a/modules/caninerabbit/room.go b/modules/caninerabbit/room.go new file mode 100644 index 000000000..fa707faf7 --- /dev/null +++ b/modules/caninerabbit/room.go @@ -0,0 +1,64 @@ +package caninerabbit + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" + "time" + + "google.golang.org/protobuf/proto" +) + +type Room struct { + module *CanineRabbit + data *pb.DBCanineRabbitRoom + sessions []comm.IUserSession + starttime time.Time + currside int32 + currindex int32 +} + +func (this *Room) GameStart() (err error) { + this.starttime = configure.Now() + if err = this.Broadcast("gameready", &pb.CanineRabbitGameReadyPush{ + ServicePath: fmt.Sprintf("%s/%s", this.module.service.GetType(), this.module.service.GetId()), + Room: this.data, + Countdown: 60, + }); err != nil { + this.module.Errorln(err) + } + return +} + +func (this *Room) PlayerLoadEnd(uid string) (err error) { + if uid == this.data.Red.Info.Uid { + this.data.Red.Ready = true + } else { + this.data.Blue.Ready = true + } + + if this.data.Red.Ready && this.data.Blue.Ready { //两个人都准备了 + this.currside = 1 + if err = this.Broadcast("gamestart", &pb.DColorGameStartPush{ + Roomid: this.data.Rid, + Side: 1, + }); err != nil { + this.module.Errorln(err) + } + } + return +} + +//玩家操作 +func (this *Room) PlayerHandle(uid string, handle *pb.CanineRabbitHandleReq) (err error) { + + return +} + +func (this *Room) Broadcast(stype string, msg proto.Message) (err error) { + if err = this.module.SendMsgToSession(string(this.module.GetType()), stype, msg, this.sessions...); err != nil { + this.module.Errorln(err) + } + return +} diff --git a/modules/caninerabbit/rooms.go b/modules/caninerabbit/rooms.go new file mode 100644 index 000000000..bda387957 --- /dev/null +++ b/modules/caninerabbit/rooms.go @@ -0,0 +1,65 @@ +package caninerabbit + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/core/cbase" + "go_dreamfactory/pb" + "sync" +) + +type roomsComp struct { + cbase.ModuleCompBase + module *CanineRabbit + lock sync.RWMutex + rooms map[string]*Room +} + +func (this *roomsComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.ModuleCompBase.Init(service, module, comp, options) + this.module = module.(*CanineRabbit) + this.rooms = make(map[string]*Room) + return +} + +func (this *roomsComp) queryRoom(rid string) (room *Room, err error) { + var ( + ok bool + ) + this.lock.Lock() + room, ok = this.rooms[rid] + this.lock.Unlock() + if !ok { + err = fmt.Errorf("no found room:%s", rid) + return + } + return +} + +func (this *roomsComp) newRoom(data *pb.DBCanineRabbitRoom, session []comm.IUserSession) (room *Room, err error) { + room = &Room{ + module: this.module, + data: data, + sessions: session, + } + this.lock.Lock() + this.rooms[data.Rid] = room + this.lock.Unlock() + + return +} + +func (this *roomsComp) removeRoom(rid string) { + var ( + ok bool + room *Room + ) + this.lock.Lock() + room, ok = this.rooms[rid] + delete(this.rooms, rid) + this.lock.Unlock() + if ok { + go this.module.gameInvite.GameInviteEnd(3, room.data.Red.Info.Uid) + } +} diff --git a/modules/dcolor/api_info.go b/modules/dcolor/api_info.go index e3cc6ffbc..4b33a2b93 100644 --- a/modules/dcolor/api_info.go +++ b/modules/dcolor/api_info.go @@ -3,6 +3,8 @@ package dcolor import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" + "go_dreamfactory/utils" ) func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.DColorInfoReq) (errdata *pb.ErrorData) { @@ -24,7 +26,16 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.DColorInfoReq) (err } return } - + if !utils.IsSameWeek(info.Weektime) { + info.Integral = 0 + info.Weekaward = make(map[int32]bool) + info.Weektime = configure.Now().Unix() + this.module.model.Change(session.GetUserId(), map[string]interface{}{ + "integral": info.Integral, + "weekaward": info.Weekaward, + "weektime": info.Weektime, + }) + } session.SendMsg(string(this.module.GetType()), "info", &pb.DColorInfoResp{Info: info}) return } diff --git a/modules/gameinvite/api_accept.go b/modules/gameinvite/api_accept.go index f8abe05cd..0e03507b7 100644 --- a/modules/gameinvite/api_accept.go +++ b/modules/gameinvite/api_accept.go @@ -97,6 +97,16 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.GameInviteAcceptR sessions = append(sessions, redsession) } switch req.Gtype { + case 2: + if roomid, err = this.module.caninerabbit.CreateRoom(sessions, rules); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + break case 3: if roomid, err = this.module.dcolor.CreateRoom(sessions, rules); err != nil { errdata = &pb.ErrorData{ diff --git a/modules/gameinvite/module.go b/modules/gameinvite/module.go index 70e633d39..13a06af78 100644 --- a/modules/gameinvite/module.go +++ b/modules/gameinvite/module.go @@ -8,10 +8,11 @@ import ( type GameInvite struct { modules.ModuleBase - service comm.IService - api *apiComp - model *modelComp - dcolor comm.IDColor + service comm.IService + api *apiComp + model *modelComp + dcolor comm.IDColor + caninerabbit comm.ICanineRabbit } func NewModule() core.IModule { @@ -44,6 +45,10 @@ func (this *GameInvite) Start() (err error) { return } this.dcolor = module.(comm.IDColor) + if module, err = this.service.GetModule(comm.ModuleCanineRabbit); err != nil { + return + } + this.caninerabbit = module.(comm.ICanineRabbit) return } func (this *GameInvite) GameInviteEnd(gtype int32, uid string) { diff --git a/pb/caninerabbit_db.pb.go b/pb/caninerabbit_db.pb.go new file mode 100644 index 000000000..b85b305da --- /dev/null +++ b/pb/caninerabbit_db.pb.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: caninerabbit/caninerabbit_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 DBCanineRabbit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Integral int32 `protobuf:"varint,3,opt,name=integral,proto3" json:"integral"` + Award map[int32]bool `protobuf:"bytes,4,rep,name=award,proto3" json:"award" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *DBCanineRabbit) Reset() { + *x = DBCanineRabbit{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCanineRabbit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCanineRabbit) ProtoMessage() {} + +func (x *DBCanineRabbit) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 DBCanineRabbit.ProtoReflect.Descriptor instead. +func (*DBCanineRabbit) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_db_proto_rawDescGZIP(), []int{0} +} + +func (x *DBCanineRabbit) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBCanineRabbit) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBCanineRabbit) GetIntegral() int32 { + if x != nil { + return x.Integral + } + return 0 +} + +func (x *DBCanineRabbit) GetAward() map[int32]bool { + if x != nil { + return x.Award + } + return nil +} + +type DBCanineRabbitChess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` + Stype int32 `protobuf:"varint,2,opt,name=stype,proto3" json:"stype"` //0兔子 1猎犬 + X int32 `protobuf:"varint,3,opt,name=x,proto3" json:"x"` + Y int32 `protobuf:"varint,4,opt,name=y,proto3" json:"y"` +} + +func (x *DBCanineRabbitChess) Reset() { + *x = DBCanineRabbitChess{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCanineRabbitChess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCanineRabbitChess) ProtoMessage() {} + +func (x *DBCanineRabbitChess) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 DBCanineRabbitChess.ProtoReflect.Descriptor instead. +func (*DBCanineRabbitChess) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_db_proto_rawDescGZIP(), []int{1} +} + +func (x *DBCanineRabbitChess) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBCanineRabbitChess) GetStype() int32 { + if x != nil { + return x.Stype + } + return 0 +} + +func (x *DBCanineRabbitChess) GetX() int32 { + if x != nil { + return x.X + } + return 0 +} + +func (x *DBCanineRabbitChess) GetY() int32 { + if x != nil { + return x.Y + } + return 0 +} + +type DBCanineRabbitRoomPlayer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Info *BaseUserInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` //发起者信息 + Isai bool `protobuf:"varint,2,opt,name=isai,proto3" json:"isai"` + Ready bool `protobuf:"varint,3,opt,name=ready,proto3" json:"ready"` + Score int32 `protobuf:"varint,4,opt,name=score,proto3" json:"score"` + Integral int32 `protobuf:"varint,5,opt,name=integral,proto3" json:"integral"` + Maxintegral int32 `protobuf:"varint,6,opt,name=maxintegral,proto3" json:"maxintegral"` +} + +func (x *DBCanineRabbitRoomPlayer) Reset() { + *x = DBCanineRabbitRoomPlayer{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCanineRabbitRoomPlayer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCanineRabbitRoomPlayer) ProtoMessage() {} + +func (x *DBCanineRabbitRoomPlayer) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 DBCanineRabbitRoomPlayer.ProtoReflect.Descriptor instead. +func (*DBCanineRabbitRoomPlayer) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_db_proto_rawDescGZIP(), []int{2} +} + +func (x *DBCanineRabbitRoomPlayer) GetInfo() *BaseUserInfo { + if x != nil { + return x.Info + } + return nil +} + +func (x *DBCanineRabbitRoomPlayer) GetIsai() bool { + if x != nil { + return x.Isai + } + return false +} + +func (x *DBCanineRabbitRoomPlayer) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *DBCanineRabbitRoomPlayer) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *DBCanineRabbitRoomPlayer) GetIntegral() int32 { + if x != nil { + return x.Integral + } + return 0 +} + +func (x *DBCanineRabbitRoomPlayer) GetMaxintegral() int32 { + if x != nil { + return x.Maxintegral + } + return 0 +} + +//犬兔大赛 房间 +type DBCanineRabbitRoom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid"` + Randomposit bool `protobuf:"varint,2,opt,name=randomposit,proto3" json:"randomposit"` //随机位置 + Headstart int32 `protobuf:"varint,3,opt,name=headstart,proto3" json:"headstart"` //先手 0 兔子 1 猎犬 + Red *DBCanineRabbitRoomPlayer `protobuf:"bytes,5,opt,name=red,proto3" json:"red"` + Blue *DBCanineRabbitRoomPlayer `protobuf:"bytes,6,opt,name=blue,proto3" json:"blue"` + Chess []*DBCanineRabbitChess `protobuf:"bytes,7,rep,name=chess,proto3" json:"chess"` //棋子 +} + +func (x *DBCanineRabbitRoom) Reset() { + *x = DBCanineRabbitRoom{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_db_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBCanineRabbitRoom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBCanineRabbitRoom) ProtoMessage() {} + +func (x *DBCanineRabbitRoom) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 DBCanineRabbitRoom.ProtoReflect.Descriptor instead. +func (*DBCanineRabbitRoom) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_db_proto_rawDescGZIP(), []int{3} +} + +func (x *DBCanineRabbitRoom) GetRid() string { + if x != nil { + return x.Rid + } + return "" +} + +func (x *DBCanineRabbitRoom) GetRandomposit() bool { + if x != nil { + return x.Randomposit + } + return false +} + +func (x *DBCanineRabbitRoom) GetHeadstart() int32 { + if x != nil { + return x.Headstart + } + return 0 +} + +func (x *DBCanineRabbitRoom) GetRed() *DBCanineRabbitRoomPlayer { + if x != nil { + return x.Red + } + return nil +} + +func (x *DBCanineRabbitRoom) GetBlue() *DBCanineRabbitRoomPlayer { + if x != nil { + return x.Blue + } + return nil +} + +func (x *DBCanineRabbitRoom) GetChess() []*DBCanineRabbitChess { + if x != nil { + return x.Chess + } + return nil +} + +var File_caninerabbit_caninerabbit_db_proto protoreflect.FileDescriptor + +var file_caninerabbit_caninerabbit_db_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x2f, 0x63, + 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xba, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, + 0x62, 0x69, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x6c, 0x12, 0x30, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, + 0x74, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x77, + 0x61, 0x72, 0x64, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x57, 0x0a, + 0x13, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x43, + 0x68, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0xbb, 0x01, 0x0a, 0x18, 0x44, 0x42, 0x43, 0x61, 0x6e, + 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x04, 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, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x61, 0x69, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x61, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, + 0x61, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x69, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x6c, 0x22, 0xee, 0x01, 0x0a, 0x12, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, + 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x72, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x20, 0x0a, + 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x64, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2b, 0x0a, + 0x03, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x43, + 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x62, 0x6c, + 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x6e, + 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x63, 0x68, 0x65, + 0x73, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x6e, + 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x43, 0x68, 0x65, 0x73, 0x73, 0x52, 0x05, + 0x63, 0x68, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_caninerabbit_caninerabbit_db_proto_rawDescOnce sync.Once + file_caninerabbit_caninerabbit_db_proto_rawDescData = file_caninerabbit_caninerabbit_db_proto_rawDesc +) + +func file_caninerabbit_caninerabbit_db_proto_rawDescGZIP() []byte { + file_caninerabbit_caninerabbit_db_proto_rawDescOnce.Do(func() { + file_caninerabbit_caninerabbit_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_caninerabbit_caninerabbit_db_proto_rawDescData) + }) + return file_caninerabbit_caninerabbit_db_proto_rawDescData +} + +var file_caninerabbit_caninerabbit_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_caninerabbit_caninerabbit_db_proto_goTypes = []interface{}{ + (*DBCanineRabbit)(nil), // 0: DBCanineRabbit + (*DBCanineRabbitChess)(nil), // 1: DBCanineRabbitChess + (*DBCanineRabbitRoomPlayer)(nil), // 2: DBCanineRabbitRoomPlayer + (*DBCanineRabbitRoom)(nil), // 3: DBCanineRabbitRoom + nil, // 4: DBCanineRabbit.AwardEntry + (*BaseUserInfo)(nil), // 5: BaseUserInfo +} +var file_caninerabbit_caninerabbit_db_proto_depIdxs = []int32{ + 4, // 0: DBCanineRabbit.award:type_name -> DBCanineRabbit.AwardEntry + 5, // 1: DBCanineRabbitRoomPlayer.info:type_name -> BaseUserInfo + 2, // 2: DBCanineRabbitRoom.red:type_name -> DBCanineRabbitRoomPlayer + 2, // 3: DBCanineRabbitRoom.blue:type_name -> DBCanineRabbitRoomPlayer + 1, // 4: DBCanineRabbitRoom.chess:type_name -> DBCanineRabbitChess + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_caninerabbit_caninerabbit_db_proto_init() } +func file_caninerabbit_caninerabbit_db_proto_init() { + if File_caninerabbit_caninerabbit_db_proto != nil { + return + } + file_comm_proto_init() + if !protoimpl.UnsafeEnabled { + file_caninerabbit_caninerabbit_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCanineRabbit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCanineRabbitChess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCanineRabbitRoomPlayer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBCanineRabbitRoom); 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_caninerabbit_caninerabbit_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_caninerabbit_caninerabbit_db_proto_goTypes, + DependencyIndexes: file_caninerabbit_caninerabbit_db_proto_depIdxs, + MessageInfos: file_caninerabbit_caninerabbit_db_proto_msgTypes, + }.Build() + File_caninerabbit_caninerabbit_db_proto = out.File + file_caninerabbit_caninerabbit_db_proto_rawDesc = nil + file_caninerabbit_caninerabbit_db_proto_goTypes = nil + file_caninerabbit_caninerabbit_db_proto_depIdxs = nil +} diff --git a/pb/caninerabbit_msg.pb.go b/pb/caninerabbit_msg.pb.go new file mode 100644 index 000000000..4c1e0da7f --- /dev/null +++ b/pb/caninerabbit_msg.pb.go @@ -0,0 +1,1088 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: caninerabbit/caninerabbit_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 CanineRabbitInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CanineRabbitInfoReq) Reset() { + *x = CanineRabbitInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitInfoReq) ProtoMessage() {} + +func (x *CanineRabbitInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitInfoReq.ProtoReflect.Descriptor instead. +func (*CanineRabbitInfoReq) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{0} +} + +type CanineRabbitInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Info *DBCanineRabbit `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` +} + +func (x *CanineRabbitInfoResp) Reset() { + *x = CanineRabbitInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitInfoResp) ProtoMessage() {} + +func (x *CanineRabbitInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitInfoResp.ProtoReflect.Descriptor instead. +func (*CanineRabbitInfoResp) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *CanineRabbitInfoResp) GetInfo() *DBCanineRabbit { + if x != nil { + return x.Info + } + return nil +} + +//猜颜色单机游戏请求 +type CanineRabbitSingleOverReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stype int32 `protobuf:"varint,2,opt,name=stype,proto3" json:"stype"` //0兔子 1猎犬 +} + +func (x *CanineRabbitSingleOverReq) Reset() { + *x = CanineRabbitSingleOverReq{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitSingleOverReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitSingleOverReq) ProtoMessage() {} + +func (x *CanineRabbitSingleOverReq) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitSingleOverReq.ProtoReflect.Descriptor instead. +func (*CanineRabbitSingleOverReq) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *CanineRabbitSingleOverReq) GetStype() int32 { + if x != nil { + return x.Stype + } + return 0 +} + +//猜颜色单机游戏请求 +type CanineRabbitSingleOverResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Integral int32 `protobuf:"varint,1,opt,name=Integral,proto3" json:"Integral"` +} + +func (x *CanineRabbitSingleOverResp) Reset() { + *x = CanineRabbitSingleOverResp{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitSingleOverResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitSingleOverResp) ProtoMessage() {} + +func (x *CanineRabbitSingleOverResp) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitSingleOverResp.ProtoReflect.Descriptor instead. +func (*CanineRabbitSingleOverResp) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *CanineRabbitSingleOverResp) GetIntegral() int32 { + if x != nil { + return x.Integral + } + return 0 +} + +type CanineRabbitGameReadyPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServicePath string `protobuf:"bytes,1,opt,name=servicePath,proto3" json:"servicePath"` //游戏区服地址 + Room *DBCanineRabbitRoom `protobuf:"bytes,2,opt,name=room,proto3" json:"room"` //房间 + Countdown int32 `protobuf:"varint,3,opt,name=countdown,proto3" json:"countdown"` //布阵倒计时 +} + +func (x *CanineRabbitGameReadyPush) Reset() { + *x = CanineRabbitGameReadyPush{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitGameReadyPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitGameReadyPush) ProtoMessage() {} + +func (x *CanineRabbitGameReadyPush) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitGameReadyPush.ProtoReflect.Descriptor instead. +func (*CanineRabbitGameReadyPush) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *CanineRabbitGameReadyPush) GetServicePath() string { + if x != nil { + return x.ServicePath + } + return "" +} + +func (x *CanineRabbitGameReadyPush) GetRoom() *DBCanineRabbitRoom { + if x != nil { + return x.Room + } + return nil +} + +func (x *CanineRabbitGameReadyPush) GetCountdown() int32 { + if x != nil { + return x.Countdown + } + return 0 +} + +//加载完毕请求 +type CanineRabbitLoadCompleteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` //房间id +} + +func (x *CanineRabbitLoadCompleteReq) Reset() { + *x = CanineRabbitLoadCompleteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitLoadCompleteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitLoadCompleteReq) ProtoMessage() {} + +func (x *CanineRabbitLoadCompleteReq) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitLoadCompleteReq.ProtoReflect.Descriptor instead. +func (*CanineRabbitLoadCompleteReq) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{5} +} + +func (x *CanineRabbitLoadCompleteReq) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + +//加载完毕请求 +type CanineRabbitLoadCompleteResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` //房间id + Issucc bool `protobuf:"varint,2,opt,name=issucc,proto3" json:"issucc"` +} + +func (x *CanineRabbitLoadCompleteResp) Reset() { + *x = CanineRabbitLoadCompleteResp{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitLoadCompleteResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitLoadCompleteResp) ProtoMessage() {} + +func (x *CanineRabbitLoadCompleteResp) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_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 CanineRabbitLoadCompleteResp.ProtoReflect.Descriptor instead. +func (*CanineRabbitLoadCompleteResp) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{6} +} + +func (x *CanineRabbitLoadCompleteResp) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + +func (x *CanineRabbitLoadCompleteResp) GetIssucc() bool { + if x != nil { + return x.Issucc + } + return false +} + +//游戏开始 通知 +type CanineRabbitGameStartPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` //战斗id + Side int32 `protobuf:"varint,2,opt,name=side,proto3" json:"side"` //先手房 0 红方先手 1蓝方先手 +} + +func (x *CanineRabbitGameStartPush) Reset() { + *x = CanineRabbitGameStartPush{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitGameStartPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitGameStartPush) ProtoMessage() {} + +func (x *CanineRabbitGameStartPush) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[7] + 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 CanineRabbitGameStartPush.ProtoReflect.Descriptor instead. +func (*CanineRabbitGameStartPush) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *CanineRabbitGameStartPush) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + +func (x *CanineRabbitGameStartPush) GetSide() int32 { + if x != nil { + return x.Side + } + return 0 +} + +//发送操作信息 +type CanineRabbitHandleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` //战斗id + Chess *DBCanineRabbitChess `protobuf:"bytes,2,opt,name=chess,proto3" json:"chess"` //棋子 +} + +func (x *CanineRabbitHandleReq) Reset() { + *x = CanineRabbitHandleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitHandleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitHandleReq) ProtoMessage() {} + +func (x *CanineRabbitHandleReq) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[8] + 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 CanineRabbitHandleReq.ProtoReflect.Descriptor instead. +func (*CanineRabbitHandleReq) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{8} +} + +func (x *CanineRabbitHandleReq) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + +func (x *CanineRabbitHandleReq) GetChess() *DBCanineRabbitChess { + if x != nil { + return x.Chess + } + return nil +} + +//发送操作信息 +type CanineRabbitHandleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CanineRabbitHandleResp) Reset() { + *x = CanineRabbitHandleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitHandleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitHandleResp) ProtoMessage() {} + +func (x *CanineRabbitHandleResp) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[9] + 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 CanineRabbitHandleResp.ProtoReflect.Descriptor instead. +func (*CanineRabbitHandleResp) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{9} +} + +//游戏结果推送 +type CanineRabbitGameHandlePush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Roomid string `protobuf:"bytes,1,opt,name=roomid,proto3" json:"roomid"` //战斗id + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Chess *DBCanineRabbitChess `protobuf:"bytes,3,opt,name=chess,proto3" json:"chess"` //棋子 +} + +func (x *CanineRabbitGameHandlePush) Reset() { + *x = CanineRabbitGameHandlePush{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitGameHandlePush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitGameHandlePush) ProtoMessage() {} + +func (x *CanineRabbitGameHandlePush) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[10] + 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 CanineRabbitGameHandlePush.ProtoReflect.Descriptor instead. +func (*CanineRabbitGameHandlePush) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{10} +} + +func (x *CanineRabbitGameHandlePush) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + +func (x *CanineRabbitGameHandlePush) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *CanineRabbitGameHandlePush) GetChess() *DBCanineRabbitChess { + if x != nil { + return x.Chess + } + return nil +} + +//游戏结束推送 +type CanineRabbitGameOverPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"` //0表示平局 1红方胜 2 蓝方胜 + RedIntegral int32 `protobuf:"varint,2,opt,name=redIntegral,proto3" json:"redIntegral"` + BlueIntegral int32 `protobuf:"varint,3,opt,name=blueIntegral,proto3" json:"blueIntegral"` +} + +func (x *CanineRabbitGameOverPush) Reset() { + *x = CanineRabbitGameOverPush{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitGameOverPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitGameOverPush) ProtoMessage() {} + +func (x *CanineRabbitGameOverPush) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[11] + 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 CanineRabbitGameOverPush.ProtoReflect.Descriptor instead. +func (*CanineRabbitGameOverPush) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{11} +} + +func (x *CanineRabbitGameOverPush) GetWinside() int32 { + if x != nil { + return x.Winside + } + return 0 +} + +func (x *CanineRabbitGameOverPush) GetRedIntegral() int32 { + if x != nil { + return x.RedIntegral + } + return 0 +} + +func (x *CanineRabbitGameOverPush) GetBlueIntegral() int32 { + if x != nil { + return x.BlueIntegral + } + return 0 +} + +type CanineRabbitAwardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + Atype int32 `protobuf:"varint,2,opt,name=atype,proto3" json:"atype"` //0 周奖励 1 累计奖励 +} + +func (x *CanineRabbitAwardReq) Reset() { + *x = CanineRabbitAwardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitAwardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitAwardReq) ProtoMessage() {} + +func (x *CanineRabbitAwardReq) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[12] + 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 CanineRabbitAwardReq.ProtoReflect.Descriptor instead. +func (*CanineRabbitAwardReq) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{12} +} + +func (x *CanineRabbitAwardReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CanineRabbitAwardReq) GetAtype() int32 { + if x != nil { + return x.Atype + } + return 0 +} + +type CanineRabbitAwardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + Atype int32 `protobuf:"varint,2,opt,name=atype,proto3" json:"atype"` //0 周奖励 1 累计奖励 + Award []*UserAtno `protobuf:"bytes,3,rep,name=award,proto3" json:"award"` //获取资源 +} + +func (x *CanineRabbitAwardResp) Reset() { + *x = CanineRabbitAwardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CanineRabbitAwardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CanineRabbitAwardResp) ProtoMessage() {} + +func (x *CanineRabbitAwardResp) ProtoReflect() protoreflect.Message { + mi := &file_caninerabbit_caninerabbit_msg_proto_msgTypes[13] + 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 CanineRabbitAwardResp.ProtoReflect.Descriptor instead. +func (*CanineRabbitAwardResp) Descriptor() ([]byte, []int) { + return file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP(), []int{13} +} + +func (x *CanineRabbitAwardResp) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CanineRabbitAwardResp) GetAtype() int32 { + if x != nil { + return x.Atype + } + return 0 +} + +func (x *CanineRabbitAwardResp) GetAward() []*UserAtno { + if x != nil { + return x.Award + } + return nil +} + +var File_caninerabbit_caninerabbit_msg_proto protoreflect.FileDescriptor + +var file_caninerabbit_caninerabbit_msg_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x2f, 0x63, + 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x63, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, + 0x62, 0x69, 0x74, 0x2f, 0x63, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, + 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, + 0x61, 0x62, 0x62, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x14, + 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, + 0x62, 0x69, 0x74, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x31, 0x0a, 0x19, 0x43, 0x61, 0x6e, + 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4f, + 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x1a, + 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x49, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0x84, 0x01, 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x69, 0x6e, + 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x47, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, + 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, + 0x61, 0x62, 0x62, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x22, 0x35, 0x0a, + 0x1b, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x4c, 0x6f, 0x61, + 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 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, 0x22, 0x4e, 0x0a, 0x1c, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, + 0x62, 0x62, 0x69, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 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, 0x16, 0x0a, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, + 0x73, 0x75, 0x63, 0x63, 0x22, 0x47, 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, + 0x62, 0x62, 0x69, 0x74, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, + 0x68, 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, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x22, 0x5b, 0x0a, + 0x15, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 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, 0x2a, + 0x0a, 0x05, 0x63, 0x68, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x44, 0x42, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x43, 0x68, + 0x65, 0x73, 0x73, 0x52, 0x05, 0x63, 0x68, 0x65, 0x73, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x61, + 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x72, 0x0a, 0x1a, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, + 0x62, 0x62, 0x69, 0x74, 0x47, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x50, 0x75, + 0x73, 0x68, 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, 0x10, 0x0a, 0x03, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x05, + 0x63, 0x68, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, + 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x43, 0x68, 0x65, 0x73, + 0x73, 0x52, 0x05, 0x63, 0x68, 0x65, 0x73, 0x73, 0x22, 0x7a, 0x0a, 0x18, 0x43, 0x61, 0x6e, 0x69, + 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, 0x69, 0x74, 0x47, 0x61, 0x6d, 0x65, 0x4f, 0x76, 0x65, 0x72, + 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, + 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x6c, 0x75, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x6c, 0x75, 0x65, 0x49, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, + 0x62, 0x62, 0x69, 0x74, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x61, 0x74, 0x79, + 0x70, 0x65, 0x22, 0x5e, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x69, 0x6e, 0x65, 0x52, 0x61, 0x62, 0x62, + 0x69, 0x74, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x61, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, + 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_caninerabbit_caninerabbit_msg_proto_rawDescOnce sync.Once + file_caninerabbit_caninerabbit_msg_proto_rawDescData = file_caninerabbit_caninerabbit_msg_proto_rawDesc +) + +func file_caninerabbit_caninerabbit_msg_proto_rawDescGZIP() []byte { + file_caninerabbit_caninerabbit_msg_proto_rawDescOnce.Do(func() { + file_caninerabbit_caninerabbit_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_caninerabbit_caninerabbit_msg_proto_rawDescData) + }) + return file_caninerabbit_caninerabbit_msg_proto_rawDescData +} + +var file_caninerabbit_caninerabbit_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_caninerabbit_caninerabbit_msg_proto_goTypes = []interface{}{ + (*CanineRabbitInfoReq)(nil), // 0: CanineRabbitInfoReq + (*CanineRabbitInfoResp)(nil), // 1: CanineRabbitInfoResp + (*CanineRabbitSingleOverReq)(nil), // 2: CanineRabbitSingleOverReq + (*CanineRabbitSingleOverResp)(nil), // 3: CanineRabbitSingleOverResp + (*CanineRabbitGameReadyPush)(nil), // 4: CanineRabbitGameReadyPush + (*CanineRabbitLoadCompleteReq)(nil), // 5: CanineRabbitLoadCompleteReq + (*CanineRabbitLoadCompleteResp)(nil), // 6: CanineRabbitLoadCompleteResp + (*CanineRabbitGameStartPush)(nil), // 7: CanineRabbitGameStartPush + (*CanineRabbitHandleReq)(nil), // 8: CanineRabbitHandleReq + (*CanineRabbitHandleResp)(nil), // 9: CanineRabbitHandleResp + (*CanineRabbitGameHandlePush)(nil), // 10: CanineRabbitGameHandlePush + (*CanineRabbitGameOverPush)(nil), // 11: CanineRabbitGameOverPush + (*CanineRabbitAwardReq)(nil), // 12: CanineRabbitAwardReq + (*CanineRabbitAwardResp)(nil), // 13: CanineRabbitAwardResp + (*DBCanineRabbit)(nil), // 14: DBCanineRabbit + (*DBCanineRabbitRoom)(nil), // 15: DBCanineRabbitRoom + (*DBCanineRabbitChess)(nil), // 16: DBCanineRabbitChess + (*UserAtno)(nil), // 17: UserAtno +} +var file_caninerabbit_caninerabbit_msg_proto_depIdxs = []int32{ + 14, // 0: CanineRabbitInfoResp.info:type_name -> DBCanineRabbit + 15, // 1: CanineRabbitGameReadyPush.room:type_name -> DBCanineRabbitRoom + 16, // 2: CanineRabbitHandleReq.chess:type_name -> DBCanineRabbitChess + 16, // 3: CanineRabbitGameHandlePush.chess:type_name -> DBCanineRabbitChess + 17, // 4: CanineRabbitAwardResp.award:type_name -> UserAtno + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_caninerabbit_caninerabbit_msg_proto_init() } +func file_caninerabbit_caninerabbit_msg_proto_init() { + if File_caninerabbit_caninerabbit_msg_proto != nil { + return + } + file_caninerabbit_caninerabbit_db_proto_init() + file_comm_proto_init() + if !protoimpl.UnsafeEnabled { + file_caninerabbit_caninerabbit_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitSingleOverReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitSingleOverResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitGameReadyPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitLoadCompleteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitLoadCompleteResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitGameStartPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitHandleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitHandleResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitGameHandlePush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitGameOverPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitAwardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_caninerabbit_caninerabbit_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CanineRabbitAwardResp); 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_caninerabbit_caninerabbit_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_caninerabbit_caninerabbit_msg_proto_goTypes, + DependencyIndexes: file_caninerabbit_caninerabbit_msg_proto_depIdxs, + MessageInfos: file_caninerabbit_caninerabbit_msg_proto_msgTypes, + }.Build() + File_caninerabbit_caninerabbit_msg_proto = out.File + file_caninerabbit_caninerabbit_msg_proto_rawDesc = nil + file_caninerabbit_caninerabbit_msg_proto_goTypes = nil + file_caninerabbit_caninerabbit_msg_proto_depIdxs = nil +} diff --git a/services/worker/main.go b/services/worker/main.go index e5a465c79..fea7f9c3a 100644 --- a/services/worker/main.go +++ b/services/worker/main.go @@ -12,6 +12,7 @@ import ( "go_dreamfactory/modules/battle" "go_dreamfactory/modules/battlerecord" "go_dreamfactory/modules/buried" + "go_dreamfactory/modules/caninerabbit" "go_dreamfactory/modules/capturesheep" "go_dreamfactory/modules/caravan" "go_dreamfactory/modules/chat" @@ -178,6 +179,7 @@ func main() { maincity.NewModule(), treasuremap.NewModule(), gameinvite.NewModule(), + caninerabbit.NewModule(), ) } From 75491c82d48c870368900cfd2e5effdcef197bcc Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 26 Oct 2023 17:57:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 4 +++- modules/dcolor/model.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/comm/const.go b/comm/const.go index 5c7a8c731..08321f6a3 100644 --- a/comm/const.go +++ b/comm/const.go @@ -404,7 +404,9 @@ const ( //藏宝图 TablekTreasuremap = "treasuremap" - TableEntertainm = "entertainm" + TableDcolor = "dcolor" + TablekCanineRabbit = "caninerabbit" + TableEntertainm = "entertainm" ) // RPC服务接口定义处 diff --git a/modules/dcolor/model.go b/modules/dcolor/model.go index 4464ead93..25de1f062 100644 --- a/modules/dcolor/model.go +++ b/modules/dcolor/model.go @@ -19,7 +19,7 @@ type modelComp struct { func (this *modelComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { err = this.MCompModel.Init(service, module, comp, options) - this.TableName = comm.TablekfPushGiftbag + this.TableName = comm.TableDcolor this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, })