From 59e5ad137162bf2b5bdf474fd72fa4c7b111195f Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Wed, 26 Jul 2023 17:36:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=96=E7=95=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=AE=9D=E7=AE=B1=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_searchitembox.json | 128 +++++++++++ modules/wtask/api_accept.go | 2 +- modules/wtask/api_boxreceive.go | 96 ++++++++ modules/wtask/configure.go | 25 +- modules/wtask/module.go | 26 ++- pb/wtask_db.pb.go | 37 +-- pb/wtask_msg.pb.go | 217 +++++++++++++++--- sys/configure/structs/Game.SearchitemBox.go | 42 ++++ .../structs/Game.SearchitemBoxData.go | 54 +++++ sys/configure/structs/Tables.go | 7 + 10 files changed, 584 insertions(+), 50 deletions(-) create mode 100644 bin/json/game_searchitembox.json create mode 100644 modules/wtask/api_boxreceive.go create mode 100644 sys/configure/structs/Game.SearchitemBox.go create mode 100644 sys/configure/structs/Game.SearchitemBoxData.go diff --git a/bin/json/game_searchitembox.json b/bin/json/game_searchitembox.json new file mode 100644 index 000000000..35ef1f072 --- /dev/null +++ b/bin/json/game_searchitembox.json @@ -0,0 +1,128 @@ +[ + { + "id": 1, + "name": [ + "GameMain", + "位置1" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 2, + "name": [ + "GameMain", + "位置2" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 3, + "name": [ + "GameMain", + "位置3" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 4, + "name": [ + "GameMain", + "位置4" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 5, + "name": [ + "GameMain", + "位置5" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 6, + "name": [ + "GameMain", + "位置6" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 7, + "name": [ + "GameMain", + "位置7" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 8, + "name": [ + "GameMain", + "位置8" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 9, + "name": [ + "GameMain", + "位置9" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 10, + "name": [ + "GameMain", + "位置10" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 11, + "name": [ + "GameMain", + "位置11" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 12, + "name": [ + "GameMain", + "位置12" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 13, + "name": [ + "GameMain", + "位置13" + ], + "drown": 17111430, + "pointweight": 1000 + }, + { + "id": 14, + "name": [ + "GameMain", + "位置14" + ], + "drown": 17111430, + "pointweight": 1000 + } +] \ No newline at end of file diff --git a/modules/wtask/api_accept.go b/modules/wtask/api_accept.go index 2f60a92bd..707a4dd6e 100644 --- a/modules/wtask/api_accept.go +++ b/modules/wtask/api_accept.go @@ -20,7 +20,7 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) ( conf *cfg.GameWorldTaskData progress []*pb.DBWTaskItem update map[string]interface{} = make(map[string]interface{}) - boxs []int32 + boxs map[int32]int32 ok bool err error ) diff --git a/modules/wtask/api_boxreceive.go b/modules/wtask/api_boxreceive.go new file mode 100644 index 000000000..11522de81 --- /dev/null +++ b/modules/wtask/api_boxreceive.go @@ -0,0 +1,96 @@ +package wtask + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" +) + +// 参数校验 +func (this *apiComp) BoxReceiveCheck(session comm.IUserSession, req *pb.WTaskBoxReceiveReq) (errdata *pb.ErrorData) { + + return +} + +// /获取系统公告 +func (this *apiComp) BoxReceive(session comm.IUserSession, req *pb.WTaskBoxReceiveReq) (errdata *pb.ErrorData) { + var ( + wtask *pb.DBWTask + box *pb.DBWTaskBox + conf *cfg.GameSearchitemBoxData + prop []*cfg.Gameatn + award []*pb.UserAssets + ok bool + err error + ) + if errdata = this.BoxReceiveCheck(session, req); errdata != nil { + return + } + + if wtask, err = this.module.modelwtask.getUserWTasks(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + + if box, ok = wtask.Boxs[req.Tid]; !ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: fmt.Sprintf("no found taskbox:%d", req.Tid), + } + return + } + ok = false + for _, v := range box.Boxs { + if v == req.Boxid { + ok = true + } + } + + if !ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: fmt.Sprintf("no found box:%d", req.Boxid), + } + return + } + + if conf, err = this.module.configure.getGameSearchitemBox(req.Boxid); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: err.Error(), + } + return + } + + user := this.module.ModuleUser.GetUser(session.GetUserId()) + if prop = this.module.ModuleTools.GetGroupDataByLottery(conf.Drown, user.Vip, user.Lv); len(prop) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("掉落组未找到:%d", conf.Drown), + } + return + } + award = make([]*pb.UserAssets, 0) + for _, v := range prop { + award = append(award, &pb.UserAssets{ + A: v.A, + T: v.T, + N: v.N, + }) + } + + if errdata = this.module.DispenseRes(session, prop, true); errdata != nil { + return + } + session.SendMsg(string(this.module.GetType()), "boxreceive", &pb.WTaskBoxReceiveResp{Tid: req.Tid, Boxid: req.Boxid, Award: award}) + return +} diff --git a/modules/wtask/configure.go b/modules/wtask/configure.go index 0d59a27a0..b4a95721a 100644 --- a/modules/wtask/configure.go +++ b/modules/wtask/configure.go @@ -17,6 +17,7 @@ const ( gameburiedCond = "game_buriedcondi.json" gamerdtasknpc = "game_rdtasknpc.json" gamesearchitemall = "game_searchitemall.json" + gamesearchitembox = "game_searchitembox.json" ) type configureComp struct { @@ -192,7 +193,7 @@ func (this *configureComp) getGameWorldAll(id int32) (conf *cfg.GameWorldAllData return } -func (this *configureComp) getGameSearchitemAll(id int32) (results []int32, err error) { +func (this *configureComp) getGameSearchitemAll(id int32) (results map[int32]int32, err error) { var ( v interface{} conf *cfg.GameSearchitemAllData @@ -208,11 +209,29 @@ func (this *configureComp) getGameSearchitemAll(id int32) (results []int32, err this.module.Errorf("err:%v", err) return } - results = make([]int32, 0) + results = make(map[int32]int32) weight = comm.RandShuffle(len(conf.Pointweight)) for i := 0; i < int(conf.Pointnum); i++ { - results = append(results, conf.Point[weight[i]]) + results[conf.Point[weight[i]]] = 0 } } return } + +func (this *configureComp) getGameSearchitemBox(id int32) (conf *cfg.GameSearchitemBoxData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(gamesearchitembox); err != nil { + return + } else { + if conf, ok = v.(*cfg.GameSearchitemBox).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(modulename, gameWorldTask, id) + this.module.Errorf("err:%v", err) + return + } + + } + return +} diff --git a/modules/wtask/module.go b/modules/wtask/module.go index f02b1c78f..45b9217ab 100644 --- a/modules/wtask/module.go +++ b/modules/wtask/module.go @@ -262,9 +262,17 @@ func (this *WTask) ResetDailytaskTask(session comm.IUserSession, groupId ...int3 activations []int32 = make([]int32, 0) accepts []int32 = make([]int32, 0) completes []int32 = make([]int32, 0) + box map[int32]int32 err error ok bool + boxchange bool ) + + defer func() { + session.Push() + this.PutUserSession(session) + }() + results = make(map[int32][]int32) for _, v := range this.configure.getdesTask(1) { alltasks[v.Key] = v @@ -313,15 +321,31 @@ func (this *WTask) ResetDailytaskTask(session comm.IUserSession, groupId ...int3 results[v] = make([]int32, 0) } results[v] = append(results[v], task.Key) + if task.Trigger == 1 { //触发宝箱 + if box, err = this.configure.getGameSearchitemAll(task.Key); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("getGameSearchitemAll uid:%s taskid:%v", session.GetUserId(), task.Key), + } + return + } + wtask.Boxs[task.Key] = &pb.DBWTaskBox{ + Boxs: box, + } + boxchange = true + } } } - } wtask.Activations = activations wtask.Accepts = accepts wtask.Completes = completes //有新任务接取 this.pushtaskprogress(session, wtask, true) + if boxchange { + session.SendMsg(string(this.GetType()), "boxchange", &pb.WTaskBoxChangePush{Boxs: wtask.Boxs}) + } if err = this.modelwtask.updateUserWTasks(session.GetUserId(), wtask); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, diff --git a/pb/wtask_db.pb.go b/pb/wtask_db.pb.go index 946b3c93e..986a26802 100644 --- a/pb/wtask_db.pb.go +++ b/pb/wtask_db.pb.go @@ -129,7 +129,7 @@ type DBWTaskBox struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Boxs []int32 `protobuf:"varint,1,rep,packed,name=boxs,proto3" json:"boxs"` + Boxs map[int32]int32 `protobuf:"bytes,1,rep,name=boxs,proto3" json:"boxs" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key:box id value: 0 未开 1 已开 } func (x *DBWTaskBox) Reset() { @@ -164,7 +164,7 @@ func (*DBWTaskBox) Descriptor() ([]byte, []int) { return file_wtask_wtask_db_proto_rawDescGZIP(), []int{1} } -func (x *DBWTaskBox) GetBoxs() []int32 { +func (x *DBWTaskBox) GetBoxs() map[int32]int32 { if x != nil { return x.Boxs } @@ -257,9 +257,14 @@ var file_wtask_wtask_db_proto_rawDesc = []byte{ 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x20, 0x0a, 0x0a, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x12, 0x12, 0x0a, - 0x04, 0x62, 0x6f, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62, 0x6f, 0x78, - 0x73, 0x22, 0x46, 0x0a, 0x0b, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, + 0x70, 0x0a, 0x0a, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x12, 0x29, 0x0a, + 0x04, 0x62, 0x6f, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, + 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x2e, 0x42, 0x6f, 0x78, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x78, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x42, 0x6f, 0x78, 0x73, + 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, 0x46, 0x0a, 0x0b, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6e, 0x49, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, @@ -279,25 +284,27 @@ func file_wtask_wtask_db_proto_rawDescGZIP() []byte { return file_wtask_wtask_db_proto_rawDescData } -var file_wtask_wtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_wtask_wtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_wtask_wtask_db_proto_goTypes = []interface{}{ (*DBWTask)(nil), // 0: DBWTask (*DBWTaskBox)(nil), // 1: DBWTaskBox (*DBWTaskItem)(nil), // 2: DBWTaskItem nil, // 3: DBWTask.GroupsEntry nil, // 4: DBWTask.BoxsEntry - (*ConIProgress)(nil), // 5: ConIProgress + nil, // 5: DBWTaskBox.BoxsEntry + (*ConIProgress)(nil), // 6: ConIProgress } var file_wtask_wtask_db_proto_depIdxs = []int32{ 3, // 0: DBWTask.groups:type_name -> DBWTask.GroupsEntry 4, // 1: DBWTask.boxs:type_name -> DBWTask.BoxsEntry - 5, // 2: DBWTaskItem.conlds:type_name -> ConIProgress - 1, // 3: DBWTask.BoxsEntry.value:type_name -> DBWTaskBox - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 5, // 2: DBWTaskBox.boxs:type_name -> DBWTaskBox.BoxsEntry + 6, // 3: DBWTaskItem.conlds:type_name -> ConIProgress + 1, // 4: DBWTask.BoxsEntry.value:type_name -> DBWTaskBox + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_wtask_wtask_db_proto_init() } @@ -350,7 +357,7 @@ func file_wtask_wtask_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_wtask_wtask_db_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/wtask_msg.pb.go b/pb/wtask_msg.pb.go index 1926fe607..8a9e661ba 100644 --- a/pb/wtask_msg.pb.go +++ b/pb/wtask_msg.pb.go @@ -931,6 +931,126 @@ func (x *WTaskBoxChangePush) GetBoxs() map[int32]*DBWTaskBox { return nil } +//世界任务宝箱领取 +type WTaskBoxReceiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tid int32 `protobuf:"varint,1,opt,name=tid,proto3" json:"tid"` + Boxid int32 `protobuf:"varint,2,opt,name=boxid,proto3" json:"boxid"` +} + +func (x *WTaskBoxReceiveReq) Reset() { + *x = WTaskBoxReceiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wtask_wtask_msg_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WTaskBoxReceiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WTaskBoxReceiveReq) ProtoMessage() {} + +func (x *WTaskBoxReceiveReq) ProtoReflect() protoreflect.Message { + mi := &file_wtask_wtask_msg_proto_msgTypes[17] + 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 WTaskBoxReceiveReq.ProtoReflect.Descriptor instead. +func (*WTaskBoxReceiveReq) Descriptor() ([]byte, []int) { + return file_wtask_wtask_msg_proto_rawDescGZIP(), []int{17} +} + +func (x *WTaskBoxReceiveReq) GetTid() int32 { + if x != nil { + return x.Tid + } + return 0 +} + +func (x *WTaskBoxReceiveReq) GetBoxid() int32 { + if x != nil { + return x.Boxid + } + return 0 +} + +//世界任务宝箱领取回应 +type WTaskBoxReceiveResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tid int32 `protobuf:"varint,1,opt,name=tid,proto3" json:"tid"` + Boxid int32 `protobuf:"varint,2,opt,name=boxid,proto3" json:"boxid"` + Award []*UserAssets `protobuf:"bytes,3,rep,name=award,proto3" json:"award"` //奖励 +} + +func (x *WTaskBoxReceiveResp) Reset() { + *x = WTaskBoxReceiveResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wtask_wtask_msg_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WTaskBoxReceiveResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WTaskBoxReceiveResp) ProtoMessage() {} + +func (x *WTaskBoxReceiveResp) ProtoReflect() protoreflect.Message { + mi := &file_wtask_wtask_msg_proto_msgTypes[18] + 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 WTaskBoxReceiveResp.ProtoReflect.Descriptor instead. +func (*WTaskBoxReceiveResp) Descriptor() ([]byte, []int) { + return file_wtask_wtask_msg_proto_rawDescGZIP(), []int{18} +} + +func (x *WTaskBoxReceiveResp) GetTid() int32 { + if x != nil { + return x.Tid + } + return 0 +} + +func (x *WTaskBoxReceiveResp) GetBoxid() int32 { + if x != nil { + return x.Boxid + } + return 0 +} + +func (x *WTaskBoxReceiveResp) GetAward() []*UserAssets { + if x != nil { + return x.Award + } + return nil +} + var File_wtask_wtask_msg_proto protoreflect.FileDescriptor var file_wtask_wtask_msg_proto_rawDesc = []byte{ @@ -1029,7 +1149,17 @@ var file_wtask_wtask_msg_proto_rawDesc = []byte{ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, 0x6b, - 0x42, 0x6f, 0x78, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, + 0x42, 0x6f, 0x78, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3c, + 0x0a, 0x12, 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x74, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x78, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x6f, 0x78, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x13, + 0x57, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x6f, 0x78, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x74, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x78, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x6f, 0x78, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -1045,7 +1175,7 @@ func file_wtask_wtask_msg_proto_rawDescGZIP() []byte { return file_wtask_wtask_msg_proto_rawDescData } -var file_wtask_wtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_wtask_wtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_wtask_wtask_msg_proto_goTypes = []interface{}{ (*WTaskInfoReq)(nil), // 0: WTaskInfoReq (*WTaskInfoResp)(nil), // 1: WTaskInfoResp @@ -1064,35 +1194,38 @@ var file_wtask_wtask_msg_proto_goTypes = []interface{}{ (*WTaskBattleFinishReq)(nil), // 14: WTaskBattleFinishReq (*WTaskBattleFinishResp)(nil), // 15: WTaskBattleFinishResp (*WTaskBoxChangePush)(nil), // 16: WTaskBoxChangePush - nil, // 17: WTaskFinishResp.GroupsEntry - nil, // 18: WTaskBoxChangePush.BoxsEntry - (*DBWTask)(nil), // 19: DBWTask - (*DBWTaskItem)(nil), // 20: DBWTaskItem - (*UserAssets)(nil), // 21: UserAssets - (*BattleFormation)(nil), // 22: BattleFormation - (*BattleInfo)(nil), // 23: BattleInfo - (*BattleReport)(nil), // 24: BattleReport - (*DBWTaskBox)(nil), // 25: DBWTaskBox + (*WTaskBoxReceiveReq)(nil), // 17: WTaskBoxReceiveReq + (*WTaskBoxReceiveResp)(nil), // 18: WTaskBoxReceiveResp + nil, // 19: WTaskFinishResp.GroupsEntry + nil, // 20: WTaskBoxChangePush.BoxsEntry + (*DBWTask)(nil), // 21: DBWTask + (*DBWTaskItem)(nil), // 22: DBWTaskItem + (*UserAssets)(nil), // 23: UserAssets + (*BattleFormation)(nil), // 24: BattleFormation + (*BattleInfo)(nil), // 25: BattleInfo + (*BattleReport)(nil), // 26: BattleReport + (*DBWTaskBox)(nil), // 27: DBWTaskBox } var file_wtask_wtask_msg_proto_depIdxs = []int32{ - 19, // 0: WTaskInfoResp.info:type_name -> DBWTask - 20, // 1: WTaskInfoResp.accepts:type_name -> DBWTaskItem - 20, // 2: WTaskAcceptResp.accepts:type_name -> DBWTaskItem - 20, // 3: WTaskCompleteCondiResp.progress:type_name -> DBWTaskItem - 21, // 4: WTaskFinishResp.award:type_name -> UserAssets - 17, // 5: WTaskFinishResp.groups:type_name -> WTaskFinishResp.GroupsEntry - 21, // 6: WTaskChapterRewardResp.award:type_name -> UserAssets - 20, // 7: WTaskAcceptChangePush.accepts:type_name -> DBWTaskItem - 22, // 8: WTaskBattleStartReq.battle:type_name -> BattleFormation - 23, // 9: WTaskBattleStartResp.info:type_name -> BattleInfo - 24, // 10: WTaskBattleFinishReq.report:type_name -> BattleReport - 18, // 11: WTaskBoxChangePush.boxs:type_name -> WTaskBoxChangePush.BoxsEntry - 25, // 12: WTaskBoxChangePush.BoxsEntry.value:type_name -> DBWTaskBox - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 21, // 0: WTaskInfoResp.info:type_name -> DBWTask + 22, // 1: WTaskInfoResp.accepts:type_name -> DBWTaskItem + 22, // 2: WTaskAcceptResp.accepts:type_name -> DBWTaskItem + 22, // 3: WTaskCompleteCondiResp.progress:type_name -> DBWTaskItem + 23, // 4: WTaskFinishResp.award:type_name -> UserAssets + 19, // 5: WTaskFinishResp.groups:type_name -> WTaskFinishResp.GroupsEntry + 23, // 6: WTaskChapterRewardResp.award:type_name -> UserAssets + 22, // 7: WTaskAcceptChangePush.accepts:type_name -> DBWTaskItem + 24, // 8: WTaskBattleStartReq.battle:type_name -> BattleFormation + 25, // 9: WTaskBattleStartResp.info:type_name -> BattleInfo + 26, // 10: WTaskBattleFinishReq.report:type_name -> BattleReport + 20, // 11: WTaskBoxChangePush.boxs:type_name -> WTaskBoxChangePush.BoxsEntry + 23, // 12: WTaskBoxReceiveResp.award:type_name -> UserAssets + 27, // 13: WTaskBoxChangePush.BoxsEntry.value:type_name -> DBWTaskBox + 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_wtask_wtask_msg_proto_init() } @@ -1308,6 +1441,30 @@ func file_wtask_wtask_msg_proto_init() { return nil } } + file_wtask_wtask_msg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WTaskBoxReceiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wtask_wtask_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WTaskBoxReceiveResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1315,7 +1472,7 @@ func file_wtask_wtask_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_wtask_wtask_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 19, + NumMessages: 21, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/Game.SearchitemBox.go b/sys/configure/structs/Game.SearchitemBox.go new file mode 100644 index 000000000..a5475fc96 --- /dev/null +++ b/sys/configure/structs/Game.SearchitemBox.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameSearchitemBox struct { + _dataMap map[int32]*GameSearchitemBoxData + _dataList []*GameSearchitemBoxData +} + +func NewGameSearchitemBox(_buf []map[string]interface{}) (*GameSearchitemBox, error) { + _dataList := make([]*GameSearchitemBoxData, 0, len(_buf)) + dataMap := make(map[int32]*GameSearchitemBoxData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameSearchitemBoxData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameSearchitemBox{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameSearchitemBox) GetDataMap() map[int32]*GameSearchitemBoxData { + return table._dataMap +} + +func (table *GameSearchitemBox) GetDataList() []*GameSearchitemBoxData { + return table._dataList +} + +func (table *GameSearchitemBox) Get(key int32) *GameSearchitemBoxData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.SearchitemBoxData.go b/sys/configure/structs/Game.SearchitemBoxData.go new file mode 100644 index 000000000..1333d9efa --- /dev/null +++ b/sys/configure/structs/Game.SearchitemBoxData.go @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type GameSearchitemBoxData struct { + Id int32 + Name []string + Drown int32 + Pointweight int32 +} + +const TypeId_GameSearchitemBoxData = 859150302 + +func (*GameSearchitemBoxData) GetTypeId() int32 { + return 859150302 +} + +func (_v *GameSearchitemBoxData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["name"].([]interface{}); !_ok_ { err = errors.New("name error"); return } + + _v.Name = make([]string, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ string + { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } + _v.Name = append(_v.Name, _list_v_) + } + } + + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["drown"].(float64); !_ok_ { err = errors.New("drown error"); return }; _v.Drown = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pointweight"].(float64); !_ok_ { err = errors.New("pointweight error"); return }; _v.Pointweight = int32(_tempNum_) } + return +} + +func DeserializeGameSearchitemBoxData(_buf map[string]interface{}) (*GameSearchitemBoxData, error) { + v := &GameSearchitemBoxData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go index ae3bb37d8..b6f5b015c 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -195,6 +195,7 @@ type Tables struct { AskAll *GameAskAll AskLibrary *GameAskLibrary SearchitemAll *GameSearchitemAll + SearchitemBox *GameSearchitemBox GuildBoss *GameGuildBoss GuildBossRoulette *GameGuildBossRoulette GuildBossRank *GameGuildBossRank @@ -1323,6 +1324,12 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.SearchitemAll, err = NewGameSearchitemAll(buf) ; err != nil { return nil, err } + if buf, err = loader("game_searchitembox") ; err != nil { + return nil, err + } + if tables.SearchitemBox, err = NewGameSearchitemBox(buf) ; err != nil { + return nil, err + } if buf, err = loader("game_guildboss") ; err != nil { return nil, err }