更新配置
This commit is contained in:
parent
a1de2bab58
commit
589f438106
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,7 @@
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
"邦尼兔组件名",
|
||||
"邦尼兔组件名入场",
|
||||
"150"
|
||||
],
|
||||
"getafter_event": [
|
||||
@ -50,7 +50,7 @@
|
||||
1002
|
||||
],
|
||||
"completetask": 0,
|
||||
"auto_accept": 0,
|
||||
"auto_accept": 1,
|
||||
"overtips": 1,
|
||||
"reword": []
|
||||
},
|
||||
@ -1721,7 +1721,7 @@
|
||||
"ontxe": 0,
|
||||
"id_after": 20002,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1754,7 +1754,7 @@
|
||||
"ontxe": 10166,
|
||||
"id_after": 20003,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1782,7 +1782,7 @@
|
||||
"ontxe": 10167,
|
||||
"id_after": 20004,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"dreamwork_restaurant_01",
|
||||
@ -1810,7 +1810,7 @@
|
||||
"ontxe": 10168,
|
||||
"id_after": 20005,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"dreamwork_restaurant_01",
|
||||
@ -1838,7 +1838,7 @@
|
||||
"ontxe": 10169,
|
||||
"id_after": 20006,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"dreamwork_restaurant_01",
|
||||
@ -1871,7 +1871,7 @@
|
||||
"ontxe": 10170,
|
||||
"id_after": 20007,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1899,7 +1899,7 @@
|
||||
"ontxe": 10171,
|
||||
"id_after": 20008,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1927,7 +1927,7 @@
|
||||
"ontxe": 10172,
|
||||
"id_after": 20009,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1955,7 +1955,7 @@
|
||||
"ontxe": 10173,
|
||||
"id_after": 20010,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
@ -1983,7 +1983,7 @@
|
||||
"ontxe": 10174,
|
||||
"id_after": 0,
|
||||
"group": 10001,
|
||||
"des": 2,
|
||||
"des": 3,
|
||||
"icon": "",
|
||||
"npc": [
|
||||
"scenes_ boundary_01",
|
||||
|
@ -6,10 +6,8 @@ import (
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
|
||||
@ -48,55 +46,3 @@ func (this *ModelRtaskRecord) getRecord(uid string) *pb.DBRtaskRecord {
|
||||
}
|
||||
return record
|
||||
}
|
||||
|
||||
// 初始化任务条件数据
|
||||
// 玩家登录时调用
|
||||
// Deprecated
|
||||
func (this *ModelRtaskRecord) initCondiData(uid string) error {
|
||||
dr := this.getRecord(uid)
|
||||
// 判断是否有记录
|
||||
if dr.Vals == nil || len(dr.Vals) == 0 {
|
||||
// 获取rdtask_condi配置表数据
|
||||
grc, err := this.moduleRtask.configure.getRtaskCondiCfg()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if grc == nil {
|
||||
return errors.New("配置空[rdtaskcondi] err")
|
||||
}
|
||||
|
||||
record := &pb.DBRtaskRecord{Uid: uid}
|
||||
record.Id = primitive.NewObjectID().Hex()
|
||||
record.Vals = make(map[int32]*pb.RtaskData)
|
||||
//遍历所有配置数据
|
||||
for _, v := range grc.GetDataList() {
|
||||
// 不符合参数配置长度则不初始化
|
||||
if len(v.Inited) != 5 {
|
||||
continue
|
||||
}
|
||||
|
||||
vals := []int32{}
|
||||
// 遍历初始化参数字段
|
||||
for _, p := range v.Inited {
|
||||
if p == 1 { // 1表示需要初始0
|
||||
vals = append(vals, 0)
|
||||
} else if p == 0 { // 0表示需要初始实际值
|
||||
vals = append(vals, p)
|
||||
} else if p == -1 { //-1 表示不初始任何值
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
record.Vals[v.Id] = &pb.RtaskData{
|
||||
Data: toMap(vals...),
|
||||
Rtype: v.Type,
|
||||
Timestamp: configure.Now().Unix(),
|
||||
}
|
||||
}
|
||||
|
||||
if err := this.Add(uid, record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
@ -146,8 +146,6 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化随机任务数据
|
||||
// this.module.ModuleRtask.InitCondiData(user.Uid)
|
||||
// 日常登录任务
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype8, 1)
|
||||
|
||||
|
@ -12,9 +12,7 @@ import "errors"
|
||||
|
||||
type GameRdtaskCondiData struct {
|
||||
Id int32
|
||||
Datatype int32
|
||||
Type int32
|
||||
Inited []int32
|
||||
Data1 int32
|
||||
Data2 int32
|
||||
Data3 int32
|
||||
@ -30,22 +28,7 @@ func (*GameRdtaskCondiData) GetTypeId() int32 {
|
||||
|
||||
func (_v *GameRdtaskCondiData)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["datatype"].(float64); !_ok_ { err = errors.New("datatype error"); return }; _v.Datatype = 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 _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["inited"].([]interface{}); !_ok_ { err = errors.New("inited error"); return }
|
||||
|
||||
_v.Inited = make([]int32, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
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_ = int32(_x_) }
|
||||
_v.Inited = append(_v.Inited, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data1"].(float64); !_ok_ { err = errors.New("data1 error"); return }; _v.Data1 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data2"].(float64); !_ok_ { err = errors.New("data2 error"); return }; _v.Data2 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data3"].(float64); !_ok_ { err = errors.New("data3 error"); return }; _v.Data3 = int32(_tempNum_) }
|
||||
|
Loading…
Reference in New Issue
Block a user