上传通用成就系统

This commit is contained in:
liwei1dao 2023-10-12 10:42:54 +08:00
parent 204e37675c
commit e47d9cbc27
24 changed files with 2835 additions and 1047 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1379,10 +1379,10 @@
},
{
"id": 236,
"insert": 2,
"insert": 1,
"filter": [
"eq",
"gte"
"eq"
]
}
]

View File

@ -3,24 +3,28 @@
"num": 1,
"distance": 10,
"value": 8,
"energy": 20
"energy": 20,
"matchvalue": 5
},
{
"num": 2,
"distance": 15,
"value": 6,
"energy": 15
"energy": 15,
"matchvalue": 4
},
{
"num": 3,
"distance": 20,
"value": 4,
"energy": 10
"energy": 10,
"matchvalue": 3
},
{
"num": 4,
"distance": 25,
"value": 2,
"energy": 5
"energy": 5,
"matchvalue": 2
}
]

View File

@ -2,16 +2,19 @@
{
"num": 1,
"time": 1,
"value": 10
"value": 10,
"matchvalue": 5
},
{
"num": 2,
"time": 2,
"value": 15
"value": 15,
"matchvalue": 10
},
{
"num": 3,
"time": 3,
"value": 20
"value": 20,
"matchvalue": 15
}
]

View File

@ -106,7 +106,7 @@
"layer": 1,
"name": {
"key": "gamesummary_fathernode_name_7",
"text": "塔"
"text": "炼塔"
},
"mapPos": {
"x": -1963,
@ -115,7 +115,7 @@
"scale": 0.4,
"usetext": {
"key": "gamesummary_fathernode_usetext_7",
"text": "点石成金的磨练地!挑战胜利可以[color=#ffcc00]获得教习在木人桩指导守护者[/color]"
"text": "千锤百炼,修身悟道。挑战胜利可以[color=#ffcc00]获得教习在木人桩指导守护者[/color]"
}
},
{
@ -123,7 +123,7 @@
"layer": 1,
"name": {
"key": "gamesummary_fathernode_name_8",
"text": "无极塔"
"text": "岗监狱"
},
"mapPos": {
"x": -1963,
@ -132,7 +132,7 @@
"scale": 0.4,
"usetext": {
"key": "gamesummary_fathernode_usetext_8",
"text": "这是[color=#ffcc00]每隔十五天[/color]开启的无穷无尽的挑战地!挑战胜利越多奖励越多!"
"text": "周而复始,始而复终,[color=#ffcc00]每隔十五天[/color]开启的森严监狱。"
}
},
{

View File

@ -399,7 +399,7 @@
],
"VIP_DaysSent": 7,
"MonthlyCard_DaysSent": 30,
"opennewguide": 1,
"opennewguide": 0,
"library_StoryUnlocking": 3,
"ps_recovery": 360,
"ps_ul": 2000,
@ -725,7 +725,7 @@
"n": 1000
}
],
"buzkashi_resurrection": 10000,
"buzkashi_resurrection": 5,
"buzkashi_caddtracktime": 1000,
"buzkashi_addtracktime": 1000,
"buzkashi_subtracktime": 1000,

View File

