Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
3e5f22f697
@ -1,6 +1,8 @@
|
||||
[
|
||||
{
|
||||
"key": 1000,
|
||||
"key": 1,
|
||||
"moneystart": -1,
|
||||
"moneyend": 10000,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
@ -10,7 +12,9 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 2000,
|
||||
"key": 2,
|
||||
"moneystart": 10000,
|
||||
"moneyend": 20000,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
@ -20,7 +24,9 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 3000,
|
||||
"key": 3,
|
||||
"moneystart": 20000,
|
||||
"moneyend": 30000,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
@ -30,7 +36,9 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 4000,
|
||||
"key": 4,
|
||||
"moneystart": 30000,
|
||||
"moneyend": 50000,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
@ -40,7 +48,9 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 5000,
|
||||
"key": 5,
|
||||
"moneystart": 50000,
|
||||
"moneyend": -1,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
@ -48,15 +58,5 @@
|
||||
"n": 9999
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": 0,
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -158,7 +158,7 @@
|
||||
},
|
||||
{
|
||||
"key": 20030,
|
||||
"opencond": "heroic_teaching",
|
||||
"opencond": "",
|
||||
"lock": 1,
|
||||
"lockend": 999,
|
||||
"ontxe": 20020,
|
||||
|
@ -536,4 +536,8 @@ type (
|
||||
//英雄升级
|
||||
HeroUpLv(uid string, heroid string, lv int32)
|
||||
}
|
||||
// 世界任务
|
||||
IWtask interface {
|
||||
IOpenCmdNotice
|
||||
}
|
||||
)
|
||||
|
@ -157,6 +157,12 @@ func (this *UserSession) Push() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// 克隆
|
||||
func (this *UserSession) Clone() (clone *UserSession) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 打印日志需要
|
||||
func (this *UserSession) ToString() string {
|
||||
return fmt.Sprintf("SessionId:%s UserId:%s GatewayServiceId:%s", this.SessionId, this.UserId, this.GatewayServiceId)
|
||||
|
@ -48,6 +48,7 @@ func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActi
|
||||
return
|
||||
}
|
||||
|
||||
go this.module.wtask.OpenCmdNotice(session.GetUserId(), req.Cid)
|
||||
//手动激活通知模块
|
||||
for _, m := range opencfg.Notify {
|
||||
i, err := this.service.GetModule(core.M_Modules(m))
|
||||
|
@ -13,6 +13,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
|
||||
var (
|
||||
bChange bool
|
||||
change []string = make([]string, 0)
|
||||
)
|
||||
rsp := &pb.SysFuncGetListResp{}
|
||||
rsp.Cond = make(map[string]int32, 0)
|
||||
@ -34,6 +35,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
list.Cond[id] = 1 //设置激活
|
||||
} else {
|
||||
list.Cond[id] = 2 //自动激活
|
||||
change = append(change, id)
|
||||
}
|
||||
bChange = true
|
||||
}
|
||||
@ -50,6 +52,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
list.Cond[id] = 1 //设置激活
|
||||
} else {
|
||||
list.Cond[id] = 2 //自动激活
|
||||
change = append(change, id)
|
||||
}
|
||||
bChange = true
|
||||
}
|
||||
@ -64,6 +67,9 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
"cond": list.Cond,
|
||||
})
|
||||
}
|
||||
if len(change) > 0 {
|
||||
go this.module.wtask.OpenCmdNotice(session.GetUserId(), change...)
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp)
|
||||
return
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ var _ comm.ISys = (*ModuleSys)(nil)
|
||||
|
||||
type ModuleSys struct {
|
||||
modules.ModuleBase
|
||||
wtask comm.IWtask
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
service base.IRPCXService
|
||||
@ -43,6 +44,11 @@ func (this *ModuleSys) Init(service core.IService, module core.IModule, options
|
||||
|
||||
func (this *ModuleSys) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleSys); err != nil {
|
||||
return
|
||||
}
|
||||
this.wtask = module.(comm.IWtask)
|
||||
this.service.RegisterFunctionName(string(comm.Rpc_OpendCond), this.OpenCond)
|
||||
return
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
@ -48,7 +47,7 @@ func (this *Worldtask) GetType() core.M_Modules {
|
||||
|
||||
func (this *Worldtask) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
event.Register(comm.EventBuriedComplete, this.TCondFinishNotify)
|
||||
// event.Register(comm.EventBuriedComplete, this.TCondFinishNotify)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ func (this *WTask) BuriedsNotify(uid string, condis []*pb.ConIProgress) {
|
||||
this.PutUserSession(session)
|
||||
}()
|
||||
//发送进度变化消息
|
||||
session.SendMsg(string(this.GetType()), "accepttaskchange", &pb.WTaskAcceptChangePush{Accepts: detailstasks})
|
||||
session.SendMsg(string(this.GetType()), "acceptchange", &pb.WTaskAcceptChangePush{Accepts: detailstasks})
|
||||
}
|
||||
|
||||
// 功能开启
|
||||
|
@ -12,6 +12,8 @@ import "errors"
|
||||
|
||||
type GameCaravanRewardData struct {
|
||||
Key int32
|
||||
Moneystart int32
|
||||
Moneyend int32
|
||||
Reward []*Gameatn
|
||||
}
|
||||
|
||||
@ -23,6 +25,8 @@ func (*GameCaravanRewardData) GetTypeId() int32 {
|
||||
|
||||
func (_v *GameCaravanRewardData)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["moneystart"].(float64); !_ok_ { err = errors.New("moneystart error"); return }; _v.Moneystart = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["moneyend"].(float64); !_ok_ { err = errors.New("moneyend error"); return }; _v.Moneyend = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
|
Loading…
Reference in New Issue
Block a user