This commit is contained in:
wh_zcy 2023-06-29 11:14:59 +08:00
commit e9df7fb286
13 changed files with 890 additions and 719 deletions

View File

@ -17683,7 +17683,7 @@
"type_sp": 1, "type_sp": 1,
"tasktxt": { "tasktxt": {
"key": "buried_buried_condi_tasktxt_756", "key": "buried_buried_condi_tasktxt_756",
"text": "维京远征火焰泰坦难度1" "text": "维京远征火焰泰坦难度2"
}, },
"type": 73, "type": 73,
"valid": 0, "valid": 0,

View File

@ -27,8 +27,7 @@
"color": 2, "color": 2,
"effects": "", "effects": "",
"access": [ "access": [
158, 158
165
], ],
"img": "attr_diamond", "img": "attr_diamond",
"intr": { "intr": {

View File

@ -95,7 +95,7 @@
{ {
"a": "attr", "a": "attr",
"t": "ps", "t": "ps",
"n": 100 "n": 50
} }
], ],
"access": [ "access": [

View File

@ -224,11 +224,11 @@
"id": 165, "id": 165,
"title": { "title": {
"key": "itemlink_itemlink_title_14", "key": "itemlink_itemlink_title_14",
"text": "前往vip" "text": "前往会员"
}, },
"desc": { "desc": {
"key": "itemlink_itemlink_desc_14", "key": "itemlink_itemlink_desc_14",
"text": "提升vip等级可获得" "text": "提升会员等级可获得"
}, },
"jumpid": 165, "jumpid": 165,
"btnTitle": { "btnTitle": {
@ -258,7 +258,7 @@
"id": 10005, "id": 10005,
"title": { "title": {
"key": "itemlink_itemlink_title_16", "key": "itemlink_itemlink_title_16",
"text": "经验副本" "text": "前往经验副本"
}, },
"desc": { "desc": {
"key": "itemlink_itemlink_desc_16", "key": "itemlink_itemlink_desc_16",
@ -275,7 +275,7 @@
"id": 702, "id": 702,
"title": { "title": {
"key": "itemlink_itemlink_title_17", "key": "itemlink_itemlink_title_17",
"text": "烹饪" "text": "前往烹饪"
}, },
"desc": { "desc": {
"key": "itemlink_itemlink_desc_17", "key": "itemlink_itemlink_desc_17",

File diff suppressed because it is too large Load Diff

View File

@ -3007,7 +3007,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 1, "layer_num": 1,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3038,7 +3038,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 2, "layer_num": 2,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3069,7 +3069,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 3, "layer_num": 3,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3100,7 +3100,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 4, "layer_num": 4,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3131,7 +3131,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 5, "layer_num": 5,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3173,7 +3173,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 6, "layer_num": 6,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3204,7 +3204,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 7, "layer_num": 7,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3235,7 +3235,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 8, "layer_num": 8,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3266,7 +3266,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 9, "layer_num": 9,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"
@ -3297,7 +3297,7 @@
"Level_type": 1, "Level_type": 1,
"layer_num": 10, "layer_num": 10,
"tab": 10, "tab": 10,
"tabIcon": "xmwg_fb_rk4", "tabIcon": "xmwg_fb_rk3",
"tabTitle": { "tabTitle": {
"key": "pagoda10", "key": "pagoda10",
"text": "功夫宗师" "text": "功夫宗师"

View File

@ -26,7 +26,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 30 "n": 120
} }
], ],
"channel": "0", "channel": "0",
@ -61,7 +61,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 150 "n": 600
} }
], ],
"channel": "0", "channel": "0",
@ -96,7 +96,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 340 "n": 1360
} }
], ],
"channel": "0", "channel": "0",
@ -131,7 +131,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 490 "n": 1960
} }
], ],
"channel": "0", "channel": "0",
@ -166,7 +166,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 640 "n": 2560
} }
], ],
"channel": "0", "channel": "0",
@ -201,7 +201,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 990 "n": 3960
} }
], ],
"channel": "0", "channel": "0",
@ -236,7 +236,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 1640 "n": 6560
} }
], ],
"channel": "0", "channel": "0",
@ -271,7 +271,7 @@
{ {
"a": "attr", "a": "attr",
"t": "diamond", "t": "diamond",
"n": 3240 "n": 12960
} }
], ],
"channel": "0", "channel": "0",
@ -290,25 +290,9 @@
"a": "attr", "a": "attr",
"t": "vipexp", "t": "vipexp",
"n": 60 "n": 60
},
{
"a": "attr",
"t": "diamond",
"n": 60
}
],
"diamond_num_double": [
{
"a": "attr",
"t": "vipexp",
"n": 60
},
{
"a": "attr",
"t": "diamond",
"n": 30
} }
], ],
"diamond_num_double": [],
"channel": "0", "channel": "0",
"text": "0", "text": "0",
"show": "6元", "show": "6元",

View File

@ -23981,7 +23981,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000004", "t": "10000008",
"n": 1 "n": 1
} }
], ],
@ -24017,7 +24017,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000005", "t": "10000009",
"n": 1 "n": 1
} }
], ],
@ -24053,7 +24053,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000006", "t": "10000010",
"n": 1 "n": 1
} }
], ],
@ -25385,7 +25385,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000008", "t": "10000004",
"n": 1 "n": 1
} }
], ],
@ -25395,17 +25395,17 @@
{ {
"a": "attr", "a": "attr",
"t": "arenacoin", "t": "arenacoin",
"n": 6000 "n": 150
} }
], ],
"sale": 200, "sale": 200,
"salelist": [ "salelist": [
200, 500,
200, 500,
200, 500,
200, 500,
200, 500,
200 500
], ],
"buyminnum": 1, "buyminnum": 1,
"buymaxnum": 1, "buymaxnum": 1,
@ -25421,7 +25421,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000009", "t": "10000005",
"n": 1 "n": 1
} }
], ],
@ -25457,7 +25457,7 @@
"iteminfo": [ "iteminfo": [
{ {
"a": "item", "a": "item",
"t": "10000010", "t": "10000006",
"n": 1 "n": 1
} }
], ],
@ -25467,17 +25467,17 @@
{ {
"a": "attr", "a": "attr",
"t": "arenacoin", "t": "arenacoin",
"n": 150 "n": 6000
} }
], ],
"sale": 500, "sale": 500,
"salelist": [ "salelist": [
500, 200,
500, 200,
500, 200,
500, 200,
500, 200,
500 200
], ],
"buyminnum": 5, "buyminnum": 5,
"buymaxnum": 5, "buymaxnum": 5,

View File

