Merge branches 'dev' and 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
cca1a56cdb
@ -98,7 +98,7 @@
|
||||
|
||||
### 支付发货API
|
||||
- 接口名:paydelivery
|
||||
- 接口说明:web 服务器给玩家发送邮件
|
||||
- 接口说明:web 服务器给玩家发送支付获得商品
|
||||
- 请求地址:{IP}:{port}/paydelivery
|
||||
- 请求参数:uid(用户id|签名),productid(商品id|签名),orderid(订单号|签名),price(总金额|签名),sign(签名)
|
||||
- 请求样例
|
||||
|
@ -136,12 +136,16 @@ func (this *Buried) ActiveCondition(uid string, condiIds ...int32) (err error) {
|
||||
//激活数据采集点
|
||||
func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb.ConIProgress, err error) {
|
||||
var (
|
||||
model *buriedModel
|
||||
bdatas *pb.DBBuried
|
||||
conf *cfg.GameBuriedCondiData
|
||||
bdata *pb.DBBuriedItem
|
||||
ok bool
|
||||
)
|
||||
if bdatas, err = this.modelBuried.getUserBurieds(uid); err != nil {
|
||||
if model, err = this.modelBuried.getburiedModel(uid); err != nil {
|
||||
return
|
||||
}
|
||||
if bdatas, err = model.getUserBurieds(uid); err != nil {
|
||||
return
|
||||
}
|
||||
condis = make([]*pb.ConIProgress, 0)
|
||||
@ -194,6 +198,7 @@ func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb.
|
||||
//设置任务完成状态并校验
|
||||
func (this *Buried) FinishConditionAndCheck(uid string, finishcondiIds []int32, condiIds ...int32) (condis []*pb.ConIProgress, err error) {
|
||||
var (
|
||||
model *buriedModel
|
||||
bdatas *pb.DBBuried
|
||||
bitem *pb.DBBuriedConItem
|
||||
conf *cfg.GameBuriedCondiData
|
||||
@ -201,7 +206,11 @@ func (this *Buried) FinishConditionAndCheck(uid string, finishcondiIds []int32,
|
||||
chanage bool
|
||||
bdata *pb.DBBuriedItem
|
||||
)
|
||||
if bdatas, err = this.modelBuried.getUserBurieds(uid); err != nil {
|
||||
|
||||
if model, err = this.modelBuried.getburiedModel(uid); err != nil {
|
||||
return
|
||||
}
|
||||
if bdatas, err = model.getUserBurieds(uid); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@ -323,7 +332,7 @@ func (this *Buried) FinishConditionAndCheck(uid string, finishcondiIds []int32,
|
||||
}
|
||||
|
||||
if chanage {
|
||||
if err = this.modelBuried.updateUserBurieds(uid, bdatas); err != nil {
|
||||
if err = model.updateUserBurieds(uid, bdatas); err != nil {
|
||||
this.Error("更新用户埋点数据错误!", log.Field{Key: "err", Value: err.Error()})
|
||||
return
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, suiteId int32, p
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
Message: fmt.Sprintf("no fond pos:%d intlv:%d", pos, lv),
|
||||
}
|
||||
return
|
||||
} else {
|
||||
|
@ -114,7 +114,6 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ShopGoodsIsSoldOut,
|
||||
Title: pb.ErrorCode_ShopGoodsIsSoldOut.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskList
|
||||
var taskList []*pb.SociatyTask
|
||||
|
||||
for _, v := range sociatyTask.TaskList {
|
||||
status := v.Status
|
||||
// if _, ok := this.module.modelSociaty.validTask(uid, v.TaskId); ok {
|
||||
// status = 1 //完成
|
||||
// }
|
||||
@ -48,7 +47,7 @@ func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskList
|
||||
|
||||
taskList = append(taskList, &pb.SociatyTask{
|
||||
TaskId: v.TaskId,
|
||||
Status: status,
|
||||
Status: v.Status,
|
||||
Received: v.Received,
|
||||
Cond: v.Cond,
|
||||
})
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"go_dreamfactory/lego/utils/crypto/md5"
|
||||
"go_dreamfactory/pb"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PayDeliveryResults struct {
|
||||
@ -53,8 +54,9 @@ func (this *Api_Comp) PayDelivery(c *engine.Context) {
|
||||
payresp.Code = pb.ErrorCode_SignError
|
||||
payresp.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_SignError)
|
||||
}
|
||||
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
|
||||
if err = this.module.service.RpcCall(
|
||||
context.Background(),
|
||||
ctx,
|
||||
comm.Service_Worker,
|
||||
string(comm.Rpc_ModulePayDelivery),
|
||||
payreq,
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/db"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SyncCrossReq struct {
|
||||
@ -51,8 +52,9 @@ func (this *Api_Comp) SyncCross(c *engine.Context) {
|
||||
resp.Message = err.Error()
|
||||
return
|
||||
}
|
||||
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
|
||||
if err = this.module.service.RpcBroadcast(
|
||||
context.Background(),
|
||||
ctx,
|
||||
comm.Service_Worker,
|
||||
string(comm.Rpc_DBSyncCross),
|
||||
pb.EmptyReq{},
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"go_dreamfactory/sys/configure"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
//上传配置文件
|
||||
@ -52,8 +53,9 @@ func (this *Api_Comp) Upload(c *engine.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
|
||||
if err := this.module.service.RpcBroadcast(
|
||||
context.Background(),
|
||||
ctx,
|
||||
comm.Service_Worker,
|
||||
string(comm.Rpc_ConfigureUpDate),
|
||||
&pb.EmptyReq{},
|
||||
|
@ -126,7 +126,7 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
||||
for _, cfg := range worldtaskConf.GetDataList() {
|
||||
for _, condId := range cfg.Completetask {
|
||||
for _, cond := range conds {
|
||||
if condId == cond.Conid && cond.State == pb.BuriedItemFinishState_buried_finish {
|
||||
if condId == cond.Conid { //&& cond.State == pb.BuriedItemFinishState_buried_finish {
|
||||
//校验任务是否是当前任务
|
||||
if task, ok := userTask.CurrentTasks[cfg.Group]; ok {
|
||||
var currentTasks []*pb.CurrentTask
|
||||
@ -160,8 +160,10 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
||||
return
|
||||
}
|
||||
if curTaskConf.DeliverNpc == 0 {
|
||||
defer func() {
|
||||
this.modelWorldtask.taskFinish(session, t.TaskId, userTask, curTaskConf)
|
||||
this.modelWorldtask.taskFinishPush(session, userTask, curTaskConf)
|
||||
}()
|
||||
}
|
||||
currentTasks = append(currentTasks, t)
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ func (this *DBModel) InsertModelLogs(table string, uID string, target interface{
|
||||
|
||||
_, err = this.DB.InsertOne(DB_ModelTable, data)
|
||||
if err != nil {
|
||||
log.Errorf("insert model db err %v", err)
|
||||
log.Errorf("table:%s insert model db err %v", this.TableName, err)
|
||||
}
|
||||
|
||||
return err
|
||||
@ -104,7 +104,7 @@ func (this *DBModel) InsertManyModelLogs(table string, datas map[string]interfac
|
||||
|
||||
_, err = this.DB.InsertMany(DB_ModelTable, data)
|
||||
if err != nil {
|
||||
log.Errorf("insert model db err %v", err)
|
||||
log.Errorf("table:%s insert model db err %v", this.TableName, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
@ -122,7 +122,7 @@ func (this *DBModel) DeleteModelLogs(table string, uID string, where interface{}
|
||||
|
||||
_, err = this.DB.InsertOne(DB_ModelTable, data)
|
||||
if err != nil {
|
||||
log.Errorf("insert model db err %v", err)
|
||||
log.Errorf("table:%s insert model db err %v", this.TableName, err)
|
||||
}
|
||||
|
||||
return err
|
||||
@ -141,7 +141,7 @@ func (this *DBModel) UpdateModelLogs(table string, uID string, where bson.M, tar
|
||||
|
||||
_, err = this.DB.InsertOne(DB_ModelTable, data)
|
||||
if err != nil {
|
||||
log.Errorf("insert model db err %v", err)
|
||||
log.Errorf("table:%s insert model db err %v", this.TableName, err)
|
||||
}
|
||||
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user