diff --git a/comm/imodule.go b/comm/imodule.go index e4163d5a0..5ea5437e8 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -171,7 +171,7 @@ type ( SetUserCaravanLvChange(session IUserSession, caravanlv int32) error //消耗体力加经验 - ConsumePsAddExp(session IUserSession, ps int) (addExp int32, errdata *pb.ErrorData) + ConsumePsAddExp(session IUserSession, ps int32) (addExp int32, errdata *pb.ErrorData) } //武器模块 IEquipment interface { diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index 296ff5dbe..caed99e78 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -31,6 +31,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha atno []*pb.UserAtno // atno 类型 res []*cfg.Gameatn // 最后获得的资源 oldDifficulty int32 // 记录 + consumPs int32 + userExp int32 ) mapData = make(map[string]interface{}, 0) reward = make([]*cfg.Gameatn, 0) @@ -74,7 +76,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha } errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) - + consumPs = hunting.Ps[req.BossType] hunting.Ps[req.BossType] = 0 // 清空预扣体力值 mapData["ps"] = hunting.Ps @@ -139,11 +141,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha } errdata = this.module.ModifyHuntingData(session.GetUserId(), mapData) - + userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs) session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{ - Data: hunting, - Asset: atno, - Sell: del, + Data: hunting, + Asset: atno, + Sell: del, + UserExp: userExp, }) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype80, 1, req.BossType, req.Difficulty)) // 随机任务统计 diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index 9a79782ea..95efb62f0 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -25,13 +25,14 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall curChapter *pb.DBMline // 当前章节信息 stageConf *cfg.GameMainStageData - isWin bool - first bool // 判断是否是首通 - update map[string]interface{} - rsp *pb.MlineChallengeOverResp - star int32 // 评星 - tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) - err error + isWin bool + first bool // 判断是否是首通 + update map[string]interface{} + rsp *pb.MlineChallengeOverResp + star int32 // 评星 + tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) + err error + consumPs int32 ) rsp = &pb.MlineChallengeOverResp{} update = make(map[string]interface{}) @@ -74,6 +75,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall // } // return // } + consumPs = curChapter.Ps[req.StageId] curChapter.Ps[req.StageId] = 0 // 清空预扣体力值 update["ps"] = curChapter.Ps if !isWin { // 战斗失败返还扣除的体力 @@ -196,6 +198,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall } } } + rsp.UserExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs) this.module.modelMline.modifyMlineData(session.GetUserId(), curChapter.Id, update) rsp.Data = curChapter session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, rsp) // 数据推送 diff --git a/modules/user/module.go b/modules/user/module.go index 587fe2df6..3548f469d 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -1123,7 +1123,7 @@ func (this *User) SetUserCaravanLvChange(session comm.IUserSession, caravanlv in return this.modelUser.Change(session.GetUserId(), update) } -func (this *User) ConsumePsAddExp(session comm.IUserSession, ps int) (addExp int32, errdata *pb.ErrorData) { +func (this *User) ConsumePsAddExp(session comm.IUserSession, ps int32) (addExp int32, errdata *pb.ErrorData) { if ps <= 0 { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, @@ -1147,7 +1147,7 @@ func (this *User) ConsumePsAddExp(session comm.IUserSession, ps int) (addExp int return } //体力消耗,增加玩家经验 - addExp = int32(ps) * ggd.FightPs + addExp = ps * ggd.FightPs user.Exp += int64(addExp) attrs := make(map[string]int32, 0) diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index b5bd8fa01..8638ea5bd 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -31,6 +31,8 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal res []*cfg.Gameatn // 最后获得的资源 bHelp bool oldDifficulty int32 // 记录通关之前的难度 + consumPs int32 + userExp int32 ) changExp = make(map[string]int32, 0) mapData = make(map[string]interface{}, 0) @@ -77,7 +79,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal } errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) - + consumPs = viking.Ps[req.BossId] viking.Ps[req.BossId] = 0 // 清空预扣体力值 mapData["ps"] = viking.Ps if !bWin { // 战斗失败了 直接返回 @@ -155,12 +157,13 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal } } } - + userExp, _ = this.module.ModuleUser.ConsumePsAddExp(session, consumPs) session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{ Data: viking, Asset: atno, Sell: del, Heroexp: changExp, + UserExp: userExp, }) if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { this.chat.SendSysChatToWorld(comm.ChatSystem14, nil, req.BossId, req.Difficulty, user.Name) diff --git a/pb/hunting_msg.pb.go b/pb/hunting_msg.pb.go index 46d06fc23..daa15b001 100644 --- a/pb/hunting_msg.pb.go +++ b/pb/hunting_msg.pb.go @@ -325,9 +325,10 @@ type HuntingChallengeOverResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data *DBHunting `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` - Asset []*UserAtno `protobuf:"bytes,2,rep,name=asset,proto3" json:"asset"` // 推送atno - Sell []string `protobuf:"bytes,3,rep,name=sell,proto3" json:"sell"` // 自动出售的装备 + Data *DBHunting `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Asset []*UserAtno `protobuf:"bytes,2,rep,name=asset,proto3" json:"asset"` // 推送atno + Sell []string `protobuf:"bytes,3,rep,name=sell,proto3" json:"sell"` // 自动出售的装备 + UserExp int32 `protobuf:"varint,4,opt,name=userExp,proto3" json:"userExp"` } func (x *HuntingChallengeOverResp) Reset() { @@ -383,6 +384,13 @@ func (x *HuntingChallengeOverResp) GetSell() []string { return nil } +func (x *HuntingChallengeOverResp) GetUserExp() int32 { + if x != nil { + return x.UserExp + } + return 0 +} + // 购买 type HuntingBuyReq struct { state protoimpl.MessageState @@ -621,29 +629,31 @@ var file_hunting_hunting_msg_proto_rawDesc = []byte{ 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x6f, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x61, 0x75, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x18, 0x48, 0x75, 0x6e, - 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, - 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x22, 0x25, 0x0a, 0x0d, 0x48, 0x75, - 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x22, 0x30, 0x0a, 0x0e, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x48, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, - 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, - 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, - 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x3b, 0x0a, - 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x08, 0x52, 0x04, 0x61, 0x75, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x48, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, + 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x45, 0x78, 0x70, 0x22, 0x25, 0x0a, 0x0d, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x30, 0x0a, 0x0e, + 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, + 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x48, + 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, + 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/mline_msg.pb.go b/pb/mline_msg.pb.go index ddbb6def1..7865908f6 100644 --- a/pb/mline_msg.pb.go +++ b/pb/mline_msg.pb.go @@ -399,8 +399,9 @@ type MlineChallengeOverResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data *DBMline `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` //当前章节信息 - Reward []*UserAssets `protobuf:"bytes,2,rep,name=reward,proto3" json:"reward"` // 奖励 + Data *DBMline `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` //当前章节信息 + Reward []*UserAssets `protobuf:"bytes,2,rep,name=reward,proto3" json:"reward"` // 奖励 + UserExp int32 `protobuf:"varint,3,opt,name=userExp,proto3" json:"userExp"` } func (x *MlineChallengeOverResp) Reset() { @@ -449,6 +450,13 @@ func (x *MlineChallengeOverResp) GetReward() []*UserAssets { return nil } +func (x *MlineChallengeOverResp) GetUserExp() int32 { + if x != nil { + return x.UserExp + } + return 0 +} + // 扫荡关卡 type MlineCleanStageReq struct { state protoimpl.MessageState @@ -591,22 +599,24 @@ var file_mline_mline_msg_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x5b, 0x0a, 0x16, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x75, 0x0a, 0x16, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x44, 0x42, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, - 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, - 0x49, 0x64, 0x22, 0x54, 0x0a, 0x13, 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, - 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, - 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, - 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x22, 0x2e, 0x0a, 0x12, + 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x13, + 0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, + 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/pb/notify_db.pb.go b/pb/notify_db.pb.go index e0526d67a..5c24edd17 100644 --- a/pb/notify_db.pb.go +++ b/pb/notify_db.pb.go @@ -20,50 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//通知 -type NotifyEvent int32 - -const ( - NotifyEvent_Notify_1001 NotifyEvent = 0 -) - -// Enum value maps for NotifyEvent. -var ( - NotifyEvent_name = map[int32]string{ - 0: "Notify_1001", - } - NotifyEvent_value = map[string]int32{ - "Notify_1001": 0, - } -) - -func (x NotifyEvent) Enum() *NotifyEvent { - p := new(NotifyEvent) - *p = x - return p -} - -func (x NotifyEvent) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NotifyEvent) Descriptor() protoreflect.EnumDescriptor { - return file_notify_notify_db_proto_enumTypes[0].Descriptor() -} - -func (NotifyEvent) Type() protoreflect.EnumType { - return &file_notify_notify_db_proto_enumTypes[0] -} - -func (x NotifyEvent) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NotifyEvent.Descriptor instead. -func (NotifyEvent) EnumDescriptor() ([]byte, []int) { - return file_notify_notify_db_proto_rawDescGZIP(), []int{0} -} - //系统公告数据结构 type DBSystemNotify struct { state protoimpl.MessageState @@ -165,9 +121,7 @@ var file_notify_notify_db_proto_rawDesc = []byte{ 0x73, 0x74, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x1e, 0x0a, - 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x0b, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x31, 0x30, 0x30, 0x31, 0x10, 0x00, 0x42, 0x06, 0x5a, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -183,11 +137,9 @@ func file_notify_notify_db_proto_rawDescGZIP() []byte { return file_notify_notify_db_proto_rawDescData } -var file_notify_notify_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_notify_notify_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_notify_notify_db_proto_goTypes = []interface{}{ - (NotifyEvent)(0), // 0: NotifyEvent - (*DBSystemNotify)(nil), // 1: DBSystemNotify + (*DBSystemNotify)(nil), // 0: DBSystemNotify } var file_notify_notify_db_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -221,14 +173,13 @@ func file_notify_notify_db_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_notify_notify_db_proto_rawDesc, - NumEnums: 1, + NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_notify_notify_db_proto_goTypes, DependencyIndexes: file_notify_notify_db_proto_depIdxs, - EnumInfos: file_notify_notify_db_proto_enumTypes, MessageInfos: file_notify_notify_db_proto_msgTypes, }.Build() File_notify_notify_db_proto = out.File diff --git a/pb/notify_msg.pb.go b/pb/notify_msg.pb.go index d90eb0c1f..2b0edaa39 100644 --- a/pb/notify_msg.pb.go +++ b/pb/notify_msg.pb.go @@ -205,45 +205,6 @@ func (x *NotifyGetListResp) GetSysNotify() []*DBSystemNotify { return nil } -//通知事件推送 -type NotifyEventPush struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NotifyEventPush) Reset() { - *x = NotifyEventPush{} - if protoimpl.UnsafeEnabled { - mi := &file_notify_notify_msg_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyEventPush) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotifyEventPush) ProtoMessage() {} - -func (x *NotifyEventPush) ProtoReflect() protoreflect.Message { - mi := &file_notify_notify_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 NotifyEventPush.ProtoReflect.Descriptor instead. -func (*NotifyEventPush) Descriptor() ([]byte, []int) { - return file_notify_notify_msg_proto_rawDescGZIP(), []int{3} -} - var File_notify_notify_msg_proto protoreflect.FileDescriptor var file_notify_notify_msg_proto_rawDesc = []byte{ @@ -274,9 +235,8 @@ var file_notify_notify_msg_proto_rawDesc = []byte{ 0x52, 0x0c, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x79, 0x52, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x11, 0x0a, - 0x0f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x73, 0x68, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x79, 0x52, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -291,22 +251,21 @@ func file_notify_notify_msg_proto_rawDescGZIP() []byte { return file_notify_notify_msg_proto_rawDescData } -var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_notify_notify_msg_proto_goTypes = []interface{}{ (*NotifyErrorNotifyPush)(nil), // 0: NotifyErrorNotifyPush (*NotifyGetListReq)(nil), // 1: NotifyGetListReq (*NotifyGetListResp)(nil), // 2: NotifyGetListResp - (*NotifyEventPush)(nil), // 3: NotifyEventPush - (ErrorCode)(0), // 4: ErrorCode - (*anypb.Any)(nil), // 5: google.protobuf.Any - (*ErrorData)(nil), // 6: ErrorData - (*DBSystemNotify)(nil), // 7: DBSystemNotify + (ErrorCode)(0), // 3: ErrorCode + (*anypb.Any)(nil), // 4: google.protobuf.Any + (*ErrorData)(nil), // 5: ErrorData + (*DBSystemNotify)(nil), // 6: DBSystemNotify } var file_notify_notify_msg_proto_depIdxs = []int32{ - 4, // 0: NotifyErrorNotifyPush.Code:type_name -> ErrorCode - 5, // 1: NotifyErrorNotifyPush.arg:type_name -> google.protobuf.Any - 6, // 2: NotifyErrorNotifyPush.err:type_name -> ErrorData - 7, // 3: NotifyGetListResp.SysNotify:type_name -> DBSystemNotify + 3, // 0: NotifyErrorNotifyPush.Code:type_name -> ErrorCode + 4, // 1: NotifyErrorNotifyPush.arg:type_name -> google.protobuf.Any + 5, // 2: NotifyErrorNotifyPush.err:type_name -> ErrorData + 6, // 3: NotifyGetListResp.SysNotify:type_name -> DBSystemNotify 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -359,18 +318,6 @@ func file_notify_notify_msg_proto_init() { return nil } } - file_notify_notify_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyEventPush); 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{ @@ -378,7 +325,7 @@ func file_notify_notify_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_notify_notify_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/viking_msg.pb.go b/pb/viking_msg.pb.go index e3679eed3..ca340d706 100644 --- a/pb/viking_msg.pb.go +++ b/pb/viking_msg.pb.go @@ -329,6 +329,7 @@ type VikingChallengeOverResp struct { Asset []*UserAtno `protobuf:"bytes,2,rep,name=asset,proto3" json:"asset"` // 推送atno Sell []string `protobuf:"bytes,3,rep,name=sell,proto3" json:"sell"` // 自动出售的装备 Heroexp map[string]int32 `protobuf:"bytes,4,rep,name=heroexp,proto3" json:"heroexp" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 英雄获得经验 + UserExp int32 `protobuf:"varint,5,opt,name=userExp,proto3" json:"userExp"` } func (x *VikingChallengeOverResp) Reset() { @@ -391,6 +392,13 @@ func (x *VikingChallengeOverResp) GetHeroexp() map[string]int32 { return nil } +func (x *VikingChallengeOverResp) GetUserExp() int32 { + if x != nil { + return x.UserExp + } + return 0 +} + // 购买 type VikingBuyReq struct { state protoimpl.MessageState @@ -628,7 +636,7 @@ var file_viking_viking_msg_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x61, - 0x75, 0x74, 0x6f, 0x22, 0xea, 0x01, 0x0a, 0x17, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, + 0x75, 0x74, 0x6f, 0x22, 0x84, 0x02, 0x0a, 0x17, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, @@ -639,25 +647,27 @@ var file_viking_viking_msg_proto_rawDesc = []byte{ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x65, 0x78, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x72, - 0x6f, 0x65, 0x78, 0x70, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x65, 0x78, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x24, 0x0a, 0x0c, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2e, 0x0a, 0x0d, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, - 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x47, 0x0a, 0x11, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, - 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, - 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, - 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, - 0x39, 0x0a, 0x12, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, - 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x1a, 0x3a, + 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x65, 0x78, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x24, 0x0a, 0x0c, 0x56, 0x69, + 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x2e, 0x0a, 0x0d, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x47, 0x0a, 0x11, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x56, 0x69, 0x6b, + 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x23, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, + 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var (