Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
2041c4af76
@ -16,9 +16,7 @@ func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.SociatyMineReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
if code = this.module.ModuleSys.IsAccess(comm.Guild, session.GetUserId()); code != pb.ErrorCode_Success {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uid := session.GetUserId()
|
uid := session.GetUserId()
|
||||||
userEx, err := this.module.ModuleUser.GetUserExpand(uid)
|
userEx, err := this.module.ModuleUser.GetUserExpand(uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -8,11 +8,11 @@ import (
|
|||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) ActivateCheck(session comm.IUserSession, req *pb.SysFuncActivateReq) (code pb.ErrorCode) {
|
func (this *apiComp) FuncActivateCheck(session comm.IUserSession, req *pb.SysFuncActivateReq) (code pb.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *apiComp) Activate(session comm.IUserSession, req *pb.SysFuncActivateReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActivateReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
rsp := &pb.SysFuncActivateResp{}
|
rsp := &pb.SysFuncActivateResp{}
|
||||||
|
|
||||||
|
@ -26,9 +26,8 @@ func (this *configureComp) getOpencondCfg() (data *cfg.GameOpencond, err error)
|
|||||||
v interface{}
|
v interface{}
|
||||||
ok bool
|
ok bool
|
||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(gameOpencond); err != nil {
|
if v, err = this.GetConfigure(gameOpencond); err == nil {
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if data, ok = v.(*cfg.GameOpencond); !ok {
|
if data, ok = v.(*cfg.GameOpencond); !ok {
|
||||||
err = fmt.Errorf("%T no is *cfg.GameOpencond", v)
|
err = fmt.Errorf("%T no is *cfg.GameOpencond", v)
|
||||||
return
|
return
|
||||||
@ -38,21 +37,17 @@ func (this *configureComp) getOpencondCfg() (data *cfg.GameOpencond, err error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) getFuncCfg(funcName string) (data *cfg.GameOpencondData) {
|
func (this *configureComp) getFuncCfg(funcName string) (data *cfg.GameOpencondData) {
|
||||||
if cfg, err := this.getOpencondCfg(); err != nil {
|
if cfg, err := this.getOpencondCfg(); err == nil {
|
||||||
return nil
|
|
||||||
} else {
|
|
||||||
data = cfg.GetDataMap()[funcName]
|
data = cfg.GetDataMap()[funcName]
|
||||||
}
|
}
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) {
|
func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) {
|
||||||
if cfg, err := this.getOpencondCfg(); err != nil {
|
if cfg, err := this.getOpencondCfg(); err == nil {
|
||||||
return nil
|
|
||||||
} else {
|
|
||||||
list = cfg.GetDataList()
|
list = cfg.GetDataList()
|
||||||
}
|
}
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过cid 找数据
|
// 通过cid 找数据
|
||||||
|
@ -16,9 +16,6 @@ func (this *apiComp) SignCheck(session comm.IUserSession, req *pb.UserSignReq) (
|
|||||||
//登录
|
//登录
|
||||||
func (this *apiComp) Sign(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) Sign(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
if code = this.module.ModuleSys.IsAccess(comm.Sign, session.GetUserId()); code != pb.ErrorCode_Success {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
||||||
session.SendMsg(string(this.module.GetType()), "sign", &pb.UserSignResp{
|
session.SendMsg(string(this.module.GetType()), "sign", &pb.UserSignResp{
|
||||||
Data: sign,
|
Data: sign,
|
||||||
|
@ -81,9 +81,7 @@ func (this *ModelSign) UserSign(session comm.IUserSession) {
|
|||||||
lastSignTime int64 // 上次签到时间
|
lastSignTime int64 // 上次签到时间
|
||||||
)
|
)
|
||||||
update = make(map[string]interface{}, 0)
|
update = make(map[string]interface{}, 0)
|
||||||
if code := this.module.ModuleSys.IsAccess(comm.Sign, session.GetUserId()); code != pb.ErrorCode_Success {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
||||||
// 获取当前是第几天
|
// 获取当前是第几天
|
||||||
lastSignTime = sign.SignTime
|
lastSignTime = sign.SignTime
|
||||||
@ -100,9 +98,7 @@ func (this *ModelSign) UserSign(session comm.IUserSession) {
|
|||||||
}
|
}
|
||||||
sign.Puzzle = make([]int32, 31)
|
sign.Puzzle = make([]int32, 31)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if sign.Puzzle[iDay] != 0 {
|
if sign.Puzzle[iDay] != 0 {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +117,6 @@ func (this *ModelSign) UserSign(session comm.IUserSession) {
|
|||||||
this.module.modelSign.Change(session.GetUserId(), update)
|
this.module.modelSign.Change(session.GetUserId(), update)
|
||||||
_data := this.module.configure.GetSignConf(sign.Day, sign.Group)
|
_data := this.module.configure.GetSignConf(sign.Day, sign.Group)
|
||||||
if _data != nil { // 发奖
|
if _data != nil { // 发奖
|
||||||
|
|
||||||
this.module.DispenseRes(session, _data.Loopgift, true) // 签到奖励
|
this.module.DispenseRes(session, _data.Loopgift, true) // 签到奖励
|
||||||
// 额外奖励
|
// 额外奖励
|
||||||
if conf := this.module.configure.GetSignExtarConf(sign.SignCount, sign.Group); conf != nil {
|
if conf := this.module.configure.GetSignExtarConf(sign.SignCount, sign.Group); conf != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user