This commit is contained in:
liwei1dao 2023-11-14 17:40:27 +08:00
commit 3d291a828d
166 changed files with 3370 additions and 1627 deletions

View File

@ -24368,10 +24368,10 @@
},
{
"id": 12070035,
"rtype": 0,
"ctype": 0,
"rtype": 1,
"ctype": 1,
"notify": [],
"type_sp": 0,
"type_sp": 1,
"tasktxt": {
"key": "buried_buried_condi_tasktxt_732",
"text": "吃面战斗2场+起名"

View File

@ -7,7 +7,7 @@
"parameter": "",
"interface": "",
"condition": "worldtaskexit_accept_20010",
"followtj": "OpenNpcOption_主线入口_原石",
"followtj": "",
"followguide": 1000102,
"finger": [
"taskDedailsPopup",
@ -40,23 +40,21 @@
{
"id": 1000102,
"group": 1,
"type": 3,
"type": 5,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 0,
"followtj": "JpystickMove",
"followguide": 1000103,
"finger": [
"command",
"mainCom$.optionList$",
"0"
"joystick"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"fingerTime": 0.5,
"objSize": {
"x": 0,
"y": 0
@ -68,24 +66,24 @@
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"mask": 1,
"lock": 1,
"uishow": 0,
"skiptime": 5000,
"skiptime": 10000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000201,
"group": 2,
"id": 1000103,
"group": 1,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtasksubfinish_20010",
"followtj": "OpenNpcOption_20010_熊猫_1",
"followguide": 1000202,
"condition": "",
"followtj": "",
"followguide": 0,
"finger": [
"command",
"mainCom$.taskpanel$.mainTaskList.tasklist$",
@ -107,8 +105,8 @@
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"mask": 1,
"lock": 1,
"uishow": 0,
"skiptime": 5000,
"skip": 0,
@ -116,92 +114,15 @@
"reward": []
},
{
"id": 1000202,
"group": 2,
"id": 1000501,
"group": 5,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"condition": "funcopen_mail",
"followtj": "",
"followguide": 0,
"finger": [
"command",
"mainCom$.optionList$",
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000301,
"group": 3,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtaskexit_submit_20010",
"followtj": "TriggerQuest_20012",
"followguide": 1000302,
"finger": [
"taskDedailsPopup",
"btn_star$"
],
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000302,
"group": 3,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "CloseItemPopup",
"followguide": 1000303,
"finger": [],
"offset": {
"x": 0,
@ -219,361 +140,10 @@
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 1,
"lock": 1,
"uishow": 0,
"skiptime": 5000,
"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$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0.1,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000304,
"group": 3,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 0,
"finger": [
"maininterface",
"mainCom$.optionList$",
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000401,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtaskexit_accept_20012",
"followtj": "OpenNpcOption_20020_小怪_船甲板",
"followguide": 1000402,
"finger": [
"taskDedailsPopup",
"btn_star$"
],
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000402,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 1000403,
"finger": [
"maininterface",
"mainCom$.optionList$",
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000403,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "OpenFight",
"followguide": 1000404,
"finger": [
"battleready",
"btn_start$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "1000102",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1000404,
"group": 4,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 0,
"finger": [
"zhandou",
"skilllist$",
"2",
"skillbtn"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0.3,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "1000201",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1001001,
"group": 10,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "worldtaskexit_accept_20050",
"followtj": "",
"followguide": 1001002,
"finger": [
"taskDedailsPopup",
"btn_star$",
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 1001002,
"group": 10,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "",
"followtj": "",
"followguide": 0,
"finger": [
"maininterface",
"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": 5000,
"skip": 0,
"skipgroup": 0,
"reward": []
},
{
"id": 2000101,
"group": 101,
"type": 3,
"startPar": "",
"parameter": "",
"interface": "",
"condition": "OpenRecruit",
"followtj": "",
"followguide": 0,
"finger": [
"recruit",
"btn_onedraw$",
"0"
],
"offset": {
"x": 0,
"y": 0
},
"fingerTime": 0,
"objSize": {
"x": 0,
"y": 0
},
"objOffset": {
"x": 0,
"y": 0
},
"txt": "1000202",
"speakerface": 0,
"sound": "",
"mask": 0,
"lock": 0,
"uishow": 0,
"skiptime": 5000,
"skiptime": 0,
"skip": 0,
"skipgroup": 0,
"reward": []

View File

@ -231,7 +231,22 @@
{
"a": "attr",
"t": "diamond",
"n": 50
"n": 1000
},
{
"a": "item",
"t": "10000008",
"n": 10
},
{
"a": "item",
"t": "10000009",
"n": 10
},
{
"a": "item",
"t": "10000010",
"n": 5
}
],
"duration": 720

53
bin/json/game_moonlv.json Normal file
View File

@ -0,0 +1,53 @@
[
{
"Id": 1,
"Level": 1,
"TaskGroupId": 10001,
"Reward": [
{
"a": "item",
"t": "10000001",
"n": 5
},
{
"a": "attr",
"t": "starcoin",
"n": 20
}
]
},
{
"Id": 2,
"Level": 2,
"TaskGroupId": 10002,
"Reward": [
{
"a": "item",
"t": "10000001",
"n": 5
},
{
"a": "attr",
"t": "starcoin",
"n": 20
}
]
},
{
"Id": 3,
"Level": 3,
"TaskGroupId": 10003,
"Reward": [
{
"a": "item",
"t": "10000001",
"n": 5
},
{
"a": "attr",
"t": "starcoin",
"n": 20
}
]
}
]

272
bin/json/game_moontask.json Normal file
View File

@ -0,0 +1,272 @@
[
{
"Id": 1,
"TaskGroup": 1001,
"TaskId": 110001,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 2,
"TaskGroup": 1001,
"TaskId": 110003,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 3,
"TaskGroup": 1001,
"TaskId": 110004,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 4,
"TaskGroup": 1001,
"TaskId": 110005,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 5,
"TaskGroup": 1001,
"TaskId": 110006,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 6,
"TaskGroup": 1001,
"TaskId": 110007,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 7,
"TaskGroup": 1002,
"TaskId": 110008,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 8,
"TaskGroup": 1002,
"TaskId": 110009,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 9,
"TaskGroup": 1002,
"TaskId": 110010,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 10,
"TaskGroup": 1002,
"TaskId": 110012,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 11,
"TaskGroup": 1002,
"TaskId": 110013,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 12,
"TaskGroup": 1003,
"TaskId": 110014,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 13,
"TaskGroup": 1003,
"TaskId": 110015,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 14,
"TaskGroup": 1003,
"TaskId": 110016,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
},
{
"Id": 15,
"TaskGroup": 1003,
"TaskId": 110017,
"TaskReward": [
{
"a": "attr",
"t": "gold",
"n": 5000
},
{
"a": "item",
"t": "10000001",
"n": 10
}
],
"JumpFunction": 0
}
]

View File

@ -7,8 +7,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20031
}
],
"wkqbx": 2,
@ -61,8 +61,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20034
}
],
"wkqbx": 2,
@ -115,8 +115,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 2,
"param": 1101000
}
],
"wkqbx": 2,
@ -142,8 +142,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20034
}
],
"wkqbx": 2,
@ -223,8 +223,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20050
}
],
"wkqbx": 2,
@ -250,8 +250,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 2,
"param": 1101000
}
],
"wkqbx": 2,
@ -304,8 +304,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20032
}
],
"wkqbx": 2,
@ -844,8 +844,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20050
}
],
"wkqbx": 0,
@ -1168,8 +1168,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20050
}
],
"wkqbx": 1,
@ -1492,8 +1492,8 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20033
}
],
"wkqbx": 2,
@ -2349,11 +2349,11 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20050
}
],
"wkqbx": 0,
"wkqbx": 2,
"img": "",
"prompt": {
"key": "opencond_opencond_prompt_86",
@ -2380,7 +2380,7 @@
"param": 10
}
],
"wkqbx": 0,
"wkqbx": 2,
"img": "",
"prompt": {
"key": "opencond_opencond_prompt_87",
@ -2394,5 +2394,86 @@
"key": "",
"text": ""
}
},
{
"id": "achievement",
"name": {
"key": "opencond_opencond_name_90",
"text": "成就"
},
"main": [
{
"key": 2,
"param": 1101000
}
],
"wkqbx": 2,
"img": "",
"prompt": {
"key": "",
"text": ""
},
"uiid": 0,
"activateType": 0,
"notify": [],
"kqbx": 0,
"kqbx_text": {
"key": "",
"text": ""
}
},
{
"id": "photo",
"name": {
"key": "opencond_opencond_name_91",
"text": "照相"
},
"main": [
{
"key": 2,
"param": 1101000
}
],
"wkqbx": 2,
"img": "",
"prompt": {
"key": "",
"text": ""
},
"uiid": 0,
"activateType": 0,
"notify": [],
"kqbx": 0,
"kqbx_text": {
"key": "",
"text": ""
}
},
{
"id": "overview",
"name": {
"key": "opencond_opencond_name_92",
"text": "导航"
},
"main": [
{
"key": 2,
"param": 1101000
}
],
"wkqbx": 2,
"img": "",
"prompt": {
"key": "",
"text": ""
},
"uiid": 0,
"activateType": 0,
"notify": [],
"kqbx": 0,
"kqbx_text": {
"key": "",
"text": ""
}
}
]