@ -83,7 +83,7 @@
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtaskfinish_20010",
"condition": "worldtasksubfinish_20010",
"followtj": "OpenNpcOption_20010_熊猫_1",
"followguide": 1000202,
"finger": [
@ -200,8 +200,43 @@
"parameter": "",
"interface": "",
"condition": "",
"followtj": "OpenNpcOption_20020_熊猫_船甲板",
"followtj": "CloseItemPopup",
"followguide": 1000303,
"finger": [],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 1,
"lock": 1,
"uishow": 0,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000303,
"group": 3,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "OpenNpcOption_20020_熊猫_船甲板",
"followguide": 1000304,
"finger": [
"command",
"mainCom$.taskpanel$.mainTaskList.tasklist$",
@ -232,7 +267,7 @@
"reward": []
},
{
"id": 1000303,
"id": 1000304,
"group": 3,
"type": 3,
"startPar": "",
@ -278,7 +313,7 @@
"parameter": "",
"interface": "",
"condition": "worldtaskexit_accept_20012",
"followtj": "",
"followtj": "OpenNpcOption_20020_小怪_船甲板",
"followguide": 1000402,
"finger": [
"taskDedailsPopup",
@ -310,7 +345,7 @@
},
{
"id": 1000402,
"group": 5,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
@ -346,5 +381,161 @@
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000403,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 1000404,
"finger": [
"ContentPane",
"btn_start$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000404,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 0,
"finger": [
"ContentPane",
"skilllist$",
"3"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 1,
"lock": 0,
"uishow": 0,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1001001,
"group": 10,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtaskexit_accept_20050",
"followtj": "",
"followguide": 0,
"finger": [
"ContentPane",
"btn_compass$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 1,
"lock": 1,
"uishow": 0,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 2000101,
"group": 101,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "OpenRecruit",
"followtj": "",
"followguide": 0,
"finger": [
"ContentPane",
"btn_tendraw$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []
}
]

View File

@ -72,7 +72,7 @@
"id": 11001,
"title": {
"key": "mainchapter_main_achievement_title_5",
"text": "苦难横行"
"text": "命运赦令"
},
"taskid": 11001005,
"reword": [
@ -125,7 +125,7 @@
"key": "mainchapter_main_achievement_title_8",
"text": "驯龙购物狂"
},
"taskid": 11001007,
"taskid": 11001008,
"reword": [
{
"a": "item",

View File

@ -3,9 +3,9 @@
"id": 1100101,
"monster_chapter": 11001,
"monster_strength": 1,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302013
],
"reward": [
{
@ -24,9 +24,9 @@
"id": 1100102,
"monster_chapter": 11001,
"monster_strength": 2,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302016
],
"reward": [
{
@ -45,9 +45,9 @@
"id": 1100103,
"monster_chapter": 11001,
"monster_strength": 3,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302019
],
"reward": [
{
@ -66,9 +66,9 @@
"id": 1100104,
"monster_chapter": 11001,
"monster_strength": 4,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302022
],
"reward": [
{
@ -87,9 +87,9 @@
"id": 1100105,
"monster_chapter": 11001,
"monster_strength": 5,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302025
],
"reward": [
{
@ -108,9 +108,9 @@
"id": 1100106,
"monster_chapter": 11001,
"monster_strength": 6,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302028
],
"reward": [
{
@ -129,9 +129,9 @@
"id": 1100107,
"monster_chapter": 11001,
"monster_strength": 7,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302031
],
"reward": [
{
@ -150,9 +150,9 @@
"id": 1100108,
"monster_chapter": 11001,
"monster_strength": 8,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302034
],
"reward": [
{
@ -171,9 +171,9 @@
"id": 1100109,
"monster_chapter": 11001,
"monster_strength": 9,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302037
],
"reward": [
{
@ -192,9 +192,9 @@
"id": 1100110,
"monster_chapter": 11001,
"monster_strength": 10,
"battlereadyid": 119,
"battlereadyid": 10500003,
"formatList": [
101011
302040
],
"reward": [
{

File diff suppressed because it is too large Load Diff

View File

@ -245002,5 +245002,305 @@
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101001,
"pos": 1,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101001,
"pos": 2,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51050,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 61,
"modelsize": 1
},
{
"Id": 1101001,
"pos": 3,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51052,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 59,
"modelsize": 1
},
{
"Id": 1101001,
"pos": 4,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101001,
"pos": 5,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101002,
"pos": 1,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51006,
"star": 3,
"equip": [],
"newskill": [],
"lv": 10,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 58,
"modelsize": 1
},
{
"Id": 1101002,
"pos": 2,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101002,
"pos": 3,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101002,
"pos": 4,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101002,
"pos": 5,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101003,
"pos": 1,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": -1,
"star": 3,
"equip": [],
"newskill": [],
"lv": 18,
"hppro": -1,
"atkpro": -1,
"defpro": -1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": -1,
"modelsize": 1
},
{
"Id": 1101003,
"pos": 2,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51050,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 61,
"modelsize": 1
},
{
"Id": 1101003,
"pos": 3,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51052,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 59,
"modelsize": 1
},
{
"Id": 1101003,
"pos": 4,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51050,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 60,
"modelsize": 1
},
{
"Id": 1101003,
"pos": 5,
"captainId": 0,
"IsBoss": 0,
"bossHpCnt": 0,
"heroid": 51052,
"star": 3,
"equip": [],
"newskill": [],
"lv": 8,
"hppro": 1,
"atkpro": 0.8,
"defpro": 0.8,
"skill1": 1,
"skill2": 1,
"skill3": 1,
"speed": 58,
"modelsize": 1
}
]

View File

@ -6770,6 +6770,207 @@
],
"goto": 0
},
{
"id": 300090,
"heroid": 25001,
"Levelid": 0,
"datas": [
"WuGuanScene",
"总教习",
"137"
],
"event": [
2,
13020
],
"goto": 0
},
{
"id": 300098,
"heroid": 25001,
"Levelid": 0,
"datas": [],
"event": [],
"goto": 0
},
{
"id": 300099,
"heroid": 25001,
"Levelid": 0,
"datas": [
"WuGuanScene",
"总教习",
"137"
],
"event": [
2,
13040
],
"goto": 0
},
{
"id": 300100,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
2,
13050
],
"goto": 0
},
{
"id": 300108,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
10,
1001
],
"goto": 0
},
{
"id": 300109,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
2,
13070
],
"goto": 0
},
{
"id": 320270,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
2,
13080
],
"goto": 0
},
{
"id": 320278,
"heroid": 25001,
"Levelid": 0,
"datas": [],
"event": [],
"goto": 0
},
{
"id": 320279,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [],
"goto": 0
},
{
"id": 320280,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
2,
13090
],
"goto": 0
},
{
"id": 320288,
"heroid": 25001,
"Levelid": 0,
"datas": [],
"event": [],
"goto": 0
},
{
"id": 320289,
"heroid": 25001,
"Levelid": 0,
"datas": [
"SmithyScene",
"打造",
"139"
],
"event": [
2,
13100
],
"goto": 0
},
{
"id": 320290,
"heroid": 25001,
"Levelid": 0,
"datas": [
"GameMain",
"功能入口-工会申请",
"901"
],
"event": [
2,
13110
],
"goto": 0
},
{
"id": 320298,
"heroid": 25001,
"Levelid": 0,
"datas": [
"GameMain",
"功能入口-工会申请",
"901"
],
"event": [
10,
908
],
"goto": 0
},
{
"id": 320299,
"heroid": 25001,
"Levelid": 0,
"datas": [
"GuildScene",
"管理工会",
"908"
],
"event": [
2,
13130
],
"goto": 0
},
{
"id": 320110,
"heroid": 25001,

File diff suppressed because it is too large Load Diff

View File

@ -110,6 +110,7 @@ const (
ModuleCaptureSheep core.M_Modules = "capturesheep" //捕羊大赛
ModuleTurntable core.M_Modules = "turntable" //
ModuleVenture core.M_Modules = "venture" //
ModuleAchieve core.M_Modules = "achieve" //全局成就
)
// 数据表名定义处

20
modules/achieve/api.go Normal file
View File

@ -0,0 +1,20 @@
package achieve
import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type apiComp struct {
modules.MCompGate
service base.IRPCXService
module *Achieve
}
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
_ = this.MCompGate.Init(service, module, comp, options)
this.service = service.(base.IRPCXService)
this.module = module.(*Achieve)
return
}

View File

@ -0,0 +1,36 @@
package achieve
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
// 参数校验
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.AchieveInfoReq) (errdata *pb.ErrorData) {
return
}
// /获取自己的排行榜信息
func (this *apiComp) Info(session comm.IUserSession, req *pb.AchieveInfoReq) (errdata *pb.ErrorData) {
var (
tasks []int32
progress []*pb.ConIProgress
err error
)
if errdata = this.InfoCheck(session, req); errdata != nil {
return
}
tasks = this.module.configure.tasksConf
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), tasks...); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ExternalModule,
Title: pb.ErrorCode_ExternalModule.ToString(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "info", &pb.AchieveInfoResp{Tasks: progress})
return
}

View File

@ -0,0 +1,51 @@
package achieve
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
// 参数校验
func (this *apiComp) AwardCheck(session comm.IUserSession, req *pb.AchieveAwardReq) (errdata *pb.ErrorData) {
return
}
// /获取自己的排行榜信息
func (this *apiComp) Award(session comm.IUserSession, req *pb.AchieveAwardReq) (errdata *pb.ErrorData) {
var (
conf *cfg.GameAchieveTaskData
atno []*pb.UserAtno
progress []*pb.ConIProgress
err error
)
if errdata = this.AwardCheck(session, req); errdata != nil {
return
}
conf, err = this.module.configure.getAchieveTaskById(req.Id)
if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), conf.TaskBuried); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ExternalModule,
Title: pb.ErrorCode_ExternalModule.ToString(),
Message: err.Error(),
}
return
}
for _, v := range progress {
if v.State == pb.BuriedItemFinishState_buried_unfinish {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: "task unfinish!",
}
return
}
}
if errdata, atno = this.module.DispenseAtno(session, conf.TaskReward, true); errdata != nil {
return
}
session.SendMsg(string(this.module.GetType()), "info", &pb.AchieveAwardResp{Id: req.Id, Award: atno})
return
}

View File

@ -0,0 +1,71 @@
package achieve
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"sync"
)
const (
game_achievetask = "game_achievetask.json"
)
type configureComp struct {
modules.MCompConfigure
module *Achieve
tasksConf []int32
lock sync.RWMutex
}
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*Achieve)
configure.RegisterConfigure(game_achievetask, cfg.NewGameAchieveTask, this.updateconfigure)
return
}
// 更新任务配置表
func (this *configureComp) updateconfigure() {
var (
v interface{}
conf *cfg.GameAchieveTask
ok bool
err error
)
if v, err = this.GetConfigure(game_achievetask); err != nil {
return
}
if conf, ok = v.(*cfg.GameAchieveTask); !ok {
this.module.Error("通用成就配置错误!")
return
}
tasksConf := make([]int32, 0)
for _, v := range conf.GetDataList() {
tasksConf = append(tasksConf, v.TaskBuried)
}
this.lock.Lock()
this.tasksConf = tasksConf
this.lock.Unlock()
}
//查询积分段位信息
func (this *configureComp) getAchieveTaskById(id int32) (result *cfg.GameAchieveTaskData, err error) {
var (
v interface{}
ok bool
)
if v, err = this.GetConfigure(game_achievetask); err != nil {
this.module.Errorln(err)
} else {
if result, ok = v.(*cfg.GameAchieveTask).GetDataMap()[id]; !ok {
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_achievetask, id)
this.module.Errorln(err)
}
}
return
}

49
modules/achieve/module.go Normal file
View File

@ -0,0 +1,49 @@
package achieve
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type Achieve struct {
modules.ModuleBase
service core.IService
wtask comm.IWtask
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Achieve{}
}
func (this *Achieve) GetType() core.M_Modules {
return comm.ModuleAchieve
}
func (this *Achieve) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
if err = this.ModuleBase.Init(service, module, options); err != nil {
return
}
this.service = service
return
}
func (this *Achieve) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleWtask); err != nil {
return
}
this.wtask = module.(comm.IWtask)
return
}
func (this *Achieve) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}

151
pb/achieve_db.pb.go Normal file
View File

@ -0,0 +1,151 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: achieve/achieve_db.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//通用成就系统
type DBAchieveData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
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"`
}
func (x *DBAchieveData) Reset() {
*x = DBAchieveData{}
if protoimpl.UnsafeEnabled {
mi := &file_achieve_achieve_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBAchieveData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBAchieveData) ProtoMessage() {}
func (x *DBAchieveData) ProtoReflect() protoreflect.Message {
mi := &file_achieve_achieve_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DBAchieveData.ProtoReflect.Descriptor instead.
func (*DBAchieveData) Descriptor() ([]byte, []int) {
return file_achieve_achieve_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBAchieveData) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBAchieveData) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
var File_achieve_achieve_db_proto protoreflect.FileDescriptor
var file_achieve_achieve_db_proto_rawDesc = []byte{
0x0a, 0x18, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x2f, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76,
0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x0d, 0x44, 0x42,
0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x44, 0x61, 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, 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_achieve_achieve_db_proto_rawDescOnce sync.Once
file_achieve_achieve_db_proto_rawDescData = file_achieve_achieve_db_proto_rawDesc
)
func file_achieve_achieve_db_proto_rawDescGZIP() []byte {
file_achieve_achieve_db_proto_rawDescOnce.Do(func() {
file_achieve_achieve_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_achieve_achieve_db_proto_rawDescData)
})
return file_achieve_achieve_db_proto_rawDescData
}
var file_achieve_achieve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_achieve_achieve_db_proto_goTypes = []interface{}{
(*DBAchieveData)(nil), // 0: DBAchieveData
}
var file_achieve_achieve_db_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_achieve_achieve_db_proto_init() }
func file_achieve_achieve_db_proto_init() {
if File_achieve_achieve_db_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_achieve_achieve_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBAchieveData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_achieve_achieve_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_achieve_achieve_db_proto_goTypes,
DependencyIndexes: file_achieve_achieve_db_proto_depIdxs,
MessageInfos: file_achieve_achieve_db_proto_msgTypes,
}.Build()
File_achieve_achieve_db_proto = out.File
file_achieve_achieve_db_proto_rawDesc = nil
file_achieve_achieve_db_proto_goTypes = nil
file_achieve_achieve_db_proto_depIdxs = nil
}

