上传资源更改消息推送
This commit is contained in:
parent
f47005cc18
commit
2071a13416
@ -23,7 +23,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ItemsGetlistReq)
|
|||||||
tempgrids []*pb.DB_UserItemData
|
tempgrids []*pb.DB_UserItemData
|
||||||
grids []*pb.DB_UserItemData
|
grids []*pb.DB_UserItemData
|
||||||
modifys []*pb.DB_UserItemData
|
modifys []*pb.DB_UserItemData
|
||||||
dels []string
|
dels []*pb.DB_UserItemData
|
||||||
)
|
)
|
||||||
defer func() {
|
defer func() {
|
||||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ItemsGetlistResp{Grids: grids})
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ItemsGetlistResp{Grids: grids})
|
||||||
@ -46,12 +46,12 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ItemsGetlistReq)
|
|||||||
} else {
|
} else {
|
||||||
tempgrids = this.module.configure.GetPackItemByType(items, req.IType)
|
tempgrids = this.module.configure.GetPackItemByType(items, req.IType)
|
||||||
modifys = make([]*pb.DB_UserItemData, 0, len(tempgrids))
|
modifys = make([]*pb.DB_UserItemData, 0, len(tempgrids))
|
||||||
dels = make([]string, 0, len(tempgrids))
|
dels = make([]*pb.DB_UserItemData, 0, len(tempgrids))
|
||||||
grids = make([]*pb.DB_UserItemData, 0, len(items))
|
grids = make([]*pb.DB_UserItemData, 0, len(items))
|
||||||
nt = time.Now().Unix()
|
nt = time.Now().Unix()
|
||||||
for _, v := range tempgrids {
|
for _, v := range tempgrids {
|
||||||
if v.ETime > 0 && v.ETime < nt { //已经过期
|
if v.ETime > 0 && v.ETime < nt { //已经过期
|
||||||
dels = append(dels, v.GridId)
|
dels = append(dels, v)
|
||||||
} else {
|
} else {
|
||||||
grids = append(grids, v)
|
grids = append(grids, v)
|
||||||
if v.IsNewItem {
|
if v.IsNewItem {
|
||||||
|
@ -76,7 +76,11 @@ func (this *ModelItemsComp) Pack_UpdateUserPack(uId string, itmes ...*pb.DB_User
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新用户的背包信息
|
//更新用户的背包信息
|
||||||
func (this *ModelItemsComp) Pack_DeleteUserPack(uId string, gridIds ...string) (err error) {
|
func (this *ModelItemsComp) Pack_DeleteUserPack(uId string, itmes ...*pb.DB_UserItemData) (err error) {
|
||||||
|
gridIds := make([]string, len(itmes))
|
||||||
|
for i, v := range itmes {
|
||||||
|
gridIds[i] = v.GridId
|
||||||
|
}
|
||||||
if err = this.DelListlds(uId, gridIds...); err != nil {
|
if err = this.DelListlds(uId, gridIds...); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
@ -110,8 +114,9 @@ func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, add
|
|||||||
var (
|
var (
|
||||||
itmes []*pb.DB_UserItemData
|
itmes []*pb.DB_UserItemData
|
||||||
add []*pb.DB_UserItemData
|
add []*pb.DB_UserItemData
|
||||||
del []string
|
del []*pb.DB_UserItemData
|
||||||
update []*pb.DB_UserItemData
|
update []*pb.DB_UserItemData
|
||||||
|
change []*pb.DB_UserItemData
|
||||||
leftnum int64
|
leftnum int64
|
||||||
)
|
)
|
||||||
if addnum == 0 {
|
if addnum == 0 {
|
||||||
@ -121,6 +126,7 @@ func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, add
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
change = make([]*pb.DB_UserItemData, len(itmes))
|
||||||
add, update, del, leftnum = this.pack_addItemToUserPack(itmes, itemId, addnum)
|
add, update, del, leftnum = this.pack_addItemToUserPack(itmes, itemId, addnum)
|
||||||
if leftnum < 0 {
|
if leftnum < 0 {
|
||||||
err = ItemNotEnoughError
|
err = ItemNotEnoughError
|
||||||
@ -134,20 +140,22 @@ func (this *ModelItemsComp) Pack_AddItemToUserPack(uId string, itemId int32, add
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
change = append(change, add...)
|
||||||
}
|
}
|
||||||
if len(del) > 0 {
|
if len(del) > 0 {
|
||||||
if err = this.Pack_DeleteUserPack(uId, del...); err != nil {
|
if err = this.Pack_DeleteUserPack(uId, del...); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
change = append(change, del...)
|
||||||
}
|
}
|
||||||
if len(update) > 0 {
|
if len(update) > 0 {
|
||||||
if err = this.Pack_UpdateUserPack(uId, update...); err != nil {
|
if err = this.Pack_UpdateUserPack(uId, update...); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
change = append(change, update...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +164,7 @@ func (this *ModelItemsComp) Pack_AddItemsToUserPack(uId string, items map[int32]
|
|||||||
var (
|
var (
|
||||||
itmes []*pb.DB_UserItemData
|
itmes []*pb.DB_UserItemData
|
||||||
add []*pb.DB_UserItemData
|
add []*pb.DB_UserItemData
|
||||||
del []string
|
del []*pb.DB_UserItemData
|
||||||
update []*pb.DB_UserItemData
|
update []*pb.DB_UserItemData
|
||||||
leftnum int64
|
leftnum int64
|
||||||
)
|
)
|
||||||
@ -237,7 +245,7 @@ func (this *ModelItemsComp) Pack_AddItemToUserPackByGrid(uId string, gridid stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
///添加移除物品到用户背包
|
///添加移除物品到用户背包
|
||||||
func (this *ModelItemsComp) pack_addItemToUserPack(items []*pb.DB_UserItemData, itemId int32, addnum int32) (add, update []*pb.DB_UserItemData, del []string, leftnum int64) {
|
func (this *ModelItemsComp) pack_addItemToUserPack(items []*pb.DB_UserItemData, itemId int32, addnum int32) (add, update, del []*pb.DB_UserItemData, leftnum int64) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
conf *cfg.Game_itemData
|
conf *cfg.Game_itemData
|
||||||
@ -253,7 +261,7 @@ func (this *ModelItemsComp) pack_addItemToUserPack(items []*pb.DB_UserItemData,
|
|||||||
isNew = true
|
isNew = true
|
||||||
leftnum = int64(addnum)
|
leftnum = int64(addnum)
|
||||||
add = make([]*pb.DB_UserItemData, 0)
|
add = make([]*pb.DB_UserItemData, 0)
|
||||||
del = make([]string, 0)
|
del = make([]*pb.DB_UserItemData, 0)
|
||||||
update = make([]*pb.DB_UserItemData, 0)
|
update = make([]*pb.DB_UserItemData, 0)
|
||||||
|
|
||||||
for _, v := range items {
|
for _, v := range items {
|
||||||
@ -263,7 +271,7 @@ func (this *ModelItemsComp) pack_addItemToUserPack(items []*pb.DB_UserItemData,
|
|||||||
if num < 0 {
|
if num < 0 {
|
||||||
leftnum += int64(v.Amount)
|
leftnum += int64(v.Amount)
|
||||||
v.Amount = 0
|
v.Amount = 0
|
||||||
del = append(del, v.GridId)
|
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.Amount = uint32(num)
|
v.Amount = uint32(num)
|
||||||
@ -285,7 +293,7 @@ func (this *ModelItemsComp) pack_addItemToUserPack(items []*pb.DB_UserItemData,
|
|||||||
} else if num == 0 {
|
} else if num == 0 {
|
||||||
leftnum = 0
|
leftnum = 0
|
||||||
v.Amount = 0
|
v.Amount = 0
|
||||||
del = append(del, v.GridId)
|
del = append(del, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,9 +63,12 @@ func (this *Items) QueryItemsAmount(source *comm.ModuleCallSource, uId string, i
|
|||||||
|
|
||||||
///添加单个物品到背包 (可以加物品和减物品)
|
///添加单个物品到背包 (可以加物品和减物品)
|
||||||
func (this *Items) AddItem(source *comm.ModuleCallSource, uId string, itemid, addnum int32) (code pb.ErrorCode) {
|
func (this *Items) AddItem(source *comm.ModuleCallSource, uId string, itemid, addnum int32) (code pb.ErrorCode) {
|
||||||
var err error
|
var (
|
||||||
|
err error
|
||||||
|
change []*pb.DB_UserItemData
|
||||||
|
)
|
||||||
defer this.Debugf("给用户添加物品 uId:%s itemid:%d addnum:%d issucc:%v", uId, itemid, addnum, err == nil)
|
defer this.Debugf("给用户添加物品 uId:%s itemid:%d addnum:%d issucc:%v", uId, itemid, addnum, err == nil)
|
||||||
if err = this.modelItems.Pack_AddItemToUserPack(uId, itemid, addnum); err != nil {
|
if change, err = this.modelItems.Pack_AddItemToUserPack(uId, itemid, addnum); err != nil {
|
||||||
this.Errorf("给用户添加物品 uId:%s itemid:%d addnum:%d err:%v", uId, itemid, addnum, err)
|
this.Errorf("给用户添加物品 uId:%s itemid:%d addnum:%d err:%v", uId, itemid, addnum, err)
|
||||||
if err == ItemNotEnoughError {
|
if err == ItemNotEnoughError {
|
||||||
code = pb.ErrorCode_ItemsNoEnough
|
code = pb.ErrorCode_ItemsNoEnough
|
||||||
@ -74,15 +77,21 @@ func (this *Items) AddItem(source *comm.ModuleCallSource, uId string, itemid, ad
|
|||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_Unknown
|
code = pb.ErrorCode_Unknown
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
this.itemsChangePush(uId, change) //推送道具背包变化
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///添加多个物品到背包 (可以加物品和减物品)
|
///添加多个物品到背包 (可以加物品和减物品)
|
||||||
func (this *Items) AddItems(source *comm.ModuleCallSource, uId string, items map[int32]int32) (code pb.ErrorCode) {
|
func (this *Items) AddItems(source *comm.ModuleCallSource, uId string, items map[int32]int32) (code pb.ErrorCode) {
|
||||||
var err error
|
var (
|
||||||
|
err error
|
||||||
|
change []*pb.DB_UserItemData
|
||||||
|
)
|
||||||
|
|
||||||
defer this.Debugf("给用户添加物品 uId:%s items:%d items:%v", uId, items, err == nil)
|
defer this.Debugf("给用户添加物品 uId:%s items:%d items:%v", uId, items, err == nil)
|
||||||
if err = this.modelItems.Pack_AddItemsToUserPack(uId, items); err != nil {
|
if change, err = this.modelItems.Pack_AddItemsToUserPack(uId, items); err != nil {
|
||||||
this.Errorf("给用户添加物品 uId:%s items:%d err:%v", uId, items, err)
|
this.Errorf("给用户添加物品 uId:%s items:%d err:%v", uId, items, err)
|
||||||
if err == ItemNotEnoughError {
|
if err == ItemNotEnoughError {
|
||||||
code = pb.ErrorCode_ItemsNoEnough
|
code = pb.ErrorCode_ItemsNoEnough
|
||||||
@ -91,8 +100,20 @@ func (this *Items) AddItems(source *comm.ModuleCallSource, uId string, items map
|
|||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_Unknown
|
code = pb.ErrorCode_Unknown
|
||||||
}
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(change) > 0 {
|
||||||
|
this.itemsChangePush(uId, change) //推送道具背包变化
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//Evens--------------------------------------------------------------------------------------------------------------------------------
|
//Evens--------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
//推送道具变化消息
|
||||||
|
func (this *Items) itemsChangePush(uid string, items []*pb.DB_UserItemData) (err error) {
|
||||||
|
if session, ok := this.GetUserSession(uid); ok {
|
||||||
|
session.SendMsg(string(this.GetType()), "change", &pb.ItemsChangePush{Grids: items})
|
||||||
|
err = session.Push()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -116,6 +116,54 @@ func (x *ItemsGetlistResp) GetGrids() []*DB_UserItemData {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//背包变化推送
|
||||||
|
type ItemsChangePush struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Grids []*DB_UserItemData `protobuf:"bytes,1,rep,name=Grids,proto3" json:"Grids"` //变化数据
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ItemsChangePush) Reset() {
|
||||||
|
*x = ItemsChangePush{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_items_items_msg_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ItemsChangePush) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ItemsChangePush) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ItemsChangePush) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_items_items_msg_proto_msgTypes[2]
|
||||||
|
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 ItemsChangePush.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ItemsChangePush) Descriptor() ([]byte, []int) {
|
||||||
|
return file_items_items_msg_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ItemsChangePush) GetGrids() []*DB_UserItemData {
|
||||||
|
if x != nil {
|
||||||
|
return x.Grids
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
//使用物品请求
|
//使用物品请求
|
||||||
type ItemsUseItemReq struct {
|
type ItemsUseItemReq struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -130,7 +178,7 @@ type ItemsUseItemReq struct {
|
|||||||
func (x *ItemsUseItemReq) Reset() {
|
func (x *ItemsUseItemReq) Reset() {
|
||||||
*x = ItemsUseItemReq{}
|
*x = ItemsUseItemReq{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[2]
|
mi := &file_items_items_msg_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -143,7 +191,7 @@ func (x *ItemsUseItemReq) String() string {
|
|||||||
func (*ItemsUseItemReq) ProtoMessage() {}
|
func (*ItemsUseItemReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ItemsUseItemReq) ProtoReflect() protoreflect.Message {
|
func (x *ItemsUseItemReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[2]
|
mi := &file_items_items_msg_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -156,7 +204,7 @@ func (x *ItemsUseItemReq) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ItemsUseItemReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ItemsUseItemReq.ProtoReflect.Descriptor instead.
|
||||||
func (*ItemsUseItemReq) Descriptor() ([]byte, []int) {
|
func (*ItemsUseItemReq) Descriptor() ([]byte, []int) {
|
||||||
return file_items_items_msg_proto_rawDescGZIP(), []int{2}
|
return file_items_items_msg_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ItemsUseItemReq) GetGridId() string {
|
func (x *ItemsUseItemReq) GetGridId() string {
|
||||||
@ -190,7 +238,7 @@ type ItemsUseItemResp struct {
|
|||||||
func (x *ItemsUseItemResp) Reset() {
|
func (x *ItemsUseItemResp) Reset() {
|
||||||
*x = ItemsUseItemResp{}
|
*x = ItemsUseItemResp{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[3]
|
mi := &file_items_items_msg_proto_msgTypes[4]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -203,7 +251,7 @@ func (x *ItemsUseItemResp) String() string {
|
|||||||
func (*ItemsUseItemResp) ProtoMessage() {}
|
func (*ItemsUseItemResp) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ItemsUseItemResp) ProtoReflect() protoreflect.Message {
|
func (x *ItemsUseItemResp) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[3]
|
mi := &file_items_items_msg_proto_msgTypes[4]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -216,7 +264,7 @@ func (x *ItemsUseItemResp) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ItemsUseItemResp.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ItemsUseItemResp.ProtoReflect.Descriptor instead.
|
||||||
func (*ItemsUseItemResp) Descriptor() ([]byte, []int) {
|
func (*ItemsUseItemResp) Descriptor() ([]byte, []int) {
|
||||||
return file_items_items_msg_proto_rawDescGZIP(), []int{3}
|
return file_items_items_msg_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
//出售道具请求sailitem
|
//出售道具请求sailitem
|
||||||
@ -233,7 +281,7 @@ type ItemsSellItemReq struct {
|
|||||||
func (x *ItemsSellItemReq) Reset() {
|
func (x *ItemsSellItemReq) Reset() {
|
||||||
*x = ItemsSellItemReq{}
|
*x = ItemsSellItemReq{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[4]
|
mi := &file_items_items_msg_proto_msgTypes[5]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -246,7 +294,7 @@ func (x *ItemsSellItemReq) String() string {
|
|||||||
func (*ItemsSellItemReq) ProtoMessage() {}
|
func (*ItemsSellItemReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ItemsSellItemReq) ProtoReflect() protoreflect.Message {
|
func (x *ItemsSellItemReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[4]
|
mi := &file_items_items_msg_proto_msgTypes[5]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -259,7 +307,7 @@ func (x *ItemsSellItemReq) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ItemsSellItemReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ItemsSellItemReq.ProtoReflect.Descriptor instead.
|
||||||
func (*ItemsSellItemReq) Descriptor() ([]byte, []int) {
|
func (*ItemsSellItemReq) Descriptor() ([]byte, []int) {
|
||||||
return file_items_items_msg_proto_rawDescGZIP(), []int{4}
|
return file_items_items_msg_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ItemsSellItemReq) GetGridId() string {
|
func (x *ItemsSellItemReq) GetGridId() string {
|
||||||
@ -293,7 +341,7 @@ type ItemsSellItemResp struct {
|
|||||||
func (x *ItemsSellItemResp) Reset() {
|
func (x *ItemsSellItemResp) Reset() {
|
||||||
*x = ItemsSellItemResp{}
|
*x = ItemsSellItemResp{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[5]
|
mi := &file_items_items_msg_proto_msgTypes[6]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -306,7 +354,7 @@ func (x *ItemsSellItemResp) String() string {
|
|||||||
func (*ItemsSellItemResp) ProtoMessage() {}
|
func (*ItemsSellItemResp) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ItemsSellItemResp) ProtoReflect() protoreflect.Message {
|
func (x *ItemsSellItemResp) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_items_items_msg_proto_msgTypes[5]
|
mi := &file_items_items_msg_proto_msgTypes[6]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -319,7 +367,7 @@ func (x *ItemsSellItemResp) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ItemsSellItemResp.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ItemsSellItemResp.ProtoReflect.Descriptor instead.
|
||||||
func (*ItemsSellItemResp) Descriptor() ([]byte, []int) {
|
func (*ItemsSellItemResp) Descriptor() ([]byte, []int) {
|
||||||
return file_items_items_msg_proto_rawDescGZIP(), []int{5}
|
return file_items_items_msg_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
var File_items_items_msg_proto protoreflect.FileDescriptor
|
var File_items_items_msg_proto protoreflect.FileDescriptor
|
||||||
@ -334,22 +382,25 @@ var file_items_items_msg_proto_rawDesc = []byte{
|
|||||||
0x65, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x05, 0x47, 0x72,
|
0x65, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x05, 0x47, 0x72,
|
||||||
0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x5f, 0x55,
|
0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x5f, 0x55,
|
||||||
0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x47, 0x72, 0x69,
|
0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x47, 0x72, 0x69,
|
||||||
0x64, 0x73, 0x22, 0x59, 0x0a, 0x0f, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x49, 0x74,
|
0x64, 0x73, 0x22, 0x39, 0x0a, 0x0f, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67,
|
||||||
0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18,
|
0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x05, 0x47, 0x72, 0x69, 0x64, 0x73, 0x18, 0x01,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x5f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74,
|
||||||
0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49,
|
0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x47, 0x72, 0x69, 0x64, 0x73, 0x22, 0x59, 0x0a,
|
||||||
0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
0x0f, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x12, 0x0a,
|
0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73,
|
0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d,
|
||||||
0x70, 0x22, 0x5a, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74,
|
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
|
||||||
0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18,
|
0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a,
|
0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d,
|
||||||
0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49,
|
0x73, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5a, 0x0a, 0x10,
|
||||||
0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
0x49, 0x74, 0x65, 0x6d, 0x73, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x0a,
|
0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65,
|
0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d,
|
||||||
0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
|
||||||
0x6f, 0x33,
|
0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
|
||||||
|
0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d,
|
||||||
|
0x73, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a,
|
||||||
|
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -364,23 +415,25 @@ func file_items_items_msg_proto_rawDescGZIP() []byte {
|
|||||||
return file_items_items_msg_proto_rawDescData
|
return file_items_items_msg_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_items_items_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_items_items_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||||
var file_items_items_msg_proto_goTypes = []interface{}{
|
var file_items_items_msg_proto_goTypes = []interface{}{
|
||||||
(*ItemsGetlistReq)(nil), // 0: ItemsGetlistReq
|
(*ItemsGetlistReq)(nil), // 0: ItemsGetlistReq
|
||||||
(*ItemsGetlistResp)(nil), // 1: ItemsGetlistResp
|
(*ItemsGetlistResp)(nil), // 1: ItemsGetlistResp
|
||||||
(*ItemsUseItemReq)(nil), // 2: ItemsUseItemReq
|
(*ItemsChangePush)(nil), // 2: ItemsChangePush
|
||||||
(*ItemsUseItemResp)(nil), // 3: ItemsUseItemResp
|
(*ItemsUseItemReq)(nil), // 3: ItemsUseItemReq
|
||||||
(*ItemsSellItemReq)(nil), // 4: ItemsSellItemReq
|
(*ItemsUseItemResp)(nil), // 4: ItemsUseItemResp
|
||||||
(*ItemsSellItemResp)(nil), // 5: ItemsSellItemResp
|
(*ItemsSellItemReq)(nil), // 5: ItemsSellItemReq
|
||||||
(*DB_UserItemData)(nil), // 6: DB_UserItemData
|
(*ItemsSellItemResp)(nil), // 6: ItemsSellItemResp
|
||||||
|
(*DB_UserItemData)(nil), // 7: DB_UserItemData
|
||||||
}
|
}
|
||||||
var file_items_items_msg_proto_depIdxs = []int32{
|
var file_items_items_msg_proto_depIdxs = []int32{
|
||||||
6, // 0: ItemsGetlistResp.Grids:type_name -> DB_UserItemData
|
7, // 0: ItemsGetlistResp.Grids:type_name -> DB_UserItemData
|
||||||
1, // [1:1] is the sub-list for method output_type
|
7, // 1: ItemsChangePush.Grids:type_name -> DB_UserItemData
|
||||||
1, // [1:1] is the sub-list for method input_type
|
2, // [2:2] is the sub-list for method output_type
|
||||||
1, // [1:1] is the sub-list for extension type_name
|
2, // [2:2] is the sub-list for method input_type
|
||||||
1, // [1:1] is the sub-list for extension extendee
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
0, // [0:1] is the sub-list for field type_name
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_items_items_msg_proto_init() }
|
func init() { file_items_items_msg_proto_init() }
|
||||||
@ -415,7 +468,7 @@ func file_items_items_msg_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_items_items_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_items_items_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ItemsUseItemReq); i {
|
switch v := v.(*ItemsChangePush); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -427,7 +480,7 @@ func file_items_items_msg_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_items_items_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_items_items_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ItemsUseItemResp); i {
|
switch v := v.(*ItemsUseItemReq); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -439,7 +492,7 @@ func file_items_items_msg_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_items_items_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_items_items_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ItemsSellItemReq); i {
|
switch v := v.(*ItemsUseItemResp); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -451,6 +504,18 @@ func file_items_items_msg_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_items_items_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_items_items_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ItemsSellItemReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_items_items_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ItemsSellItemResp); i {
|
switch v := v.(*ItemsSellItemResp); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -469,7 +534,7 @@ func file_items_items_msg_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_items_items_msg_proto_rawDesc,
|
RawDescriptor: file_items_items_msg_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 6,
|
NumMessages: 7,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -12,6 +12,11 @@ message ItemsGetlistResp {
|
|||||||
repeated DB_UserItemData Grids = 1; //用户背包列表
|
repeated DB_UserItemData Grids = 1; //用户背包列表
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//背包变化推送
|
||||||
|
message ItemsChangePush {
|
||||||
|
repeated DB_UserItemData Grids = 1; //变化数据
|
||||||
|
}
|
||||||
|
|
||||||
//使用物品请求
|
//使用物品请求
|
||||||
message ItemsUseItemReq {
|
message ItemsUseItemReq {
|
||||||
string GridId = 1; //格子Id
|
string GridId = 1; //格子Id
|
||||||
|
Loading…
Reference in New Issue
Block a user