View File

@ -365,7 +365,7 @@
"Levelid": 0,
"datas": [
"GameMain",
"梅林",
"20012_梅林_船甲板",
"901"
],
"event": [
@ -380,7 +380,7 @@
"Levelid": 0,
"datas": [
"GameMain",
"20020_小怪_船甲板1",
"20020_小怪_船甲板",
"901"
],
"event": [
@ -410,7 +410,7 @@
"Levelid": 0,
"datas": [
"GameMain",
"20060-乌龟大师",
"功能入口-招募",
"901"
],
"event": [
@ -609,8 +609,8 @@
"901"
],
"event": [
2,
10100
1,
103
],
"goto": 0
},
@ -629,6 +629,21 @@
],
"goto": 0
},
{
"id": 200341,
"heroid": 45001,
"Levelid": 0,
"datas": [
"GameMain",
"功能入口-烹饪",
"901"
],
"event": [
2,
10100
],
"goto": 0
},
{
"id": 100421,
"heroid": 35002,

File diff suppressed because it is too large Load Diff

View File

@ -123,6 +123,7 @@ const (
ModuleIsLand core.M_Modules = "island" //海岛探险
ModuleEgghunt core.M_Modules = "egghunt" //彩蛋
ModuleCatchbugs core.M_Modules = "catchbugs" //捉虫子
ModuleMoonlv core.M_Modules = "monnlv" //护月等级
)
// 数据表名定义处
@ -419,6 +420,8 @@ const (
//用户日志
TableUserLog = "userlog"
TableMoonlv = "moonlv"
)
// RPC服务接口定义处
@ -1133,3 +1136,8 @@ const (
OpencondTypePagoda OpencondType = 5 //爬塔
OpencondTypeSociaty OpencondType = 6 //工会等级
)
const (
GMResAddType int32 = 0
GMResDelType int32 = 1
)

View File

@ -69,7 +69,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AcademyReceiveRe
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype151, 1))
this.module.WriteUserLog(session.GetUserId(), "AcademyReceiveReq", level.Award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AcademyReceiveReq", level.Award)
})
}

View File

@ -67,7 +67,7 @@ func (this *apiComp) TeachingReceive(session comm.IUserSession, req *pb.AcademyT
this.module.DispenseRes(session, level.Award, true)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AcademyTeachingReceiveReq", level.Award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AcademyTeachingReceiveReq", level.Award)
})
}
session.SendMsg(string(this.module.GetType()), "teachingreceive", &pb.AcademyTeachingReceiveResp{Issucc: true})

View File

@ -81,7 +81,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AchieveAwardReq) (
session.SendMsg(string(this.module.GetType()), "award", &pb.AchieveAwardResp{Id: req.Id, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AchieveAwardReq", conf.TaskReward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AchieveAwardReq", conf.TaskReward)
})
return
}

View File

