Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-12-28 10:39:17 +08:00
commit 51e84ab1bf
7 changed files with 113 additions and 32 deletions

View File

@ -18,6 +18,7 @@ import (
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"math"
"reflect" "reflect"
"strings" "strings"
"testing" "testing"
@ -70,6 +71,16 @@ func GetMonthStartEnd() (int64, int64) {
return _d1, _d2 return _d1, _d2
} }
func Test_Main(t *testing.T) { 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 list []int32
var list2 []int32 var list2 []int32
list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9} list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9}

View File

@ -95,6 +95,10 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string,
initUpdate["tujian"] = sz initUpdate["tujian"] = sz
this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate) this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate)
// 首次获得英雄 则推送
session.SendMsg("hero", "firstget", &pb.HeroFirstGetPush{
HeroId: heroCfgId,
})
} }
} }
//}(session.GetUserId(), heroCfgId) //}(session.GetUserId(), heroCfgId)

View File

@ -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 !db.IsCross() {
if conn, err := db.Cross(); err == nil { if conn, err := db.Cross(); err == nil {
var ( var (

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"math"
"strconv" "strconv"
"time" "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 := db.NewDBModel(comm.TableHuntingRank, time.Hour, conn_)
dbModel.AddList(uid, new.Id, new) 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)
} }
} }

View File

@ -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 !db.IsCross() {
if conn, err := db.Cross(); err == nil { if conn, err := db.Cross(); err == nil {
var ( var (

View File

@ -13,6 +13,7 @@ import (
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
"math"
"strconv" "strconv"
"time" "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 := db.NewDBModel(comm.TableVikingRank, time.Hour, conn_)
dbModel.AddList(uid, new.Id, new) 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)
} }
} }

View File

@ -2184,6 +2184,54 @@ func (x *HeroBuyResp) GetTenbuy() int32 {
return 0 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 protoreflect.FileDescriptor
var file_hero_hero_msg_proto_rawDesc = []byte{ 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, 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, 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, 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, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x62, 0x75, 0x79, 0x22,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -2395,7 +2446,7 @@ func file_hero_hero_msg_proto_rawDescGZIP() []byte {
return file_hero_hero_msg_proto_rawDescData 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{}{ var file_hero_hero_msg_proto_goTypes = []interface{}{
(*HeroInfoReq)(nil), // 0: HeroInfoReq (*HeroInfoReq)(nil), // 0: HeroInfoReq
(*HeroInfoResp)(nil), // 1: HeroInfoResp (*HeroInfoResp)(nil), // 1: HeroInfoResp
@ -2438,36 +2489,37 @@ var file_hero_hero_msg_proto_goTypes = []interface{}{
(*HeroTalentResetResp)(nil), // 38: HeroTalentResetResp (*HeroTalentResetResp)(nil), // 38: HeroTalentResetResp
(*HeroBuyReq)(nil), // 39: HeroBuyReq (*HeroBuyReq)(nil), // 39: HeroBuyReq
(*HeroBuyResp)(nil), // 40: HeroBuyResp (*HeroBuyResp)(nil), // 40: HeroBuyResp
nil, // 41: HeroPropertyPush.PropertyEntry (*HeroFirstGetPush)(nil), // 41: HeroFirstGetPush
nil, // 42: HeroPropertyPush.AddPropertyEntry nil, // 42: HeroPropertyPush.PropertyEntry
nil, // 43: HeroFusionReq.HerosEntry nil, // 43: HeroPropertyPush.AddPropertyEntry
(*DBHero)(nil), // 44: DBHero nil, // 44: HeroFusionReq.HerosEntry
(*DBHeroTalent)(nil), // 45: DBHeroTalent (*DBHero)(nil), // 45: DBHero
(*DBHeroTalent)(nil), // 46: DBHeroTalent
} }
var file_hero_hero_msg_proto_depIdxs = []int32{ var file_hero_hero_msg_proto_depIdxs = []int32{
44, // 0: HeroInfoResp.base:type_name -> DBHero 45, // 0: HeroInfoResp.base:type_name -> DBHero
44, // 1: HeroListResp.list:type_name -> DBHero 45, // 1: HeroListResp.list:type_name -> DBHero
4, // 2: HeroStrengthenUplvReq.expCards:type_name -> MapStringInt32 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, // 4: HeroStrengthenUpStarReq.hero:type_name -> CostCardData
7, // 5: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData 7, // 5: HeroStrengthenUpStarReq.heroRace:type_name -> CostCardData
44, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero 45, // 6: HeroStrengthenUpStarResp.hero:type_name -> DBHero
44, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero 45, // 7: HeroStrengthenUpSkillResp.hero:type_name -> DBHero
44, // 8: HeroResonanceResp.hero:type_name -> DBHero 45, // 8: HeroResonanceResp.hero:type_name -> DBHero
44, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero 45, // 9: HeroResonanceResp.upStarCard:type_name -> DBHero
44, // 10: HeroResonanceResetResp.hero:type_name -> DBHero 45, // 10: HeroResonanceResetResp.hero:type_name -> DBHero
16, // 11: HeroResonanceUseEnergyReq.energy:type_name -> EnergyData 16, // 11: HeroResonanceUseEnergyReq.energy:type_name -> EnergyData
44, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero 45, // 12: HeroResonanceUseEnergyResp.hero:type_name -> DBHero
44, // 13: HeroAwakenResp.hero:type_name -> DBHero 45, // 13: HeroAwakenResp.hero:type_name -> DBHero
41, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry 42, // 14: HeroPropertyPush.property:type_name -> HeroPropertyPush.PropertyEntry
42, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry 43, // 15: HeroPropertyPush.addProperty:type_name -> HeroPropertyPush.AddPropertyEntry
44, // 16: HeroLockResp.hero:type_name -> DBHero 45, // 16: HeroLockResp.hero:type_name -> DBHero
44, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero 45, // 17: HeroGetSpecifiedResp.hero:type_name -> DBHero
44, // 18: HeroChangePush.list:type_name -> DBHero 45, // 18: HeroChangePush.list:type_name -> DBHero
43, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry 44, // 19: HeroFusionReq.heros:type_name -> HeroFusionReq.HerosEntry
45, // 20: HeroTalentListResp.telnet:type_name -> DBHeroTalent 46, // 20: HeroTalentListResp.telnet:type_name -> DBHeroTalent
45, // 21: HeroTalentLearnResp.telnet:type_name -> DBHeroTalent 46, // 21: HeroTalentLearnResp.telnet:type_name -> DBHeroTalent
45, // 22: HeroTalentResetResp.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 output_type
23, // [23:23] is the sub-list for method input_type 23, // [23:23] is the sub-list for method input_type
23, // [23:23] is the sub-list for extension type_name 23, // [23:23] is the sub-list for extension type_name
@ -2974,6 +3026,18 @@ func file_hero_hero_msg_proto_init() {
return nil 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -2981,7 +3045,7 @@ func file_hero_hero_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_hero_msg_proto_rawDesc, RawDescriptor: file_hero_hero_msg_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 44, NumMessages: 45,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },