dp-s_doc/AllCallBack/AllCallBack.md

142 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 集成回调函数 文档
**说明**
由于新增的回调接口较多,并且注册方式与使用方法相同所以全部写在这个文档中
---
**注册方式**
>此文档中每一个回调函数都分为两个注册接口 一个注册接口在原函数执行前 一个注册接口在原函数执行后
>这里使用 玩家拾取道具 接口为例 与frida一样函数的参数被储存在 args 数组中 可以用过args[0] args[1]这样的方式调用
```
//函数调用前的回调函数
Cb_User_Get_Item_Enter_Func.MyFunc <- function(args){
local itemId = args[2];
local SUser = User(args[1]);
print("玩家: [ " + SUser.GetCharacName() + " ]" + " 拾取了道具: [ " + itemId + " ]");
//return null 或者不写 return 代表不对原函数参数做任何修改
//return args 代表修改原函数的参数为修改过的args
}
//函数调用后的回调函数
Cb_User_Get_Item_Leave_Func.MyFunc <- function(args){
local itemId = args[2];
local SUser = User(args[1]);
print("玩家: [ " + SUser.GetCharacName() + " ]" + " 拾取了道具: [ " + itemId + " ]");
//对args 数组 进行 pop 操作将会取得原函数的返回值
local OldRet = args.pop();
//return null 或者不写 return 代表不对原函数返回值做任何修改
//return 任意其他类型 代表将原函数返回值强制修改为你返回的值
}
```
---
---
**回调大全**
接下来开始公布回调函数
---
---
>玩家新增道具时
```
Cb_User_Insert_Item_Enter_Func
Cb_User_Insert_Item_Leave_Func
```
---
>玩家捡起道具
```
Cb_User_Get_Item_Enter_Func
Cb_User_Get_Item_Leave_Func
```
---
>服务器Chat日志HOOK
```
Cb_Server_Chat_Log_Enter_Func
Cb_Server_Chat_Log_Leave_Func
```
---
>玩家上线设置IP
```
Cb_User_Set_WebAddress_Enter_Func
Cb_User_Set_WebAddress_Leave_Func
```
---
>服务端关闭执行函数
```
Cb_Server_Close_Enter_Func
Cb_Server_Close_Leave_Func
```
---
>检查地下城的状况
```
Cb_CheckInoutConditionDungeon_Enter_Func
Cb_CheckInoutConditionDungeon_Leave_Func
```
---
>地下城现场杀死地狱党组怪物Cnt
```
Cb_Field_KillHellPartyGroupMonsterCnt_Enter_Func
Cb_Field_KillHellPartyGroupMonsterCnt_Leave_Func
```
---
>经验收益
```
Cb_Gain_Exp_Sp_Enter_Func
Cb_Gain_Exp_Sp_Leave_Func
```
---
>货币收益
```
Cb_Gain_Money_Enter_Func
Cb_Gain_Money_Leave_Func
```
---
>GetItem检查错误
```
Cb_GetItem_Check_Error_Enter_Func
Cb_GetItem_Check_Error_Leave_Func
```
---
>队伍清除副本
```
Cb_ClearDungeon_Enter_Func
Cb_ClearDungeon_Leave_Func
```
---
>检查选择进入副本时状态
```
Cb_SelectDungeon_Check_Error_Enter_Func
Cb_SelectDungeon_Check_Error_Leave_Func
```
---
>切换装备
```
Cb_CInventory_ChangeEquip_Enter_Func
Cb_CInventory_ChangeEquip_Leave_Func
```
---
>获取通关时间回调
```
Cb_CParty_SetBestClearTime_Enter_Func
Cb_CParty_SetBestClearTime_Leave_Func
```
---