340
pb/achieve_msg.pb.go Normal file
View File

@ -0,0 +1,340 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: achieve/achieve_msg.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//系统信息拉取
type AchieveInfoReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *AchieveInfoReq) Reset() {
*x = AchieveInfoReq{}
if protoimpl.UnsafeEnabled {
mi := &file_achieve_achieve_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AchieveInfoReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AchieveInfoReq) ProtoMessage() {}
func (x *AchieveInfoReq) ProtoReflect() protoreflect.Message {
mi := &file_achieve_achieve_msg_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AchieveInfoReq.ProtoReflect.Descriptor instead.
func (*AchieveInfoReq) Descriptor() ([]byte, []int) {
return file_achieve_achieve_msg_proto_rawDescGZIP(), []int{0}
}
//系统信息拉取
type AchieveInfoResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Tasks []*ConIProgress `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks"`
}
func (x *AchieveInfoResp) Reset() {
*x = AchieveInfoResp{}
if protoimpl.UnsafeEnabled {
mi := &file_achieve_achieve_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AchieveInfoResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AchieveInfoResp) ProtoMessage() {}
func (x *AchieveInfoResp) ProtoReflect() protoreflect.Message {
mi := &file_achieve_achieve_msg_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AchieveInfoResp.ProtoReflect.Descriptor instead.
func (*AchieveInfoResp) Descriptor() ([]byte, []int) {
return file_achieve_achieve_msg_proto_rawDescGZIP(), []int{1}
}
func (x *AchieveInfoResp) GetTasks() []*ConIProgress {
if x != nil {
return x.Tasks
}
return nil
}
type AchieveAwardReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
}
func (x *AchieveAwardReq) Reset() {
*x = AchieveAwardReq{}
if protoimpl.UnsafeEnabled {
mi := &file_achieve_achieve_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AchieveAwardReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AchieveAwardReq) ProtoMessage() {}
func (x *AchieveAwardReq) ProtoReflect() protoreflect.Message {
mi := &file_achieve_achieve_msg_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AchieveAwardReq.ProtoReflect.Descriptor instead.
func (*AchieveAwardReq) Descriptor() ([]byte, []int) {
return file_achieve_achieve_msg_proto_rawDescGZIP(), []int{2}
}
func (x *AchieveAwardReq) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type AchieveAwardResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
Award []*UserAtno `protobuf:"bytes,2,rep,name=award,proto3" json:"award"` //奖励
}
func (x *AchieveAwardResp) Reset() {
*x = AchieveAwardResp{}
if protoimpl.UnsafeEnabled {
mi := &file_achieve_achieve_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AchieveAwardResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AchieveAwardResp) ProtoMessage() {}
func (x *AchieveAwardResp) ProtoReflect() protoreflect.Message {
mi := &file_achieve_achieve_msg_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AchieveAwardResp.ProtoReflect.Descriptor instead.
func (*AchieveAwardResp) Descriptor() ([]byte, []int) {
return file_achieve_achieve_msg_proto_rawDescGZIP(), []int{3}
}
func (x *AchieveAwardResp) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *AchieveAwardResp) GetAward() []*UserAtno {
if x != nil {
return x.Award
}
return nil
}
var File_achieve_achieve_msg_proto protoreflect.FileDescriptor
var file_achieve_achieve_msg_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x2f, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76,
0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x62, 0x75, 0x72,
0x69, 0x65, 0x64, 0x2f, 0x62, 0x75, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x10, 0x0a, 0x0e, 0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x71, 0x22, 0x36, 0x0a, 0x0f, 0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6e, 0x49, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65,
0x73, 0x73, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x41, 0x63, 0x68,
0x69, 0x65, 0x76, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x10,
0x41, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64,
0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_achieve_achieve_msg_proto_rawDescOnce sync.Once
file_achieve_achieve_msg_proto_rawDescData = file_achieve_achieve_msg_proto_rawDesc
)
func file_achieve_achieve_msg_proto_rawDescGZIP() []byte {
file_achieve_achieve_msg_proto_rawDescOnce.Do(func() {
file_achieve_achieve_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_achieve_achieve_msg_proto_rawDescData)
})
return file_achieve_achieve_msg_proto_rawDescData
}
var file_achieve_achieve_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_achieve_achieve_msg_proto_goTypes = []interface{}{
(*AchieveInfoReq)(nil), // 0: AchieveInfoReq
(*AchieveInfoResp)(nil), // 1: AchieveInfoResp
(*AchieveAwardReq)(nil), // 2: AchieveAwardReq
(*AchieveAwardResp)(nil), // 3: AchieveAwardResp
(*ConIProgress)(nil), // 4: ConIProgress
(*UserAtno)(nil), // 5: UserAtno
}
var file_achieve_achieve_msg_proto_depIdxs = []int32{
4, // 0: AchieveInfoResp.tasks:type_name -> ConIProgress
5, // 1: AchieveAwardResp.award:type_name -> UserAtno
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_achieve_achieve_msg_proto_init() }
func file_achieve_achieve_msg_proto_init() {
if File_achieve_achieve_msg_proto != nil {
return
}
file_buried_buried_db_proto_init()
file_comm_proto_init()
if !protoimpl.UnsafeEnabled {
file_achieve_achieve_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AchieveInfoReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_achieve_achieve_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AchieveInfoResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_achieve_achieve_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AchieveAwardReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_achieve_achieve_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AchieveAwardResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_achieve_achieve_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_achieve_achieve_msg_proto_goTypes,
DependencyIndexes: file_achieve_achieve_msg_proto_depIdxs,
MessageInfos: file_achieve_achieve_msg_proto_msgTypes,
}.Build()
File_achieve_achieve_msg_proto = out.File
file_achieve_achieve_msg_proto_rawDesc = nil
file_achieve_achieve_msg_proto_goTypes = nil
file_achieve_achieve_msg_proto_depIdxs = nil
}

View File

@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"go_dreamfactory/modules/academy"
"go_dreamfactory/modules/achieve"
"go_dreamfactory/modules/activity"
"go_dreamfactory/modules/addrecharge"
"go_dreamfactory/modules/arena"
@ -161,6 +162,7 @@ func main() {
capturesheep.NewModule(),
turntable.NewModule(),
venture.NewModule(),
achieve.NewModule(),
)
}

View File

@ -15,6 +15,7 @@ type GameBuzkashiGradeData struct {
Distance float32
Value int32
Energy int32
Matchvalue int32
}
const TypeId_GameBuzkashiGradeData = -378990226
@ -28,6 +29,7 @@ func (_v *GameBuzkashiGradeData)Deserialize(_buf map[string]interface{}) (err er
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["distance"].(float64); !_ok_ { err = errors.New("distance error"); return }; _v.Distance = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["value"].(float64); !_ok_ { err = errors.New("value error"); return }; _v.Value = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["energy"].(float64); !_ok_ { err = errors.New("energy error"); return }; _v.Energy = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["matchvalue"].(float64); !_ok_ { err = errors.New("matchvalue error"); return }; _v.Matchvalue = int32(_tempNum_) }
return
}

View File

@ -14,6 +14,7 @@ type GameBuzkashiQteLvData struct {
Num int32
Time float32
Value int32
Matchvalue int32
}
const TypeId_GameBuzkashiQteLvData = 795602659
@ -26,6 +27,7 @@ func (_v *GameBuzkashiQteLvData)Deserialize(_buf map[string]interface{}) (err er
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["num"].(float64); !_ok_ { err = errors.New("num error"); return }; _v.Num = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["value"].(float64); !_ok_ { err = errors.New("value error"); return }; _v.Value = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["matchvalue"].(float64); !_ok_ { err = errors.New("matchvalue error"); return }; _v.Matchvalue = int32(_tempNum_) }
return
}