Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
dea631420b
@ -14,12 +14,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -51,12 +55,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -88,12 +96,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -125,12 +137,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -162,12 +178,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -199,12 +219,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -236,12 +260,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -273,12 +301,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -310,12 +342,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -347,12 +383,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -384,12 +424,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -421,12 +465,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -458,12 +506,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -495,12 +547,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -532,12 +588,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -569,12 +629,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -606,12 +670,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -643,12 +711,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -680,12 +752,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -717,12 +793,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -754,12 +834,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -791,12 +875,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
@ -828,12 +916,16 @@
|
|||||||
},
|
},
|
||||||
"taskneed": 2,
|
"taskneed": 2,
|
||||||
"taskreq": [
|
"taskreq": [
|
||||||
"lv",
|
{
|
||||||
"1"
|
"key": 1,
|
||||||
|
"param": 1
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"taskreqex": [
|
"taskreqex": [
|
||||||
"star",
|
{
|
||||||
"5"
|
"key": 2,
|
||||||
|
"param": 5
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
3376
bin/json/game_smithydrop.json
Normal file
3376
bin/json/game_smithydrop.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -42,10 +42,25 @@ func (s *SmithyView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//拒绝
|
||||||
|
refuse := func() {
|
||||||
|
if err := service.GetPttService().SendToClient(
|
||||||
|
t.MainType,
|
||||||
|
"refuse",
|
||||||
|
&pb.SmithyRefuseReq{
|
||||||
|
CustomerId: 1,
|
||||||
|
},
|
||||||
|
); err != nil {
|
||||||
|
logrus.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
customerBtn := widget.NewButton("顾客", loadCustomer)
|
customerBtn := widget.NewButton("顾客", loadCustomer)
|
||||||
|
refuseBtn := widget.NewButton("拒绝", refuse)
|
||||||
jiaoyiBtn := widget.NewButton("交易", jiaoyi)
|
jiaoyiBtn := widget.NewButton("交易", jiaoyi)
|
||||||
|
|
||||||
btns := container.NewHBox(customerBtn, jiaoyiBtn)
|
btns := container.NewHBox(customerBtn, jiaoyiBtn, refuseBtn)
|
||||||
c := container.NewBorder(btns, nil, nil, nil)
|
c := container.NewBorder(btns, nil, nil, nil)
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
36
comm/weight.go
Normal file
36
comm/weight.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package comm
|
||||||
|
|
||||||
|
import "math/rand"
|
||||||
|
|
||||||
|
type WeightItem struct {
|
||||||
|
Id interface{}
|
||||||
|
Weight int
|
||||||
|
}
|
||||||
|
|
||||||
|
// 权重项目
|
||||||
|
type WeightedRandom struct {
|
||||||
|
items []*WeightItem
|
||||||
|
totalWeight int
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewWeightedRandom(items []*WeightItem) *WeightedRandom {
|
||||||
|
wr := &WeightedRandom{items: items}
|
||||||
|
for _, item := range wr.items {
|
||||||
|
wr.totalWeight += int(item.Weight)
|
||||||
|
}
|
||||||
|
return wr
|
||||||
|
}
|
||||||
|
|
||||||
|
func (wr *WeightedRandom) Pick() *WeightItem {
|
||||||
|
if wr.totalWeight <= 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
randomNumber := rand.Intn(wr.totalWeight)
|
||||||
|
for _, item := range wr.items {
|
||||||
|
if randomNumber < int(item.Weight) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
randomNumber -= int(item.Weight)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
@ -32,6 +32,8 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (co
|
|||||||
list.Award += 1
|
list.Award += 1
|
||||||
update["award"] = list.Award
|
update["award"] = list.Award
|
||||||
this.module.modelPandaAtlas.modifyPandaAtlasList(session.GetUserId(), update)
|
this.module.modelPandaAtlas.modifyPandaAtlasList(session.GetUserId(), update)
|
||||||
session.SendMsg(string(this.module.GetType()), "award", &pb.AtlasAwardResp{})
|
session.SendMsg(string(this.module.GetType()), "award", &pb.AtlasAwardResp{
|
||||||
|
Data: list,
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
32
modules/dispatch/api_do.go
Normal file
32
modules/dispatch/api_do.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package dispatch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 派遣
|
||||||
|
|
||||||
|
func (a *apiComp) DoCheck(session comm.IUserSession, req *pb.DispatchDoReq) (code pb.ErrorCode) {
|
||||||
|
if len(req.HeroId) == 0 || req.TaskId == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
if code = a.DoCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := a.module.modelDispatch.dispatch(session.GetUserId(), req.TaskId, req.HeroId); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rsp := &pb.DispatchDoResp{}
|
||||||
|
|
||||||
|
session.SendMsg(string(a.module.GetType()), "do", rsp)
|
||||||
|
return
|
||||||
|
}
|
29
modules/dispatch/api_notice.go
Normal file
29
modules/dispatch/api_notice.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package dispatch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 公告板信息
|
||||||
|
|
||||||
|
func (a *apiComp) NoticeCheck(session comm.IUserSession, req *pb.DispatchNoticeReq) (code pb.ErrorCode) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||||
|
|
||||||
|
if d == nil {
|
||||||
|
d = a.module.modelDispatch.initDispatch(session.GetUserId())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rsp := &pb.DispatchNoticeResp{
|
||||||
|
Dispatch: d,
|
||||||
|
}
|
||||||
|
|
||||||
|
session.SendMsg(string(a.module.GetType()), "notice", rsp)
|
||||||
|
return
|
||||||
|
}
|
30
modules/dispatch/api_receive.go
Normal file
30
modules/dispatch/api_receive.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package dispatch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 领取派遣奖励
|
||||||
|
|
||||||
|
func (a *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.DispatchReceiveReq) (code pb.ErrorCode) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
|
d := a.module.modelDispatch.getDBDispatch(session.GetUserId())
|
||||||
|
if d == nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
a.module.modelDispatch.taskRandom(session.GetUserId(), d.Nb.Lv)
|
||||||
|
|
||||||
|
rsp := &pb.DispatchReceiveResp{}
|
||||||
|
|
||||||
|
session.SendMsg(string(a.module.GetType()), "receive", rsp)
|
||||||
|
return
|
||||||
|
}
|
21
modules/dispatch/api_refresh.go
Normal file
21
modules/dispatch/api_refresh.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package dispatch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 刷新
|
||||||
|
func (a *apiComp) RefreshCheck(session comm.IUserSession, req *pb.DispatchRefreshReq) (code pb.ErrorCode) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
|
rsp := &pb.DispatchRefreshResp{}
|
||||||
|
|
||||||
|
session.SendMsg(string(a.module.GetType()), "refresh", rsp)
|
||||||
|
return
|
||||||
|
}
|
84
modules/dispatch/configure.go
Normal file
84
modules/dispatch/configure.go
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
package dispatch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
gameDispatchLv = "game_dispatch_lv.json"
|
||||||
|
gameDispatchTask = "game_dispatch_task.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
type configureComp struct {
|
||||||
|
modules.MCompConfigure
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||||
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||||
|
gameDispatchLv: cfg.NewGameDispatch_Lv,
|
||||||
|
gameDispatchTask: cfg.NewGameDispatch_Task,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公告栏配置
|
||||||
|
func (this *configureComp) getDispatchLvConf(lv int32) (data *cfg.GameDispatch_LvData, err error) {
|
||||||
|
var v interface{}
|
||||||
|
|
||||||
|
if v, err = this.GetConfigure(gameDispatchLv); err != nil {
|
||||||
|
err = fmt.Errorf("%T no is *cfg.GameDispatchLv", v)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
d, ok := v.(*cfg.GameDispatch_Lv)
|
||||||
|
if !ok {
|
||||||
|
err = fmt.Errorf("%T is not *cfg.GameDispatchLv", v)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if data, ok = d.GetDataMap()[lv]; ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//任务配置
|
||||||
|
func(this *configureComp) getDispatchTaskConf(taskId int32) (data *cfg.GameDispatch_TaskData,err error) {
|
||||||
|
var v interface{}
|
||||||
|
|
||||||
|
if v, err = this.GetConfigure(gameDispatchTask); err != nil {
|
||||||
|
err = fmt.Errorf("%T no is *cfg.GameDispatchTask", v)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
d, ok := v.(*cfg.GameDispatch_Task)
|
||||||
|
if !ok {
|
||||||
|
err = fmt.Errorf("%T is not *cfg.GameDispatchTask", v)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if data, ok = d.GetDataMap()[taskId]; ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 任务列表
|
||||||
|
func (this *configureComp) getDispatchListConf() (list []*cfg.GameDispatch_TaskData) {
|
||||||
|
if v, err := this.GetConfigure(gameDispatchTask); err != nil {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
d, ok := v.(*cfg.GameDispatch_Task)
|
||||||
|
if !ok {
|
||||||
|
err = fmt.Errorf("%T is not *cfg.GameDispatch_Task", v)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list = d.GetDataList()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
package dispatch
|
package dispatch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
"go_dreamfactory/sys/configure"
|
||||||
|
"go_dreamfactory/utils"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
@ -26,3 +30,177 @@ func (this *modelDispatch) Init(service core.IService, module core.IModule, comp
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *modelDispatch) initDispatch(uid string) (dis *pb.DBDispatch) {
|
||||||
|
taskIds, err := this.taskRandom(uid, 1)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(taskIds) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dis = &pb.DBDispatch{
|
||||||
|
Uid: uid,
|
||||||
|
Ticket: 6,
|
||||||
|
Nb: &pb.Noticeboard{
|
||||||
|
Lv: 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range taskIds {
|
||||||
|
taskConf, err := this.module.configure.getDispatchTaskConf(v)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//接续截至时间
|
||||||
|
duration := configure.Now().Unix() + int64(taskConf.Taskcd)
|
||||||
|
dis.Nb.Tasks = append(dis.Nb.Tasks, &pb.DispatchTask{
|
||||||
|
TaskId: v,
|
||||||
|
Duration: duration,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := this.Add(uid, dis); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取派遣数据
|
||||||
|
func (this *modelDispatch) getDBDispatch(uid string) *pb.DBDispatch {
|
||||||
|
dis := &pb.DBDispatch{}
|
||||||
|
if err := this.Get(uid, dis); err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 随机任务
|
||||||
|
func (this *modelDispatch) taskRandom(uid string, noticeLv int32) (taskIds []int32, err error) {
|
||||||
|
d := this.getDBDispatch(uid)
|
||||||
|
if d == nil {
|
||||||
|
return nil, errors.New("no data")
|
||||||
|
}
|
||||||
|
|
||||||
|
if d.Nb == nil {
|
||||||
|
return nil, errors.New("notice is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
conf, err := this.module.configure.getDispatchLvConf(noticeLv)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var items []*comm.WeightItem
|
||||||
|
for i, v := range conf.Probability {
|
||||||
|
items = append(items, &comm.WeightItem{Id: (i + 1), Weight: int(v)})
|
||||||
|
}
|
||||||
|
|
||||||
|
wr := comm.NewWeightedRandom(items)
|
||||||
|
//任务类型
|
||||||
|
var taskType int
|
||||||
|
if c := wr.Pick(); c != nil {
|
||||||
|
taskType = c.Id.(int)
|
||||||
|
}
|
||||||
|
|
||||||
|
confList := this.module.configure.getDispatchListConf()
|
||||||
|
var tIds []int32
|
||||||
|
for _, v := range confList {
|
||||||
|
if int(v.Type) == taskType {
|
||||||
|
tIds = append(tIds, v.Id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断随机数量
|
||||||
|
var n int
|
||||||
|
n = len(d.Nb.Tasks)
|
||||||
|
|
||||||
|
if len(taskIds) > 0 {
|
||||||
|
ids := utils.RandomNumbers(0, len(tIds), n)
|
||||||
|
for i := 0; i < len(ids); i++ {
|
||||||
|
taskIds = append(taskIds, tIds[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证英雄的条件
|
||||||
|
func (this *modelDispatch) validHeroCond(uid string, taskId int32, heroId string) (ok bool, err error) {
|
||||||
|
//taskConf
|
||||||
|
gd, err := this.module.configure.getDispatchTaskConf(taskId)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取英雄信息
|
||||||
|
hero, code := this.module.ModuleHero.GetHeroByObjID(uid, heroId)
|
||||||
|
|
||||||
|
//校验英雄的条件
|
||||||
|
if code == pb.ErrorCode_Success && hero != nil {
|
||||||
|
for _, v := range gd.Taskreq {
|
||||||
|
switch v.Key {
|
||||||
|
case 1: //lv
|
||||||
|
if hero.Lv >= v.Param {
|
||||||
|
ok = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
case 2: //star
|
||||||
|
if hero.Star >= v.Param {
|
||||||
|
ok = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验英雄是否已被派遣
|
||||||
|
dispatch := this.getDBDispatch(uid)
|
||||||
|
if dispatch == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range dispatch.Nb.Tasks {
|
||||||
|
for _, h := range v.HeroIds {
|
||||||
|
if h == heroId {
|
||||||
|
ok = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 派遣
|
||||||
|
func (this *modelDispatch) dispatch(uid string, taskId int32, heroIds []string) error {
|
||||||
|
for _, heroId := range heroIds {
|
||||||
|
if ok, err := this.validHeroCond(uid, taskId, heroId); err == nil {
|
||||||
|
if !ok {
|
||||||
|
return comm.NewCustomError(pb.ErrorCode_DispatchHeroNoReached)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
d := this.getDBDispatch(uid)
|
||||||
|
if d == nil {
|
||||||
|
return errors.New("no data")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range d.Nb.Tasks {
|
||||||
|
if v.TaskId == taskId && v.Status == 0 {
|
||||||
|
v.HeroIds = heroIds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update := map[string]interface{}{
|
||||||
|
"nb": d.Nb.Tasks,
|
||||||
|
}
|
||||||
|
if err := this.Change(uid, update); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -10,6 +10,8 @@ import (
|
|||||||
type Dispatch struct {
|
type Dispatch struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
api *apiComp
|
api *apiComp
|
||||||
|
configure *configureComp
|
||||||
|
modelDispatch *modelDispatch
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -21,7 +23,13 @@ func (this *Dispatch) Init(service core.IService, module core.IModule, options c
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (this *Dispatch) GetType() core.M_Modules {
|
func (this *Dispatch) GetType() core.M_Modules {
|
||||||
return comm.ModuleDispatch
|
return comm.ModuleDispatch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Dispatch) OnInstallComp() {
|
||||||
|
this.ModuleBase.OnInstallComp()
|
||||||
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
|
this.modelDispatch = this.RegisterComp(new(modelDispatch)).(*modelDispatch)
|
||||||
|
}
|
||||||
|
@ -29,6 +29,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
customLv int32 // 定制装备的等级
|
customLv int32 // 定制装备的等级
|
||||||
rsp *pb.SmithyForgeEquipResp
|
rsp *pb.SmithyForgeEquipResp
|
||||||
needTemperatureCos int32 // 需要消耗的温度
|
needTemperatureCos int32 // 需要消耗的温度
|
||||||
|
maxT int32
|
||||||
)
|
)
|
||||||
rsp = &pb.SmithyForgeEquipResp{}
|
rsp = &pb.SmithyForgeEquipResp{}
|
||||||
update = make(map[string]interface{})
|
update = make(map[string]interface{})
|
||||||
@ -53,12 +54,11 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
stove.Data[req.ReelId] = &pb.Mastery{
|
stove.Data[req.ReelId] = &pb.Mastery{
|
||||||
Lv: 1,
|
Lv: 0,
|
||||||
Value: 0,
|
Value: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stove.Data[req.ReelId].Value += 1
|
|
||||||
stove.Forge[req.ReelId] += 1
|
|
||||||
// 是否是精益打造
|
// 是否是精益打造
|
||||||
if req.Quality > 0 {
|
if req.Quality > 0 {
|
||||||
costRes = append(costRes, reelcfg.RefineCos)
|
costRes = append(costRes, reelcfg.RefineCos)
|
||||||
@ -85,7 +85,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
needTemperatureCos = reelcfg.TemperatureCos
|
needTemperatureCos = reelcfg.TemperatureCos
|
||||||
// 熟练度减少的温度
|
// 熟练度减少的温度
|
||||||
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
|
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
|
||||||
needTemperatureCos = reelcfg.TemperatureCos * (1000 - t) / 1000
|
needTemperatureCos = reelcfg.TemperatureCos * (1000 - t) / 1000 // 千分比
|
||||||
|
|
||||||
if req.Lava > 0 { // 是否是熔岩打造
|
if req.Lava > 0 { // 是否是熔岩打造
|
||||||
exemption := this.module.configure.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度
|
exemption := this.module.configure.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度
|
||||||
@ -133,28 +133,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否提升了熟练度等级
|
|
||||||
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
|
|
||||||
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
|
|
||||||
stove.Data[req.ReelId].Lv += 1
|
|
||||||
stove.Data[req.ReelId].Value = 0
|
|
||||||
// 校验是否解锁了新的图纸
|
|
||||||
if nextProficiency.Type == comm.SmithyReelType3 {
|
|
||||||
stove.Data[nextProficiency.Value1] = &pb.Mastery{
|
|
||||||
Lv: 1,
|
|
||||||
Value: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 是否解锁新套装
|
|
||||||
if nextProficiency.Type == comm.SmithyReelType4 {
|
|
||||||
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
|
||||||
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
|
|
||||||
update := make(map[string]interface{}, 0)
|
|
||||||
update["suiteId"] = rst.SuiteId
|
|
||||||
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success {
|
if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -183,11 +161,41 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if stoveLvConf := this.module.configure.GetSmithyStoveConf(stove.Lv); stoveLvConf != nil {
|
||||||
|
maxT = stoveLvConf.MaxTemperature
|
||||||
|
}
|
||||||
|
if stove.RecoveTime == 0 && stove.Temperature <= maxT {
|
||||||
stove.RecoveTime = configure.Now().Unix()
|
stove.RecoveTime = configure.Now().Unix()
|
||||||
update["data"] = stove.Data
|
|
||||||
update["recoveTime"] = stove.RecoveTime
|
update["recoveTime"] = stove.RecoveTime
|
||||||
|
}
|
||||||
|
stove.Data[req.ReelId].Value += 1
|
||||||
|
stove.Forge[req.ReelId] += 1
|
||||||
|
update["data"] = stove.Data
|
||||||
|
|
||||||
update["forge"] = stove.Forge // 打造次数
|
update["forge"] = stove.Forge // 打造次数
|
||||||
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
||||||
|
// 检查是否提升了熟练度等级
|
||||||
|
nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1)
|
||||||
|
if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度
|
||||||
|
stove.Data[req.ReelId].Lv += 1
|
||||||
|
stove.Data[req.ReelId].Value = 0
|
||||||
|
// 校验是否解锁了新的图纸
|
||||||
|
if nextProficiency.Type == comm.SmithyReelType3 {
|
||||||
|
stove.Data[nextProficiency.Value1] = &pb.Mastery{
|
||||||
|
Lv: 1,
|
||||||
|
Value: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是否解锁新套装
|
||||||
|
if nextProficiency.Type == comm.SmithyReelType4 {
|
||||||
|
if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
||||||
|
rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1)
|
||||||
|
update := make(map[string]interface{}, 0)
|
||||||
|
update["suiteId"] = rst.SuiteId
|
||||||
|
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), update)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
rsp.Data = stove
|
rsp.Data = stove
|
||||||
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
||||||
// 更新图鉴信息
|
// 更新图鉴信息
|
||||||
|
@ -38,14 +38,14 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (cod
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
conf := this.module.configure.GetSmithyCustomerConf(req.CustomerId)
|
// conf := this.module.configure.GetSmithyCustomerConf(req.CustomerId)
|
||||||
if conf == nil {
|
// if conf == nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
// code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 发奖励
|
// // 发奖励
|
||||||
this.module.DispenseRes(session, conf.Reword, true)
|
// this.module.DispenseRes(session, conf.Reword, true)
|
||||||
|
|
||||||
rsp := &pb.SmithySellResp{
|
rsp := &pb.SmithySellResp{
|
||||||
CustomerId: req.CustomerId,
|
CustomerId: req.CustomerId,
|
||||||
|
@ -22,6 +22,7 @@ const (
|
|||||||
game_smithyatlaslv = "game_smithyatlaslv.json" // 收藏等级积分
|
game_smithyatlaslv = "game_smithyatlaslv.json" // 收藏等级积分
|
||||||
game_smithyatlasscore = "game_smithyatlasscore.json" // 图鉴积分
|
game_smithyatlasscore = "game_smithyatlasscore.json" // 图鉴积分
|
||||||
game_smithytask = "game_smithytask.json" //图鉴任务
|
game_smithytask = "game_smithytask.json" //图鉴任务
|
||||||
|
game_smithyDrop = "game_smithydrop.json" //装备掉落
|
||||||
)
|
)
|
||||||
|
|
||||||
// /配置管理基础组件
|
// /配置管理基础组件
|
||||||
|
349
pb/dispatch_db.pb.go
Normal file
349
pb/dispatch_db.pb.go
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.0
|
||||||
|
// protoc v3.20.0
|
||||||
|
// source: dispatch/dispatch_db.proto
|
||||||
|
|
||||||
|
package pb
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 玩家派遣信息
|
||||||
|
type DBDispatch struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //
|
||||||
|
Ticket int32 `protobuf:"varint,2,opt,name=ticket,proto3" json:"ticket" bson:"ticket"` //门票
|
||||||
|
Nb *Noticeboard `protobuf:"bytes,3,opt,name=nb,proto3" json:"nb" bson:"nb"` //公告栏
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBDispatch) Reset() {
|
||||||
|
*x = DBDispatch{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_db_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBDispatch) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DBDispatch) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DBDispatch) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_db_proto_msgTypes[0]
|
||||||
|
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 DBDispatch.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DBDispatch) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_db_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBDispatch) GetUid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Uid
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBDispatch) GetTicket() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Ticket
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBDispatch) GetNb() *Noticeboard {
|
||||||
|
if x != nil {
|
||||||
|
return x.Nb
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公告栏
|
||||||
|
type Noticeboard struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Lv int32 `protobuf:"varint,1,opt,name=lv,proto3" json:"lv" bson:"lv"` // 公告栏等级
|
||||||
|
NoticeType int32 `protobuf:"varint,2,opt,name=noticeType,proto3" json:"noticeType" bson:"noticeType"` // 公告栏类型
|
||||||
|
Tasks []*DispatchTask `protobuf:"bytes,3,rep,name=tasks,proto3" json:"tasks" bson:"tasks"` //当前公告任务
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noticeboard) Reset() {
|
||||||
|
*x = Noticeboard{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_db_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noticeboard) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Noticeboard) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Noticeboard) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_db_proto_msgTypes[1]
|
||||||
|
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 Noticeboard.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Noticeboard) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_db_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noticeboard) GetLv() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Lv
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noticeboard) GetNoticeType() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.NoticeType
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noticeboard) GetTasks() []*DispatchTask {
|
||||||
|
if x != nil {
|
||||||
|
return x.Tasks
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 派遣任务
|
||||||
|
type DispatchTask struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId" bson:"taskId"` //任务ID
|
||||||
|
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status" bson:"status"` //任务状态 默认0 1任务中 2任务完成
|
||||||
|
Duration int64 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration" bson:"duration"` //持续截至时间
|
||||||
|
LeftTime int64 `protobuf:"varint,4,opt,name=leftTime,proto3" json:"leftTime" bson:"leftTime"` //任务截至时间
|
||||||
|
HeroIds []string `protobuf:"bytes,5,rep,name=heroIds,proto3" json:"heroIds"` //go_tags(`bson:"heroIds"`) 派遣的英雄
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) Reset() {
|
||||||
|
*x = DispatchTask{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_db_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchTask) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchTask) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_db_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 DispatchTask.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchTask) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_db_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) GetTaskId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TaskId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) GetStatus() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Status
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) GetDuration() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Duration
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) GetLeftTime() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LeftTime
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchTask) GetHeroIds() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.HeroIds
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_dispatch_dispatch_db_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_dispatch_dispatch_db_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x1a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61,
|
||||||
|
0x74, 0x63, 0x68, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x0a,
|
||||||
|
0x44, 0x42, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06,
|
||||||
|
0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69,
|
||||||
|
0x63, 0x6b, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x02, 0x6e, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||||
|
0x32, 0x0c, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x02,
|
||||||
|
0x6e, 0x62, 0x22, 0x62, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x62, 0x6f, 0x61, 0x72,
|
||||||
|
0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c,
|
||||||
|
0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70,
|
||||||
|
0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
|
||||||
|
0x32, 0x0d, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x52,
|
||||||
|
0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x70, 0x61,
|
||||||
|
0x74, 0x63, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
|
||||||
|
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74,
|
||||||
|
0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74,
|
||||||
|
0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x65, 0x66, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18,
|
||||||
|
0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x66, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||||
|
0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09,
|
||||||
|
0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||||
|
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_dispatch_dispatch_db_proto_rawDescOnce sync.Once
|
||||||
|
file_dispatch_dispatch_db_proto_rawDescData = file_dispatch_dispatch_db_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_dispatch_dispatch_db_proto_rawDescGZIP() []byte {
|
||||||
|
file_dispatch_dispatch_db_proto_rawDescOnce.Do(func() {
|
||||||
|
file_dispatch_dispatch_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_dispatch_dispatch_db_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_dispatch_dispatch_db_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_dispatch_dispatch_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
|
var file_dispatch_dispatch_db_proto_goTypes = []interface{}{
|
||||||
|
(*DBDispatch)(nil), // 0: DBDispatch
|
||||||
|
(*Noticeboard)(nil), // 1: Noticeboard
|
||||||
|
(*DispatchTask)(nil), // 2: DispatchTask
|
||||||
|
}
|
||||||
|
var file_dispatch_dispatch_db_proto_depIdxs = []int32{
|
||||||
|
1, // 0: DBDispatch.nb:type_name -> Noticeboard
|
||||||
|
2, // 1: Noticeboard.tasks:type_name -> DispatchTask
|
||||||
|
2, // [2:2] is the sub-list for method output_type
|
||||||
|
2, // [2:2] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension 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_dispatch_dispatch_db_proto_init() }
|
||||||
|
func file_dispatch_dispatch_db_proto_init() {
|
||||||
|
if File_dispatch_dispatch_db_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_dispatch_dispatch_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DBDispatch); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Noticeboard); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchTask); 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{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_dispatch_dispatch_db_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 3,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_dispatch_dispatch_db_proto_goTypes,
|
||||||
|
DependencyIndexes: file_dispatch_dispatch_db_proto_depIdxs,
|
||||||
|
MessageInfos: file_dispatch_dispatch_db_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_dispatch_dispatch_db_proto = out.File
|
||||||
|
file_dispatch_dispatch_db_proto_rawDesc = nil
|
||||||
|
file_dispatch_dispatch_db_proto_goTypes = nil
|
||||||
|
file_dispatch_dispatch_db_proto_depIdxs = nil
|
||||||
|
}
|
538
pb/dispatch_msg.pb.go
Normal file
538
pb/dispatch_msg.pb.go
Normal file
@ -0,0 +1,538 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.0
|
||||||
|
// protoc v3.20.0
|
||||||
|
// source: dispatch/dispatch_msg.proto
|
||||||
|
|
||||||
|
package pb
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 玩家公告
|
||||||
|
type DispatchNoticeReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeReq) Reset() {
|
||||||
|
*x = DispatchNoticeReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchNoticeReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[0]
|
||||||
|
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 DispatchNoticeReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchNoticeReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
type DispatchNoticeResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Dispatch *DBDispatch `protobuf:"bytes,1,opt,name=dispatch,proto3" json:"dispatch"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeResp) Reset() {
|
||||||
|
*x = DispatchNoticeResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchNoticeResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[1]
|
||||||
|
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 DispatchNoticeResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchNoticeResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchNoticeResp) GetDispatch() *DBDispatch {
|
||||||
|
if x != nil {
|
||||||
|
return x.Dispatch
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
//刷新公告
|
||||||
|
type DispatchRefreshReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshReq) Reset() {
|
||||||
|
*x = DispatchRefreshReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchRefreshReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_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 DispatchRefreshReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchRefreshReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
type DispatchRefreshResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshResp) Reset() {
|
||||||
|
*x = DispatchRefreshResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchRefreshResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchRefreshResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[3]
|
||||||
|
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 DispatchRefreshResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchRefreshResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
//一键领取奖励
|
||||||
|
type DispatchReceiveReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveReq) Reset() {
|
||||||
|
*x = DispatchReceiveReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchReceiveReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[4]
|
||||||
|
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 DispatchReceiveReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchReceiveReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
type DispatchReceiveResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveResp) Reset() {
|
||||||
|
*x = DispatchReceiveResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchReceiveResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchReceiveResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_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 DispatchReceiveResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchReceiveResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 派遣
|
||||||
|
type DispatchDoReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId"`
|
||||||
|
HeroId []string `protobuf:"bytes,2,rep,name=heroId,proto3" json:"heroId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoReq) Reset() {
|
||||||
|
*x = DispatchDoReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchDoReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchDoReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[6]
|
||||||
|
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 DispatchDoReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchDoReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{6}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoReq) GetTaskId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TaskId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoReq) GetHeroId() []string {
|
||||||
|
if x != nil {
|
||||||
|
return x.HeroId
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DispatchDoResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoResp) Reset() {
|
||||||
|
*x = DispatchDoResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DispatchDoResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DispatchDoResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DispatchDoResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dispatch_dispatch_msg_proto_msgTypes[7]
|
||||||
|
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 DispatchDoResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DispatchDoResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescGZIP(), []int{7}
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_dispatch_dispatch_msg_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_dispatch_dispatch_msg_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x1b, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61,
|
||||||
|
0x74, 0x63, 0x68, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x64,
|
||||||
|
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
|
||||||
|
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x69, 0x73,
|
||||||
|
0x70, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x22, 0x3d,
|
||||||
|
0x0a, 0x12, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
|
||||||
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x44, 0x69, 0x73, 0x70, 0x61,
|
||||||
|
0x74, 0x63, 0x68, 0x52, 0x08, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x22, 0x14, 0x0a,
|
||||||
|
0x12, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
|
||||||
|
0x52, 0x65, 0x71, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52,
|
||||||
|
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x69,
|
||||||
|
0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71,
|
||||||
|
0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x63, 0x65,
|
||||||
|
0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3f, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x61,
|
||||||
|
0x74, 0x63, 0x68, 0x44, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b,
|
||||||
|
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||||
|
0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
|
||||||
|
0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x70,
|
||||||
|
0x61, 0x74, 0x63, 0x68, 0x44, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||||
|
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_dispatch_dispatch_msg_proto_rawDescOnce sync.Once
|
||||||
|
file_dispatch_dispatch_msg_proto_rawDescData = file_dispatch_dispatch_msg_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_dispatch_dispatch_msg_proto_rawDescGZIP() []byte {
|
||||||
|
file_dispatch_dispatch_msg_proto_rawDescOnce.Do(func() {
|
||||||
|
file_dispatch_dispatch_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_dispatch_dispatch_msg_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_dispatch_dispatch_msg_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_dispatch_dispatch_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||||
|
var file_dispatch_dispatch_msg_proto_goTypes = []interface{}{
|
||||||
|
(*DispatchNoticeReq)(nil), // 0: DispatchNoticeReq
|
||||||
|
(*DispatchNoticeResp)(nil), // 1: DispatchNoticeResp
|
||||||
|
(*DispatchRefreshReq)(nil), // 2: DispatchRefreshReq
|
||||||
|
(*DispatchRefreshResp)(nil), // 3: DispatchRefreshResp
|
||||||
|
(*DispatchReceiveReq)(nil), // 4: DispatchReceiveReq
|
||||||
|
(*DispatchReceiveResp)(nil), // 5: DispatchReceiveResp
|
||||||
|
(*DispatchDoReq)(nil), // 6: DispatchDoReq
|
||||||
|
(*DispatchDoResp)(nil), // 7: DispatchDoResp
|
||||||
|
(*DBDispatch)(nil), // 8: DBDispatch
|
||||||
|
}
|
||||||
|
var file_dispatch_dispatch_msg_proto_depIdxs = []int32{
|
||||||
|
8, // 0: DispatchNoticeResp.dispatch:type_name -> DBDispatch
|
||||||
|
1, // [1:1] is the sub-list for method output_type
|
||||||
|
1, // [1:1] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_dispatch_dispatch_msg_proto_init() }
|
||||||
|
func file_dispatch_dispatch_msg_proto_init() {
|
||||||
|
if File_dispatch_dispatch_msg_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_db_proto_init()
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchNoticeReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchNoticeResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchRefreshReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchRefreshResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchReceiveReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchReceiveResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchDoReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dispatch_dispatch_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DispatchDoResp); 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{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_dispatch_dispatch_msg_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 8,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_dispatch_dispatch_msg_proto_goTypes,
|
||||||
|
DependencyIndexes: file_dispatch_dispatch_msg_proto_depIdxs,
|
||||||
|
MessageInfos: file_dispatch_dispatch_msg_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_dispatch_dispatch_msg_proto = out.File
|
||||||
|
file_dispatch_dispatch_msg_proto_rawDesc = nil
|
||||||
|
file_dispatch_dispatch_msg_proto_goTypes = nil
|
||||||
|
file_dispatch_dispatch_msg_proto_depIdxs = nil
|
||||||
|
}
|
@ -334,6 +334,8 @@ const (
|
|||||||
ErrorCode_SmithyNoActivateAtlas ErrorCode = 4113 // 没有图鉴更新数据
|
ErrorCode_SmithyNoActivateAtlas ErrorCode = 4113 // 没有图鉴更新数据
|
||||||
ErrorCode_SmithyLvToolsFailed ErrorCode = 4114 //
|
ErrorCode_SmithyLvToolsFailed ErrorCode = 4114 //
|
||||||
ErrorCode_SmithyLvToolsPre ErrorCode = 4115 // 前置条件不足
|
ErrorCode_SmithyLvToolsPre ErrorCode = 4115 // 前置条件不足
|
||||||
|
// dispatch
|
||||||
|
ErrorCode_DispatchHeroNoReached ErrorCode = 4201 //英雄条件未达标
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enum value maps for ErrorCode.
|
// Enum value maps for ErrorCode.
|
||||||
@ -618,6 +620,7 @@ var (
|
|||||||
4113: "SmithyNoActivateAtlas",
|
4113: "SmithyNoActivateAtlas",
|
||||||
4114: "SmithyLvToolsFailed",
|
4114: "SmithyLvToolsFailed",
|
||||||
4115: "SmithyLvToolsPre",
|
4115: "SmithyLvToolsPre",
|
||||||
|
4201: "DispatchHeroNoReached",
|
||||||
}
|
}
|
||||||
ErrorCode_value = map[string]int32{
|
ErrorCode_value = map[string]int32{
|
||||||
"Success": 0,
|
"Success": 0,
|
||||||
@ -899,6 +902,7 @@ var (
|
|||||||
"SmithyNoActivateAtlas": 4113,
|
"SmithyNoActivateAtlas": 4113,
|
||||||
"SmithyLvToolsFailed": 4114,
|
"SmithyLvToolsFailed": 4114,
|
||||||
"SmithyLvToolsPre": 4115,
|
"SmithyLvToolsPre": 4115,
|
||||||
|
"DispatchHeroNoReached": 4201,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -933,7 +937,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_errorcode_proto_rawDesc = []byte{
|
var file_errorcode_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x2a, 0xe3, 0x32, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
0x6f, 0x2a, 0xff, 0x32, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||||
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
||||||
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
||||||
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
@ -1339,8 +1343,10 @@ var file_errorcode_proto_rawDesc = []byte{
|
|||||||
0x6c, 0x61, 0x73, 0x10, 0x91, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79,
|
0x6c, 0x61, 0x73, 0x10, 0x91, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79,
|
||||||
0x4c, 0x76, 0x54, 0x6f, 0x6f, 0x6c, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x92, 0x20,
|
0x4c, 0x76, 0x54, 0x6f, 0x6f, 0x6c, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x92, 0x20,
|
||||||
0x12, 0x15, 0x0a, 0x10, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x4c, 0x76, 0x54, 0x6f, 0x6f, 0x6c,
|
0x12, 0x15, 0x0a, 0x10, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x4c, 0x76, 0x54, 0x6f, 0x6f, 0x6c,
|
||||||
0x73, 0x50, 0x72, 0x65, 0x10, 0x93, 0x20, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
0x73, 0x50, 0x72, 0x65, 0x10, 0x93, 0x20, 0x12, 0x1a, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x70, 0x61,
|
||||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x74, 0x63, 0x68, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64,
|
||||||
|
0x10, 0xe9, 0x20, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
37
sys/configure/structs/Game.DispatchCond.go
Normal file
37
sys/configure/structs/Game.DispatchCond.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package cfg
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
type GameDispatchCond struct {
|
||||||
|
Key int32
|
||||||
|
Param int32
|
||||||
|
}
|
||||||
|
|
||||||
|
const TypeId_GameDispatchCond = -852261064
|
||||||
|
|
||||||
|
func (*GameDispatchCond) GetTypeId() int32 {
|
||||||
|
return -852261064
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_v *GameDispatchCond)Deserialize(_buf map[string]interface{}) (err error) {
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["param"].(float64); !_ok_ { err = errors.New("param error"); return }; _v.Param = int32(_tempNum_) }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeserializeGameDispatchCond(_buf map[string]interface{}) (*GameDispatchCond, error) {
|
||||||
|
v := &GameDispatchCond{}
|
||||||
|
if err := v.Deserialize(_buf); err == nil {
|
||||||
|
return v, nil
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
14
sys/configure/structs/Game.DispatchCondType.go
Normal file
14
sys/configure/structs/Game.DispatchCondType.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package cfg
|
||||||
|
|
||||||
|
const (
|
||||||
|
GameDispatchCondType_Lv = 1
|
||||||
|
GameDispatchCondType_Star = 2
|
||||||
|
)
|
@ -12,7 +12,7 @@ import "errors"
|
|||||||
|
|
||||||
type GameDispatch_LvData struct {
|
type GameDispatch_LvData struct {
|
||||||
Lv int32
|
Lv int32
|
||||||
Probability []float32
|
Probability []int32
|
||||||
Upgrade int32
|
Upgrade int32
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,11 +29,11 @@ func (_v *GameDispatch_LvData)Deserialize(_buf map[string]interface{}) (err erro
|
|||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
if _arr_, _ok_ = _buf["probability"].([]interface{}); !_ok_ { err = errors.New("probability error"); return }
|
if _arr_, _ok_ = _buf["probability"].([]interface{}); !_ok_ { err = errors.New("probability error"); return }
|
||||||
|
|
||||||
_v.Probability = make([]float32, 0, len(_arr_))
|
_v.Probability = make([]int32, 0, len(_arr_))
|
||||||
|
|
||||||
for _, _e_ := range _arr_ {
|
for _, _e_ := range _arr_ {
|
||||||
var _list_v_ float32
|
var _list_v_ int32
|
||||||
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) }
|
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
|
||||||
_v.Probability = append(_v.Probability, _list_v_)
|
_v.Probability = append(_v.Probability, _list_v_)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,12 @@ type GameDispatch_TaskData struct {
|
|||||||
Id int32
|
Id int32
|
||||||
Type int32
|
Type int32
|
||||||
Taskname string
|
Taskname string
|
||||||
Taskcd float32
|
Taskcd int32
|
||||||
Tasktime float32
|
Tasktime int32
|
||||||
Tasktxt string
|
Tasktxt string
|
||||||
Taskneed int32
|
Taskneed int32
|
||||||
Taskreq []string
|
Taskreq []*GameDispatchCond
|
||||||
Taskreqex []string
|
Taskreqex []*GameDispatchCond
|
||||||
Reward []*Gameatn
|
Reward []*Gameatn
|
||||||
Rewardex []*Gameatn
|
Rewardex []*Gameatn
|
||||||
}
|
}
|
||||||
@ -34,8 +34,8 @@ func (_v *GameDispatch_TaskData)Deserialize(_buf map[string]interface{}) (err er
|
|||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
|
||||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["taskname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Taskname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Taskname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["taskname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Taskname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Taskname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskcd"].(float64); !_ok_ { err = errors.New("taskcd error"); return }; _v.Taskcd = float32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskcd"].(float64); !_ok_ { err = errors.New("taskcd error"); return }; _v.Taskcd = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["tasktime"].(float64); !_ok_ { err = errors.New("tasktime error"); return }; _v.Tasktime = float32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["tasktime"].(float64); !_ok_ { err = errors.New("tasktime error"); return }; _v.Tasktime = int32(_tempNum_) }
|
||||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["tasktxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Tasktxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Tasktxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["tasktxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Tasktxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Tasktxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskneed"].(float64); !_ok_ { err = errors.New("taskneed error"); return }; _v.Taskneed = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskneed"].(float64); !_ok_ { err = errors.New("taskneed error"); return }; _v.Taskneed = int32(_tempNum_) }
|
||||||
{
|
{
|
||||||
@ -43,11 +43,11 @@ func (_v *GameDispatch_TaskData)Deserialize(_buf map[string]interface{}) (err er
|
|||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
if _arr_, _ok_ = _buf["taskreq"].([]interface{}); !_ok_ { err = errors.New("taskreq error"); return }
|
if _arr_, _ok_ = _buf["taskreq"].([]interface{}); !_ok_ { err = errors.New("taskreq error"); return }
|
||||||
|
|
||||||
_v.Taskreq = make([]string, 0, len(_arr_))
|
_v.Taskreq = make([]*GameDispatchCond, 0, len(_arr_))
|
||||||
|
|
||||||
for _, _e_ := range _arr_ {
|
for _, _e_ := range _arr_ {
|
||||||
var _list_v_ string
|
var _list_v_ *GameDispatchCond
|
||||||
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
|
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameDispatchCond(_x_); err != nil { return } }
|
||||||
_v.Taskreq = append(_v.Taskreq, _list_v_)
|
_v.Taskreq = append(_v.Taskreq, _list_v_)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,11 +57,11 @@ func (_v *GameDispatch_TaskData)Deserialize(_buf map[string]interface{}) (err er
|
|||||||
var _ok_ bool
|
var _ok_ bool
|
||||||
if _arr_, _ok_ = _buf["taskreqex"].([]interface{}); !_ok_ { err = errors.New("taskreqex error"); return }
|
if _arr_, _ok_ = _buf["taskreqex"].([]interface{}); !_ok_ { err = errors.New("taskreqex error"); return }
|
||||||
|
|
||||||
_v.Taskreqex = make([]string, 0, len(_arr_))
|
_v.Taskreqex = make([]*GameDispatchCond, 0, len(_arr_))
|
||||||
|
|
||||||
for _, _e_ := range _arr_ {
|
for _, _e_ := range _arr_ {
|
||||||
var _list_v_ string
|
var _list_v_ *GameDispatchCond
|
||||||
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
|
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameDispatchCond(_x_); err != nil { return } }
|
||||||
_v.Taskreqex = append(_v.Taskreqex, _list_v_)
|
_v.Taskreqex = append(_v.Taskreqex, _list_v_)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
42
sys/configure/structs/Game.SmithyDrop.go
Normal file
42
sys/configure/structs/Game.SmithyDrop.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package cfg
|
||||||
|
|
||||||
|
type GameSmithyDrop struct {
|
||||||
|
_dataMap map[int32]*GameSmithyDropData
|
||||||
|
_dataList []*GameSmithyDropData
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGameSmithyDrop(_buf []map[string]interface{}) (*GameSmithyDrop, error) {
|
||||||
|
_dataList := make([]*GameSmithyDropData, 0, len(_buf))
|
||||||
|
dataMap := make(map[int32]*GameSmithyDropData)
|
||||||
|
for _, _ele_ := range _buf {
|
||||||
|
if _v, err2 := DeserializeGameSmithyDropData(_ele_); err2 != nil {
|
||||||
|
return nil, err2
|
||||||
|
} else {
|
||||||
|
_dataList = append(_dataList, _v)
|
||||||
|
dataMap[_v.Id] = _v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return &GameSmithyDrop{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameSmithyDrop) GetDataMap() map[int32]*GameSmithyDropData {
|
||||||
|
return table._dataMap
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameSmithyDrop) GetDataList() []*GameSmithyDropData {
|
||||||
|
return table._dataList
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameSmithyDrop) Get(key int32) *GameSmithyDropData {
|
||||||
|
return table._dataMap[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
58
sys/configure/structs/Game.SmithyDropData.go
Normal file
58
sys/configure/structs/Game.SmithyDropData.go
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package cfg
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
type GameSmithyDropData struct {
|
||||||
|
Id int32
|
||||||
|
Dropid int32
|
||||||
|
Condition int32
|
||||||
|
Prize []*Gameatn
|
||||||
|
Star int32
|
||||||
|
P int32
|
||||||
|
}
|
||||||
|
|
||||||
|
const TypeId_GameSmithyDropData = -1505870933
|
||||||
|
|
||||||
|
func (*GameSmithyDropData) GetTypeId() int32 {
|
||||||
|
return -1505870933
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_v *GameSmithyDropData)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 _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["dropid"].(float64); !_ok_ { err = errors.New("dropid error"); return }; _v.Dropid = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["condition"].(float64); !_ok_ { err = errors.New("condition error"); return }; _v.Condition = int32(_tempNum_) }
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["prize"].([]interface{}); !_ok_ { err = errors.New("prize error"); return }
|
||||||
|
|
||||||
|
_v.Prize = make([]*Gameatn, 0, len(_arr_))
|
||||||
|
|
||||||
|
for _, _e_ := range _arr_ {
|
||||||
|
var _list_v_ *Gameatn
|
||||||
|
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||||
|
_v.Prize = append(_v.Prize, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["p"].(float64); !_ok_ { err = errors.New("p error"); return }; _v.P = int32(_tempNum_) }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeserializeGameSmithyDropData(_buf map[string]interface{}) (*GameSmithyDropData, error) {
|
||||||
|
v := &GameSmithyDropData{}
|
||||||
|
if err := v.Deserialize(_buf); err == nil {
|
||||||
|
return v, nil
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
50
sys/configure/structs/Game.dispatch.go
Normal file
50
sys/configure/structs/Game.dispatch.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package cfg
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
type Gamedispatch struct {
|
||||||
|
N int32
|
||||||
|
G []*Gameatn
|
||||||
|
}
|
||||||
|
|
||||||
|
const TypeId_Gamedispatch = -1941607722
|
||||||
|
|
||||||
|
func (*Gamedispatch) GetTypeId() int32 {
|
||||||
|
return -1941607722
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_v *Gamedispatch)Deserialize(_buf map[string]interface{}) (err error) {
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["n"].(float64); !_ok_ { err = errors.New("n error"); return }; _v.N = int32(_tempNum_) }
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["g"].([]interface{}); !_ok_ { err = errors.New("g error"); return }
|
||||||
|
|
||||||
|
_v.G = make([]*Gameatn, 0, len(_arr_))
|
||||||
|
|
||||||
|
for _, _e_ := range _arr_ {
|
||||||
|
var _list_v_ *Gameatn
|
||||||
|
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||||
|
_v.G = append(_v.G, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeserializeGamedispatch(_buf map[string]interface{}) (*Gamedispatch, error) {
|
||||||
|
v := &Gamedispatch{}
|
||||||
|
if err := v.Deserialize(_buf); err == nil {
|
||||||
|
return v, nil
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
@ -167,6 +167,7 @@ type Tables struct {
|
|||||||
SmithyAtlas *GameSmithyAtlas
|
SmithyAtlas *GameSmithyAtlas
|
||||||
SmithyAtlasLv *GameSmithyAtlasLv
|
SmithyAtlasLv *GameSmithyAtlasLv
|
||||||
SmithyAtlasScore *GameSmithyAtlasScore
|
SmithyAtlasScore *GameSmithyAtlasScore
|
||||||
|
SmithyDrop *GameSmithyDrop
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTables(loader JsonLoader) (*Tables, error) {
|
func NewTables(loader JsonLoader) (*Tables, error) {
|
||||||
@ -1110,5 +1111,11 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
|||||||
if tables.SmithyAtlasScore, err = NewGameSmithyAtlasScore(buf); err != nil {
|
if tables.SmithyAtlasScore, err = NewGameSmithyAtlasScore(buf); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if buf, err = loader("game_smithydrop"); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if tables.SmithyDrop, err = NewGameSmithyDrop(buf); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return tables, nil
|
return tables, nil
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ func TestRandom(t *testing.T) {
|
|||||||
|
|
||||||
func TestNumber(t *testing.T) {
|
func TestNumber(t *testing.T) {
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
fmt.Println(utils.RandomNumbers(0, 99, 10))
|
fmt.Println(utils.RandomNumbers(0, 4, 6))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user