This commit is contained in:
meixiongfeng 2023-05-23 17:02:16 +08:00
commit d573f458da
26 changed files with 9670 additions and 6591 deletions

View File

@ -7,3 +7,12 @@ go build -o ./bin/cmd ./services/cmd/main.go
go build -o ./bin/mainte ./services/mainte/main.go
go build -o ./bin/gateway ./services/gateway/main.go
go build -o ./bin/worker ./services/worker/main.go
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=5ae6b8eacb8f065c6b6c8211febaf024a4179652b82c4c2ad59a8878cecee5e4' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": "服务构建完成"
}
}'

BIN
bin/cmd

Binary file not shown.

Binary file not shown.

View File

@ -434,10 +434,98 @@
1
]
},
{
"id": 1100106,
"chapterid": 11001,
"previoustage": 1100105,
"Episodetype": 1,
"openlevel": 1,
"Episodelocation": {
"x": 0,
"y": 0,
"z": 0
},
"EditorStage": 0,
"detailwindow": "effect_chezhan",
"frontstoryid": 636,
"afterstoryid": 637,
"mainlineName": {
"key": "mainchapter_main_stage_mainlineName_6",
"text": "1-6"
},
"title": {
"key": "mainchapter_main_stage_title_6",
"text": "第6关猩猩怪山洞"
},
"desc": {
"key": "mainchapter_main_stage_desc_6",
"text": "原来猩猩怪意外获得月光原石,这才导致地质突变,一群人进入抢夺月光原石的混战。"
},
"exp": 800,
"hero_exp": 3150,
"ps_consume": [
{
"a": "attr",
"t": "ps",
"n": 5
}
],
"ps_mg": [
{
"a": "attr",
"t": "ps",
"n": 1
}
],
"firstaward": [
{
"a": "attr",
"t": "gold",
"n": 18140
},
{
"a": "item",
"t": "600004",
"n": 1
},
{
"a": "attr",
"t": "exp",
"n": 1000
}
],
"commonaward": [
{
"a": "attr",
"t": "gold",
"n": 18140
}
],
"BattleReadyID": 102,
"FormatList": [
101051
],
"captainId": 550025,
"star": [
1,
1,
1
],
"star_type": [
1,
2,
2
],
"star_value": [
0,
2,
1
]
},
{
"id": 1100201,
"chapterid": 11002,
"previoustage": 1100105,
"previoustage": 1100106,
"Episodetype": 1,
"openlevel": 1,
"Episodelocation": {

File diff suppressed because it is too large Load Diff

View File

@ -182,16 +182,586 @@
]
},
{
"id": 113,
"id": 370,
"name": {
"key": "worldtask_world_all_name_9",
"text": "日常测试任务"
"text": "测试主线1"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_9",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 3
}
]
},
{
"id": 380,
"name": {
"key": "worldtask_world_all_name_10",
"text": "测试主线2"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_10",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 4
}
]
},
{
"id": 390,
"name": {
"key": "worldtask_world_all_name_11",
"text": "测试主线3"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_11",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 5
}
]
},
{
"id": 400,
"name": {
"key": "worldtask_world_all_name_12",
"text": "测试主线4"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_12",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 6
}
]
},
{
"id": 410,
"name": {
"key": "worldtask_world_all_name_13",
"text": "测试主线5"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_13",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 7
}
]
},
{
"id": 420,
"name": {
"key": "worldtask_world_all_name_14",
"text": "测试主线6"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_14",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 8
}
]
},
{
"id": 430,
"name": {
"key": "worldtask_world_all_name_15",
"text": "测试主线7"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_15",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 9
}
]
},
{
"id": 440,
"name": {
"key": "worldtask_world_all_name_16",
"text": "测试主线8"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_16",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 10
}
]
},
{
"id": 450,
"name": {
"key": "worldtask_world_all_name_17",
"text": "测试主线9"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_17",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 11
}
]
},
{
"id": 460,
"name": {
"key": "worldtask_world_all_name_18",
"text": "测试主线10"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_18",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 12
}
]
},
{
"id": 470,
"name": {
"key": "worldtask_world_all_name_19",
"text": "测试主线11"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_19",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 13
}
]
},
{
"id": 480,
"name": {
"key": "worldtask_world_all_name_20",
"text": "测试主线12"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_20",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 14
}
]
},
{
"id": 490,
"name": {
"key": "worldtask_world_all_name_21",
"text": "测试主线13"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_21",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 15
}
]
},
{
"id": 500,
"name": {
"key": "worldtask_world_all_name_22",
"text": "测试主线14"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_22",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 16
}
]
},
{
"id": 510,
"name": {
"key": "worldtask_world_all_name_23",
"text": "测试主线15"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_23",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 17
}
]
},
{
"id": 520,
"name": {
"key": "worldtask_world_all_name_24",
"text": "测试主线16"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_24",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 18
}
]
},
{
"id": 530,
"name": {
"key": "worldtask_world_all_name_25",
"text": "测试主线17"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_25",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 19
}
]
},
{
"id": 540,
"name": {
"key": "worldtask_world_all_name_26",
"text": "测试主线18"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_26",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 20
}
]
},
{
"id": 550,
"name": {
"key": "worldtask_world_all_name_27",
"text": "测试主线19"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_27",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 21
}
]
},
{
"id": 560,
"name": {
"key": "worldtask_world_all_name_28",
"text": "测试主线20"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_28",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 22
}
]
},
{
"id": 570,
"name": {
"key": "worldtask_world_all_name_29",
"text": "测试主线21"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_29",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 23
}
]
},
{
"id": 580,
"name": {
"key": "worldtask_world_all_name_30",
"text": "测试主线22"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_30",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 24
}
]
},
{
"id": 590,
"name": {
"key": "worldtask_world_all_name_31",
"text": "测试主线23"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_31",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 25
}
]
},
{
"id": 600,
"name": {
"key": "worldtask_world_all_name_32",
"text": "测试主线24"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_32",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 26
}
]
},
{
"id": 610,
"name": {
"key": "worldtask_world_all_name_33",
"text": "测试主线25"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_33",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 27
}
]
},
{
"id": 620,
"name": {
"key": "worldtask_world_all_name_34",
"text": "测试主线26"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_34",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 28
}
]
},
{
"id": 630,
"name": {
"key": "worldtask_world_all_name_35",
"text": "测试主线27"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_35",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 29
}
]
},
{
"id": 640,
"name": {
"key": "worldtask_world_all_name_36",
"text": "测试主线28"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_36",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 30
}
]
},
{
"id": 650,
"name": {
"key": "worldtask_world_all_name_37",
"text": "测试主线29"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_37",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 31
}
]
},
{
"id": 660,
"name": {
"key": "worldtask_world_all_name_38",
"text": "测试主线30"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_38",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
"t": "30001",
"n": 32
}
]
},
{
"id": 70010,
"name": {
"key": "worldtask_world_all_name_39",
"text": "日常测试任务"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_39",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [
{
"a": "item",
@ -201,14 +771,14 @@
]
},
{
"id": 410,
"id": 80010,
"name": {
"key": "worldtask_world_all_name_10",
"key": "worldtask_world_all_name_40",
"text": "周常测试任务"
},
"task_icon": "",
"task_txt": {
"key": "worldtask_world_all_task_txt_10",
"key": "worldtask_world_all_task_txt_40",
"text": "完成所有任务有可以领取额外奖励"
},
"reword": [

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,5 +1,22 @@
#!/bin/sh
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=5ae6b8eacb8f065c6b6c8211febaf024a4179652b82c4c2ad59a8878cecee5e4' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": " 服务正在启动"
}
}'
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=e15fc4f867d6b83336eb720f70d0fb66de1dab49da944f33478d8e619f35c2ac' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": "* 服务正在启动"
}
}'
./stup.sh start dfcross_1_worker0 worker ./conf/dfcross_1_worker0.yaml
sleep 1
./stup.sh start dfcross_1_mainte mainte ./conf/dfcross_1_mainte.yaml
@ -9,3 +26,24 @@ sleep 1
./stup.sh start df01_worker0 worker ./conf/df01_worker0.yaml
sleep 1
./stup.sh start df01_gateway0 gateway ./conf/df01_gateway0.yaml
sleep 1
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=5ae6b8eacb8f065c6b6c8211febaf024a4179652b82c4c2ad59a8878cecee5e4' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": " 服务启动完成"
}
}'
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=e15fc4f867d6b83336eb720f70d0fb66de1dab49da944f33478d8e619f35c2ac' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": "* 服务启动完成"
}
}'