@ -98,7 +98,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.ActivityGetRew
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ActivityGetRewardReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ActivityGetRewardReq", reward)
})
return
}

View File

@ -77,7 +77,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.AddRechargeRecei
session.SendMsg(string(this.module.GetType()), "receive", &pb.AddRechargeReceiveResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AddRechargeReceiveReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AddRechargeReceiveReq", award)
})
return
}

View File

@ -79,7 +79,7 @@ func (this *apiComp) ReceiveAll(session comm.IUserSession, req *pb.AddRechargeRe
})
session.SendMsg(string(this.module.GetType()), "receiveall", &pb.AddRechargeReceiveAllResp{Record: info.Record, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AddRechargeReceiveAllReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AddRechargeReceiveAllReq", award)
})
return
}

View File

@ -99,7 +99,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
session.SendMsg(string(this.module.GetType()), "buy", &pb.MoonfantasyBuyResp{Issucc: true, BattleNum: info.Buynum})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MoonfantasyBuyReq", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}})
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MoonfantasyBuyReq", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: req.BuyNum}})
})
return
}

View File

@ -289,7 +289,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
if bReward {
this.module.WriteUserLog(session.GetUserId(), "ArenaChallengeRewardReq", reward.WinReward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ArenaChallengeRewardReq", reward.WinReward)
}
})

View File

@ -98,7 +98,7 @@ func (this *apiComp) PlotReward(session comm.IUserSession, req *pb.ArenaPlotRewa
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ArenaPlotRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ArenaPlotRewardReq", atno)
})
return
}

View File

@ -73,7 +73,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.AtlasAwardReq) (er
Res: respRes,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "AtlasAwardReq", respRes)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "AtlasAwardReq", respRes)
})
return
}

View File

@ -63,7 +63,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.CanineRabbitAwardR
session.SendMsg(string(this.module.GetType()), "award", &pb.CanineRabbitAwardResp{Type: req.Type, Awardmap: info.Award, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CanineRabbitAwardReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CanineRabbitAwardReq", res)
})
return
}

View File

@ -71,7 +71,7 @@ func (this *apiComp) AllWeekReward(session comm.IUserSession, req *pb.Captureshe
}
session.SendMsg(string(this.module.GetType()), "allweekreward", &pb.CapturesheepAllWeekRewardResp{Weekreward: info.Weekreward, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepAllWeekRewardReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CapturesheepAllWeekRewardReq", award)
})
return
}

View File

@ -134,7 +134,7 @@ func (this *apiComp) Over(session comm.IUserSession, req *pb.CapturesheepOverReq
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepOverReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CapturesheepOverReq", award)
})
return
}

View File

@ -74,7 +74,7 @@ func (this *apiComp) WeekReward(session comm.IUserSession, req *pb.CapturesheepW
session.SendMsg(string(this.module.GetType()), "weekreward", &pb.CapturesheepWeekRewardResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepWeekRewardReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CapturesheepWeekRewardReq", award)
})
return
}

View File

@ -116,7 +116,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
this.module.Errorf("获得虚拟币失败:%v", errdata)
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "troll sell", addRes)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "troll sell", addRes)
})
this.module.ArrayBag(caravan)
@ -232,7 +232,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
this.module.Errorf("获得虚拟币失败:%v", errdata)
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "troll buy", []*cfg.Gameatn{{
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "troll buy", []*cfg.Gameatn{{
A: "attr",
T: "merchantmoney",
N: addScore,

View File

@ -99,7 +99,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.CaravanGetRewa
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CaravanGetRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CaravanGetRewardReq", atno)
})
return
}

View File

@ -222,7 +222,7 @@ func (this *Caravan) InitCaravanTicket(session comm.IUserSession, conf *cfg.Game
errdata = this.DispenseRes(session, res, true) // 推送门票和虚拟币资源
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "InitCaravanTicket", res)
this.WriteUserLog(session.GetUserId(), 0, "InitCaravanTicket", res)
})
return
}
@ -387,7 +387,7 @@ func (this *Caravan) TaskComplete(session comm.IUserSession, taskid ...int32) {
}
session.SendMsg(string(this.GetType()), "taskcomplete", resp)
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "TaskComplete", conf.Reword)
this.WriteUserLog(session.GetUserId(), 0, "TaskComplete", conf.Reword)
})
}
}

View File

@ -54,7 +54,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.CatchbugsAwardReq)
session.SendMsg(string(this.module.GetType()), "award", &pb.CatchbugsAwardResp{Awardmap: info.Awards, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CatchbugsAwardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CatchbugsAwardReq", atno)
})
return
}

View File

@ -153,7 +153,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.CombatAskReq) (errda
session.SendMsg(string(this.module.GetType()), "ask", &pb.CombatAskResp{Level: pitem})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CombatAskReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CombatAskReq", reward)
})
return
}

View File

@ -101,7 +101,7 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CombatChallengeReceiveReq", atns)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CombatChallengeReceiveReq", atns)
})
}
session.SendMsg(string(this.module.GetType()), "challengereceive", &pb.CombatChallengeReceiveResp{Level: req.Level, Manster: req.Manster, Atns: atns})

View File

@ -112,7 +112,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
session.SendMsg(string(this.module.GetType()), "drop", &pb.CombatDropResp{Level: req.Level, Atns: atns})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CombatDropReq", atns)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CombatDropReq", atns)
})
return
}

View File

@ -58,7 +58,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.DailytaskReceive
session.SendMsg(string(this.module.GetType()), "receive", &pb.DailytaskReceiveResp{Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "DailytaskReceiveReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DailytaskReceiveReq", atno)
})
return
}

View File

@ -81,7 +81,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.DColorAwardReq) (e
session.SendMsg(string(this.module.GetType()), "award", &pb.DColorAwardResp{Atype: req.Atype, Award: atno, Awardmap: awards})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "DColorAwardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DColorAwardReq", atno)
})
return
}

View File

@ -71,7 +71,7 @@ func (a *apiComp) Autoreceive(session comm.IUserSession, req *pb.DispatchAutoRec
session.SendMsg(string(a.module.GetType()), "autoreceive", rsp)
go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
a.module.WriteUserLog(session.GetUserId(), "DispatchAutoReceiveReq", res)
a.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DispatchAutoReceiveReq", res)
})
return
}

View File

@ -69,7 +69,7 @@ func (a *apiComp) Notice(session comm.IUserSession, req *pb.DispatchNoticeReq) (
a.module.DispenseRes(session, []*cfg.Gameatn{atn}, true)
go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
a.module.WriteUserLog(session.GetUserId(), "恢复门票", atn)
a.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "恢复门票", atn)
})
}
}

View File

@ -94,7 +94,7 @@ func (a *apiComp) Receive(session comm.IUserSession, req *pb.DispatchReceiveReq)
session.SendMsg(string(a.module.GetType()), "receive", rsp)
go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
a.module.WriteUserLog(session.GetUserId(), "DispatchReceiveReq", res)
a.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DispatchReceiveReq", res)
})
return
}

View File

@ -59,7 +59,7 @@ func (a *apiComp) Weekrecive(session comm.IUserSession, req *pb.DispatchWeekReci
if len(res) > 0 {
a.module.DispenseRes(session, res, true)
go a.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
a.module.WriteUserLog(session.GetUserId(), "DispatchWeekReciveReq", res)
a.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DispatchWeekReciveReq", res)
})
}
session.SendMsg(string(a.module.GetType()), "weekrecive", rsp)

View File

@ -170,7 +170,7 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
if curLv > preLv { // 升级后统计任务
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype235, dragon.Lv, utils.ToInt32(dragon.Dragonid)))
this.module.WriteUserLog(session.GetUserId(), "DragonTrainReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DragonTrainReq", atno)
})
}
return

View File

@ -58,7 +58,7 @@ func (this *apiComp) Award(session comm.IUserSession, req *pb.EgghuntAwardReq) (
session.SendMsg(string(this.module.GetType()), "award", &pb.EgghuntAwardResp{Id: req.Id, Award: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EgghuntAwardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "EgghuntAwardReq", atno)
})
return
}

View File

@ -100,7 +100,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
return
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EnchantChallengeOverReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "EnchantChallengeOverReq", res)
})
}

View File

@ -88,7 +88,7 @@ func (this *apiComp) BoxReward(session comm.IUserSession, req *pb.EntertainBoxRe
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EntertainBoxRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "EntertainBoxRewardReq", atno)
})
return
}

View File

@ -66,7 +66,7 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.EntertainRewardRe
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EntertainRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(),0, "EntertainRewardReq", atno)
})
return
}

View File

@ -582,7 +582,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) {
return
}
go this.module.AsynHandleSession(this.szSession[winindex], func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "xxlGame", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "xxlGame", atno)
})
this.szSession[winindex].Push()
}

View File

@ -110,7 +110,7 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.EquipmentSellReq) (
}
session.SendMsg(string(this.module.GetType()), "sell", &pb.EquipmentSellResp{IsSucc: true, Reward: reward})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "EquipmentSellReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "EquipmentSellReq", reward)
})
return
}

View File

@ -418,7 +418,7 @@ func (this *Equipment) SellEquipments(session comm.IUserSession, equs []string)
}
go func() {
this.WriteUserLog(session.GetUserId(), "SellEquipments", atno)
this.WriteUserLog(session.GetUserId(), 0, "SellEquipments", atno)
}()
return
}
@ -515,7 +515,7 @@ func (this *Equipment) RecycleEquipments(session comm.IUserSession, equs []strin
return
}
go func() {
this.WriteUserLog(session.GetUserId(), "RecycleEquipments", atno)
this.WriteUserLog(session.GetUserId(), 0, "RecycleEquipments", atno)
}()
return
}

View File

@ -61,7 +61,7 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar
session.SendMsg(string(this.module.GetType()), "getreward", rsp)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "FriendGetrewardReq", globalConf.FriendPeize)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "FriendGetrewardReq", globalConf.FriendPeize)
})
return
}

View File

@ -133,7 +133,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (errda
// 赠送X次友情点
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype11, 1))
this.module.WriteUserLog(session.GetUserId(), "FriendGetrewardReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "FriendGetrewardReq", res)
})
return
}

View File

@ -62,7 +62,7 @@ func (this *apiComp) ActivateAtlas(session comm.IUserSession, req *pb.GourmetAct
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GourmetActivateAtlasReq", conf.Unlockreward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GourmetActivateAtlasReq", conf.Unlockreward)
})
return
}

View File

@ -100,7 +100,7 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype150, 1))
this.module.WriteUserLog(session.GetUserId(), "GourmetCreateFoodReq", atn)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GourmetCreateFoodReq", atn)
})
return
}

View File

@ -116,7 +116,7 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GrowtaskAdvReceiveReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GrowtaskAdvReceiveReq", atno)
})
return
}

View File

@ -77,7 +77,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.GrowtaskReceiveR
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GrowtaskReceiveReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GrowtaskReceiveReq", reward)
})
return
}

View File

@ -206,7 +206,7 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
Boosticket: member.Boosticket,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GuildGveChallengeFinishReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GuildGveChallengeFinishReq", award)
})
return
}

View File

@ -73,7 +73,7 @@ func (this *apiComp) Roulette(session comm.IUserSession, req *pb.GuildGveRoulett
session.SendMsg(string(this.module.GetType()), "roulette", &pb.GuildGveRouletteResp{Cid: confs[index].Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GuildGveRouletteReq", confs[index].Reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GuildGveRouletteReq", confs[index].Reward)
})
return
}

View File

@ -372,7 +372,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
this.module.SendTaskMsg(session, szStar, req.DrawCount, req.DrawType)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroDrawCardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroDrawCardReq", atno)
})
return
}

View File

@ -100,7 +100,7 @@ func (this *apiComp) PeachReward(session comm.IUserSession, req *pb.HeroPeachRew
session.SendMsg(string(this.module.GetType()), HeroPeachRewardReq, rsp)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroPeachRewardReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroPeachRewardReq", reward)
})
return
}

View File

