@lpc-lang/core 1.1.2-5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +255 -0
- package/bin/lpc +4 -0
- package/bin/lpcserver +4 -0
- package/cancellationToken/cancellationToken.d.ts +8 -0
- package/cancellationToken/cancellationToken.d.ts.map +1 -0
- package/cancellationToken/serverCancellationToken.d.ts +21 -0
- package/cancellationToken/serverCancellationToken.d.ts.map +1 -0
- package/cli/_namespaces/lpc.d.ts +2 -0
- package/cli/_namespaces/lpc.d.ts.map +1 -0
- package/cli/lpc.d.ts +2 -0
- package/cli/lpc.d.ts.map +1 -0
- package/compiler/LpcConfig.d.ts +17 -0
- package/compiler/LpcConfig.d.ts.map +1 -0
- package/compiler/_namespaces/lpc.d.ts +49 -0
- package/compiler/_namespaces/lpc.d.ts.map +1 -0
- package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts +2 -0
- package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts.map +1 -0
- package/compiler/_namespaces/lpc.performance.d.ts +2 -0
- package/compiler/_namespaces/lpc.performance.d.ts.map +1 -0
- package/compiler/binder.d.ts +2 -0
- package/compiler/binder.d.ts.map +1 -0
- package/compiler/builderPublic.d.ts +76 -0
- package/compiler/builderPublic.d.ts.map +1 -0
- package/compiler/checker.d.ts +2 -0
- package/compiler/checker.d.ts.map +1 -0
- package/compiler/commandLineParser.d.ts +47 -0
- package/compiler/commandLineParser.d.ts.map +1 -0
- package/compiler/core.d.ts +3 -0
- package/compiler/core.d.ts.map +1 -0
- package/compiler/corePublic.d.ts +19 -0
- package/compiler/corePublic.d.ts.map +1 -0
- package/compiler/debug.d.ts +71 -0
- package/compiler/debug.d.ts.map +1 -0
- package/compiler/diagnosticInformation.d.ts +518 -0
- package/compiler/diagnosticInformation.d.ts.map +1 -0
- package/compiler/emitter.d.ts +11 -0
- package/compiler/emitter.d.ts.map +1 -0
- package/compiler/executeCommandLine.d.ts +15 -0
- package/compiler/executeCommandLine.d.ts.map +1 -0
- package/compiler/expressionToTypeNode.d.ts +2 -0
- package/compiler/expressionToTypeNode.d.ts.map +1 -0
- package/compiler/factory/baseNodeFactory.d.ts +2 -0
- package/compiler/factory/baseNodeFactory.d.ts.map +1 -0
- package/compiler/factory/emitHelper.d.ts +2 -0
- package/compiler/factory/emitHelper.d.ts.map +1 -0
- package/compiler/factory/emitNode.d.ts +22 -0
- package/compiler/factory/emitNode.d.ts.map +1 -0
- package/compiler/factory/nodeChildren.d.ts +2 -0
- package/compiler/factory/nodeChildren.d.ts.map +1 -0
- package/compiler/factory/nodeConverters.d.ts +2 -0
- package/compiler/factory/nodeConverters.d.ts.map +1 -0
- package/compiler/factory/nodeFactory.d.ts +4 -0
- package/compiler/factory/nodeFactory.d.ts.map +1 -0
- package/compiler/factory/parenthesizerRules.d.ts +2 -0
- package/compiler/factory/parenthesizerRules.d.ts.map +1 -0
- package/compiler/factory/utilities.d.ts +2 -0
- package/compiler/factory/utilities.d.ts.map +1 -0
- package/compiler/factory/utilitiesPublic.d.ts +4 -0
- package/compiler/factory/utilitiesPublic.d.ts.map +1 -0
- package/compiler/lpcFileHandler.d.ts +10 -0
- package/compiler/lpcFileHandler.d.ts.map +1 -0
- package/compiler/lpcJsHelpers.d.ts +17 -0
- package/compiler/lpcJsHelpers.d.ts.map +1 -0
- package/compiler/lpcbuild.d.ts +2 -0
- package/compiler/lpcbuild.d.ts.map +1 -0
- package/compiler/lpcbuildPublic.d.ts +26 -0
- package/compiler/lpcbuildPublic.d.ts.map +1 -0
- package/compiler/moduleNameResolver.d.ts +55 -0
- package/compiler/moduleNameResolver.d.ts.map +1 -0
- package/compiler/moduleSpecifiers.d.ts +2 -0
- package/compiler/moduleSpecifiers.d.ts.map +1 -0
- package/compiler/nodeTests.d.ts +115 -0
- package/compiler/nodeTests.d.ts.map +1 -0
- package/compiler/parser.d.ts +65 -0
- package/compiler/parser.d.ts.map +1 -0
- package/compiler/path.d.ts +2 -0
- package/compiler/path.d.ts.map +1 -0
- package/compiler/perfLoger.d.ts +2 -0
- package/compiler/perfLoger.d.ts.map +1 -0
- package/compiler/performance.d.ts +2 -0
- package/compiler/performance.d.ts.map +1 -0
- package/compiler/performanceCore.d.ts +2 -0
- package/compiler/performanceCore.d.ts.map +1 -0
- package/compiler/program.d.ts +72 -0
- package/compiler/program.d.ts.map +1 -0
- package/compiler/resolutionCache.d.ts +6 -0
- package/compiler/resolutionCache.d.ts.map +1 -0
- package/compiler/resolver.d.ts +1 -0
- package/compiler/resolver.d.ts.map +1 -0
- package/compiler/scanner.d.ts +85 -0
- package/compiler/scanner.d.ts.map +1 -0
- package/compiler/sourcemap.d.ts +2 -0
- package/compiler/sourcemap.d.ts.map +1 -0
- package/compiler/sys.d.ts +56 -0
- package/compiler/sys.d.ts.map +1 -0
- package/compiler/tracing.d.ts +31 -0
- package/compiler/tracing.d.ts.map +1 -0
- package/compiler/transformers/declarations.d.ts +2 -0
- package/compiler/transformers/declarations.d.ts.map +1 -0
- package/compiler/transformers.d.ts +2 -0
- package/compiler/transformers.d.ts.map +1 -0
- package/compiler/types.d.ts +3284 -0
- package/compiler/types.d.ts.map +1 -0
- package/compiler/utilities.d.ts +57 -0
- package/compiler/utilities.d.ts.map +1 -0
- package/compiler/utilitiesPublic.d.ts +213 -0
- package/compiler/utilitiesPublic.d.ts.map +1 -0
- package/compiler/visitorPublic.d.ts +72 -0
- package/compiler/visitorPublic.d.ts.map +1 -0
- package/compiler/watch.d.ts +2 -0
- package/compiler/watch.d.ts.map +1 -0
- package/compiler/watchPublic.d.ts +44 -0
- package/compiler/watchPublic.d.ts.map +1 -0
- package/compiler/watchUtilities.d.ts +14 -0
- package/compiler/watchUtilities.d.ts.map +1 -0
- package/config-types.d.ts +33 -0
- package/config-types.d.ts.map +1 -0
- package/harness/harnessIO.d.ts +4 -0
- package/harness/harnessIO.d.ts.map +1 -0
- package/lpc/_namespaces/lpc.d.ts +6 -0
- package/lpc/_namespaces/lpc.d.ts.map +1 -0
- package/lpc/_namespaces/lpc.server.d.ts +2 -0
- package/lpc/_namespaces/lpc.server.d.ts.map +1 -0
- package/lpc/lpc.d.ts +2 -0
- package/lpc/lpc.d.ts.map +1 -0
- package/lpcserver/document.d.ts +1 -0
- package/lpcserver/document.d.ts.map +1 -0
- package/lpcserver/nodeServer.d.ts +25 -0
- package/lpcserver/nodeServer.d.ts.map +1 -0
- package/lpcserver/protocol.const.d.ts +46 -0
- package/lpcserver/protocol.const.d.ts.map +1 -0
- package/lpcserver/server.d.ts +3 -0
- package/lpcserver/server.d.ts.map +1 -0
- package/lpcserver/textRendering.d.ts +14 -0
- package/lpcserver/textRendering.d.ts.map +1 -0
- package/lpcserver/typeConverters.d.ts +44 -0
- package/lpcserver/typeConverters.d.ts.map +1 -0
- package/lpcserver/utils.d.ts +14 -0
- package/lpcserver/utils.d.ts.map +1 -0
- package/package.json +48 -0
- package/parse-fluff-docs.d.ts +2 -0
- package/parse-fluff-docs.d.ts.map +1 -0
- package/parse-ld-docs.d.ts +2 -0
- package/parse-ld-docs.d.ts.map +1 -0
- package/server/_namespaces/lpc.d.ts +5 -0
- package/server/_namespaces/lpc.d.ts.map +1 -0
- package/server/_namespaces/lpc.server.d.ts +11 -0
- package/server/_namespaces/lpc.server.d.ts.map +1 -0
- package/server/_namespaces/lpc.server.protocol.d.ts +2 -0
- package/server/_namespaces/lpc.server.protocol.d.ts.map +1 -0
- package/server/editorServices.d.ts +261 -0
- package/server/editorServices.d.ts.map +1 -0
- package/server/project.d.ts +143 -0
- package/server/project.d.ts.map +1 -0
- package/server/protocol.d.ts +962 -0
- package/server/protocol.d.ts.map +1 -0
- package/server/scriptInfo.d.ts +53 -0
- package/server/scriptInfo.d.ts.map +1 -0
- package/server/scriptVersionCache.d.ts +2 -0
- package/server/scriptVersionCache.d.ts.map +1 -0
- package/server/session.d.ts +150 -0
- package/server/session.d.ts.map +1 -0
- package/server/types.d.ts +24 -0
- package/server/types.d.ts.map +1 -0
- package/server/utilities.d.ts +2 -0
- package/server/utilities.d.ts.map +1 -0
- package/server/utilitiesPublic.d.ts +37 -0
- package/server/utilitiesPublic.d.ts.map +1 -0
- package/server.d.ts +2 -0
- package/server.d.ts.map +1 -0
- package/services/_namespaces/lpc.Completions.StringCompletions.d.ts +2 -0
- package/services/_namespaces/lpc.Completions.StringCompletions.d.ts.map +1 -0
- package/services/_namespaces/lpc.Completions.d.ts +4 -0
- package/services/_namespaces/lpc.Completions.d.ts.map +1 -0
- package/services/_namespaces/lpc.FindAllReferences.d.ts +3 -0
- package/services/_namespaces/lpc.FindAllReferences.d.ts.map +1 -0
- package/services/_namespaces/lpc.GoToDefinition.d.ts +2 -0
- package/services/_namespaces/lpc.GoToDefinition.d.ts.map +1 -0
- package/services/_namespaces/lpc.JsDoc.d.ts +2 -0
- package/services/_namespaces/lpc.JsDoc.d.ts.map +1 -0
- package/services/_namespaces/lpc.NavigationBar.d.ts +2 -0
- package/services/_namespaces/lpc.NavigationBar.d.ts.map +1 -0
- package/services/_namespaces/lpc.Rename.d.ts +2 -0
- package/services/_namespaces/lpc.Rename.d.ts.map +1 -0
- package/services/_namespaces/lpc.SignatureHelp.d.ts +2 -0
- package/services/_namespaces/lpc.SignatureHelp.d.ts.map +1 -0
- package/services/_namespaces/lpc.SymbolDisplay.d.ts +2 -0
- package/services/_namespaces/lpc.SymbolDisplay.d.ts.map +1 -0
- package/services/_namespaces/lpc.codefix.d.ts +3 -0
- package/services/_namespaces/lpc.codefix.d.ts.map +1 -0
- package/services/_namespaces/lpc.d.ts +30 -0
- package/services/_namespaces/lpc.d.ts.map +1 -0
- package/services/_namespaces/lpc.formatting.d.ts +7 -0
- package/services/_namespaces/lpc.formatting.d.ts.map +1 -0
- package/services/_namespaces/lpc.textChanges.d.ts +2 -0
- package/services/_namespaces/lpc.textChanges.d.ts.map +1 -0
- package/services/classifier2020.d.ts +2 -0
- package/services/classifier2020.d.ts.map +1 -0
- package/services/codefixes/helpers.d.ts +2 -0
- package/services/codefixes/helpers.d.ts.map +1 -0
- package/services/codefixes/importFixes.d.ts +2 -0
- package/services/codefixes/importFixes.d.ts.map +1 -0
- package/services/completions.d.ts +2 -0
- package/services/completions.d.ts.map +1 -0
- package/services/documentRegistry.d.ts +90 -0
- package/services/documentRegistry.d.ts.map +1 -0
- package/services/exportInfoMap.d.ts +5 -0
- package/services/exportInfoMap.d.ts.map +1 -0
- package/services/findAllReferences.d.ts +2 -0
- package/services/findAllReferences.d.ts.map +1 -0
- package/services/formatting/formatting.d.ts +2 -0
- package/services/formatting/formatting.d.ts.map +1 -0
- package/services/formatting/formattingContext.d.ts +2 -0
- package/services/formatting/formattingContext.d.ts.map +1 -0
- package/services/formatting/rule.d.ts +2 -0
- package/services/formatting/rule.d.ts.map +1 -0
- package/services/formatting/rules.d.ts +2 -0
- package/services/formatting/rules.d.ts.map +1 -0
- package/services/formatting/rulesMap.d.ts +2 -0
- package/services/formatting/rulesMap.d.ts.map +1 -0
- package/services/formatting/smartIndenter.d.ts +2 -0
- package/services/formatting/smartIndenter.d.ts.map +1 -0
- package/services/goToDefinition.d.ts +2 -0
- package/services/goToDefinition.d.ts.map +1 -0
- package/services/importTracker.d.ts +2 -0
- package/services/importTracker.d.ts.map +1 -0
- package/services/jsDoc.d.ts +2 -0
- package/services/jsDoc.d.ts.map +1 -0
- package/services/navigationBar.d.ts +2 -0
- package/services/navigationBar.d.ts.map +1 -0
- package/services/rename.d.ts +2 -0
- package/services/rename.d.ts.map +1 -0
- package/services/services.d.ts +54 -0
- package/services/services.d.ts.map +1 -0
- package/services/signatureHelp.d.ts +2 -0
- package/services/signatureHelp.d.ts.map +1 -0
- package/services/sourcemaps.d.ts +2 -0
- package/services/sourcemaps.d.ts.map +1 -0
- package/services/stringCompletions.d.ts +2 -0
- package/services/stringCompletions.d.ts.map +1 -0
- package/services/suggestionDiagnostics.d.ts +2 -0
- package/services/suggestionDiagnostics.d.ts.map +1 -0
- package/services/symbolDisplay.d.ts +2 -0
- package/services/symbolDisplay.d.ts.map +1 -0
- package/services/textChanges.d.ts +2 -0
- package/services/textChanges.d.ts.map +1 -0
- package/services/types.d.ts +901 -0
- package/services/types.d.ts.map +1 -0
- package/services/utilities.d.ts +3 -0
- package/services/utilities.d.ts.map +1 -0
- package/src/cli.js +58 -0
- package/src/cli.js.map +7 -0
- package/src/efuns/fluffos/arrays.h +205 -0
- package/src/efuns/fluffos/async.h +84 -0
- package/src/efuns/fluffos/buffers.h +80 -0
- package/src/efuns/fluffos/calls.h +275 -0
- package/src/efuns/fluffos/contrib.h +805 -0
- package/src/efuns/fluffos/db.h +125 -0
- package/src/efuns/fluffos/driver.h +107 -0
- package/src/efuns/fluffos/ed.h +48 -0
- package/src/efuns/fluffos/efuns.fluffos.h +75 -0
- package/src/efuns/fluffos/external.h +30 -0
- package/src/efuns/fluffos/filesystem.h +154 -0
- package/src/efuns/fluffos/floats.h +136 -0
- package/src/efuns/fluffos/functions.h +104 -0
- package/src/efuns/fluffos/general.h +548 -0
- package/src/efuns/fluffos/interactive.h +777 -0
- package/src/efuns/fluffos/internals.h +455 -0
- package/src/efuns/fluffos/lpc-config.json +10 -0
- package/src/efuns/fluffos/mappings.h +205 -0
- package/src/efuns/fluffos/misc.h +43 -0
- package/src/efuns/fluffos/mudlib.h +228 -0
- package/src/efuns/fluffos/numbers.h +41 -0
- package/src/efuns/fluffos/objects.h +365 -0
- package/src/efuns/fluffos/parsing.h +220 -0
- package/src/efuns/fluffos/pcre.h +75 -0
- package/src/efuns/fluffos/sockets.h +276 -0
- package/src/efuns/fluffos/strings.h +542 -0
- package/src/efuns/fluffos/system.h +408 -0
- package/src/efuns/fluffos/zh-cn/arrays.zh-cn.h +167 -0
- package/src/efuns/fluffos/zh-cn/async.zh-cn.h +81 -0
- package/src/efuns/fluffos/zh-cn/buffers.zh-cn.h +69 -0
- package/src/efuns/fluffos/zh-cn/calls.zh-cn.h +242 -0
- package/src/efuns/fluffos/zh-cn/contrib.zh-cn.h +767 -0
- package/src/efuns/fluffos/zh-cn/db.zh-cn.h +113 -0
- package/src/efuns/fluffos/zh-cn/ed.zh-cn.h +42 -0
- package/src/efuns/fluffos/zh-cn/efuns.fluffos.h +76 -0
- package/src/efuns/fluffos/zh-cn/external.zh-cn.h +25 -0
- package/src/efuns/fluffos/zh-cn/filesystem.zh-cn.h +140 -0
- package/src/efuns/fluffos/zh-cn/floats.zh-cn.h +129 -0
- package/src/efuns/fluffos/zh-cn/functions.zh-cn.h +87 -0
- package/src/efuns/fluffos/zh-cn/general.zh-cn.h +506 -0
- package/src/efuns/fluffos/zh-cn/interactive.zh-cn.h +659 -0
- package/src/efuns/fluffos/zh-cn/internals.zh-cn.h +356 -0
- package/src/efuns/fluffos/zh-cn/mappings.zh-cn.h +188 -0
- package/src/efuns/fluffos/zh-cn/misc.zh-cn.h +43 -0
- package/src/efuns/fluffos/zh-cn/mudlib.zh-cn.h +190 -0
- package/src/efuns/fluffos/zh-cn/numbers.zh-cn.h +36 -0
- package/src/efuns/fluffos/zh-cn/objects.zh-cn.h +280 -0
- package/src/efuns/fluffos/zh-cn/parsing.zh-cn.h +212 -0
- package/src/efuns/fluffos/zh-cn/pcre.zh-cn.h +67 -0
- package/src/efuns/fluffos/zh-cn/sockets.zh-cn.h +230 -0
- package/src/efuns/fluffos/zh-cn/strings.zh-cn.h +484 -0
- package/src/efuns/fluffos/zh-cn/system.zh-cn.h +366 -0
- package/src/efuns/ldmud/defines.h +69 -0
- package/src/efuns/ldmud/efun.h +10449 -0
- package/src/efuns/ldmud/efuns.ldmud.h +87 -0
- package/src/efuns/ldmud/lpc-config.json +9 -0
- package/src/efuns/ldmud/obsolete.h +2168 -0
- package/src/lpc.js +82486 -0
- package/src/lpc.js.map +6 -0
- package/src/server.js +129 -0
- package/src/server.js.map +7 -0
- package/types.d.ts +23 -0
- package/types.d.ts.map +1 -0
- package/utils.d.ts +21 -0
- package/utils.d.ts.map +1 -0
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
// interactive.h
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* write() - 发送消息给当前玩家
|
|
5
|
+
*
|
|
6
|
+
* 将消息 'str' 发送给当前玩家。 'str' 也可以是一个数字,
|
|
7
|
+
* 将被转换为字符串。
|
|
8
|
+
*
|
|
9
|
+
* 此 efun 不会调用 receive_message() 应用。因此如果希望它被
|
|
10
|
+
* 该应用捕获,您可能需要覆盖此 efun。
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
void write( mixed str );
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* users() - 返回包含所有交互玩家的对象数组
|
|
17
|
+
*
|
|
18
|
+
* @returns {__LPC_CONFIG_LIBFILES_PLAYER*} 一个对象数组,包含所有交互玩家。
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
object *users( void );
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* userp() - 确定给定对象是否曾经是交互式的
|
|
25
|
+
*
|
|
26
|
+
* @returns 1 如果参数曾经是交互式的。
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
int userp(object ob);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* this_user - 当前交互玩家对象
|
|
33
|
+
*
|
|
34
|
+
* 返回导致调用函数被调用的玩家对象。
|
|
35
|
+
*
|
|
36
|
+
* 此 efun 是 `this_player(0)` 的别名,请参阅 this_player(3) 的文档。
|
|
37
|
+
*
|
|
38
|
+
* @param {int} flag - 如果非零,返回交互玩家对象。默认为 0
|
|
39
|
+
* @returns {__LPC_CONFIG_LIBFILES_PLAYER} - 交互玩家对象
|
|
40
|
+
*/
|
|
41
|
+
varargs object this_user(int flag);
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* this_player - 当前玩家对象
|
|
46
|
+
*
|
|
47
|
+
* 返回导致调用函数被调用的玩家对象。注意,即使在玩家对象内
|
|
48
|
+
* 调用 this_player() 可能返回与 this_object() 不同的值。
|
|
49
|
+
* 如果以 this_player(1) 调用,则返回的值将是导致调用函数
|
|
50
|
+
* 被调用的交互对象。this_player(1) 在某些情况下可能返回与
|
|
51
|
+
* this_player() 不同的值(例如,当 admin 使用 command() 强制
|
|
52
|
+
* 玩家执行某个命令时)。
|
|
53
|
+
*
|
|
54
|
+
* `this_user` 和 `this_interactive` 是 `this_player` 的别名,具有
|
|
55
|
+
* 不同的默认标志。
|
|
56
|
+
*
|
|
57
|
+
* @param {int} flag - 如果非零,返回交互玩家对象。默认为 0
|
|
58
|
+
* @returns {__LPC_CONFIG_LIBFILES_PLAYER} - 玩家对象
|
|
59
|
+
*/
|
|
60
|
+
varargs object this_player( int flag );
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* this_interactive - 当前交互玩家对象
|
|
64
|
+
*
|
|
65
|
+
* 返回导致调用函数被调用的玩家对象。即使由于
|
|
66
|
+
* enable_commands() 或 command() 后来发生了变化,这仍然返回
|
|
67
|
+
* this_player() 最初的值。
|
|
68
|
+
*
|
|
69
|
+
* 此 efun 是 `this_player(1)` 的别名,请参阅 this_player(3) 的文档。
|
|
70
|
+
*
|
|
71
|
+
* @param {int} flag - 如果非零,返回交互玩家对象。默认为 1
|
|
72
|
+
*/
|
|
73
|
+
varargs object this_interactive( int flag );
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* telnet_nop() - 发送一个 TELNET NOP 消息
|
|
77
|
+
*
|
|
78
|
+
* 如果用户在 telnet 下,则发送一个 TELNET_IAC TELNET_NOP
|
|
79
|
+
* 序列,方便保持连接存活。
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
void telnet_nop();
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* telnet_msp_oob() - 发送一个 OOB MSP 消息
|
|
86
|
+
*
|
|
87
|
+
* 如果用户在 telnet 下,则发送一个 IAC SB TELOPT_MSP
|
|
88
|
+
* 消息 IAC SE 序列,具体文档见
|
|
89
|
+
* https://wiki.mudlet.org/w/Manual:Supported_Protocols#MSP
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
void telnet_msp_oob(string);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* telnet_ga() - 发送一个 TELNET GA 消息
|
|
96
|
+
*
|
|
97
|
+
* 如果用户在 telnet 下,则发送一个 TELNET_IAC TELNET_GA
|
|
98
|
+
* 序列,适用于那些不以换行符结束的提示。
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
void telnet_ga();
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* snoop() - 监听一个交互用户
|
|
105
|
+
*
|
|
106
|
+
* 当两个参数都被使用时,开始由 'snooper' 对 'snoopee' 的监听。
|
|
107
|
+
* 如果省略第二个参数,则关闭 'snoopee' 的所有监听。
|
|
108
|
+
* snoop() 的安全性通常由一个 simul_efun 控制。
|
|
109
|
+
* 在两个参数的情况下,snoop() 成功返回 'snoopee',而在
|
|
110
|
+
* 单个参数的情况下返回 'snooper'。返回 0 表示失败。
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
varargs object snoop( object snooper, object snoopee );
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* shout() - 向所有生物对象发送消息
|
|
117
|
+
*
|
|
118
|
+
* 将字符串 'str' 发送给所有生物对象,但不包括 this_player()。
|
|
119
|
+
*
|
|
120
|
+
* 此 efun 不会调用 receive_message() 应用,因此如果希望它被
|
|
121
|
+
* 该应用捕获,您可能需要覆盖此 efun。
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
void shout( string str );
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* set_this_user - 当前交互玩家对象
|
|
128
|
+
*
|
|
129
|
+
* 此 efun 是 `set_this_player(who)` 的别名,请参阅
|
|
130
|
+
* set_this_player(3) 的文档。
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
void set_this_user( object who );
|
|
134
|
+
void set_this_player( object who );
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* set_this_player - 更改当前玩家对象
|
|
138
|
+
*
|
|
139
|
+
* set_this_player() 将 'who' 设置为 this_player() 的新值。这个 efun
|
|
140
|
+
* 仅在定义了 __NO_ADD_ACTION__ 时可用,因为在 __NO_ADD_ACTION__
|
|
141
|
+
* 下,命令的解析和分派是 mudlib 的责任。
|
|
142
|
+
*
|
|
143
|
+
* 'who' 也可以为零,此时 this_player() 被设置为零。
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
void set_this_player( object who );
|
|
147
|
+
void set_this_user( object who );
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
*
|
|
152
|
+
* 为当前玩家设置输出/输入编码。
|
|
153
|
+
*
|
|
154
|
+
* 如果给定的编码名称不可用,将抛出错误。可用的编码名称
|
|
155
|
+
* 取决于您的 ICU 版本,通常,中文使用 GBK。
|
|
156
|
+
*
|
|
157
|
+
* 如果没有参数,重置玩家为无编码,这意味着 UTF-8。
|
|
158
|
+
*
|
|
159
|
+
* 返回来自 ICU 的规范编码名称,它将与 query_encoding() 返回的相同。
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
varargs string set_encoding( string encoding );
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* send_gmcp() - 发送 GMCP 消息
|
|
166
|
+
*
|
|
167
|
+
* 为这个对象发送 GMCP '消息' 到用户的客户端。
|
|
168
|
+
*
|
|
169
|
+
* 有关有效负载格式的信息,请参见:http://www.gammon.com.au/gmcp,
|
|
170
|
+
* https://github.com/keneanung/GMCPAdditions
|
|
171
|
+
*
|
|
172
|
+
* 注意:send_gmcp() 应仅在用户对象内调用。
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
void send_gmcp( string message );
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* say() - 向同一环境中的所有用户发送消息
|
|
179
|
+
*
|
|
180
|
+
* 向发起者的环境、同一环境中的所有物品以及发起者内部的所有物品发送消息。
|
|
181
|
+
* 发起者是 this_player(),除非 this_player() == 0,此时发起者是 this_object()。
|
|
182
|
+
*
|
|
183
|
+
* 第二个参数是可选的。如果指定了第二个参数 'obj',则消息会发送给
|
|
184
|
+
* 所有对象,除了 'obj'。如果 'obj' 不是对象,而是对象数组,那么
|
|
185
|
+
* 所有这些对象都将被排除在接收消息之外。
|
|
186
|
+
*
|
|
187
|
+
* 此 efun 不会调用 receive_message() 应用,所以如果您希望它能被这个应用捕获,您可能希望重写此 efun。
|
|
188
|
+
*
|
|
189
|
+
*/
|
|
190
|
+
varargs void say( string str, object obj );
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* resolve() - 将互联网地址解析为域名,或反之亦然
|
|
194
|
+
*
|
|
195
|
+
* resolve() 解析 'address',它应该是 "127.0.0.1" 形式的互联网地址
|
|
196
|
+
* 或域名,转换为其域名或互联网地址。当解析完成后,'callback_func'
|
|
197
|
+
* 将在当前对象中被调用。回调的格式为:
|
|
198
|
+
*
|
|
199
|
+
* void callback(string address, string resolved, int key);
|
|
200
|
+
*
|
|
201
|
+
* 'key' 将与调用 resolve() 返回的数字匹配。'address' 将是主机的
|
|
202
|
+
* 域名,而 'resolved' 是点分十进制的 IP 地址。如果查找失败,未知值将为 0。
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
int resolve( string address, string callback_func );
|
|
206
|
+
int resolve( string address, closure callback_func );
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* remove_action - 取消绑定一个命令动词到本地函数
|
|
210
|
+
*
|
|
211
|
+
* remove_action(3) 取消将动词 cmd 从对象函数 fun 解绑。
|
|
212
|
+
* 基本上,remove_action() 是 add_action(3) 和 add_verb(3) 的补充。
|
|
213
|
+
* 当不再需要一个动词时,可以用 remove_action() 解绑。
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
int remove_action( string fun, string cmd );
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* receive() - 向当前对象显示消息
|
|
220
|
+
*
|
|
221
|
+
* 此 efun 是驱动程序中 add_message() 函数的接口。
|
|
222
|
+
* 其目的是向当前对象显示消息。如果当前对象是交互式的,则返回 1,
|
|
223
|
+
* 否则返回 0。通常,receive() 是从 catch_tell(4) 或 receive_message(4)
|
|
224
|
+
* 中调用的。
|
|
225
|
+
*
|
|
226
|
+
*/
|
|
227
|
+
int receive( string message );
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* query_snooping() - 返回一个对象正在窃听的对象
|
|
231
|
+
*
|
|
232
|
+
* 如果 'ob'(一个交互式对象)正在窃听另一个交互式对象,
|
|
233
|
+
* 则返回被窃听的对象。否则,返回 0。
|
|
234
|
+
*
|
|
235
|
+
*/
|
|
236
|
+
object query_snooping( object ob );
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* query_snoop() - 返回一个交互式对象的窃听者
|
|
240
|
+
*
|
|
241
|
+
* 如果 'ob'(一个交互式对象)正在被另一个交互式对象窃听,
|
|
242
|
+
* 则返回窃听该对象的对象。否则,返回 0。
|
|
243
|
+
*
|
|
244
|
+
*/
|
|
245
|
+
object query_snoop( object ob );
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* query_ip_number() - 返回玩家对象的 IP 地址
|
|
249
|
+
*
|
|
250
|
+
* 返回玩家 'ob' 的 IP 地址(点分十进制形式或 IPv6 形式)。
|
|
251
|
+
*
|
|
252
|
+
*/
|
|
253
|
+
varargs string query_ip_number( object ob );
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* query_ip_name() - 返回给定玩家对象的 IP 名称。
|
|
257
|
+
*
|
|
258
|
+
* 返回玩家 'ob' 的 IP 的 DNS PTR 记录。在新连接到服务器时,
|
|
259
|
+
* 将触发异步 DNS 反向查找。
|
|
260
|
+
*
|
|
261
|
+
* 在查找完成之前,返回的结果与 'query_ip_number(3)' 相同。
|
|
262
|
+
*
|
|
263
|
+
* 查找完成后,如果查找成功,该函数将返回此对象 IP 的 DNS PTR 值。
|
|
264
|
+
* 如果查找失败(由于网络问题、未为该 IP 配置 PTR 记录等),
|
|
265
|
+
* 此函数将继续返回与 'query_ip_number(3)' 相同的结果。
|
|
266
|
+
*
|
|
267
|
+
* 该结果被缓存,此函数没有开销。
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
string query_ip_name( object ob );
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* query_idle() - 查询一个交互式玩家闲置了多少秒
|
|
274
|
+
*
|
|
275
|
+
* 查询玩家对象 (ob) 已闲置的秒数。
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
278
|
+
int query_idle( object ob );
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* query_host_name() - 返回主机名
|
|
282
|
+
*
|
|
283
|
+
* query_host_name() 返回主机的名称。
|
|
284
|
+
*
|
|
285
|
+
*/
|
|
286
|
+
string query_host_name( void );
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
*
|
|
290
|
+
*
|
|
291
|
+
* 获取当前玩家的输入/输出编码。
|
|
292
|
+
*
|
|
293
|
+
* 注意:您获得的名称是 ICU 内部名称,这将与 set_encoding() 返回的结果相同,但可能是您传递的名称,也可能不是,但它们指的是相同的编码。
|
|
294
|
+
*
|
|
295
|
+
*/
|
|
296
|
+
string query_encoding();
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* printf, sprintf - 格式化输出转换
|
|
300
|
+
*
|
|
301
|
+
* 这是 LPC 的 (s)printf() 的实现,具有一些扩展
|
|
302
|
+
* 实现者:Lynscar (Sean A Reith)。
|
|
303
|
+
*
|
|
304
|
+
* 此版本支持以下修饰符:
|
|
305
|
+
*
|
|
306
|
+
* " " 用空格填充正整数。
|
|
307
|
+
*
|
|
308
|
+
* "+" 用加号填充正整数。
|
|
309
|
+
*
|
|
310
|
+
* "-" 在字段大小内左对齐。
|
|
311
|
+
* 注意:标准 (s)printf() 默认右对齐,但在主要基于字符串的语言中这是不自然的,但为了“兼容性”保留了这一点。
|
|
312
|
+
*
|
|
313
|
+
* "|" 在字段大小内居中。
|
|
314
|
+
*
|
|
315
|
+
* "=" 如果字符串大于字段大小,则为列模式。这对于字符串是有意义的,所有其他类型会忽略此设置。列会自动换行。
|
|
316
|
+
*
|
|
317
|
+
* "#" 表格模式,打印以 '\n' 分隔的 'words' 列表,在字段大小内。仅对字符串有效。
|
|
318
|
+
*
|
|
319
|
+
* n 指定字段大小,星号 '*' 表示使用相应的参数作为字段大小。如果 n 前面加了零,则填充为零,其他情况下填充为空格(或指定的填充字符串)。
|
|
320
|
+
*
|
|
321
|
+
* "."n 精度为 n,简单字符串在此之后截断(如果精度大于字段大小,则字段大小 = 精度),表格使用精度来指定列数(如果没有指定精度,则表格会计算最佳适配),所有其他类型都会忽略此设置。
|
|
322
|
+
*
|
|
323
|
+
* ":"n n 同时指定字段大小和精度,如果 n 前面加了零,则填充为零而不是空格。
|
|
324
|
+
*
|
|
325
|
+
* "@" 参数是一个数组。相应的格式信息(去掉 "@")应用于数组的每个元素。
|
|
326
|
+
*
|
|
327
|
+
* "'X'" 单引号之间的字符用于填充到字段大小(默认为空格)(如果同时指定了零(在字段大小前)和填充字符串,则第二个指定的优先)。 注意:要在填充字符串中包含 "'",必须使用 "\'"(因为反斜杠必须在解释器中转义),同样,要包括 "\" 需要 "\\"。
|
|
328
|
+
*
|
|
329
|
+
* 下面是可能的类型说明符。
|
|
330
|
+
*
|
|
331
|
+
* % 在这种情况下,不解释任何参数,并插入一个 "%",并且所有修饰符都会被忽略。
|
|
332
|
+
*
|
|
333
|
+
* O 参数是 LPC 数据类型。
|
|
334
|
+
*
|
|
335
|
+
* s 参数是字符串。
|
|
336
|
+
*
|
|
337
|
+
* d, i 整数参数以十进制形式打印。
|
|
338
|
+
*
|
|
339
|
+
* c 整数参数以字符形式打印。
|
|
340
|
+
*
|
|
341
|
+
* o 整数参数以八进制形式打印。
|
|
342
|
+
*
|
|
343
|
+
* x 整数参数以十六进制形式打印。
|
|
344
|
+
*
|
|
345
|
+
* X 整数参数以大写字母 A-F 的十六进制形式打印。
|
|
346
|
+
*
|
|
347
|
+
* f 浮点数
|
|
348
|
+
*
|
|
349
|
+
* 基本用法:
|
|
350
|
+
* printf("%s is %i", "X", 1) = "X is 1"
|
|
351
|
+
*
|
|
352
|
+
* 对齐:
|
|
353
|
+
* printf("%-20s", "left") = "left "
|
|
354
|
+
* printf("%20|s", "center") = " center "
|
|
355
|
+
* printf("%20s", "right") = " right"
|
|
356
|
+
* printf("%-20'-'s", "left") = "left----------------"
|
|
357
|
+
* printf("%20'-'|s", "center") = "-------center-------"
|
|
358
|
+
* printf("%20'-'s", "right") = "---------------right"
|
|
359
|
+
*
|
|
360
|
+
* 数字:
|
|
361
|
+
* printf("%.2f", 1.2345) = "1.23"
|
|
362
|
+
* printf("%10.2f", 1.2345) = " 1.23"
|
|
363
|
+
* printf("%10.6f", 0.123) = " 0.123000"
|
|
364
|
+
*
|
|
365
|
+
* 动态字段大小:
|
|
366
|
+
* printf("%-*s", 10, "ten") = "ten "
|
|
367
|
+
* printf("%|*s", 20, "twenty") = " twenty "
|
|
368
|
+
* printf("%*s", 30, "thirty") = " thirty"
|
|
369
|
+
*
|
|
370
|
+
*/
|
|
371
|
+
void printf( string format... );
|
|
372
|
+
string sprintf( string format... );
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* int notify_fail( string | function str );
|
|
376
|
+
*
|
|
377
|
+
* 将 'str' 存储为错误消息,以便在从通过 add_action() 设置的动作中返回 0 时返回,而不是默认消息 'What?'。该消息将在返回 0 时显示。 这是一种显示错误消息的首选方式,因为它允许其他对象有机会响应相同的动词(命令)。 不要使用 write() 显示错误消息,因为这将要求您返回 1(除非您想看到 write() 的结果以及 'What?' 消息)。 但是,如果您确实返回 1,则没有其他对象将有机会响应用户命令。
|
|
378
|
+
*
|
|
379
|
+
* 如果传递的是函数而不是字符串,则调用该函数而不是打印消息。如果函数返回一个字符串,则该字符串将用作失败消息。此外,this_player() 被正确设置,因此可以使用 write()。
|
|
380
|
+
*
|
|
381
|
+
* 如果多次调用 "notify_fail()",则只有最后一次调用有效。
|
|
382
|
+
*
|
|
383
|
+
* 这个函数的理念是允许比 'What?' 更好的错误消息。
|
|
384
|
+
*
|
|
385
|
+
*/
|
|
386
|
+
int notify_fail( string | function str );
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* message - 向“生物”对象发送消息
|
|
390
|
+
*
|
|
391
|
+
* message() 在目标列表中的所有对象中调用 apply receive_message(mixed type, string message),排除在排除列表中的对象。 这为对象提供了消息,使它们能够根据接收到的消息类型采取适当的行动。
|
|
392
|
+
*
|
|
393
|
+
* 消息类型可用于过滤、格式化、调整等。例如 'combat','shout','emergency','system' 等等。
|
|
394
|
+
*
|
|
395
|
+
* 消息是一个包含要发送的文本的字符串。
|
|
396
|
+
*
|
|
397
|
+
* 目标是接收消息的对象列表。 这可以是单个对象字符串或对象指针,或可能是数组。如果目标是非生物,则其环境中的所有对象都将接收消息。
|
|
398
|
+
*
|
|
399
|
+
* 排除是一个不应接收该消息的对象列表。 这可以是一个对象或对象数组。
|
|
400
|
+
*
|
|
401
|
+
* message("say", "You say: Hello!", this_player());
|
|
402
|
+
* message("say", this_player()->query_cap_name() + " says: Hello!", environment(this_player()), ({ this_player() }));
|
|
403
|
+
*
|
|
404
|
+
*/
|
|
405
|
+
void message( mixed type, string message, mixed target, mixed exclude );
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* interactive() - 检测给定对象是否为互动对象
|
|
409
|
+
*
|
|
410
|
+
* 如果'ob'是一个互动玩家,返回非零值。 如果玩家已经链接死亡,则返回0。
|
|
411
|
+
*
|
|
412
|
+
*/
|
|
413
|
+
varargs int interactive( object ob );
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* input_to() - 使下一行输入发送到指定的函数
|
|
417
|
+
*
|
|
418
|
+
* 使用户的下一行输入作为参数发送到本地函数'fun'。输入行不会被驱动解析。
|
|
419
|
+
*
|
|
420
|
+
* 注意,input_to是非阻塞的,这意味着调用input_to的对象不会暂停等待输入。
|
|
421
|
+
* 相反,该对象将继续执行input_to之后的任何语句。指定的函数'fun'不会在用户输入
|
|
422
|
+
* 收集之前被调用。
|
|
423
|
+
*
|
|
424
|
+
* 如果在同一执行中多次调用“input_to()”,只有第一次调用有效。
|
|
425
|
+
*
|
|
426
|
+
* 如果可选参数'flag'非零,则玩家提供的行不会被回显,并且在被监听时不可见
|
|
427
|
+
* (这对于收集密码很有用)。
|
|
428
|
+
*
|
|
429
|
+
* 函数'fun'将以用户输入作为其第一个参数(字符串)被调用。 任何额外的参数
|
|
430
|
+
* 传递给input_to的参数将作为随用户输入后的参数传递给'fun'。
|
|
431
|
+
*
|
|
432
|
+
*/
|
|
433
|
+
varargs void input_to(string | function fun, mixed flag, mixed args... );
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* in_input() - 确定玩家是否正在输入到input_to中
|
|
437
|
+
*
|
|
438
|
+
* 如果对象当前正在输入到input_to或get_char中,则返回1。
|
|
439
|
+
*
|
|
440
|
+
* @param {object} ob - 要检查的对象,默认为F_THIS_OBJECT
|
|
441
|
+
*/
|
|
442
|
+
int in_input( object ob );
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* in_edit() - 确定玩家是否在编辑器中
|
|
446
|
+
*
|
|
447
|
+
* 如果给定对象在编辑器中,则返回正在编辑的文件,否则返回0。
|
|
448
|
+
*
|
|
449
|
+
* @param {object} ob - 要检查的对象,默认为F_THIS_OBJECT
|
|
450
|
+
*/
|
|
451
|
+
varargs string in_edit( object ob );
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* has_zmp
|
|
455
|
+
*
|
|
456
|
+
* 如果互动用户在其客户端启用了ZMP协议,则返回非零值。 如果用户未启用,则返回0。
|
|
457
|
+
*
|
|
458
|
+
*/
|
|
459
|
+
int has_zmp(object user);
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* has_mxp
|
|
463
|
+
*
|
|
464
|
+
* 如果互动用户在其客户端启用了MXP协议,则返回非零值。 如果用户未启用,则返回0。
|
|
465
|
+
*
|
|
466
|
+
*/
|
|
467
|
+
int has_mxp(object user);
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* has_gmcp() - 返回给定互动用户的客户端是否启用了GMCP协议
|
|
471
|
+
*
|
|
472
|
+
* 如果互动用户在其客户端启用了GMCP协议,则此函数将返回1,否则返回0。
|
|
473
|
+
*
|
|
474
|
+
* 注意:
|
|
475
|
+
* FluffOS要求在运行时配置中设置以下选项以支持GMCP协议。
|
|
476
|
+
*
|
|
477
|
+
*/
|
|
478
|
+
int has_gmcp( object user );
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* get_char - 使输入的下一个字符发送到指定函数
|
|
482
|
+
*
|
|
483
|
+
* 使用户输入的下一个字符作为参数发送到函数'fun'。输入字符不会被驱动解析。
|
|
484
|
+
*
|
|
485
|
+
* 注意,get_char是非阻塞的,这意味着调用get_char的对象不会暂停等待输入。
|
|
486
|
+
* 相反,该对象将继续执行get_char之后的任何语句。指定的函数'fun'不会在用户输入
|
|
487
|
+
* 收集之前被调用。
|
|
488
|
+
*
|
|
489
|
+
* 如果在同一执行中多次调用“get_char()”,只有第一次调用有效。
|
|
490
|
+
*
|
|
491
|
+
* 如果可选参数'flag'非零,则玩家提供的字符不会被回显,并且在被监听时不可见
|
|
492
|
+
* (这对于收集密码很有用)。
|
|
493
|
+
*
|
|
494
|
+
* 函数'fun'将以用户输入作为其第一个参数(字符串)被调用。 任何额外的参数
|
|
495
|
+
* 传递给get_char的参数将作为随用户输入后的参数传递给'fun'。
|
|
496
|
+
*
|
|
497
|
+
*/
|
|
498
|
+
varargs void get_char( string | function fun, int flag... );
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* find_player() - 按名称查找玩家
|
|
502
|
+
*
|
|
503
|
+
* 类似于find_living(),但仅搜索那些互动的对象或曾经互动的对象。
|
|
504
|
+
* @returns {__LPC_CONFIG_LIBFILES_PLAYER} - 玩家对象
|
|
505
|
+
*/
|
|
506
|
+
object find_player( string str );
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* exec() - 将玩家(互动)连接从一个对象切换到另一个对象
|
|
510
|
+
*
|
|
511
|
+
* 此efun允许将与给定对象的互动链接迁移到另一个对象。
|
|
512
|
+
* 也就是说,在成功的exec(to, from)调用之后,interactive(to)将返回1,
|
|
513
|
+
* interactive(from)将返回0。控制'from'的玩家将在exec()调用后开始控制'to'。
|
|
514
|
+
* 注意这是一个强大的函数,其使用必须受到限制,如果你希望安全地进行mud。
|
|
515
|
+
* 限制exec()使用的正确方法是创建一个同名的simul_efun,然
|
|
516
|
+
* 后使用valid_override(4)限制simul_efun重载的使用(即efun::exec())。
|
|
517
|
+
* exec()函数如果切换成功,则返回1(否则返回0)。
|
|
518
|
+
*
|
|
519
|
+
*/
|
|
520
|
+
int exec( object to, object from );
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* enable_commands() - 允许对象使用“玩家”命令
|
|
524
|
+
*
|
|
525
|
+
* enable_commands() 将 this_object() 标记为一个活对象,并允许它
|
|
526
|
+
* 使用 add_action() 添加的命令(通过使用 command())。当
|
|
527
|
+
* enable_commands() 被调用时,驱动程序还会寻找本地功能
|
|
528
|
+
* catch_tell(),如果找到了,每次向该对象发送消息(通过 say() 例如)时都会调用它。
|
|
529
|
+
*
|
|
530
|
+
* 自 FluffOS 3.0-alpha7 起:此函数现在接受 int,默认为 0。
|
|
531
|
+
* 这与旧形式的含义相同,仅仅是重新启用命令,但并没有
|
|
532
|
+
* 设置动作。(它应该在之前调用 disable_commands() 时被清除)
|
|
533
|
+
*
|
|
534
|
+
* 当 setup_actions > 0 时,驱动程序将重新设置所有动作,
|
|
535
|
+
* 通过在其环境、兄弟对象和库存对象上调用 init()(按此顺序)。
|
|
536
|
+
* @deprecated
|
|
537
|
+
*/
|
|
538
|
+
void enable_commands( );
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* enable_commands() - 允许对象使用“玩家”命令
|
|
542
|
+
*
|
|
543
|
+
* enable_commands() 将 this_object() 标记为一个活对象,并允许它
|
|
544
|
+
* 使用 add_action() 添加的命令(通过使用 command())。当
|
|
545
|
+
* enable_commands() 被调用时,驱动程序还会寻找本地功能
|
|
546
|
+
* catch_tell(),如果找到了,每次向该对象发送消息(通过 say() 例如)时都会调用它。
|
|
547
|
+
*
|
|
548
|
+
* 自 FluffOS 3.0-alpha7 起:此函数现在接受 int,默认为 0。
|
|
549
|
+
* 这与旧形式的含义相同,仅仅是重新启用命令,但并没有
|
|
550
|
+
* 设置动作。(它应该在之前调用 disable_commands() 时被清除)
|
|
551
|
+
*
|
|
552
|
+
* 当 setup_actions > 0 时,驱动程序将重新设置所有动作,
|
|
553
|
+
* 通过在其环境、兄弟对象和库存对象上调用 init()(按此顺序)。
|
|
554
|
+
* @since 3.0-alpha7.1
|
|
555
|
+
*/
|
|
556
|
+
void enable_commands( int setup_actions = 0 );
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* ed() - 编辑一个文件
|
|
560
|
+
*
|
|
561
|
+
* 这个 efun 仅在 __OLD_ED__ 被定义时可用。
|
|
562
|
+
*
|
|
563
|
+
* 这是一个有趣的函数。它将启动一个本地编辑器,编辑一个可选
|
|
564
|
+
* 文件。这个编辑器几乎兼容 UNIX ed。当在编辑器中时,输入 'h' 获取帮助。
|
|
565
|
+
*
|
|
566
|
+
* <write_fn> 函数允许 mudlib 处理文件锁和修改文件的管理日志。
|
|
567
|
+
* 当编辑器写入一个文件时,驱动程序将调用 <write_fn> 函数两次。
|
|
568
|
+
* 第一次,函数在写入发生之前被调用 -- <flag> 将为 0。
|
|
569
|
+
* 如果函数返回 TRUE,写入将继续;否则将中止。第二次,
|
|
570
|
+
* 函数在写入完成后被调用 -- <flag> 将非零。这个回调
|
|
571
|
+
* 函数的形式应该是:
|
|
572
|
+
*
|
|
573
|
+
* int write_fn(string fname, int flag)
|
|
574
|
+
*
|
|
575
|
+
* 当编辑器退出时,驱动程序将回调 <exit_fn> 函数。
|
|
576
|
+
* 此函数允许 mudlib 进行清理。这个回调
|
|
577
|
+
* 函数的形式是:
|
|
578
|
+
*
|
|
579
|
+
* void exit_fn()
|
|
580
|
+
*
|
|
581
|
+
* 可选的 <restricted> 标志限制编辑器的能力,例如插入文件和使用
|
|
582
|
+
* 不同文件名进行保存。
|
|
583
|
+
*
|
|
584
|
+
*/
|
|
585
|
+
varargs void ed( string file, string exit_fn, int restricted );
|
|
586
|
+
varargs void ed( string file, string write_fn, string exit_fn, int restricted );
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* disable_wizard() - 移除对象的巫师特权
|
|
590
|
+
*
|
|
591
|
+
* enable_wizard() 的相反操作。禁用当前对象的巫师特权。
|
|
592
|
+
*
|
|
593
|
+
*/
|
|
594
|
+
void disable_wizard( void );
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* disable_commands() - 将活对象变为非活对象
|
|
598
|
+
*
|
|
599
|
+
* 将活对象变为非活对象,即 add_actions 无效,
|
|
600
|
+
* livingp 返回 false,并且如果对象是交互式的,禁止用户输入
|
|
601
|
+
* 其他命令,除了用于 input_to 的命令。disable_commands
|
|
602
|
+
* 始终返回 0。
|
|
603
|
+
*
|
|
604
|
+
* 调用 disable_commands() 还会清除由其他对象之前添加的
|
|
605
|
+
* 所有动作,它还会移除由该对象定义的动作。
|
|
606
|
+
*
|
|
607
|
+
*/
|
|
608
|
+
int disable_commands( void );
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* commands() - 返回一些有关用户可以执行的动作的信息
|
|
612
|
+
*
|
|
613
|
+
* 返回一个数组,数组中包含 4 项描述可用于 this_object() 的动作。
|
|
614
|
+
* 第一个项目是命令本身(如通过 add_action() 传递)。
|
|
615
|
+
* 第二个是标志集(作为 add_action 的第三个参数传递,通常默认为 0)。
|
|
616
|
+
* 第三个是定义动作的对象。第四个是要调用的函数(“<function>”如果是函数指针)。
|
|
617
|
+
*
|
|
618
|
+
*/
|
|
619
|
+
mixed *commands( void );
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* command() - 执行一个命令,如同该对象给出
|
|
623
|
+
*
|
|
624
|
+
* 执行 'str' 对象 'ob' 的命令,如果省略 'ob',则对 this_object()。
|
|
625
|
+
* 请注意,第二个参数的可用性由本地管理员决定,通常情况下不可用,
|
|
626
|
+
* 这时会导致错误。失败时返回 0,否则返回一个数字值,
|
|
627
|
+
* 这是 LPC "评估成本" 的命令。更大的数字意味着更高的成本,
|
|
628
|
+
* 但整个规模是主观的和不可靠的。
|
|
629
|
+
*
|
|
630
|
+
*/
|
|
631
|
+
varargs int command( string str, object ob );
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* add_action() - 将命令动词绑定到本地函数
|
|
635
|
+
*
|
|
636
|
+
* 设置一个本地函数 <fun>,当用户输入与命令 <cmd> 匹配时调用。
|
|
637
|
+
* 由玩家命令调用的函数将以字符串作为参数。它必须返回 0,
|
|
638
|
+
* 如果这是错误的命令,否则返回 1。
|
|
639
|
+
*
|
|
640
|
+
* 如果第二个参数是一个数组,则数组中的所有命令将调用第二个函数。
|
|
641
|
+
* 可以通过 query_verb() 找出哪个命令调用了该函数。
|
|
642
|
+
*
|
|
643
|
+
* 如果这是错误的命令,解析器将继续查找另一个命令,
|
|
644
|
+
* 直到找到一个返回 true 或给出错误信息给玩家。
|
|
645
|
+
*
|
|
646
|
+
* 通常 add_action() 仅在 init() 例程中调用。定义命令的对象必须在玩家面前,
|
|
647
|
+
* 可以是玩家,或者被玩家携带,或者是玩家周围的房间,或
|
|
648
|
+
* 者是与玩家在同一个房间中的对象。
|
|
649
|
+
*
|
|
650
|
+
* 如果参数 <flag> 为 1,则仅需要命令的前导字符匹配动词 <cmd>,
|
|
651
|
+
* 并且完整动词由 query_verb() 返回。如果参数 <flag> 为 2,
|
|
652
|
+
* 则再次仅需要前导字符匹配,但 query_verb() 只将返回
|
|
653
|
+
* <cmd> 之后的字符。
|
|
654
|
+
*
|
|
655
|
+
*/
|
|
656
|
+
void add_action( string | function fun, string | string * cmd);
|
|
657
|
+
void add_action( string | function fun, string | string * cmd, int flag);
|
|
658
|
+
|
|
659
|
+
|