Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
acbf0e2f27
@ -449,6 +449,7 @@ const (
|
|||||||
Reddot17102 ReddotType = 17102 // 铁匠铺手册台
|
Reddot17102 ReddotType = 17102 // 铁匠铺手册台
|
||||||
Reddot17106 ReddotType = 17106 // 铁匠铺手册台收藏家奖励上
|
Reddot17106 ReddotType = 17106 // 铁匠铺手册台收藏家奖励上
|
||||||
Reddot17107 ReddotType = 17107 // 铁匠铺手册台收藏家奖励按钮上
|
Reddot17107 ReddotType = 17107 // 铁匠铺手册台收藏家奖励按钮上
|
||||||
|
Reddot17108 ReddotType = 17108 // 铁匠铺炉温回复时间
|
||||||
//竞技场
|
//竞技场
|
||||||
Reddot22100 ReddotType = 22100 //当玩家竞技场可挑战次数到达最大时
|
Reddot22100 ReddotType = 22100 //当玩家竞技场可挑战次数到达最大时
|
||||||
Reddot22102 ReddotType = 22102 //当竞技场npc可以挑战时
|
Reddot22102 ReddotType = 22102 //当竞技场npc可以挑战时
|
||||||
|
28
modules/activity/api_gethddata.go
Normal file
28
modules/activity/api_gethddata.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package activity
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
)
|
||||||
|
|
||||||
|
//参数校验
|
||||||
|
func (this *apiComp) GetHdDataCheck(session comm.IUserSession, req *pb.ActivityGetHdDataReq) (errdata *pb.ErrorData) {
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *apiComp) GetHdData(session comm.IUserSession, req *pb.ActivityGetHdDataReq) (errdata *pb.ErrorData) {
|
||||||
|
|
||||||
|
list, err := this.module.modelhdData.getHddata(session.GetUserId())
|
||||||
|
if err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
session.SendMsg(string(this.module.GetType()), "gethddata", &pb.ActivityGetHdDataResp{
|
||||||
|
Data: list,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
@ -6,17 +6,16 @@ import (
|
|||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type modelActivity struct {
|
type modelhdData struct {
|
||||||
modules.MCompModel
|
modules.MCompModel
|
||||||
module *Activity
|
module *Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *modelActivity) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *modelhdData) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
this.TableName = string(comm.TableHdData)
|
this.TableName = string(comm.TableHdData)
|
||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.module = module.(*Activity)
|
this.module = module.(*Activity)
|
||||||
@ -24,30 +23,31 @@ func (this *modelActivity) Init(service core.IService, module core.IModule, comp
|
|||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "hdid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *modelActivity) getActivityList(uid string) (result *pb.DBActivityData, err error) {
|
// 获取用户活动数据
|
||||||
result = &pb.DBActivityData{
|
func (this *modelhdData) getHddata(uid string) (result []*pb.DBActivityData, err error) {
|
||||||
Uid: uid,
|
result = make([]*pb.DBActivityData, 0)
|
||||||
Hid: 0,
|
if err = this.GetList(uid, &result); err != nil {
|
||||||
Gotarr: []int32{},
|
this.module.Errorf("err:%v", err)
|
||||||
Lasttime: 0,
|
|
||||||
Val: 0,
|
|
||||||
}
|
|
||||||
if err = this.Get(uid, result); err != nil {
|
|
||||||
if mongo.ErrNoDocuments == err {
|
|
||||||
result.Id = primitive.NewObjectID().Hex()
|
|
||||||
result.Uid = uid
|
|
||||||
|
|
||||||
this.Add(uid, result)
|
|
||||||
err = nil
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *modelActivity) modifyActivityList(uid string, data map[string]interface{}) error {
|
// 新增一条活动数据
|
||||||
return this.Change(uid, data)
|
func (this *modelhdData) Insert(uid string, data *pb.DBActivityData) (err error) {
|
||||||
|
if err = this.AddList(uid, data.Id, data); err != nil {
|
||||||
|
this.module.Errorf("err:%v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *modelhdData) modifyActivityList(uid string, oid string, data map[string]interface{}) error {
|
||||||
|
return this.ChangeList(uid, oid, data)
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,9 @@ import (
|
|||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type modelHdList struct {
|
type modelHdList struct {
|
||||||
@ -16,7 +19,12 @@ func (this *modelHdList) Init(service core.IService, module core.IModule, comp c
|
|||||||
this.TableName = string(comm.TableHdList)
|
this.TableName = string(comm.TableHdList)
|
||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.module = module.(*Activity)
|
this.module = module.(*Activity)
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "hdid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,11 +12,12 @@ import (
|
|||||||
|
|
||||||
type Activity struct {
|
type Activity struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
api *apiComp
|
api *apiComp
|
||||||
configure *configureComp
|
configure *configureComp
|
||||||
modelActivity *modelActivity
|
|
||||||
service core.IService
|
service core.IService
|
||||||
modelhdList *modelHdList
|
modelhdList *modelHdList
|
||||||
|
modelhdData *modelhdData
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -48,7 +49,7 @@ func (this *Activity) OnInstallComp() {
|
|||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
this.modelActivity = this.RegisterComp(new(modelActivity)).(*modelActivity)
|
this.modelhdData = this.RegisterComp(new(modelhdData)).(*modelhdData)
|
||||||
this.modelhdList = this.RegisterComp(new(modelHdList)).(*modelHdList)
|
this.modelhdList = this.RegisterComp(new(modelHdList)).(*modelHdList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
go this.ModuleHero.RechargeMoney(args.Uid, conf.Amount)
|
go this.ModuleHero.RechargeMoney(args.Uid, args.Price)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,6 +315,20 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
||||||
rsp.Data = stove
|
rsp.Data = stove
|
||||||
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
||||||
|
|
||||||
|
// 炉温恢复时间红点推送
|
||||||
|
i, err := this.module.service.GetModule(comm.ModuleReddot)
|
||||||
|
if err != nil {
|
||||||
|
this.module.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if b, y := i.(comm.IReddot); y {
|
||||||
|
b.PushReddot(session, &pb.ReddotItem{
|
||||||
|
Rid: int32(comm.Reddot17108),
|
||||||
|
Nextchanagetime: stove.RecoveTime,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//session.SendMsg(string(this.GetType()), "change", &pb.ReddotChangePush{Rids: reddot})
|
||||||
// 校验图鉴信息
|
// 校验图鉴信息
|
||||||
this.module.modelAtlas.CheckActivateEquipAtlas(session.GetUserId(), rsp.Equip, preHitCount)
|
this.module.modelAtlas.CheckActivateEquipAtlas(session.GetUserId(), rsp.Equip, preHitCount)
|
||||||
var equip map[int32]int32 // key xingji value 数量
|
var equip map[int32]int32 // key xingji value 数量
|
||||||
|
@ -72,6 +72,19 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (err
|
|||||||
update["temperature"] = stove.Temperature
|
update["temperature"] = stove.Temperature
|
||||||
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
|
||||||
session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove})
|
session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove})
|
||||||
|
|
||||||
|
// 炉温恢复时间红点推送
|
||||||
|
i, err := this.module.service.GetModule(comm.ModuleReddot)
|
||||||
|
if err != nil {
|
||||||
|
this.module.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if b, y := i.(comm.IReddot); y {
|
||||||
|
b.PushReddot(session, &pb.ReddotItem{
|
||||||
|
Rid: int32(comm.Reddot17108),
|
||||||
|
Nextchanagetime: stove.RecoveTime,
|
||||||
|
})
|
||||||
|
}
|
||||||
tasks := make([]*pb.BuriedParam, 0)
|
tasks := make([]*pb.BuriedParam, 0)
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
||||||
this.module.ModuleBuried.TriggerBuried(session.GetUserId(), tasks...)
|
this.module.ModuleBuried.TriggerBuried(session.GetUserId(), tasks...)
|
||||||
|
@ -236,3 +236,10 @@ func (this *modelStove) CheckUnlockSuid(reelId, lv, dropid int32) int32 {
|
|||||||
|
|
||||||
return dropid
|
return dropid
|
||||||
}
|
}
|
||||||
|
func (this *modelStove) checkReddot17108(uid string) int64 {
|
||||||
|
list, _ := this.module.modelStove.getSmithyStoveList(uid)
|
||||||
|
if list.RecoveTime == 0 {
|
||||||
|
return configure.Now().Unix()
|
||||||
|
}
|
||||||
|
return list.RecoveTime
|
||||||
|
}
|
||||||
|
@ -138,7 +138,12 @@ func (this *Smithy) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
|
|||||||
Activated: this.modelTask.checkReddot17107(session.GetUserId()),
|
Activated: this.modelTask.checkReddot17107(session.GetUserId()),
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case comm.Reddot17108: // 铁匠铺炉温恢复
|
||||||
|
reddot[comm.Reddot17108] = &pb.ReddotItem{
|
||||||
|
Rid: int32(comm.Reddot17108),
|
||||||
|
Nextchanagetime: this.modelStove.checkReddot17108(session.GetUserId()),
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ type DBActivityData struct {
|
|||||||
|
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
|
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
|
||||||
Hid int32 `protobuf:"varint,3,opt,name=hid,proto3" json:"hid"`
|
Hdid int32 `protobuf:"varint,3,opt,name=hdid,proto3" json:"hdid"`
|
||||||
Gotarr []int32 `protobuf:"varint,4,rep,packed,name=gotarr,proto3" json:"gotarr"`
|
Gotarr []int32 `protobuf:"varint,4,rep,packed,name=gotarr,proto3" json:"gotarr"`
|
||||||
Lasttime int64 `protobuf:"varint,5,opt,name=lasttime,proto3" json:"lasttime"`
|
Lasttime int64 `protobuf:"varint,5,opt,name=lasttime,proto3" json:"lasttime"`
|
||||||
Val int32 `protobuf:"varint,6,opt,name=val,proto3" json:"val"`
|
Val int32 `protobuf:"varint,6,opt,name=val,proto3" json:"val"`
|
||||||
@ -381,9 +381,9 @@ func (x *DBActivityData) GetUid() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBActivityData) GetHid() int32 {
|
func (x *DBActivityData) GetHdid() int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Hid
|
return x.Hdid
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -450,16 +450,16 @@ var file_activity_activity_db_proto_rawDesc = []byte{
|
|||||||
0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x04,
|
0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x04,
|
||||||
0x64, 0x61, 0x74, 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74,
|
0x64, 0x61, 0x74, 0x61, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74,
|
||||||
0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
|
0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
|
||||||
0x8a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61,
|
0x8c, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61,
|
||||||
0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
0x74, 0x61, 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,
|
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x05, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72,
|
0x28, 0x05, 0x52, 0x04, 0x68, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61,
|
||||||
0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x12, 0x1a,
|
0x72, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72,
|
||||||
0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
|
0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
|
||||||
0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61,
|
0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03,
|
||||||
0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04,
|
0x76, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x42, 0x06,
|
||||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user