diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index 2ace8e4d8..ccd28ac06 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -18,6 +18,7 @@ import ( "go_dreamfactory/sys/configure" "go_dreamfactory/sys/db" "go_dreamfactory/utils" + "math" "reflect" "strings" "testing" @@ -70,6 +71,16 @@ func GetMonthStartEnd() (int64, int64) { return _d1, _d2 } func Test_Main(t *testing.T) { + + var l int64 + var l1 int64 + var i int32 + var f float64 + i = math.MaxInt32 + l = int64(i) << 31 + l1 = 1 << 31 + f = float64(l) + fmt.Printf("%d,%d,%f", l, l1, f) var list []int32 var list2 []int32 list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9} diff --git a/modules/hero/module.go b/modules/hero/module.go index a46bc6d6c..2ef8fa60c 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -95,6 +95,10 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string, initUpdate["tujian"] = sz this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate) + // 首次获得英雄 则推送 + session.SendMsg("hero", "firstget", &pb.HeroFirstGetPush{ + HeroId: heroCfgId, + }) } } //}(session.GetUserId(), heroCfgId) diff --git a/modules/hunting/model_rank.go b/modules/hunting/model_rank.go index 8e0ff8816..f2d307f7f 100644 --- a/modules/hunting/model_rank.go +++ b/modules/hunting/model_rank.go @@ -56,7 +56,7 @@ func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32) } // 排行数据写跨服 -func (this *ModelRank) SetRankListData(tableName string, score int32, uid string) { +func (this *ModelRank) SetRankListData(tableName string, score int64, uid string) { if !db.IsCross() { if conn, err := db.Cross(); err == nil { var ( diff --git a/modules/hunting/module.go b/modules/hunting/module.go index 69a9f7f8b..b9b2b2f12 100644 --- a/modules/hunting/module.go +++ b/modules/hunting/module.go @@ -6,6 +6,7 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/db" + "math" "strconv" "time" @@ -136,7 +137,7 @@ func (this *Hunting) CheckRank(uid string, boosID int32, difficulty int32, hunti dbModel := db.NewDBModel(comm.TableHuntingRank, time.Hour, conn_) dbModel.AddList(uid, new.Id, new) } - this.modulerank.SetRankListData("huntingRank"+strconv.Itoa(int(boosID)), difficulty<<16+costTime, objID) + this.modulerank.SetRankListData("huntingRank"+strconv.Itoa(int(boosID)), int64(difficulty)<<31+int64(math.MaxInt32-costTime), objID) } } diff --git a/modules/viking/model_rank.go b/modules/viking/model_rank.go index f8b5af96b..9540a3020 100644 --- a/modules/viking/model_rank.go +++ b/modules/viking/model_rank.go @@ -55,7 +55,7 @@ func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) * } // 排行数据写跨服 -func (this *ModelRank) SetRankListData(tableName string, score int32, uid string) { +func (this *ModelRank) SetRankListData(tableName string, score int64, uid string) { if !db.IsCross() { if conn, err := db.Cross(); err == nil { var ( diff --git a/modules/viking/module.go b/modules/viking/module.go index d2ffc2ada..3f4cdc61e 100644 --- a/modules/viking/module.go +++ b/modules/viking/module.go @@ -13,6 +13,7 @@ import ( "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/sys/db" + "math" "strconv" "time" @@ -143,7 +144,7 @@ func (this *Viking) CheckRank(uid string, boosID int32, difficulty int32, viking dbModel := db.NewDBModel(comm.TableVikingRank, time.Hour, conn_) dbModel.AddList(uid, new.Id, new) } - this.modulerank.SetRankListData("vikingRank"+strconv.Itoa(int(boosID)), difficulty<<16+costTime, objID) + this.modulerank.SetRankListData("vikingRank"+strconv.Itoa(int(boosID)), int64(difficulty<<31)+int64(math.MaxInt32-costTime), objID) } } diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index 212cd1ac4..76dba0441 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -2184,6 +2184,54 @@ func (x *HeroBuyResp) GetTenbuy() int32 { return 0 } +// 首次获得英雄 +type HeroFirstGetPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HeroId string `protobuf:"bytes,1,opt,name=heroId,proto3" json:"heroId"` //英雄id +} + +func (x *HeroFirstGetPush) Reset() { + *x = HeroFirstGetPush{} + if protoimpl.UnsafeEnabled { + mi := &file_hero_hero_msg_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeroFirstGetPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeroFirstGetPush) ProtoMessage() {} + +func (x *HeroFirstGetPush) ProtoReflect() protoreflect.Message { + mi := &file_hero_hero_msg_proto_msgTypes[41] + 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 HeroFirstGetPush.ProtoReflect.Descriptor instead. +func (*HeroFirstGetPush) Descriptor() ([]byte, []int) { + return file_hero_hero_msg_proto_rawDescGZIP(), []int{41} +} + +func (x *HeroFirstGetPush) GetHeroId() string { + if x != nil { + return x.HeroId + } + return "" +} + var File_hero_hero_msg_proto protoreflect.FileDescriptor var file_hero_hero_msg_proto_rawDesc = []byte{ @@ -2379,8 +2427,11 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x65, 0x62, 0x75, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x6e, 0x65, 0x62, 0x75, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x62, 0x75, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x62, 0x75, 0x79, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x62, 0x75, 0x79, 0x22, + 0x2a, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x65, 0x74, 0x50, + 0x75, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2395,7 +2446,7 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte { return file_hero_hero_msg_proto_rawDescData } -var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 44) +var file_hero_hero_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 45) var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroInfoReq)(nil), // 0: HeroInfoReq (*HeroInfoResp)(nil), // 1: HeroInfoResp @@ -2438,36 +2489,37 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{ (*HeroTalentResetResp)(nil), // 38: HeroTalentResetResp (*HeroBuyReq)(nil), // 39: HeroBuyReq (*HeroBuyResp)(nil), // 40: HeroBuyResp - nil, // 41: HeroPropertyPush.PropertyEntry - nil, // 42: HeroPropertyPush.AddPropertyEntry - nil, // 43: HeroFusionReq.HerosEntry - (*DBHero)(nil), // 44: DBHero - (*DBHeroTalent)(nil), // 45: DBHeroTalent + (*HeroFirstGetPush)(nil), // 41: HeroFirstGetPush + nil, // 42: HeroPropertyPush.PropertyEntry + nil, // 43: HeroPropertyPush.AddPropertyEntry + nil, // 44: HeroFusionReq.HerosEntry + (*DBHero)(nil), // 45: DBHero + (*DBHeroTalent)(nil), // 46: DBHeroTalent } var file_hero_hero_msg_proto_depIdxs = []int32{ - 44, // 0: HeroInfoResp.base:type_name -> DBHero - 44, // 1: HeroListResp.list:type_name -> DBHero + 45, // 0: HeroInfoResp.base:type_name -> DBHero + 45, // 1: HeroListResp.list:type_name -> DBHero 4, // 2: HeroStrengthenUplvReq.expCards:type_name -> MapStringInt32 - 44, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero + 45, // 3: HeroStrengthenUplvResp.hero:type_name -> DBHero 7, // 4: HeroStrengthenUpStarReq.hero:type_name -> CostCardData 7, // 5: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData - 44, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero - 44, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero - 44, // 8: HeroResonanceResp.hero:type_name -> DBHero - 44, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero - 44, // 10: HeroResonanceResetResp.hero:type_name -> DBHero + 45, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero + 45, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero + 45, // 8: HeroResonanceResp.hero:type_name -> DBHero + 45, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero + 45, // 10: HeroResonanceResetResp.hero:type_name -> DBHero 16, // 11: HeroResonanceUseEnergyReq.energy:type_name -> EnergyData - 44, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero - 44, // 13: HeroAwakenResp.hero:type_name -> DBHero - 41, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry - 42, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry - 44, // 16: HeroLockResp.hero:type_name -> DBHero - 44, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero - 44, // 18: HeroChangePush.list:type_name -> DBHero - 43, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry - 45, // 20: HeroTalentListResp.telnet:type_name -> DBHeroTalent - 45, // 21: HeroTalentLearnResp.telnet:type_name -> DBHeroTalent - 45, // 22: HeroTalentResetResp.telnet:type_name -> DBHeroTalent + 45, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero + 45, // 13: HeroAwakenResp.hero:type_name -> DBHero + 42, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry + 43, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry + 45, // 16: HeroLockResp.hero:type_name -> DBHero + 45, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero + 45, // 18: HeroChangePush.list:type_name -> DBHero + 44, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry + 46, // 20: HeroTalentListResp.telnet:type_name -> DBHeroTalent + 46, // 21: HeroTalentLearnResp.telnet:type_name -> DBHeroTalent + 46, // 22: HeroTalentResetResp.telnet:type_name -> DBHeroTalent 23, // [23:23] is the sub-list for method output_type 23, // [23:23] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name @@ -2974,6 +3026,18 @@ func file_hero_hero_msg_proto_init() { return nil } } + file_hero_hero_msg_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeroFirstGetPush); 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{ @@ -2981,7 +3045,7 @@ func file_hero_hero_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hero_hero_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 44, + NumMessages: 45, NumExtensions: 0, NumServices: 0, },