View File

@ -1,4 +1,23 @@
#!/bin/sh
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=5ae6b8eacb8f065c6b6c8211febaf024a4179652b82c4c2ad59a8878cecee5e4' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": " 服务停止"
}
}'
curl -XPOST -s -L 'https://oapi.dingtalk.com/robot/send?access_token=e15fc4f867d6b83336eb720f70d0fb66de1dab49da944f33478d8e619f35c2ac' -H 'Content-Type: application/json' -H "charset:utf-8" -d '{"msgtype": "text",
"text": {
"content": "* 服务停止"
}
}'
./stup.sh stop df01_gateway0
./stup.sh stop df01_mainte

Binary file not shown.

View File

@ -42,6 +42,7 @@ type Config struct {
ServiceDBInfo *pb.ServiceDBInfo `json:"serviceDBInfo,omitempty"` //
JsonDir string `json:"jsonDir,omitempty"` //json配置目录
PingConf *PingConf `json:"pingConf,omitempty"` //ping配置
MultiMgo map[string]*MgoDB `json:"multiMgo,omitempty"` //MongoDBMap
}
type PingConf struct {

View File

@ -1,11 +1,17 @@
package formview
import (
"fmt"
os_storage "go_dreamfactory/cmd/v2/lib/storage"
"go_dreamfactory/cmd/v2/model"
"strings"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
"github.com/spf13/cast"
@ -29,36 +35,90 @@ func (this *GlobalConfView) CreateView(t *model.TestCase) fyne.CanvasObject {
logrus.Error(err)
return &fyne.Container{}
}
//redis form
redisForm := widget.NewForm()
//mongo form
mongoUrl := widget.NewEntry()
port := widget.NewEntry()
user := widget.NewEntry()
passd := widget.NewEntry()
mongoDatabase := widget.NewEntry()
mongoForm := widget.NewForm(
widget.NewFormItem("Addr", container.NewBorder(nil, nil, nil, port, mongoUrl)),
widget.NewFormItem("User", user),
widget.NewFormItem("Pass", passd),
widget.NewFormItem("DBName", mongoDatabase),
)
if this.conf.ServiceDBInfo != nil {
user.Text = this.conf.MgoDB.User
passd.Text = this.conf.MgoDB.Password
mongoUrl.Text = this.conf.MgoDB.Host
port.Text = cast.ToString(this.conf.MgoDB.Port)
mongoDatabase.Text = this.conf.MgoDB.Database
// 表单
createForm := func() *widget.Form {
name := widget.NewEntry()
mongoUrl := widget.NewEntry()
port := widget.NewEntry()
user := widget.NewEntry()
passd := widget.NewEntry()
mongoDatabase := widget.NewEntry()
mongoForm := widget.NewForm(
widget.NewFormItem("Name", name),
widget.NewFormItem("Addr", container.NewBorder(nil, nil, nil, port, mongoUrl)),
widget.NewFormItem("User", user),
widget.NewFormItem("Pass", passd),
widget.NewFormItem("DBName", mongoDatabase),
)
return mongoForm
}
bottomBtn := widget.NewButton("保存", func() {
if err := this.storage.StoreConfig(this.conf); err != nil {
logrus.Error(err)
center := container.NewHBox()
topBtn := widget.NewButton("新建", func() {
//mongo form
mongoForm := createForm()
dconf := dialog.NewCustom("创建数据源", "关闭", mongoForm, this.w)
mongoForm.OnSubmit = func() {
if this.conf.MultiMgo == nil {
this.conf.MultiMgo = make(map[string]*os_storage.MgoDB)
}
name := mongoForm.Items[0]
mongoUrl := mongoForm.Items[1]
port := mongoForm.Items[2]
user := mongoForm.Items[3]
passd := mongoForm.Items[4]
mongoDatabase := mongoForm.Items[5]
if _, ok := this.conf.MultiMgo[name.Text]; ok {
dialog.NewInformation("提示", name.Text+" 数据源已存在", this.w)
return
}
this.conf.MultiMgo[name.Text] = &os_storage.MgoDB{
Name: name.Text,
Host: mongoUrl.Text,
Port: cast.ToInt32(port.Text),
User: user.Text,
Password: passd.Text,
Database: mongoDatabase.Text,
}
if err := this.storage.StoreConfig(this.conf); err != nil {
logrus.Error(err)
}
dconf.Hide()
center.Refresh()
}
mongoForm.SubmitText = "确定"
dconf.Resize(fyne.NewSize(400, 200))
dconf.Show()
})
layout := container.NewGridWithRows(2, redisForm, mongoForm)
c := container.NewBorder(nil, bottomBtn, nil, nil, layout)
editBtn := widget.NewButtonWithIcon("", theme.SettingsIcon(), func() {})
// 创建Card
for k, v := range this.conf.MultiMgo {
data := binding.BindStringList(&[]string{})
data.Append(fmt.Sprintf("%-3s\t: %s", "addr", strings.Join([]string{v.Host, cast.ToString(v.Port)}, ":")))
data.Append(fmt.Sprintf("user:%v", v.User))
data.Append(fmt.Sprintf("pass:%v", v.Password))
data.Append(fmt.Sprintf("DB:%v", v.Database))
dataList := widget.NewListWithData(data,
func() fyne.CanvasObject {
return widget.NewLabel("template")
},
func(i binding.DataItem, o fyne.CanvasObject) {
o.(*widget.Label).Bind(i.(binding.String))
},
)
obj := widget.NewCard("", "",
container.NewBorder(container.NewHBox(widget.NewLabel(k), layout.NewSpacer(), editBtn), nil, nil, nil, dataList),
)
obj.Resize(fyne.NewSize(400, 450))
center.AddObject(obj)
}
c := container.NewBorder(container.NewHBox(topBtn), nil, nil, nil, container.NewWithoutLayout(container.NewHBox(center)))
return c
}

View File

@ -82,32 +82,42 @@ func (this *Logger) Enabled(lvl Loglevel) bool {
return this.level.Enabled(lvl)
}
func (this *Logger) Debug(msg string, args ...Field) {
this.Log(DebugLevel, msg, args...)
}
func (this *Logger) Info(msg string, args ...Field) {
this.Log(InfoLevel, msg, args...)
}
func (this *Logger) Print(msg string, args ...Field) {
this.Log(InfoLevel, msg, args...)
}
func (this *Logger) Warn(msg string, args ...Field) {
this.Log(WarnLevel, msg, args...)
}
func (this *Logger) Error(msg string, args ...Field) {
this.Log(ErrorLevel, msg, args...)
}
func (this *Logger) Panic(msg string, args ...Field) {
this.Log(PanicLevel, msg, args...)
}
func (this *Logger) Fatal(msg string, args ...Field) {
this.Log(FatalLevel, msg, args...)
os.Exit(1)
}
func (this *Logger) Log(level Loglevel, msg string, args ...Field) {
if this.level.Enabled(level) {
this.logWithFields(level, msg, args...)
if this.level.Enabled(DebugLevel) {
this.logWithFields(DebugLevel, msg, args...)
}
}
func (this *Logger) Info(msg string, args ...Field) {
if this.level.Enabled(InfoLevel) {
this.logWithFields(InfoLevel, msg, args...)
}
}
func (this *Logger) Print(msg string, args ...Field) {
if this.level.Enabled(InfoLevel) {
this.logWithFields(InfoLevel, msg, args...)
}
}
func (this *Logger) Warn(msg string, args ...Field) {
if this.level.Enabled(WarnLevel) {
this.logWithFields(WarnLevel, msg, args...)
}
}
func (this *Logger) Error(msg string, args ...Field) {
if this.level.Enabled(ErrorLevel) {
this.logWithFields(ErrorLevel, msg, args...)
}
}
func (this *Logger) Panic(msg string, args ...Field) {
if this.level.Enabled(PanicLevel) {
this.logWithFields(PanicLevel, msg, args...)
}
}
func (this *Logger) Fatal(msg string, args ...Field) {
if this.level.Enabled(FatalLevel) {
this.logWithFields(ErrorLevel, msg, args...)
}
os.Exit(1)
}
func (this *Logger) Debugf(format string, args ...interface{}) {
this.Logf(DebugLevel, format, args...)
}

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db"
"math/rand"
"time"
)
@ -48,6 +49,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (code
info = &pb.DBArenaUser{
Uid: session.GetUserId(),
Name: user.Name,
Avatar: user.Avatar,
Lv: user.Lv,
Integral: global.ArenaInitiaIntegral,
Streak: 0,
@ -60,6 +62,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (code
code = pb.ErrorCode_ConfigNoFound
return
}
info.Loc = []float64{float64(info.Dan), float64(rand.Int31n(100)) / 1000.0}
if err = this.module.modelArena.Add(session.GetUserId(), info); err != nil {
this.module.Errorln(err)
}

View File

@ -72,6 +72,8 @@ func (a *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (code pb.
return
}
go a.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype186, 1))
//扣除门票
a.module.ConsumeRes(session, []*cfg.Gameatn{ticketAtn}, true)

View File

@ -167,7 +167,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
code = pb.ErrorCode_SystemError
return
}
tasks = append(tasks, comm.GettaskParam(comm.Rtype5, 1, equipNum, utils.ToInt32(hero.HeroID)))
tasks = append(tasks, comm.GettaskParam(comm.Rtype5, equipNum, utils.ToInt32(hero.HeroID)))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype5, utils.ToInt32(hero.HeroID), equipNum)
for k, v := range equipStr {
tasks = append(tasks, comm.GettaskParam(comm.Rtype41, 1, utils.ToInt32(hero.HeroID), v, k))

View File

@ -609,28 +609,6 @@ func (this *ModuleBase) Panicln(args ...interface{}) {
this.options.GetLog().Panicln(args...)
}
func (this *ModuleBase) DebugWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) InfoWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) PrintWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) WarnWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) ErrorWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) FatalWithField(msg string, fields ...log.Field) {
}
func (this *ModuleBase) PanicWithField(msg string, fields ...log.Field) {
}
// 发放资源
func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gameatn, bPush bool) (code pb.ErrorCode, atno []*pb.UserAtno) {
var (

View File

@ -186,7 +186,8 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (condis []*rtaskCondHandle)
comm.Rtype62, comm.Rtype64, comm.Rtype69, comm.Rtype72, comm.Rtype88, comm.Rtype104,
comm.Rtype96, comm.Rtype105, comm.Rtype128, comm.Rtype130, comm.Rtype131,
comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146,
comm.Rtype147, comm.Rtype149, comm.Rtype153, comm.Rtype154, comm.Rtype155, comm.Rtype156:
comm.Rtype147, comm.Rtype149, comm.Rtype153, comm.Rtype154, comm.Rtype155, comm.Rtype156,
comm.Rtype171, comm.Rtype186:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.lessEqualFirstParam,
@ -309,6 +310,17 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com
return
}
if conf.Data == 1 { //接取
if r, ok := record.Vals[handle.condId]; ok {
if r.Flag == 0 { //非接取
r.Data = make(map[int32]int32)
r.Rtype = conf.Type
} else {
return
}
}
}
if handle.update != nil {
if err := handle.update(uid, record, conf, params...); err != nil {
log.Errorf("update task:%v", err)

View File

@ -7,7 +7,7 @@ import (
cfg "go_dreamfactory/sys/configure/structs"
)
//活跃度领取
// 活跃度领取
func (this *apiComp) ActiveReceiveCheck(session comm.IUserSession, req *pb.TaskActiveReceiveReq) (code pb.ErrorCode) {
if req.Id == 0 {
code = pb.ErrorCode_TaskIdEmpty
@ -87,6 +87,7 @@ func (this *apiComp) ActiveReceive(session comm.IUserSession, req *pb.TaskActive
log.Field{Key: "code", Value: code},
)
}
go this.moduleTask.ModuleRtask.TriggerTask(uid, comm.GettaskParam(comm.Rtype171, 1))
}
resp := &pb.TaskActiveReceiveResp{

View File

@ -278,9 +278,11 @@ func (this *ModelTask) initTask(uid string, taskTag comm.TaskTag) error {
}
}
if err := this.Change(uid, update); err != nil {
this.moduleTask.Errorf("initTask err %v", err)
return err
if len(update) > 0 {
if err := this.Change(uid, update); err != nil {
this.moduleTask.Errorf("initTask err %v", err)
return err
}
}
return nil
}

View File

@ -65,7 +65,7 @@ func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err
)
return
}
this.module.Error("Get", log.Field{Key: "uid", Value: uid})
// this.module.Error("Get", log.Field{Key: "uid", Value: uid})
return result, err
}
}

