diff --git a/comm/imodule.go b/comm/imodule.go index 5ea5437e8..eb49be119 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -55,7 +55,7 @@ type ( ///添加单个物品到背包 (可以加物品和减物品) 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) ///购买统一入场券 diff --git a/modules/equipment/api_wash.go b/modules/equipment/api_wash.go index 5fe9e5401..6642d9f5b 100644 --- a/modules/equipment/api_wash.go +++ b/modules/equipment/api_wash.go @@ -64,14 +64,18 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) ( } adverbEntry = make([]*pb.EquipmentAttributeEntry, len(equip.AdverbEntry)) - for i, v := range comm.RandShuffle(len(equip.AdverbEntry)) { - adverbEntry[i] = &pb.EquipmentAttributeEntry{ - Id: attrlibrarys[v].Key, - Libraryid: attrlibrarys[v].Libraryid, - Lv: equip.AdverbEntry[i].Lv, - AttrName: attrlibrarys[v].Attrkey, - BaseValue: attrlibrarys[v].Attrvar, - Value: attrlibrarys[v].Attrvar + int32(float64(attrlibrarys[v].Addition[equip.AdverbEntry[i].Lv-1])/1000.0*float64(attrlibrarys[v].AttrvarCorrect)), + for i, v := range comm.RandShuffle(len(attrlibrarys)) { + if i < len(equip.AdverbEntry) { + adverbEntry[i] = &pb.EquipmentAttributeEntry{ + Id: attrlibrarys[v].Key, + Libraryid: attrlibrarys[v].Libraryid, + Lv: equip.AdverbEntry[i].Lv, + AttrName: attrlibrarys[v].Attrkey, + BaseValue: attrlibrarys[v].Attrvar, + 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) diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 2222624e6..ee603a3e4 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -390,10 +390,12 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte num = int64(v.Amount) + int64(leftnum) if num < 0 { leftnum += int64(v.Amount) + v.Change = -1 * int32(v.Amount) v.Amount = 0 del = append(del, v) } else if num > 0 && num < int64(v.Amount) { leftnum = 0 + v.Change = int32(num) - int32(v.Amount) v.Amount = uint32(num) update = append(update, v) break @@ -401,6 +403,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte if conf.UpperLimit > 0 { if num <= int64(conf.UpperLimit) { leftnum = 0 + v.Change = int32(num) - int32(v.Amount) v.Amount = uint32(num) update = append(update, v) break @@ -413,6 +416,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte } } else { leftnum = 0 + v.Change = int32(num) - int32(v.Amount) v.Amount = uint32(num) update = append(update, v) } @@ -434,6 +438,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte GridId: primitive.NewObjectID().Hex(), UId: uid, ItemId: itemId, + Change: int32(leftnum), Amount: uint32(leftnum), CTime: configure.Now().Unix(), IsNewItem: isNew, @@ -451,6 +456,7 @@ func (this *ModelItemsComp) addItemToUserPack(uid string, items []*pb.DB_UserIte GridId: primitive.NewObjectID().Hex(), UId: uid, ItemId: itemId, + Change: int32(conf.UpperLimit), Amount: uint32(conf.UpperLimit), CTime: configure.Now().Unix(), IsNewItem: isNew, diff --git a/modules/items/module.go b/modules/items/module.go index 58cf03a3d..06c578421 100644 --- a/modules/items/module.go +++ b/modules/items/module.go @@ -34,19 +34,19 @@ type Items struct { configure *ConfigureComp } -//模块名称 +// 模块名称 func (this *Items) GetType() core.M_Modules { return comm.ModuleItems } -//模块初始化接口 注册用户创建角色事件 +// 模块初始化接口 注册用户创建角色事件 func (this *Items) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(base.IRPCXService) return } -//模块启动 +// 模块启动 func (this *Items) Start() (err error) { err = this.ModuleBase.Start() var module core.IModule @@ -58,7 +58,7 @@ func (this *Items) Start() (err error) { return } -//装备组件 +// 装备组件 func (this *Items) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) @@ -66,13 +66,13 @@ func (this *Items) OnInstallComp() { this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp) } -//Event------------------------------------------------------------------------------------------------------------ +// Event------------------------------------------------------------------------------------------------------------ func (this *Items) EventUserOffline(uid, sessionid string) { this.modelItems.BatchDelLists(uid) } -//IItems------------------------------------------------------------------------------------------------------------------------------- -///查询用户背包物品数量 +// IItems------------------------------------------------------------------------------------------------------------------------------- +// /查询用户背包物品数量 func (this *Items) QueryItemAmount(uId string, itemid string) (amount uint32) { defer this.Debugf("获取物品 uId:%s itemid:%s addnum:%d ", uId, itemid, amount) amount = 0 @@ -82,7 +82,7 @@ func (this *Items) QueryItemAmount(uId string, itemid string) (amount uint32) { return } -///查询用户背包多个物品数量 +// /查询用户背包多个物品数量 func (this *Items) QueryItemsAmount(uId string, itemid ...string) (result map[string]uint32) { result = this.modelItems.QueryUserPackItemsAmount(uId, itemid...) return @@ -124,7 +124,7 @@ func (this *Items) AddItemforGrid(session comm.IUserSession, gridid string, addn return } -///添加单个物品到背包 (可以加物品和减物品) +// /添加单个物品到背包 (可以加物品和减物品) func (this *Items) AddItem(session comm.IUserSession, itemid string, addnum int32, bPush bool) (errdata *pb.ErrorData) { var ( err error @@ -161,15 +161,17 @@ func (this *Items) AddItem(session comm.IUserSession, itemid string, addnum int3 return } -///添加多个物品到背包 (可以加物品和减物品) -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 ( - tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) - err error + tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0) + _change []*pb.DB_UserItemData + err error ) 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) if err == ItemNotEnoughError { errdata = &pb.ErrorData{ @@ -198,8 +200,16 @@ func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, b } return } - if len(change) > 0 && bPush { - this.itemsChangePush(session, change) //推送道具背包变化 + for _, v := range _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 { if v > 0 { @@ -213,12 +223,12 @@ func (this *Items) AddItems(session comm.IUserSession, items map[string]int32, b return } -//使用物品 +// 使用物品 func (this *Items) UseItem(session comm.IUserSession, gid string, amount int32, slt int32) (errdata *pb.ErrorData) { return this.modelItems.useitem(session, gid, amount, slt) } -//清理背包 +// 清理背包 func (this *Items) CleanItems(session comm.IUserSession) (errdata *pb.ErrorData) { var ( err error @@ -236,19 +246,19 @@ func (this *Items) CleanItems(session comm.IUserSession) (errdata *pb.ErrorData) return } -//购买门票道具 +// 购买门票道具 func (this *Items) BuyUnifiedTicket(session comm.IUserSession, buynum int32) (errdata *pb.ErrorData) { _, errdata = this.modelItems.buyTicket(session, buynum) return } -//回复道具 +// 回复道具 func (this *Items) RecoverTicket(session comm.IUserSession) (errdata *pb.ErrorData) { errdata = this.modelItems.recoverTicket(session) return } -//出售道具 +// 出售道具 func (this *Items) SellItem(session comm.IUserSession, items map[string]int32, bPush bool) (errdata *pb.ErrorData, atno []*pb.UserAtno) { var ( grids []string = make([]string, 0, len(items)) @@ -334,8 +344,8 @@ func (this *Items) SellItem(session comm.IUserSession, items map[string]int32, b return } -//Evens-------------------------------------------------------------------------------------------------------------------------------- -//推送道具变化消息 +// Evens-------------------------------------------------------------------------------------------------------------------------------- +// 推送道具变化消息 func (this *Items) itemsChangePush(session comm.IUserSession, items []*pb.DB_UserItemData) (err error) { session.SendMsg(string(this.GetType()), "change", &pb.ItemsChangePush{Grids: items}) return diff --git a/modules/modulebase.go b/modules/modulebase.go index 5306295a8..957f1ef16 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -684,16 +684,10 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea } } if len(items) > 0 { //道具资源 - addItems, code := this.ModuleItems.AddItems(session, items, bPush) - this.Debugf("发放道具资源: %v [%v]", items, code) - for _, v := range addItems { - atno = append(atno, &pb.UserAtno{ - A: "item", - T: v.ItemId, - N: int32(len(items)), - O: v.GridId, - }) - } + _atno, code := this.ModuleItems.AddItems(session, items, bPush) + errdata = code + atno = append(atno, _atno...) + this.Debugf("发放道具资源: %v [%v]", _atno, code) } if len(heros) > 0 { //卡片资源 hero, atn, code := this.ModuleHero.CreateRepeatHeros(session, heros, bPush) diff --git a/pb/hero_db.pb.go b/pb/hero_db.pb.go index 2683e9124..c404896a5 100644 --- a/pb/hero_db.pb.go +++ b/pb/hero_db.pb.go @@ -321,8 +321,8 @@ type DBHeroRecord struct { 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 - Star4 int32 `protobuf:"varint,3,opt,name=star4,proto3" json:"star4"` // 4星保底 -- 新版抽卡废弃字段 - Star5 int32 `protobuf:"varint,4,opt,name=star5,proto3" json:"star5"` // 5星保底 -- 新版抽卡废弃字段 + Star4 int32 `protobuf:"varint,3,opt,name=star4,proto3" json:"star4"` // 4星保底 + Star5 int32 `protobuf:"varint,4,opt,name=star5,proto3" json:"star5"` // 5星保底 Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime"` // 修改时间 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 累计抽卡次数 @@ -334,9 +334,6 @@ type DBHeroRecord struct { 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星英雄 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() { @@ -476,27 +473,6 @@ func (x *DBHeroRecord) GetRace() map[int32]int32 { 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 { 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, 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, 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, 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, @@ -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, 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, - 0x65, 0x12, 0x31, 0x0a, 0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x34, 0x18, 0x10, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x2e, 0x42, 0x61, 0x6f, 0x64, 0x69, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x62, 0x61, - 0x6f, 0x64, 0x69, 0x34, 0x12, 0x31, 0x0a, 0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x18, 0x11, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x2e, 0x42, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x62, 0x61, 0x6f, 0x64, 0x69, 0x35, 0x12, 0x2e, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x35, 0x48, 0x65, - 0x72, 0x6f, 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, 0x1a, 0x37, 0x0a, 0x09, 0x52, 0x61, 0x63, 0x65, 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, 0x1a, 0x39, 0x0a, 0x0b, - 0x42, 0x61, 0x6f, 0x64, 0x69, 0x34, 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, 0x1a, 0x39, 0x0a, 0x0b, 0x42, 0x61, 0x6f, 0x64, 0x69, - 0x35, 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, 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, + 0x65, 0x1a, 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, + 0x3c, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x35, 0x48, 0x65, 0x72, 0x6f, 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, 0x1a, 0x37, 0x0a, + 0x09, 0x52, 0x61, 0x63, 0x65, 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 ( @@ -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_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_hero_hero_db_proto_goTypes = []interface{}{ (HeroType)(0), // 0: HeroType (*DBHero)(nil), // 1: DBHero @@ -767,36 +722,30 @@ var file_hero_hero_db_proto_goTypes = []interface{}{ nil, // 10: DBHeroRecord.ConditionEntry nil, // 11: DBHeroRecord.Star5HeroEntry nil, // 12: DBHeroRecord.RaceEntry - nil, // 13: DBHeroRecord.Baodi4Entry - nil, // 14: DBHeroRecord.Baodi5Entry - nil, // 15: DBHeroRecord.CountEntry - nil, // 16: DBHeroTalent.TalentEntry - (*SkillData)(nil), // 17: SkillData - (*DB_EquipmentSuit)(nil), // 18: DB_EquipmentSuit + nil, // 13: DBHeroTalent.TalentEntry + (*SkillData)(nil), // 14: SkillData + (*DB_EquipmentSuit)(nil), // 15: DB_EquipmentSuit } 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 5, // 2: DBHero.addProperty:type_name -> DBHero.AddPropertyEntry 6, // 3: DBHero.juexProperty:type_name -> DBHero.JuexPropertyEntry 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 - 17, // 7: DBHero.equipSkill:type_name -> SkillData + 14, // 7: DBHero.equipSkill:type_name -> SkillData 8, // 8: DBHero.horoscopeProperty:type_name -> DBHero.HoroscopePropertyEntry 9, // 9: DBHero.fetters:type_name -> DBHero.FettersEntry 10, // 10: DBHeroRecord.condition:type_name -> DBHeroRecord.ConditionEntry 11, // 11: DBHeroRecord.star5Hero:type_name -> DBHeroRecord.Star5HeroEntry 12, // 12: DBHeroRecord.race:type_name -> DBHeroRecord.RaceEntry - 13, // 13: DBHeroRecord.baodi4:type_name -> DBHeroRecord.Baodi4Entry - 14, // 14: DBHeroRecord.baodi5:type_name -> DBHeroRecord.Baodi5Entry - 15, // 15: DBHeroRecord.count:type_name -> DBHeroRecord.CountEntry - 16, // 16: DBHeroTalent.talent:type_name -> DBHeroTalent.TalentEntry - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 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 + 13, // 13: DBHeroTalent.talent:type_name -> DBHeroTalent.TalentEntry + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_hero_hero_db_proto_init() } @@ -850,7 +799,7 @@ func file_hero_hero_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hero_hero_db_proto_rawDesc, NumEnums: 1, - NumMessages: 16, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/items_db.pb.go b/pb/items_db.pb.go index de5a87120..1530730aa 100644 --- a/pb/items_db.pb.go +++ b/pb/items_db.pb.go @@ -28,12 +28,13 @@ type DB_UserItemData struct { GridId string `protobuf:"bytes,1,opt,name=gridId,proto3" json:"gridId" bson:"_id"` // 背包格子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"` // 存放物品的数量 - CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` // 物品获取时间 - ETime int64 `protobuf:"varint,6,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` // 物品过期时间 - IsNewItem bool `protobuf:"varint,7,opt,name=isNewItem,proto3" json:"isNewItem" bson:"isNewItem"` // 是否是新的 - Lastopt int64 `protobuf:"varint,8,opt,name=lastopt,proto3" json:"lastopt" bson:"lastopt"` // 最后操作时间 + Change int32 `protobuf:"varint,5,opt,name=change,proto3" json:"change" bson:"change"` // 最后一次变化量 + CTime int64 `protobuf:"varint,6,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` // 物品获取时间 + ETime int64 `protobuf:"varint,7,opt,name=eTime,proto3" json:"eTime" bson:"eTime"` // 物品过期时间 + 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() { @@ -96,6 +97,13 @@ func (x *DB_UserItemData) GetAmount() uint32 { return 0 } +func (x *DB_UserItemData) GetChange() int32 { + if x != nil { + return x.Change + } + return 0 +} + func (x *DB_UserItemData) GetCTime() int64 { if x != nil { return x.CTime @@ -128,21 +136,22 @@ var File_items_items_db_proto protoreflect.FileDescriptor var file_items_items_db_proto_rawDesc = []byte{ 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, 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, 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, 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, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, - 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70, 0x74, 0x18, 0x08, 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, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x4e, 0x65, + 0x77, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4e, + 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x6f, 0x70, + 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 (