@ -29,7 +29,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
costRes []*cfg.Gameatn costRes []*cfg.Gameatn
customLv int32 // 定制装备的等级 customLv int32 // 定制装备的等级
rsp *pb.SmithyForgeEquipResp rsp *pb.SmithyForgeEquipResp
needT int32 // 需要消耗的温度 needT float32 // 需要消耗的温度
maxT int32 maxT int32
atno []*pb.UserAtno atno []*pb.UserAtno
lava *cfg.Gameatn lava *cfg.Gameatn
@ -107,32 +107,32 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
customLv = reelcfg.CustomizedLv[index] customLv = reelcfg.CustomizedLv[index]
} }
} }
needT = reelcfg.TemperatureCos * req.Count needT = float32(reelcfg.TemperatureCos * req.Count)
// 熟练度减少的温度 // 熟练度减少的温度
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv) t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
needT = needT * (1000 - t) / 1000 // 千分比 needT *= float32(1000-t) / 1000 // 千分比
// 工具台技能减少 // 工具台技能减少
_s := this.module.modelStove.StoveToolsTemperature(stove) _s := this.module.modelStove.StoveToolsTemperature(stove)
if _s != 0 { if _s != 0 {
needT *= (1 - _s/1000) needT *= (1 - float32(_s)/1000)
} }
if req.Lava == 0 { if req.Lava == 0 {
// 检查炉温 是否够 // 检查炉温 是否够
if stove.Temperature < needT { if stove.Temperature < int32(needT) {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_SmithyNoTemperature, Code: pb.ErrorCode_SmithyNoTemperature,
Title: pb.ErrorCode_SmithyNoTemperature.ToString(), Title: pb.ErrorCode_SmithyNoTemperature.ToString(),
} }
return return
} }
stove.Temperature -= needT // 消耗温度 stove.Temperature -= int32(needT) // 消耗温度
update["temperature"] = stove.Temperature update["temperature"] = stove.Temperature
} else { } else {
exemption := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度 exemption := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCos // 预计消耗温度
gloabNum := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCosNum // 每个消耗的温度 gloabNum := this.module.ModuleTools.GetGlobalConf().ExemptionTemperatureCosNum // 每个消耗的温度
if gloabNum != 0 { if gloabNum != 0 {
req.Lava = needT / gloabNum req.Lava = int32(needT) / gloabNum
if needT%gloabNum != 0 { if int32(needT)%gloabNum != 0 {
req.Lava += 1 req.Lava += 1
} }
// 计算 // 计算

57
modules/version/api.go Normal file
View File

@ -0,0 +1,57 @@
package version
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
"go_dreamfactory/lego/sys/gin"
"go_dreamfactory/lego/sys/gin/engine"
"reflect"
"strings"
)
/*
web api 服务组件
*/
type Api_Comp struct {
cbase.ModuleCompBase
options *Options //模块参数
module *Version //当前模块对象
gin gin.ISys //gin 框架 web的热门框架
}
// 组件初始化接口 启动web服务 并注册api
func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.ModuleCompBase.Init(service, module, comp, options)
this.options = options.(*Options)
this.module = module.(*Version)
if this.gin, err = gin.NewSys(gin.SetListenPort(this.options.Port)); err != nil {
return
}
this.suitableMethods() //发射注册api
return
}
func (this *Api_Comp) suitableMethods() {
typ := reflect.TypeOf(this)
vof := reflect.ValueOf(this)
for m := 0; m < typ.NumMethod(); m++ {
method := typ.Method(m)
mname := method.Name
mtype := method.Type
if method.PkgPath != "" {
continue
}
if mtype.NumIn() != 2 {
continue
}
context := mtype.In(1)
if context.String() != "*engine.Context" {
continue
}
if mtype.NumOut() != 0 {
continue
}
this.gin.POST(strings.ToLower(mname), vof.MethodByName(mname).Interface().(func(*engine.Context)))
this.gin.GET(strings.ToLower(mname), vof.MethodByName(mname).Interface().(func(*engine.Context)))
}
}

47
modules/version/module.go Normal file
View File

@ -0,0 +1,47 @@
package version
import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
)
/*
模块名:web
描述:提供管理员相关的http接口
开发:李伟
*/
func NewModule() core.IModule {
m := new(Version)
return m
}
type Version struct {
cbase.ModuleBase
options *Options
service base.IRPCXService
api_comp *Api_Comp //提供weba pi服务的组件
}
// 模块名
func (this *Version) GetType() core.M_Modules {
return "version"
}
// 模块自定义参数
func (this *Version) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
func (this *Version) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService)
this.options = options.(*Options)
return
}
func (this *Version) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
}

View File

@ -0,0 +1,25 @@
package version
import (
"go_dreamfactory/lego/utils/mapstructure"
"go_dreamfactory/modules"
)
type (
Options struct {
modules.Options
WebDir string
Port int
Key string
}
)
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
if settings != nil {
if err = this.Options.LoadConfig(settings); err != nil {
return
}
err = mapstructure.Decode(settings, this)
}
return
}

59
services/version/main.go Normal file
View File

@ -0,0 +1,59 @@
package main
import (
"flag"
"fmt"
"go_dreamfactory/modules/version"
"go_dreamfactory/services"
"go_dreamfactory/sys/db"
"go_dreamfactory/lego"
"go_dreamfactory/lego/base/rpcx"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
)
/*
服务类型:mainte
服务描述:数据库维护以及GM后台接口 服务
*/
var (
conf = flag.String("conf", "./conf/version.yaml", "获取需要启动的服务配置文件") //启动服务的Id
)
/*服务启动的入口函数*/
func main() {
flag.Parse()
s := NewService(
rpcx.SetConfPath(*conf),
rpcx.SetVersion("1.0.0.0"),
)
s.OnInstallComp( //装备组件
//services.NewGateRouteComp(), //此服务需要接受用户的消息 需要装备网关组件
)
lego.Run(s, //运行模块
version.NewModule(),
)
}
func NewService(ops ...rpcx.Option) core.IService {
s := new(Service)
s.Configure(ops...)
return s
}
// worker 的服务对象定义
type Service struct {
services.ServiceBase
}
// 初始化worker需要的一些系统工具
func (this *Service) InitSys() {
this.ServiceBase.InitSys()
//存储系统
if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil {
panic(fmt.Sprintf("init sys.db err: %s", err.Error()))
} else {
log.Infof("init sys.db success!")
}
}