Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop

This commit is contained in:
sk 2024-07-01 18:43:26 +08:00
commit 808a2458fe
6 changed files with 239 additions and 137 deletions

View File

@ -89,11 +89,12 @@ func (OpResultCode) EnumDescriptor() ([]byte, []int) {
type SPacketID int32
const (
SPacketID_PACKET_BAG_ZERO SPacketID = 0 // 弃用消息号
SPacketID_PACKET_ALL_BAG_INFO SPacketID = 2530 //请求背包数据
SPacketID_PACKET_ALL_BAG_USE SPacketID = 2531 //使用背包道具
SPacketID_PACKET_SC_SYNCBAGDATA SPacketID = 2532 //背包数据更新
SPacketID_PACKET_ALL_BAG_END SPacketID = 2549 //最大消息号
SPacketID_PACKET_BAG_ZERO SPacketID = 0 // 弃用消息号
SPacketID_PACKET_ALL_BAG_INFO SPacketID = 2530 //请求背包数据
SPacketID_PACKET_ALL_BAG_USE SPacketID = 2531 //使用背包道具
SPacketID_PACKET_SC_SYNCBAGDATA SPacketID = 2532 //背包数据更新
SPacketID_PACKET_SC_ITEM_EXCHANGE_RES SPacketID = 2533 //背包道具兑换返回
SPacketID_PACKET_ALL_BAG_END SPacketID = 2549 //最大消息号
//3000~3099
SPacketID_PACKET_PropExchange SPacketID = 3000 // 道具兑换
SPacketID_PACKET_ExchangeList SPacketID = 3001 // 兑换列表
@ -106,18 +107,20 @@ var (
2530: "PACKET_ALL_BAG_INFO",
2531: "PACKET_ALL_BAG_USE",
2532: "PACKET_SC_SYNCBAGDATA",
2533: "PACKET_SC_ITEM_EXCHANGE_RES",
2549: "PACKET_ALL_BAG_END",
3000: "PACKET_PropExchange",
3001: "PACKET_ExchangeList",
}
SPacketID_value = map[string]int32{
"PACKET_BAG_ZERO": 0,
"PACKET_ALL_BAG_INFO": 2530,
"PACKET_ALL_BAG_USE": 2531,
"PACKET_SC_SYNCBAGDATA": 2532,
"PACKET_ALL_BAG_END": 2549,
"PACKET_PropExchange": 3000,
"PACKET_ExchangeList": 3001,
"PACKET_BAG_ZERO": 0,
"PACKET_ALL_BAG_INFO": 2530,
"PACKET_ALL_BAG_USE": 2531,
"PACKET_SC_SYNCBAGDATA": 2532,
"PACKET_SC_ITEM_EXCHANGE_RES": 2533,
"PACKET_ALL_BAG_END": 2549,
"PACKET_PropExchange": 3000,
"PACKET_ExchangeList": 3001,
}
)
@ -532,6 +535,55 @@ func (x *SCUpBagInfo) GetInfos() []*ItemInfo {
return nil
}
//背包使用兑换返回结果
//PACKET_SC_ITEM_EXCHANGE_RES
type SCItemExChangeRes struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RetCode OpResultCode `protobuf:"varint,1,opt,name=RetCode,proto3,enum=bag.OpResultCode" json:"RetCode,omitempty"`
}
func (x *SCItemExChangeRes) Reset() {
*x = SCItemExChangeRes{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCItemExChangeRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCItemExChangeRes) ProtoMessage() {}
func (x *SCItemExChangeRes) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[5]
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 SCItemExChangeRes.ProtoReflect.Descriptor instead.
func (*SCItemExChangeRes) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{5}
}
func (x *SCItemExChangeRes) GetRetCode() OpResultCode {
if x != nil {
return x.RetCode
}
return OpResultCode_OPRC_Sucess
}
//PACKET_SC_SYNCBAGDATA
type SCSyncBagData struct {
state protoimpl.MessageState
@ -544,7 +596,7 @@ type SCSyncBagData struct {
func (x *SCSyncBagData) Reset() {
*x = SCSyncBagData{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[5]
mi := &file_bag_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -557,7 +609,7 @@ func (x *SCSyncBagData) String() string {
func (*SCSyncBagData) ProtoMessage() {}
func (x *SCSyncBagData) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[5]
mi := &file_bag_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -570,7 +622,7 @@ func (x *SCSyncBagData) ProtoReflect() protoreflect.Message {
// Deprecated: Use SCSyncBagData.ProtoReflect.Descriptor instead.
func (*SCSyncBagData) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{5}
return file_bag_proto_rawDescGZIP(), []int{6}
}
func (x *SCSyncBagData) GetInfos() []*ItemInfo {
@ -592,7 +644,7 @@ type PropInfo struct {
func (x *PropInfo) Reset() {
*x = PropInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[6]
mi := &file_bag_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -605,7 +657,7 @@ func (x *PropInfo) String() string {
func (*PropInfo) ProtoMessage() {}
func (x *PropInfo) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[6]
mi := &file_bag_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -618,7 +670,7 @@ func (x *PropInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use PropInfo.ProtoReflect.Descriptor instead.
func (*PropInfo) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{6}
return file_bag_proto_rawDescGZIP(), []int{7}
}
func (x *PropInfo) GetItemId() int32 {
@ -647,7 +699,7 @@ type CSPropExchange struct {
func (x *CSPropExchange) Reset() {
*x = CSPropExchange{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[7]
mi := &file_bag_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -660,7 +712,7 @@ func (x *CSPropExchange) String() string {
func (*CSPropExchange) ProtoMessage() {}
func (x *CSPropExchange) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[7]
mi := &file_bag_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -673,7 +725,7 @@ func (x *CSPropExchange) ProtoReflect() protoreflect.Message {
// Deprecated: Use CSPropExchange.ProtoReflect.Descriptor instead.
func (*CSPropExchange) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{7}
return file_bag_proto_rawDescGZIP(), []int{8}
}
func (x *CSPropExchange) GetId() int32 {
@ -696,7 +748,7 @@ type SCPropExchange struct {
func (x *SCPropExchange) Reset() {
*x = SCPropExchange{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[8]
mi := &file_bag_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -709,7 +761,7 @@ func (x *SCPropExchange) String() string {
func (*SCPropExchange) ProtoMessage() {}
func (x *SCPropExchange) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[8]
mi := &file_bag_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -722,7 +774,7 @@ func (x *SCPropExchange) ProtoReflect() protoreflect.Message {
// Deprecated: Use SCPropExchange.ProtoReflect.Descriptor instead.
func (*SCPropExchange) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{8}
return file_bag_proto_rawDescGZIP(), []int{9}
}
func (x *SCPropExchange) GetRetCode() OpResultCode {
@ -759,7 +811,7 @@ type ExchangeInfo struct {
func (x *ExchangeInfo) Reset() {
*x = ExchangeInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[9]
mi := &file_bag_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -772,7 +824,7 @@ func (x *ExchangeInfo) String() string {
func (*ExchangeInfo) ProtoMessage() {}
func (x *ExchangeInfo) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[9]
mi := &file_bag_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -785,7 +837,7 @@ func (x *ExchangeInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExchangeInfo.ProtoReflect.Descriptor instead.
func (*ExchangeInfo) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{9}
return file_bag_proto_rawDescGZIP(), []int{10}
}
func (x *ExchangeInfo) GetId() int32 {
@ -821,7 +873,7 @@ type CSExchangeList struct {
func (x *CSExchangeList) Reset() {
*x = CSExchangeList{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[10]
mi := &file_bag_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -834,7 +886,7 @@ func (x *CSExchangeList) String() string {
func (*CSExchangeList) ProtoMessage() {}
func (x *CSExchangeList) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[10]
mi := &file_bag_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -847,7 +899,7 @@ func (x *CSExchangeList) ProtoReflect() protoreflect.Message {
// Deprecated: Use CSExchangeList.ProtoReflect.Descriptor instead.
func (*CSExchangeList) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{10}
return file_bag_proto_rawDescGZIP(), []int{11}
}
func (x *CSExchangeList) GetTp() int32 {
@ -869,7 +921,7 @@ type SCExchangeList struct {
func (x *SCExchangeList) Reset() {
*x = SCExchangeList{}
if protoimpl.UnsafeEnabled {
mi := &file_bag_proto_msgTypes[11]
mi := &file_bag_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -882,7 +934,7 @@ func (x *SCExchangeList) String() string {
func (*SCExchangeList) ProtoMessage() {}
func (x *SCExchangeList) ProtoReflect() protoreflect.Message {
mi := &file_bag_proto_msgTypes[11]
mi := &file_bag_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -895,7 +947,7 @@ func (x *SCExchangeList) ProtoReflect() protoreflect.Message {
// Deprecated: Use SCExchangeList.ProtoReflect.Descriptor instead.
func (*SCExchangeList) Descriptor() ([]byte, []int) {
return file_bag_proto_rawDescGZIP(), []int{11}
return file_bag_proto_rawDescGZIP(), []int{12}
}
func (x *SCExchangeList) GetInfos() []*ExchangeInfo {
@ -958,65 +1010,71 @@ var file_bag_proto_rawDesc = []byte{
0x18, 0x0a, 0x07, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
0x52, 0x07, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x49, 0x6e, 0x66,
0x6f, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x49,
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x34,
0x0a, 0x0d, 0x53, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12,
0x23, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d,
0x2e, 0x62, 0x61, 0x67, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49,
0x6e, 0x66, 0x6f, 0x73, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d,
0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e,
0x75, 0x6d, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x0e, 0x53, 0x43, 0x50, 0x72, 0x6f, 0x70, 0x45,
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x4f,
0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x52, 0x65, 0x6d,
0x61, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d,
0x2e, 0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x52,
0x65, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x78, 0x0a, 0x0c, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x09, 0x43, 0x6f,
0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x43, 0x6f,
0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x09, 0x47, 0x61, 0x69, 0x6e, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67,
0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x47, 0x61, 0x69, 0x6e, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0x49, 0x0a, 0x0e, 0x53, 0x43, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f,
0x73, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54,
0x70, 0x2a, 0x99, 0x01, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73,
0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x55, 0x73, 0x65, 0x55,
0x70, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x49, 0x64, 0x45, 0x72,
0x72, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x44, 0x62, 0x45, 0x72,
0x72, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x42, 0x61, 0x67, 0x46,
0x75, 0x6c, 0x6c, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f,
0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x52,
0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0x07, 0x2a, 0xbc, 0x01,
0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x13, 0x0a, 0x0f, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x42, 0x41, 0x47, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00,
0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42,
0x41, 0x47, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe2, 0x13, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42, 0x41, 0x47, 0x5f, 0x55, 0x53, 0x45,
0x10, 0xe3, 0x13, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
0x5f, 0x53, 0x59, 0x4e, 0x43, 0x42, 0x41, 0x47, 0x44, 0x41, 0x54, 0x41, 0x10, 0xe4, 0x13, 0x12,
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42, 0x41,
0x47, 0x5f, 0x45, 0x4e, 0x44, 0x10, 0xf5, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x50, 0x72, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10,
0xb8, 0x17, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x45, 0x78, 0x63,
0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xb9, 0x17, 0x42, 0x23, 0x5a, 0x21,
0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x62, 0x61,
0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x40,
0x0a, 0x11, 0x53, 0x43, 0x49, 0x74, 0x65, 0x6d, 0x45, 0x78, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x52, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65,
0x22, 0x34, 0x0a, 0x0d, 0x53, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x67, 0x44, 0x61, 0x74,
0x61, 0x12, 0x23, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x74,
0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x49, 0x74, 0x65,
0x6d, 0x4e, 0x75, 0x6d, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x50, 0x72, 0x6f, 0x70, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x0e, 0x53, 0x43, 0x50, 0x72, 0x6f,
0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x07, 0x52, 0x65, 0x74,
0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x67,
0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x52,
0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x52,
0x65, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x0b, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x78, 0x0a, 0x0c,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x09,
0x43, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x62, 0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09,
0x43, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x09, 0x47, 0x61, 0x69,
0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62,
0x61, 0x67, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x47, 0x61, 0x69,
0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x45, 0x78, 0x63, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0x49, 0x0a, 0x0e, 0x53, 0x43, 0x45, 0x78,
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x49, 0x6e,
0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x61, 0x67, 0x2e,
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e,
0x66, 0x6f, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x02, 0x54, 0x70, 0x2a, 0x99, 0x01, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63,
0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72,
0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x55, 0x73,
0x65, 0x55, 0x70, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x49, 0x64,
0x45, 0x72, 0x72, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x44, 0x62,
0x45, 0x72, 0x72, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x42, 0x61,
0x67, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x52, 0x43, 0x5f,
0x4e, 0x6f, 0x74, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x4f,
0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0x07, 0x2a,
0xde, 0x01, 0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x13, 0x0a,
0x0f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x42, 0x41, 0x47, 0x5f, 0x5a, 0x45, 0x52, 0x4f,
0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c, 0x4c,
0x5f, 0x42, 0x41, 0x47, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe2, 0x13, 0x12, 0x17, 0x0a, 0x12,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42, 0x41, 0x47, 0x5f, 0x55,
0x53, 0x45, 0x10, 0xe3, 0x13, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x53, 0x43, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x42, 0x41, 0x47, 0x44, 0x41, 0x54, 0x41, 0x10, 0xe4,
0x13, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x49,
0x54, 0x45, 0x4d, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x52, 0x45, 0x53,
0x10, 0xe5, 0x13, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x41, 0x4c,
0x4c, 0x5f, 0x42, 0x41, 0x47, 0x5f, 0x45, 0x4e, 0x44, 0x10, 0xf5, 0x13, 0x12, 0x18, 0x0a, 0x13,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x50, 0x72, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61,
0x6e, 0x67, 0x65, 0x10, 0xb8, 0x17, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xb9, 0x17,
0x42, 0x23, 0x5a, 0x21, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
0x6c, 0x2f, 0x62, 0x61, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1032,40 +1090,42 @@ func file_bag_proto_rawDescGZIP() []byte {
}
var file_bag_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_bag_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_bag_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_bag_proto_goTypes = []interface{}{
(OpResultCode)(0), // 0: bag.OpResultCode
(SPacketID)(0), // 1: bag.SPacketID
(*ItemInfo)(nil), // 2: bag.ItemInfo
(*CSBagInfo)(nil), // 3: bag.CSBagInfo
(*SCBagInfo)(nil), // 4: bag.SCBagInfo
(*CSUpBagInfo)(nil), // 5: bag.CSUpBagInfo
(*SCUpBagInfo)(nil), // 6: bag.SCUpBagInfo
(*SCSyncBagData)(nil), // 7: bag.SCSyncBagData
(*PropInfo)(nil), // 8: bag.PropInfo
(*CSPropExchange)(nil), // 9: bag.CSPropExchange
(*SCPropExchange)(nil), // 10: bag.SCPropExchange
(*ExchangeInfo)(nil), // 11: bag.ExchangeInfo
(*CSExchangeList)(nil), // 12: bag.CSExchangeList
(*SCExchangeList)(nil), // 13: bag.SCExchangeList
(OpResultCode)(0), // 0: bag.OpResultCode
(SPacketID)(0), // 1: bag.SPacketID
(*ItemInfo)(nil), // 2: bag.ItemInfo
(*CSBagInfo)(nil), // 3: bag.CSBagInfo
(*SCBagInfo)(nil), // 4: bag.SCBagInfo
(*CSUpBagInfo)(nil), // 5: bag.CSUpBagInfo
(*SCUpBagInfo)(nil), // 6: bag.SCUpBagInfo
(*SCItemExChangeRes)(nil), // 7: bag.SCItemExChangeRes
(*SCSyncBagData)(nil), // 8: bag.SCSyncBagData
(*PropInfo)(nil), // 9: bag.PropInfo
(*CSPropExchange)(nil), // 10: bag.CSPropExchange
(*SCPropExchange)(nil), // 11: bag.SCPropExchange
(*ExchangeInfo)(nil), // 12: bag.ExchangeInfo
(*CSExchangeList)(nil), // 13: bag.CSExchangeList
(*SCExchangeList)(nil), // 14: bag.SCExchangeList
}
var file_bag_proto_depIdxs = []int32{
0, // 0: bag.SCBagInfo.RetCode:type_name -> bag.OpResultCode
2, // 1: bag.SCBagInfo.Infos:type_name -> bag.ItemInfo
0, // 2: bag.SCUpBagInfo.RetCode:type_name -> bag.OpResultCode
2, // 3: bag.SCUpBagInfo.Infos:type_name -> bag.ItemInfo
2, // 4: bag.SCSyncBagData.Infos:type_name -> bag.ItemInfo
0, // 5: bag.SCPropExchange.RetCode:type_name -> bag.OpResultCode
8, // 6: bag.SCPropExchange.Items:type_name -> bag.PropInfo
8, // 7: bag.SCPropExchange.RemainItems:type_name -> bag.PropInfo
8, // 8: bag.ExchangeInfo.CostItems:type_name -> bag.PropInfo
8, // 9: bag.ExchangeInfo.GainItems:type_name -> bag.PropInfo
11, // 10: bag.SCExchangeList.Infos:type_name -> bag.ExchangeInfo
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
0, // 4: bag.SCItemExChangeRes.RetCode:type_name -> bag.OpResultCode
2, // 5: bag.SCSyncBagData.Infos:type_name -> bag.ItemInfo
0, // 6: bag.SCPropExchange.RetCode:type_name -> bag.OpResultCode
9, // 7: bag.SCPropExchange.Items:type_name -> bag.PropInfo
9, // 8: bag.SCPropExchange.RemainItems:type_name -> bag.PropInfo
9, // 9: bag.ExchangeInfo.CostItems:type_name -> bag.PropInfo
9, // 10: bag.ExchangeInfo.GainItems:type_name -> bag.PropInfo
12, // 11: bag.SCExchangeList.Infos:type_name -> bag.ExchangeInfo
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_bag_proto_init() }
@ -1135,7 +1195,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCSyncBagData); i {
switch v := v.(*SCItemExChangeRes); i {
case 0:
return &v.state
case 1:
@ -1147,7 +1207,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PropInfo); i {
switch v := v.(*SCSyncBagData); i {
case 0:
return &v.state
case 1:
@ -1159,7 +1219,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSPropExchange); i {
switch v := v.(*PropInfo); i {
case 0:
return &v.state
case 1:
@ -1171,7 +1231,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCPropExchange); i {
switch v := v.(*CSPropExchange); i {
case 0:
return &v.state
case 1:
@ -1183,7 +1243,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExchangeInfo); i {
switch v := v.(*SCPropExchange); i {
case 0:
return &v.state
case 1:
@ -1195,7 +1255,7 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSExchangeList); i {
switch v := v.(*ExchangeInfo); i {
case 0:
return &v.state
case 1:
@ -1207,6 +1267,18 @@ func file_bag_proto_init() {
}
}
file_bag_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSExchangeList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_bag_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCExchangeList); i {
case 0:
return &v.state
@ -1225,7 +1297,7 @@ func file_bag_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_bag_proto_rawDesc,
NumEnums: 2,
NumMessages: 12,
NumMessages: 13,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -18,6 +18,7 @@ enum SPacketID {
PACKET_ALL_BAG_INFO = 2530; //
PACKET_ALL_BAG_USE = 2531; //使
PACKET_SC_SYNCBAGDATA = 2532;//
PACKET_SC_ITEM_EXCHANGE_RES = 2533;//
PACKET_ALL_BAG_END = 2549; //
//3000~3099
PACKET_PropExchange = 3000; //
@ -77,6 +78,13 @@ message SCUpBagInfo {
//使
repeated ItemInfo Infos = 6;//
}
//使
//PACKET_SC_ITEM_EXCHANGE_RES
message SCItemExChangeRes{
OpResultCode RetCode = 1;
}
//PACKET_SC_SYNCBAGDATA
message SCSyncBagData{
repeated ItemInfo Infos = 1;//

2
public

@ -1 +1 @@
Subproject commit e3cbc9f58234727bd5f859f86083ad584b66009b
Subproject commit aef8c489a27508831d69b4f66dee10c5258abb92

View File

@ -522,6 +522,7 @@ func (this *BagMgr) ItemExchangeCard(p *Player, itemId int32, money, cardType in
var err error
var newMsg *model.Message
res := &webapiproto.SAGetMatchAwardCode{}
pack := &bag.SCItemExChangeRes{RetCode: bag.OpResultCode_OPRC_Sucess}
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
// 获取兑换码
pack := &webapiproto.ASGetMatchAwardCode{
@ -573,12 +574,15 @@ func (this *BagMgr) ItemExchangeCard(p *Player, itemId int32, money, cardType in
})
this.AddItems(p, items, 0, common.GainWayItemChange, "system", "背包内使用兑换失败", 0, 0, false)
logger.Logger.Errorf("获取兑换码失败 snid:%v itemID:%v res:%v err:%v", p.SnId, itemId, res, err)
pack.RetCode = bag.OpResultCode_OPRC_Error
p.SendToClient(int(bag.SPacketID_PACKET_SC_ITEM_EXCHANGE_RES), pack)
return
}
p := PlayerMgrSington.GetPlayerBySnId(p.SnId)
if p != nil {
p.AddMessage(newMsg)
}
p.SendToClient(int(bag.SPacketID_PACKET_SC_ITEM_EXCHANGE_RES), pack)
}), fmt.Sprintf("ItemExChange%d", p.SnId)).Start()
return true
}

View File

@ -2,6 +2,7 @@ package main
import (
"container/list"
"math"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
@ -72,6 +73,7 @@ type TaskHandle struct {
}
func (t *TaskHandle) TaskUpdate(id int, data any) {
info, ok := data.(*TaskData)
if !ok {
return
@ -111,7 +113,7 @@ func (t *TaskHandle) TaskUpdate(id int, data any) {
case common.TaskTypeWinCoin: // 赢取金币数量
WelfareMgrSington.UpdateDiamondBankData(p, num, true)
case common.TaskTypeLoseCoin: //输的金币数量
WelfareMgrSington.UpdateDiamondBankData(p, num, false)
WelfareMgrSington.UpdateDiamondBankData(p, int64(math.Abs(float64(num))), false)
case common.TaskTypeTienlenWinTimes: // tienlen游戏赢取次数
case common.TaskTypeActivityScore: // 活跃积分数量
@ -243,4 +245,5 @@ func init() {
TaskSubjectSingleton.Attach(common.TaskTypeInviteNum, taskHandle)
TaskSubjectSingleton.Attach(common.TaskTypeTurnplate, taskHandle)
TaskSubjectSingleton.Attach(common.TaskTypeInviteRecharge, taskHandle)
TaskSubjectSingleton.Attach(common.TaskTypeLoseCoin, taskHandle)
}

View File

@ -1878,15 +1878,6 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) {
DayBuyMaxCnt := fGetPropValue("DayBuyMaxCntDiamond")
if p.WelfData != nil && p.WelfData.PigBank != nil {
pack.BankMaxDiamond = BankMaxDiamond
// 检查每日领取次数
/* if p.WelfData.DiamondBank.DayBuyTimes >= DayBuyMaxCnt {
pack.OpRetCode = welfare.OpResultCode_OPRC_PigbankOverTakeTimes
logger.Logger.Trace("存钱罐领取次数已打上限!")
p.SendToClient(int(welfare.SPacketID_PACKET_SCDiamondBankTakeDiamond), pack)
return
}*/
if p.WelfData.DiamondBank.BankDiamond >= float64(BankMaxDiamond) {
p.WelfData.DiamondBank.BankDiamond = float64(BankMaxDiamond)
}
@ -1899,6 +1890,13 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) {
p.WelfData.DiamondBank.TakeTimes++
p.WelfData.DiamondBank.DayBuyTimes++
for _, data := range pool {
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
infoData = data
break
}
}
pack.BankMaxDiamond = int64(infoData.MaxDiamond)
pack.TakeTimes = p.WelfData.DiamondBank.DayBuyTimes
pack.DayBuyMaxCnt = DayBuyMaxCnt
pack.TakeDiamondNum = float64(addDiamond)
@ -1925,6 +1923,10 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo
}
return 0
}
if p.WelfData.DiamondBank.DayBuyTimes == fGetPropValue("DayBuyMaxCntDiamond") {
return
}
WinCoinRate := fGetPropValue("WinCoinRateDiamond")
LoseCoinRate := fGetPropValue("LoseCoinRateDiamond")
addDiamond := float64(0)
@ -1937,6 +1939,19 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo
diamondStr := fmt.Sprintf("%.4f", addDiamond)
addDiamond, _ = strconv.ParseFloat(diamondStr, 64)
p.WelfData.DiamondBank.BankDiamond += addDiamond
pool := srvdata.PBDB_PigBank_DiamondMgr.Datas.GetArr()
infoData := pool[0]
for _, data := range pool {
if p.WelfData.DiamondBank.DayBuyTimes+1 >= data.BuyCountMin && p.WelfData.DiamondBank.DayBuyTimes+1 <= data.BuyCountMax {
infoData = data
break
}
}
BankMaxDiamond := int64(infoData.MaxDiamond)
if p.WelfData.DiamondBank.BankDiamond >= float64(BankMaxDiamond) {
p.WelfData.DiamondBank.BankDiamond = float64(BankMaxDiamond)
}
logger.Logger.Tracef("玩家更新钻石存储罐数据 snid = %d,coinNum = %d,isWin = %s,当前钻石存储罐钻石数量:%f本次增加钻石数量:%f", p.SnId, coinNum, isWin, p.WelfData.DiamondBank.BankDiamond, addDiamond)
}
func (this *WelfareMgr) Update() {