View File

@ -146,6 +146,15 @@ func (this *ModelWorldtask) checkCondi(uid string, condiId int32) bool {
)
return false
}
//update flag=1
dr := iwt.GetCondiData(uid)
if dr != nil {
if v, ok := dr.Vals[condiId]; ok {
v.Flag = 1
iwt.ChangeCondi(uid, dr.Vals)
}
}
return true
}
}

View File

@ -197,7 +197,7 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId
mytask.CurrentTask = make(map[int32]*pb.Worldtask)
}
if len(nextTaskIds) == 1 {
if len(nextTaskIds) >= 1 {
mytask.CurrentTask[groupId] = &pb.Worldtask{
TaskId: nextTaskIds[0],
TaskType: 2, //设置主线类型

View File

@ -455,6 +455,7 @@ type RtaskData struct {
Data map[int32]int32 `protobuf:"bytes,1,rep,name=data,proto3" json:"data" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"data"` // 当前任务值
Rtype int32 `protobuf:"varint,2,opt,name=rtype,proto3" json:"rtype" bson:"rtype"` // 任务类型
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp"` //@go_tasg(`bson:"timestamp"`) 时间戳
Flag int32 `protobuf:"varint,4,opt,name=flag,proto3" json:"flag"` //@go_tasg(`bson:"flag"`) 任务是接取时记录 flag:1表示已记录 再次记录时不清除
}
func (x *RtaskData) Reset() {
@ -510,6 +511,13 @@ func (x *RtaskData) GetTimestamp() int64 {
return 0
}
func (x *RtaskData) GetFlag() int32 {
if x != nil {
return x.Flag
}
return 0
}
// 玩家任务记录
type DBRtaskRecord struct {
state protoimpl.MessageState
@ -636,30 +644,31 @@ var file_task_task_db_proto_rawDesc = []byte{
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x66, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x22, 0xa2, 0x01, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61,
0x38, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61,
0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14,
0x2e, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74,
0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x74, 0x79, 0x70, 0x65,
0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x1a, 0x37,
0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 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, 0xba, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x76,
0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x44, 0x42, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x56, 0x61, 0x6c, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x1a,
0x43, 0x0a, 0x09, 0x56, 0x61, 0x6c, 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, 0x20,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x72, 0x74, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12,
0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x6c,
0x61, 0x67, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 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, 0xba, 0x01, 0x0a, 0x0d,
0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
0x2c, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x56, 0x61,
0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74,
0x69, 0x6d, 0x65, 0x1a, 0x43, 0x0a, 0x09, 0x56, 0x61, 0x6c, 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, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (