Lua接口/服务端/AddGlobalCountNews:修订间差异

来自天龙知识库
跳到导航跳到搜索
Waylee​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
Waylee​(留言 | 贡献)
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例
 
(未显示同一用户的1个中间版本)
第10行: 第10行:
<pre>AddGlobalCountNews(sceneId, newstr)</pre>
<pre>AddGlobalCountNews(sceneId, newstr)</pre>


服务端脚本中共出现 76 处调用,实参个数出现过:2 个(76 处)。
服务端脚本中共出现 77 处调用,实参个数出现过:2 个(77 处)。


实现位于 <code>LuaFnTbl_Misc.h</code> 第 637 行,注册表第 381、810 行。
实现位于 <code>LuaFnTbl_Misc.h</code>。


== 参数 ==
== 参数 ==
第22行: 第22行:
| 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>(76 处)</span>
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(77 处)</span>
|-
|-
| 2
| 2

2026年9月20日 (日) 00:12的最新版本

首页 · 服务端接口 · 通用与活动 · 调用约定

向全组服务器发送新闻公告,公告发送指定次数

同一接口的其他调用名称:LuaFnAddGlobalCountNews。

Lua 调用

AddGlobalCountNews(sceneId, newstr)

服务端脚本中共出现 77 处调用,实参个数出现过:2 个(77 处)。

实现位于 LuaFnTbl_Misc.h。

参数

序号 参数 / 类型 说明
1 sceneId
number
当前调用所在的场景 ID。
脚本中的实参:sceneId(77 处)
2 newstr
string
公告内容,字符串指针类型
脚本中的实参:str(27 处)、message(19 处)、szMsg(7 处)

返回值

无返回值。赋值接收时得到 nil;这与返回数字 0 不同。

用法补充

向全组服务器发送新闻公告,公告发送指定次数
没有测试

脚本中的调用

以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。

-- city0_building12.lua
AddGlobalCountNews(sceneId, strText)

-- event/city/protect_guild_generate.lua
AddGlobalCountNews(sceneId, "@*;SrvMsg;SCA:#P"..cityDefaultName.."告急!帮会城市"..)

-- event/equip/equip_bind.lua
AddGlobalCountNews(sceneId, szMsg)

-- event/EventScript/client_GiveRose.lua
AddGlobalCountNews(sceneId, message)

-- event/festival/christmas07/nightwatchgift.lua
AddGlobalCountNews(sceneId, "#{SDSY_081212_01}")

-- event/huashan/ehuashan_1.lua
AddGlobalCountNews(sceneId, str)

-- event/huashan/ehuashan_1.lua
AddGlobalCountNews(sceneId, szStr)

-- event/huodong/edataosha_callback.lua
AddGlobalCountNews(sceneId, Msg)