Lua接口/服务端/LuaFnIsMaster:修订间差异
来自天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的1个中间版本) | |||
| 第10行: | 第10行: | ||
服务端脚本中共出现 14 处调用,实参个数出现过:3 个(14 处)。 | 服务端脚本中共出现 14 处调用,实参个数出现过:3 个(14 处)。 | ||
实现位于 <code>LuaFnTbl_Relation.h</code> | 实现位于 <code>LuaFnTbl_Relation.h</code>。 | ||
== 参数 == | == 参数 == | ||
2026年9月20日 (日) 00:14的最新版本
判断 targetId 是否是 selfId 的师傅
Lua 调用
LuaFnIsMaster(sceneId, selfId, targetId)
服务端脚本中共出现 14 处调用,实参个数出现过:3 个(14 处)。
实现位于 LuaFnTbl_Relation.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(14 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(5 处)、otherPlayer(3 处)、theID(2 处)
|
| 3 | targetIdnumber
|
对方 ID 脚本中的实参: leaderID(2 处)、selfId(2 处)、theID(2 处)
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/festival/christmas07/SuZhouZuoTong_QianXun.lua LuaFnIsMaster(sceneId, otherPlayer, firstPlayer) -- event/festival/christmas07/SuZhouZuoTong_QianXun.lua LuaFnIsMaster(sceneId, firstPlayer, otherPlayer) -- event/festival/SpringFestival07/echunjie_jiaozi.lua LuaFnIsMaster(sceneId, otherPlayer, leaderID) -- event/huodong/echangeusername.lua LuaFnIsMaster(sceneId, selfId, ObjID0) -- event/huodong/echangeusername.lua LuaFnIsMaster(sceneId, selfId, ObjID1) -- event/relation/b_swear.lua LuaFnIsMaster(sceneId, selfId, theID) -- event/relation/b_swear.lua LuaFnIsMaster(sceneId, theID, otherID) -- event/relation/m_marry.lua LuaFnIsMaster(sceneId, maleId, femaleId)
注意事项
- 调用对象必须是当前场景中的有效玩家。