@ -117,7 +117,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
if len(starConf.Starup) > 0 {
this.module.WriteUserLog(session.GetUserId(), "HeroStrengthenUpStarReq", starConf.Starup)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroStrengthenUpStarReq", starConf.Starup)
}
})
return

View File

@ -73,7 +73,7 @@ func (this *apiComp) TalentReset(session comm.IUserSession, req *pb.HeroTalentRe
this.module.Errorf("DispenseRes err,uid:%s,item:%v", session.GetUserId(), res)
} // 返还升级的天赋点数
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroTalentResetReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroTalentResetReq", res)
})
}

View File

@ -868,7 +868,7 @@ func (this *ModelHero) createHero(session comm.IUserSession, heroCfgId string, c
if len(res) > 0 { // 资源统一发放
this.module.DispenseRes(session, res, true)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "create hero", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "create hero", res)
})
}
return
@ -973,7 +973,7 @@ func (this *ModelHero) GetDrawCardReward(session comm.IUserSession, szCards []st
rsp = append(rsp, &pb.AtnoData{Atno: atno})
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "GetDrawCardReward", rsp)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GetDrawCardReward", rsp)
})
return
}

View File

@ -108,7 +108,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.HeroTaskReceiveR
}
session.SendMsg(string(this.module.GetType()), "receive", &pb.HeroTaskReceiveResp{Hero: req.Hero, Stage: req.Stage, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HeroTaskReceiveReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroTaskReceiveReq", award)
})
return

View File

@ -71,7 +71,7 @@ func (this *apiComp) Reset(session comm.IUserSession, req *pb.HoroscopeResetReq)
}
session.SendMsg(string(this.module.GetType()), "reset", &pb.HoroscopeResetResp{Issucc: true, Info: info, Award: consume})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "HoroscopeResetReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HoroscopeResetReq", res)
})
return

View File

@ -204,7 +204,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1))
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "HuntingChallengeOverReq", szAtno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HuntingChallengeOverReq", szAtno)
})
return
}

View File

@ -93,7 +93,7 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.IsLandCompleteR
session.SendMsg(string(this.module.GetType()), "complete", &pb.IsLandCompleteResp{Level: req.Level, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "IsLandCompleteReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "IsLandCompleteReq", award)
})
return
}

View File

@ -70,7 +70,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.IsLandReceiveReq
session.SendMsg(string(this.module.GetType()), "receive", &pb.IsLandReceiveResp{Info: info, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "IsLandReceiveReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "IsLandReceiveReq", award)
})
return
}

View File

@ -109,7 +109,7 @@ func (this *apiComp) BuyPhysical(session comm.IUserSession, req *pb.ItemsBuyPhys
})
session.SendMsg(string(this.module.GetType()), "buyphysical", &pb.ItemsBuyPhysicalResp{Issucc: true, PhysicalBuyNum: user.Physicalbuynum, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsBuyPhysicalReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsBuyPhysicalReq", atno)
})
return
}

View File

@ -92,7 +92,7 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose
session.SendMsg(string(this.module.GetType()), "decompose", &pb.ItemsDecomposeResp{GridId: req.GridId, Amount: req.Amount, Issucc: true, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsDecomposeReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsDecomposeReq", atno)
})
return
}

View File

@ -71,7 +71,7 @@ func (this *apiComp) PotionSynthesis(session comm.IUserSession, req *pb.ItemsPot
session.SendMsg(string(this.module.GetType()), "potionsynthesis", &pb.ItemsPotionSynthesisResp{Succ: true, Id: req.Id, Num: req.Num})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsPotionSynthesisReq", give)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsPotionSynthesisReq", give)
})
return

View File

@ -73,7 +73,7 @@ func (this *apiComp) SellItem(session comm.IUserSession, req *pb.ItemsSellItemRe
}
session.SendMsg(string(this.module.GetType()), "sellitem", &pb.ItemsSellItemResp{GridId: req.GridId, Amount: req.Amount, Issucc: true, Asets: atno})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsSellItemReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsSellItemReq", atno)
})
return
}

View File

@ -88,7 +88,7 @@ func (this *apiComp) Sellinbulk(session comm.IUserSession, req *pb.ItemsSellinbu
session.SendMsg(string(this.module.GetType()), "sellitem", &pb.ItemsSellinbulkResp{Grids: req.Grids, Amount: req.Amount, Issucc: issucc})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "ItemsSellinbulkReq", sale)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsSellinbulkReq", sale)
})
return
}

View File

@ -546,7 +546,7 @@ func (this *ModelItemsComp) buyTicket(session comm.IUserSession, buy int32) (inf
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "buyTicket", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "buyTicket", res)
})
return
}
@ -604,7 +604,7 @@ func (this *ModelItemsComp) recoverTicket(session comm.IUserSession) (errdata *p
this.module.DispenseRes(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}}, true)
info.Recovertimeunifiedticket = time.Unix(info.Recovertimeunifiedticket, 0).Add(time.Duration(ticketNum) * time.Minute).Unix()
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "recoverTicket", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}})
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "recoverTicket", []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}})
})
}
}
@ -829,7 +829,7 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "useitem", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "useitem", atno)
})
return
}

View File

@ -365,7 +365,7 @@ func (this *Items) SellItem(session comm.IUserSession, items map[string]int32, b
this.itemsChangePush(session, change) //推送道具背包变化
}
go this.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "SellItem", atno)
this.WriteUserLog(session.GetUserId(), 0, "SellItem", atno)
})
return
}

View File

@ -92,7 +92,7 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.JielongRewardReq)
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "JielongRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "JielongRewardReq", atno)
})
return
}

View File

@ -104,7 +104,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq
})
session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "KFTaskReceiveReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "KFTaskReceiveReq", award)
})
return

View File

@ -108,7 +108,7 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "LibraryGetStoryRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "LibraryGetStoryRewardReq", atno)
})
return
}

View File

@ -73,7 +73,7 @@ func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvReward
Reward: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "LibraryLvRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "LibraryLvRewardReq", atno)
})
return
}

View File

@ -69,7 +69,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.LinestoryReceive
}
session.SendMsg(string(this.module.GetType()), LinestorySubTypeReceive, rsp)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "LinestoryReceiveReq", conf.Reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "LinestoryReceiveReq", conf.Reward)
})
return
}

