上传装备洗练和道具添加优化

This commit is contained in:
liwei 2023-06-26 14:23:31 +08:00
parent a3bec23bf2
commit 0daa74e069
7 changed files with 123 additions and 151 deletions

View File

@ -55,7 +55,7 @@ type (
///添加单个物品到背包 (可以加物品和减物品) ///添加单个物品到背包 (可以加物品和减物品)
AddItem(session IUserSession, itemid string, addnum int32, bPush bool) (errdata *pb.ErrorData) AddItem(session IUserSession, itemid string, addnum int32, bPush bool) (errdata *pb.ErrorData)
///添加多个物品到背包 (可以加物品和减物品) ///添加多个物品到背包 (可以加物品和减物品)
AddItems(session IUserSession, items map[string]int32, bPush bool) (change []*pb.DB_UserItemData, errdata *pb.ErrorData) AddItems(session IUserSession, items map[string]int32, bPush bool) (change []*pb.UserAtno, errdata *pb.ErrorData)
///清理道具 ///清理道具
CleanItems(session IUserSession) (errdata *pb.ErrorData) CleanItems(session IUserSession) (errdata *pb.ErrorData)
///购买统一入场券 ///购买统一入场券

View File

@ -64,14 +64,18 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) (
} }
adverbEntry = make([]*pb.EquipmentAttributeEntry, len(equip.AdverbEntry)) adverbEntry = make([]*pb.EquipmentAttributeEntry, len(equip.AdverbEntry))
for i, v := range comm.RandShuffle(len(equip.AdverbEntry)) { for i, v := range comm.RandShuffle(len(attrlibrarys)) {
if i < len(equip.AdverbEntry) {
adverbEntry[i] = &pb.EquipmentAttributeEntry{ adverbEntry[i] = &pb.EquipmentAttributeEntry{
Id: attrlibrarys[v].Key, Id: attrlibrarys[v].Key,
Libraryid: attrlibrarys[v].Libraryid, Libraryid: attrlibrarys[v].Libraryid,
Lv: equip.AdverbEntry[i].Lv, Lv: equip.AdverbEntry[i].Lv,
AttrName: attrlibrarys[v].Attrkey, AttrName: attrlibrarys[v].Attrkey,
BaseValue: attrlibrarys[v].Attrvar, BaseValue: attrlibrarys[v].Attrvar,
Value: attrlibrarys[v].Attrvar + int32(float64(attrlibrarys[v].Addition[equip.AdverbEntry[i].Lv-1])/1000.0*float64(attrlibrarys[v].AttrvarCorrect)), Value: attrlibrarys[v].Attrvar + int32(float64(attrlibrarys[v].Addition[equip.AdverbEntry[i].Lv-1])/1000.0*float64(attrlibrarys[v].Attrvar)),
}
} else {
break
} }
} }
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype95, 1) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype95, 1)

View File

@ -390,10 +390,12 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
num = int64(v.Amount) + int64(leftnum) num = int64(v.Amount) + int64(leftnum)
if num < 0 { if num < 0 {
leftnum += int64(v.Amount) leftnum += int64(v.Amount)
v.Change = -1 * int32(v.Amount)
v.Amount = 0 v.Amount = 0
del = append(del, v) del = append(del, v)
} else if num > 0 && num < int64(v.Amount) { } else if num > 0 && num < int64(v.Amount) {
leftnum = 0 leftnum = 0
v.Change = int32(num) - int32(v.Amount)
v.Amount = uint32(num) v.Amount = uint32(num)
update = append(update, v) update = append(update, v)
break break
@ -401,6 +403,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
if conf.UpperLimit > 0 { if conf.UpperLimit > 0 {
if num <= int64(conf.UpperLimit) { if num <= int64(conf.UpperLimit) {
leftnum = 0 leftnum = 0
v.Change = int32(num) - int32(v.Amount)
v.Amount = uint32(num) v.Amount = uint32(num)
update = append(update, v) update = append(update, v)
break break
@ -413,6 +416,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
} }
} else { } else {
leftnum = 0 leftnum = 0
v.Change = int32(num) - int32(v.Amount)
v.Amount = uint32(num) v.Amount = uint32(num)
update = append(update, v) update = append(update, v)
} }
@ -434,6 +438,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
GridId: primitive.NewObjectID().Hex(), GridId: primitive.NewObjectID().Hex(),
UId: uid, UId: uid,
ItemId: itemId, ItemId: itemId,
Change: int32(leftnum),
Amount: uint32(leftnum), Amount: uint32(leftnum),
CTime: configure.Now().Unix(), CTime: configure.Now().Unix(),
IsNewItem: isNew, IsNewItem: isNew,
@ -451,6 +456,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte
GridId: primitive.NewObjectID().Hex(), GridId: primitive.NewObjectID().Hex(),
UId: uid, UId: uid,
ItemId: itemId, ItemId: itemId,
Change: int32(conf.UpperLimit),
Amount: uint32(conf.UpperLimit), Amount: uint32(conf.UpperLimit),
CTime: configure.Now().Unix(), CTime: configure.Now().Unix(),
IsNewItem: isNew, IsNewItem: isNew,

View File

@ -162,14 +162,16 @@ func (this *Items) AddItem(session comm.IUserSession, itemid string, addnum int3
} }
// /添加多个物品到背包 (可以加物品和减物品) // /添加多个物品到背包 (可以加物品和减物品)
func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, bPush bool) (change []*pb.DB_UserItemData, errdata *pb.ErrorData) { func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, bPush bool) (change []*pb.UserAtno, errdata *pb.ErrorData) {
var ( var (
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
_change []*pb.DB_UserItemData
err error err error
) )
defer this.Debugf("给用户添加物品 uId:%s items:%v items:%v", session.GetUserId(), items, err == nil) defer this.Debugf("给用户添加物品 uId:%s items:%v items:%v", session.GetUserId(), items, err == nil)
if change, err = this.modelItems.AddItemsToUserPack(session.GetUserId(), items); err != nil { change = make([]*pb.UserAtno, 0)
if _change, err = this.modelItems.AddItemsToUserPack(session.GetUserId(), items); err != nil {
this.Errorf("给用户添加物品 uId:%s items:%v err:%v", session.GetUserId(), items, err) this.Errorf("给用户添加物品 uId:%s items:%v err:%v", session.GetUserId(), items, err)
if err == ItemNotEnoughError { if err == ItemNotEnoughError {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -198,8 +200,16 @@ func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, b
} }
return return
} }
if len(change) > 0 && bPush { for _, v := range _change {
this.itemsChangePush(session, change) //推送道具背包变化 change = append(change, &pb.UserAtno{
A: comm.ItemType,
T: v.ItemId,
N: v.Change,
O: v.GridId,
})
}
if len(_change) > 0 && bPush {
this.itemsChangePush(session, _change) //推送道具背包变化
} }
for k, v := range items { for k, v := range items {
if v > 0 { if v > 0 {

View File

@ -684,16 +684,10 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
} }
} }
if len(items) > 0 { //道具资源 if len(items) > 0 { //道具资源
addItems, code := this.ModuleItems.AddItems(session, items, bPush) _atno, code := this.ModuleItems.AddItems(session, items, bPush)
this.Debugf("发放道具资源: %v [%v]", items, code) errdata = code
for _, v := range addItems { atno = append(atno, _atno...)
atno = append(atno, &pb.UserAtno{ this.Debugf("发放道具资源: %v [%v]", _atno, code)
A: "item",
T: v.ItemId,
N: int32(len(items)),
O: v.GridId,
})
}
} }
if len(heros) > 0 { //卡片资源 if len(heros) > 0 { //卡片资源
hero, atn, code := this.ModuleHero.CreateRepeatHeros(session, heros, bPush) hero, atn, code := this.ModuleHero.CreateRepeatHeros(session, heros, bPush)

View File

@ -321,8 +321,8 @@ type DBHeroRecord struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID 主键id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID 主键id
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
Star4 int32 `protobuf:"varint,3,opt,name=star4,proto3" json:"star4"` // 4星保底 -- 新版抽卡废弃字段 Star4 int32 `protobuf:"varint,3,opt,name=star4,proto3" json:"star4"` // 4星保底
Star5 int32 `protobuf:"varint,4,opt,name=star5,proto3" json:"star5"` // 5星保底 -- 新版抽卡废弃字段 Star5 int32 `protobuf:"varint,4,opt,name=star5,proto3" json:"star5"` // 5星保底
Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime"` // 修改时间 Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime"` // 修改时间
Drawcount int32 `protobuf:"varint,6,opt,name=drawcount,proto3" json:"drawcount"` // 普通卡牌累计抽取次数 Drawcount int32 `protobuf:"varint,6,opt,name=drawcount,proto3" json:"drawcount"` // 普通卡牌累计抽取次数
Condition map[string]int32 `protobuf:"bytes,7,rep,name=condition,proto3" json:"condition" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key recharge、login 等 value 累计抽卡次数 Condition map[string]int32 `protobuf:"bytes,7,rep,name=condition,proto3" json:"condition" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key recharge、login 等 value 累计抽卡次数
@ -334,9 +334,6 @@ type DBHeroRecord struct {
Inevitable int32 `protobuf:"varint,13,opt,name=inevitable,proto3" json:"inevitable"` //第2-30次抽奖必出一个5星英雄 Inevitable int32 `protobuf:"varint,13,opt,name=inevitable,proto3" json:"inevitable"` //第2-30次抽奖必出一个5星英雄
Inevitable1 int32 `protobuf:"varint,14,opt,name=inevitable1,proto3" json:"inevitable1"` //第30-50次抽奖必出一个5星英雄 Inevitable1 int32 `protobuf:"varint,14,opt,name=inevitable1,proto3" json:"inevitable1"` //第30-50次抽奖必出一个5星英雄
Race map[int32]int32 `protobuf:"bytes,15,rep,name=race,proto3" json:"race" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 阵营类型 value count Race map[int32]int32 `protobuf:"bytes,15,rep,name=race,proto3" json:"race" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 阵营类型 value count
Baodi4 map[int32]int32 `protobuf:"bytes,16,rep,name=baodi4,proto3" json:"baodi4" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 4星保底次数 key 阵营类型 value count
Baodi5 map[int32]int32 `protobuf:"bytes,17,rep,name=baodi5,proto3" json:"baodi5" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 5星保底次数 key 阵营类型 value count
Count map[int32]int32 `protobuf:"bytes,18,rep,name=count,proto3" json:"count" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 抽卡次数 key 阵营类型 value count
} }
func (x *DBHeroRecord) Reset() { func (x *DBHeroRecord) Reset() {
@ -476,27 +473,6 @@ func (x *DBHeroRecord) GetRace() map[int32]int32 {
return nil return nil
} }
func (x *DBHeroRecord) GetBaodi4() map[int32]int32 {
if x != nil {
return x.Baodi4
}
return nil
}
func (x *DBHeroRecord) GetBaodi5() map[int32]int32 {
if x != nil {
return x.Baodi5
}
return nil
}
func (x *DBHeroRecord) GetCount() map[int32]int32 {
if x != nil {
return x.Count
}
return nil
}
// 英雄天赋系统 // 英雄天赋系统
type DBHeroTalent struct { type DBHeroTalent struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -658,7 +634,7 @@ var file_hero_hero_db_proto_rawDesc = []byte{
0x3a, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 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, 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, 0xde, 0x07, 0x0a, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x98, 0x05, 0x0a, 0x0c,
0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 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, 0x14, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14,
@ -689,54 +665,33 @@ var file_hero_hero_db_proto_rawDesc = []byte{
0x62, 0x6c, 0x65, 0x31, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x62, 0x6c, 0x65, 0x31, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72,
0x64, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x72, 0x61, 0x63, 0x64, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x72, 0x61, 0x63,
0x65, 0x12, 0x31, 0x0a, 0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x34, 0x18, 0x10, 0x20, 0x03, 0x28, 0x65, 0x1a, 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e,
0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x2e, 0x42, 0x61, 0x6f, 0x64, 0x69, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x62, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x6f, 0x64, 0x69, 0x34, 0x12, 0x31, 0x0a, 0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x3c, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x35, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72,
0x6f, 0x72, 0x64, 0x2e, 0x42, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x12, 0x2e, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x09, 0x52, 0x61, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x6f, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x35, 0x48, 0x65, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02,
0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x6f, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28,
0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a, 0x09, 0x52, 0x61, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x2e, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x61,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x6c, 0x65, 0x6e, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x6e,
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x42, 0x61, 0x6f, 0x64, 0x69, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x2f, 0x0a, 0x08, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x48,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x42, 0x61, 0x6f, 0x64, 0x69, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x69, 0x6c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e,
0x35, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x6f, 0x6e, 0x67, 0x46, 0x75, 0x10, 0x01,
0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 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,
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb6, 0x01, 0x0a,
0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x61, 0x6c, 0x65, 0x6e, 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,
0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x61, 0x6c, 0x65, 0x6e,
0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f,
0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x06, 0x74, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x61,
0x6c, 0x65, 0x6e, 0x74, 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, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x2f, 0x0a, 0x08, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70,
0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x69, 0x6c,
0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4b, 0x6f,
0x6e, 0x67, 0x46, 0x75, 0x10, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -752,7 +707,7 @@ func file_hero_hero_db_proto_rawDescGZIP() []byte {
} }
var file_hero_hero_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_hero_hero_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_hero_hero_db_proto_goTypes = []interface{}{ var file_hero_hero_db_proto_goTypes = []interface{}{
(HeroType)(0), // 0: HeroType (HeroType)(0), // 0: HeroType
(*DBHero)(nil), // 1: DBHero (*DBHero)(nil), // 1: DBHero
@ -767,36 +722,30 @@ var file_hero_hero_db_proto_goTypes = []interface{}{
nil, // 10: DBHeroRecord.ConditionEntry nil, // 10: DBHeroRecord.ConditionEntry
nil, // 11: DBHeroRecord.Star5HeroEntry nil, // 11: DBHeroRecord.Star5HeroEntry
nil, // 12: DBHeroRecord.RaceEntry nil, // 12: DBHeroRecord.RaceEntry
nil, // 13: DBHeroRecord.Baodi4Entry nil, // 13: DBHeroTalent.TalentEntry
nil, // 14: DBHeroRecord.Baodi5Entry (*SkillData)(nil), // 14: SkillData
nil, // 15: DBHeroRecord.CountEntry (*DB_EquipmentSuit)(nil), // 15: DB_EquipmentSuit
nil, // 16: DBHeroTalent.TalentEntry
(*SkillData)(nil), // 17: SkillData
(*DB_EquipmentSuit)(nil), // 18: DB_EquipmentSuit
} }
var file_hero_hero_db_proto_depIdxs = []int32{ var file_hero_hero_db_proto_depIdxs = []int32{
17, // 0: DBHero.normalSkill:type_name -> SkillData 14, // 0: DBHero.normalSkill:type_name -> SkillData
4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry 4, // 1: DBHero.property:type_name -> DBHero.PropertyEntry
5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry 5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry
6, // 3: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry 6, // 3: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry
0, // 4: DBHero.status:type_name -> HeroType 0, // 4: DBHero.status:type_name -> HeroType
18, // 5: DBHero.suits:type_name -> DB_EquipmentSuit 15, // 5: DBHero.suits:type_name -> DB_EquipmentSuit
7, // 6: DBHero.talentProperty:type_name -> DBHero.TalentPropertyEntry 7, // 6: DBHero.talentProperty:type_name -> DBHero.TalentPropertyEntry
17, // 7: DBHero.equipSkill:type_name -> SkillData 14, // 7: DBHero.equipSkill:type_name -> SkillData
8, // 8: DBHero.horoscopeProperty:type_name -> DBHero.HoroscopePropertyEntry 8, // 8: DBHero.horoscopeProperty:type_name -> DBHero.HoroscopePropertyEntry
9, // 9: DBHero.fetters:type_name -> DBHero.FettersEntry 9, // 9: DBHero.fetters:type_name -> DBHero.FettersEntry
10, // 10: DBHeroRecord.condition:type_name -> DBHeroRecord.ConditionEntry 10, // 10: DBHeroRecord.condition:type_name -> DBHeroRecord.ConditionEntry
11, // 11: DBHeroRecord.star5Hero:type_name -> DBHeroRecord.Star5HeroEntry 11, // 11: DBHeroRecord.star5Hero:type_name -> DBHeroRecord.Star5HeroEntry
12, // 12: DBHeroRecord.race:type_name -> DBHeroRecord.RaceEntry 12, // 12: DBHeroRecord.race:type_name -> DBHeroRecord.RaceEntry
13, // 13: DBHeroRecord.baodi4:type_name -> DBHeroRecord.Baodi4Entry 13, // 13: DBHeroTalent.talent:type_name -> DBHeroTalent.TalentEntry
14, // 14: DBHeroRecord.baodi5:type_name -> DBHeroRecord.Baodi5Entry 14, // [14:14] is the sub-list for method output_type
15, // 15: DBHeroRecord.count:type_name -> DBHeroRecord.CountEntry 14, // [14:14] is the sub-list for method input_type
16, // 16: DBHeroTalent.talent:type_name -> DBHeroTalent.TalentEntry 14, // [14:14] is the sub-list for extension type_name
17, // [17:17] is the sub-list for method output_type 14, // [14:14] is the sub-list for extension extendee
17, // [17:17] is the sub-list for method input_type 0, // [0:14] is the sub-list for field type_name
17, // [17:17] is the sub-list for extension type_name
17, // [17:17] is the sub-list for extension extendee
0, // [0:17] is the sub-list for field type_name
} }
func init() { file_hero_hero_db_proto_init() } func init() { file_hero_hero_db_proto_init() }
@ -850,7 +799,7 @@ func file_hero_hero_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hero_hero_db_proto_rawDesc, RawDescriptor: file_hero_hero_db_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 16, NumMessages: 13,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -30,10 +30,11 @@ type DB_UserItemData struct {
UId string `protobuf:"bytes,2,opt,name=uId,proto3" json:"uId" bson:"uid"` // 用户id UId string `protobuf:"bytes,2,opt,name=uId,proto3" json:"uId" bson:"uid"` // 用户id
ItemId string `protobuf:"bytes,3,opt,name=itemId,proto3" json:"itemId" bson:"itemId"` // 存放物品的Id ItemId string `protobuf:"bytes,3,opt,name=itemId,proto3" json:"itemId" bson:"itemId"` // 存放物品的Id
Amount uint32 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount" bson:"amount"` // 存放物品的数量 Amount uint32 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount" bson:"amount"` // 存放物品的数量
CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` // 物品获取时间 Change int32 `protobuf:"varint,5,opt,name=change,proto3" json:"change" bson:"change"` // 最后一次变化量
ETime int64 `protobuf:"varint,6,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` // 物品过期时间 CTime int64 `protobuf:"varint,6,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` // 物品获取时间
IsNewItem bool `protobuf:"varint,7,opt,name=isNewItem,proto3" json:"isNewItem" bson:"isNewItem"` // 是否是新的 ETime int64 `protobuf:"varint,7,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` // 物品过期时间
Lastopt int64 `protobuf:"varint,8,opt,name=lastopt,proto3" json:"lastopt" bson:"lastopt"` // 最后操作时间 IsNewItem bool `protobuf:"varint,8,opt,name=isNewItem,proto3" json:"isNewItem" bson:"isNewItem"` // 是否是新的
Lastopt int64 `protobuf:"varint,9,opt,name=lastopt,proto3" json:"lastopt" bson:"lastopt"` // 最后操作时间
} }
func (x *DB_UserItemData) Reset() { func (x *DB_UserItemData) Reset() {
@ -96,6 +97,13 @@ func (x *DB_UserItemData) GetAmount() uint32 {
return 0 return 0
} }
func (x *DB_UserItemData) GetChange() int32 {
if x != nil {
return x.Change
}
return 0
}
func (x *DB_UserItemData) GetCTime() int64 { func (x *DB_UserItemData) GetCTime() int64 {
if x != nil { if x != nil {
return x.CTime return x.CTime
@ -128,21 +136,22 @@ var File_items_items_db_proto protoreflect.FileDescriptor
var file_items_items_db_proto_rawDesc = []byte{ var file_items_items_db_proto_rawDesc = []byte{
0x0a, 0x14, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x64, 0x62, 0x0a, 0x14, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x64, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x01, 0x0a, 0x0f, 0x44, 0x42, 0x5f, 0x55, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x0f, 0x44, 0x42, 0x5f, 0x55, 0x73,
0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72,
0x69, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x69, 0x64, 0x69, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x69, 0x64,
0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x03, 0x75, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x61, 0x6d, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05,
0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69,
0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x07, 0x20, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x4e, 0x65,
0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e,
0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70, 0x74,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (