51 lines
1.1 KiB
Markdown
51 lines
1.1 KiB
Markdown
# CheckMoveTown 回调函数文档
|
||
|
||
**回调说明**:
|
||
`CheckMoveTown`类用于在服务端中持续执行的HOOK。
|
||
|
||
---
|
||
|
||
**注册方法**:
|
||
- `Cb_WongWork_CDungeonClear_getClearedDungeonDiffMap.rawset(Key,Function)`
|
||
|
||
**参数**:
|
||
- `角色对象`
|
||
- `下一个城镇的ID`
|
||
|
||
**特殊说明**:
|
||
- `如果返回值不为 -99 则不允许进入下一个城镇`
|
||
- `所有此类回调函数中只要有一个不满足-99条件即为失败`
|
||
|
||
|
||
**例子**:
|
||
|
||
```squirrel
|
||
function Test_Function(SUser,NextVillageId)
|
||
{
|
||
return -99;
|
||
}
|
||
Cb_WongWork_CDungeonClear_getClearedDungeonDiffMap.rawset("Test", Test_Function);
|
||
```
|
||
or
|
||
```squirrel
|
||
function Test_Function(SUser,NextVillageId)
|
||
{
|
||
return -99;
|
||
}
|
||
Cb_WongWork_CDungeonClear_getClearedDungeonDiffMap.Test <- Test_Function;
|
||
```
|
||
or
|
||
```squirrel
|
||
function Test_Function(SUser,NextVillageId)
|
||
{
|
||
return -99;
|
||
}
|
||
Cb_WongWork_CDungeonClear_getClearedDungeonDiffMap["Test"] <- Test_Function;
|
||
```
|
||
or
|
||
```squirrel
|
||
Cb_WongWork_CDungeonClear_getClearedDungeonDiffMap.Test <- function (SUser,NextVillageId)
|
||
{
|
||
return -99;
|
||
};
|
||
``` |