View File

@ -61,7 +61,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma
session.SendMsg(string(this.module.GetType()), "getusermailattachment", &pb.MailGetUserMailAttachmentResp{Mail: mail})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MailGetUserMailAttachmentReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MailGetUserMailAttachmentReq", res)
})
return
}
@ -124,7 +124,7 @@ func (this *apiComp) GetAllMailAttachment(session comm.IUserSession, req *pb.Mai
Ids: mailIds,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MailGetAllMailAttachmentReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MailGetAllMailAttachmentReq", atno)
})
return
}

View File

@ -87,7 +87,7 @@ func (this *apiComp) BoosChallengeOver(session comm.IUserSession, req *pb.Mainli
Reward: aeward,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineBoosChallengeOverReq", aeward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineBoosChallengeOverReq", aeward)
})
return
}

View File

@ -82,7 +82,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
}) // 数据推送
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineChallengeOverReq false", conf.PsConsume)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineChallengeOverReq false", conf.PsConsume)
})
return
}
@ -197,7 +197,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypeMaxmapid, req.Level)
this.module.WriteUserLog(session.GetUserId(), "MainlineChallengeOverReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineChallengeOverReq", reward)
})
return
}

View File

@ -137,7 +137,7 @@ func (this *apiComp) LevelPass(session comm.IUserSession, req *pb.MainlineLevelP
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "MainlineLevelPassReq", aeward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineLevelPassReq", aeward)
})
return
}

View File

@ -156,7 +156,7 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineReceiveAwardReq", reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineReceiveAwardReq", reward)
})
return
}

View File

@ -92,7 +92,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "MainlineShopBuyReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineShopBuyReq", atno)
})
return
}

View File

@ -96,7 +96,7 @@ func (this *apiComp) TaskChapteReward(session comm.IUserSession, req *pb.Mainlin
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineTaskChapteRewardReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineTaskChapteRewardReq", award)
})
return
}

View File

@ -78,7 +78,7 @@ func (this *apiComp) TaskReceive(session comm.IUserSession, req *pb.MainlineTask
session.SendMsg(string(this.module.GetType()), "taskreceive", &pb.MainlineTaskReceiveResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MainlineTaskReceiveReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineTaskReceiveReq", award)
})
return
}

View File

@ -39,16 +39,22 @@ func (this *modelUserLog) Init(service core.IService, module core.IModule, comp
}
// 用户操作明细数据记录
func (this *modelUserLog) AddUserLog(uid string, tag string, data interface{}) {
func (this *modelUserLog) AddUserLog(uid string, itype int32, tag string, data interface{}) {
var (
dbModel *db.DBModel
err error
jsonStr []byte
logType string
)
if jsonStr, err = json.Marshal(data); err != nil {
log.Errorln(err)
return
}
if itype == 0 {
logType = "add" // 新增资源类型
} else if itype == 1 {
logType = "sub" // 消耗资源类型
}
if db.IsCross() { //如果是跨服 直接找到对应的本服
if tag, _, b := utils.UIdSplit(uid); b {
if conn, err := db.ServerDBConn(tag); err == nil {
@ -57,6 +63,7 @@ func (this *modelUserLog) AddUserLog(uid string, tag string, data interface{}) {
Id: primitive.NewObjectID().Hex(),
Uid: uid,
ExpireAt: time.Now().Add(time.Hour * 24 * 8).Unix(),
Logtype: logType,
Tag: tag,
Data: string(jsonStr),
}); err != nil {
@ -71,6 +78,7 @@ func (this *modelUserLog) AddUserLog(uid string, tag string, data interface{}) {
Uid: uid,
ExpireAt: time.Now().Add(time.Hour * 24 * 8).Unix(),
Tag: tag,
Logtype: logType,
Data: string(jsonStr),
}); err != nil {
log.Errorln(err)

View File

@ -955,6 +955,6 @@ func (this *ModuleBase) AsynHandleSession(session comm.IUserSession, handle func
}
//写用户日志
func (this *ModuleBase) WriteUserLog(uid string, tag string, data interface{}) {
this.userlog.AddUserLog(uid, tag, data)
func (this *ModuleBase) WriteUserLog(uid string, itype int32, tag string, data interface{}) {
this.userlog.AddUserLog(uid, itype, tag, data)
}

View File

@ -44,7 +44,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MoonfantasyRecei
return
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MoonfantasyReceiveReq", boss.PsMg)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MoonfantasyReceiveReq", boss.PsMg)
})
return
} else {
@ -54,7 +54,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MoonfantasyRecei
this.module.DispenseRes(session, boss.Prize, true)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "MoonfantasyReceiveReq", boss.Prize)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MoonfantasyReceiveReq", boss.Prize)
})
}

25
modules/moonlv/api.go Normal file
View File

@ -0,0 +1,25 @@
package moonlv
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type apiComp struct {
modules.MCompGate
service core.IService
module *Moonlv
}
//组件初始化接口
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.module = module.(*Moonlv)
this.service = service
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,29 @@
package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MoonlvGetListReq) (errdata *pb.ErrorData) {
return
}
// 获取护月等级基本信息
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MoonlvGetListReq) (errdata *pb.ErrorData) {
list, err := this.module.modelMoonlv.getMoonlvList(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
}
return
}
session.SendMsg(string(this.module.GetType()), "getlist", &pb.MoonlvGetListResp{
Data: list,
})
return
}

View File

