Lua接口/服务端/MissionLog:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的3个中间版本) | |||
| 第8行: | 第8行: | ||
<pre>MissionLog(sceneId, msg)</pre> | <pre>MissionLog(sceneId, msg)</pre> | ||
服务端脚本中共出现 | 服务端脚本中共出现 94 处调用,实参个数出现过:2 个(94 处)。 | ||
实现位于 <code>LuaFnTbl_Mission.h</code> | 实现位于 <code>LuaFnTbl_Mission.h</code>。 | ||
== 参数 == | == 参数 == | ||
| 第20行: | 第20行: | ||
| 1 | | 1 | ||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | | <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code> | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(94 处)</span> | ||
|- | |- | ||
| 2 | | 2 | ||
| 第30行: | 第30行: | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre>-- event/city/ecity_0201seekplant.lua | <pre>-- event/city/ecity_0201seekplant.lua | ||
MissionLog(sceneId, msg) | MissionLog(sceneId, msg) | ||
-- event/city/ecity_mission.lua | -- event/city/ecity_mission.lua | ||
MissionLog(sceneId, LogInfo) | MissionLog(sceneId, LogInfo) | ||
-- event/festival/christmas07/nightwatchgift.lua | -- event/festival/christmas07/nightwatchgift.lua | ||
MissionLog(sceneId, "[07SHOUYE]: | MissionLog(sceneId, "[07SHOUYE]: ActivityStart")</pre> | ||
</div> | </div> | ||
2026年10月27日 (二) 12:31的最新版本
将任务脚本文本直接写入 Mission 日志文件。
Lua 调用
MissionLog(sceneId, msg)
服务端脚本中共出现 94 处调用,实参个数出现过:2 个(94 处)。
实现位于 LuaFnTbl_Mission.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(94 处)
|
| 2 | msgstring
|
文字内容(字符串)。 脚本中的实参: LogInfo(48 处)、"error: x888888_Check_MissionAvailable..xingxius(6 处)、logstr(6 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- event/city/ecity_0201seekplant.lua MissionLog(sceneId, msg) -- event/city/ecity_mission.lua MissionLog(sceneId, LogInfo) -- event/festival/christmas07/nightwatchgift.lua MissionLog(sceneId, "[07SHOUYE]: ActivityStart")