@ -0,0 +1,74 @@
package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) AwardCheck(session comm.IUserSession, req *pb.MoonlvAwardReq) (errdata *pb.ErrorData) {
if req.Lv == 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
return
}
// 领取等级奖励
func (this *apiComp) Award(session comm.IUserSession, req *pb.MoonlvAwardReq) (errdata *pb.ErrorData) {
var (
update map[string]interface{}
)
update = make(map[string]interface{}, 0)
list, err := this.module.modelMoonlv.getMoonlvList(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
}
return
}
if _, ok := list.Reward[req.Lv]; ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_TaskRepeatedReward,
Title: pb.ErrorCode_TaskRepeatedReward.ToString(),
}
return
}
for _, v := range list.Tasks {
if v.Received != 2 { // 只要有未领取的就不能升级
errdata = &pb.ErrorData{
Code: pb.ErrorCode_TaskNoFinished,
Title: pb.ErrorCode_TaskNoFinished.ToString(),
}
return
}
}
if _, err := this.module.configure.GetMoonLvConf(list.Lv + 1); err != nil { // 查看能不能继续升级
list.Lv += 1
update["lv"] = list.Lv
// 升级了清空当前任务
list.Tasks = nil
update["task"] = list.Tasks
}
list.Reward[req.Lv] = true
update["reward"] = list.Reward
if err := this.module.modelMoonlv.modifyMoonlvList(session.GetUserId(), update); err != nil {
this.module.Error(err.Error())
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "award", &pb.MoonlvAwardResp{
Data: &pb.DBMoonLv{},
Res: []*pb.UserAssets{},
})
return
}

View File

@ -0,0 +1,79 @@
package moonlv
import (
"errors"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
// 任务奖励领取
func (this *apiComp) TaskAwardCheck(session comm.IUserSession, req *pb.MoonlvTaskAwardReq) (errdata *pb.ErrorData) {
if req.TaskId == 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
return
}
func (this *apiComp) TaskAward(session comm.IUserSession, req *pb.MoonlvTaskAwardReq) (errdata *pb.ErrorData) {
var (
atno []*pb.UserAtno
list *pb.DBMoonLv
err error
)
if errdata = this.TaskAwardCheck(session, req); errdata != nil {
return
}
list, err = this.module.modelMoonlv.getMoonlvList(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if err := this.module.modelMoonlv.updateTaskRecord(session.GetUserId(), req.TaskId, list); err != nil {
var errCustom = new(comm.CustomError)
if errors.As(err, &errCustom) {
errdata = &pb.ErrorData{
Code: errCustom.Code,
Title: errCustom.Code.ToString(),
Message: err.Error(),
}
} else {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
}
return
}
if conf, err := this.module.configure.GetMoonLvTaskConfByTaskId(list.Lv, req.TaskId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
} else {
if errdata, atno = this.module.DispenseAtno(session, conf.TaskReward, true); errdata != nil {
return
}
}
session.SendMsg(string(this.module.GetType()), "taskaward", &pb.MoonlvTaskAwardResp{
TaskId: req.TaskId,
Reward: atno,
Data: list,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MoonlvTaskAwardReq", atno)
})
return
}

View File

@ -0,0 +1,111 @@
package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"sync"
)
const (
monnlv = "game_moonlv.json"
monntask = "game_moontask.json"
)
// /配置管理基础组件
type configureComp struct {
modules.MCompConfigure
module *Moonlv
hlock sync.RWMutex
taskgroup map[int32][]*cfg.GameMoonTaskData
}
// 组件初始化接口
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.(*Moonlv)
err = this.LoadMultiConfigure(map[string]interface{}{
monnlv: cfg.NewGameMoonLv,
monntask: cfg.NewGameMoonTask,
})
configure.RegisterConfigure(monntask, cfg.NewGameMoonTask, this.LoadGameMoonTaskData)
return
}
func (this *configureComp) LoadGameMoonTaskData() {
if v, err := this.GetConfigure(monntask); err == nil {
if configure, ok := v.(*cfg.GameMoonTask); ok {
this.hlock.Lock()
this.taskgroup = make(map[int32][]*cfg.GameMoonTaskData, 0)
defer this.hlock.Unlock()
for _, value := range configure.GetDataList() {
this.taskgroup[value.TaskGroup] = append(this.taskgroup[value.TaskGroup], value)
}
return
}
} else {
log.Errorf("get LoadGameMoonTaskData conf err:%v", err)
}
}
// 加载多个配置文件
func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) {
for k, v := range confs {
err = configure.RegisterConfigure(k, v, nil)
if err != nil {
log.Errorf("配置文件:%s解析失败!", k)
break
}
}
return
}
// 读取配置数据
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
return configure.GetConfigure(name)
}
func (this *configureComp) GetMoonLvConf(lv int32) (conf *cfg.GameMoonLvData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(monnlv); err == nil {
if configure, ok := v.(*cfg.GameMoonLv); ok {
if conf = configure.Get(lv); conf != nil {
return
}
}
}
err = comm.NewNotFoundConfErr("moonlv", monnlv, lv)
return
}
func (this *configureComp) GetMoonLvTaskConf(groupId int32) (conf []*cfg.GameMoonTaskData, err error) {
var ok bool
this.hlock.Lock()
conf, ok = this.taskgroup[groupId]
this.hlock.Unlock()
if !ok {
err = comm.NewNotFoundConfErr("moonlv", monntask, groupId)
}
return
}
func (this *configureComp) GetMoonLvTaskConfByTaskId(groupId int32, taskid int32) (conf *cfg.GameMoonTaskData, err error) {
this.hlock.Lock()
list, ok := this.taskgroup[groupId]
this.hlock.Unlock()
if !ok {
err = comm.NewNotFoundConfErr("moonlv", monntask, groupId)
}
for _, v := range list {
if v.TaskId == taskid {
conf = v
return
}
}
return
}

View File

@ -0,0 +1,81 @@
package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
type modelMoonlv struct {
modules.MCompModel
module *Moonlv
}
func (this *modelMoonlv) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = string(comm.TableMoonlv)
err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*Moonlv)
// uid 创建索引
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}
func (this *modelMoonlv) getMoonlvList(uid string) (result *pb.DBMoonLv, err error) {
result = &pb.DBMoonLv{}
if err = this.Get(uid, result); err != nil {
if mongo.ErrNoDocuments == err {
result.Id = primitive.NewObjectID().Hex()
result.Uid = uid
result.Lv = 1 // 默认1级
result.Reward = make(map[int32]bool)
this.Add(uid, result)
err = nil
}
return
}
return
}
func (this *modelMoonlv) modifyMoonlvList(uid string, data map[string]interface{}) error {
return this.Change(uid, data)
}
func (this *modelMoonlv) getTaskRecord(uid string) (*pb.DBTujianTask, error) {
tt := &pb.DBTujianTask{Uid: uid}
if err := this.Get(uid, tt); err != nil {
return tt, err
}
return tt, nil
}
func (this *modelMoonlv) updateTaskRecord(uid string, taskId int32, dt *pb.DBMoonLv) error {
update := make(map[string]interface{})
for _, v := range dt.Tasks {
if v.TaskId == taskId {
if v.Received == 1 {
v.Received = 2
} else if v.Received == 2 {
return comm.NewCustomError(pb.ErrorCode_SmithyTaskReceived)
} else {
return comm.NewCustomError(pb.ErrorCode_SmithyTaskNoFinished)
}
break
}
}
update["tasks"] = dt.Tasks
if len(update) > 0 {
if err := this.Change(uid, update); err != nil {
return err
}
}
return nil
}

115
modules/moonlv/module.go Normal file
View File

@ -0,0 +1,115 @@
package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Moonlv struct {
modules.ModuleBase
api *apiComp
configure *configureComp
modelMoonlv *modelMoonlv
service core.IService
}
func NewModule() core.IModule {
return &Moonlv{}
}
func (this *Moonlv) GetType() core.M_Modules {
return comm.ModuleMoonlv
}
func (this *Moonlv) 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 *Moonlv) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelMoonlv = this.RegisterComp(new(modelMoonlv)).(*modelMoonlv)
}
func (this *Moonlv) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIProgress) {
var groupID int32
this.Debug("护月任务通知", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "conds", Value: conds})
dt, err := this.modelMoonlv.getMoonlvList(session.GetUserId())
if c, e := this.configure.GetMoonLvConf(dt.Lv); e != nil {
groupID = c.TaskGroupId
}
confList, err := this.configure.GetMoonLvTaskConf(groupID)
if err != nil {
this.Error(err.Error())
return
}
condMap := make(map[int32]*pb.ConIProgress)
for _, conf := range confList {
for _, cond := range conds {
if cond.Conid == conf.TaskId {
condMap[conf.TaskId] = cond
}
}
}
update := make(map[string]interface{})
if dt.Tasks == nil {
for k, v := range condMap {
tt := &pb.MoonTask{
TaskId: k,
Cond: v,
}
if v.State == pb.BuriedItemFinishState_buried_finish {
tt.Received = 1
}
dt.Tasks = append(dt.Tasks, tt)
}
update["tasks"] = dt.Tasks
if err := this.modelMoonlv.modifyMoonlvList(session.GetUserId(), update); err != nil {
this.Error(err.Error())
return
}
return
}
var newTask []*pb.MoonTask
existTaskMap := make(map[int32]*pb.MoonTask)
for _, task := range dt.Tasks {
existTaskMap[task.TaskId] = task
}
for k, v := range condMap {
if task, ok := existTaskMap[k]; ok {
task.Cond = v
if v.State == pb.BuriedItemFinishState_buried_finish {
task.Received = 1
}
} else {
nt := &pb.MoonTask{
TaskId: k,
Cond: v,
}
if v.State == pb.BuriedItemFinishState_buried_finish {
nt.Received = 1
}
newTask = append(newTask, nt)
}
}
dt.Tasks = append(dt.Tasks, newTask...)
update["tasks"] = dt.Tasks
if len(update) > 0 {
if err := this.modelMoonlv.modifyMoonlvList(session.GetUserId(), update); err != nil {
this.Error(err.Error())
return
}
}
}

View File

@ -63,7 +63,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.OldtimesReceiveR
if len(res) > 0 {
this.module.DispenseRes(session, res, true)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "OldtimesReceiveReq", res)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "OldtimesReceiveReq", res)
})
}
session.SendMsg(string(this.module.GetType()), "receive", rsp)

View File

@ -192,7 +192,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleSys.CheckOpenCond(session, comm.OpencondTypePagoda, conf.Key)
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype168, pagoda.Data[conf.Tab], conf.Tab))
this.module.WriteUserLog(session.GetUserId(), "PagodaChallengeOverReq", conf.Reward)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PagodaChallengeOverReq", conf.Reward)
})
return
}

View File

@ -68,7 +68,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
Atno: atno,
})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "PagodaGetRewardReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PagodaGetRewardReq", atno)
})
}
return

View File

@ -188,7 +188,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), "PagodaChallengeRaceOverReq", atno)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PagodaChallengeRaceOverReq", atno)
})
return
}

View File

@ -71,7 +71,7 @@ func (this *apiComp) AllWeekReward(session comm.IUserSession, req *pb.ParkourAll
}
session.SendMsg(string(this.module.GetType()), "allweekreward", &pb.CapturesheepAllWeekRewardResp{Weekreward: info.Weekreward, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepAllWeekRewardReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CapturesheepAllWeekRewardReq", award)
})
return
}

View File

@ -74,7 +74,7 @@ func (this *apiComp) WeekReward(session comm.IUserSession, req *pb.ParkourWeekRe
}
session.SendMsg(string(this.module.GetType()), "weekreward", &pb.CapturesheepWeekRewardResp{Id: req.Id, Award: award})
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "CapturesheepWeekRewardReq", award)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "CapturesheepWeekRewardReq", award)
})
return
}

View File

@ -584,7 +584,7 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) {
Award: award[v.GetUserId()],
})
go this.AsynHandleSession(v, func(session comm.IUserSession) {
this.WriteUserLog(session.GetUserId(), "ParkourRaceOverPush", award[v.GetUserId()])
this.WriteUserLog(session.GetUserId(), 0, "ParkourRaceOverPush", award[v.GetUserId()])
})
sessions = append(sessions, v)
}

View File

@ -143,7 +143,7 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32)
return
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "deliverybyid", conf.Item)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "deliverybyid", conf.Item)
})
return
}
@ -210,7 +210,7 @@ func (this *modelActivityComp) delivery(session comm.IUserSession, pid string) (
return
}
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), "delivery", conf.Item)
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "delivery", conf.Item)
})
return
}

Some files were not shown because too many files have changed in this diff Show More