@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,69 @@
|
|
|
1
|
+
// buffers.h
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* write_buffer() - 将一个缓冲区写入文件,或从源读取到缓冲区
|
|
5
|
+
*
|
|
6
|
+
* 如果 'dest' 是一个文件,则 'source' 必须是一个整数(并将以网络字节序写入文件)、
|
|
7
|
+
* 一个缓冲区或一个字符串,'source' 将从字节 # 'start' 开始写入文件 'dest'。
|
|
8
|
+
*
|
|
9
|
+
* 如果 'dest' 是一个缓冲区,则 'source' 将从字节 # 'start' 开始写入该缓冲区。
|
|
10
|
+
* 如果 'source' 是一个整数,则将以网络字节序写入。
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
int write_buffer( string | buffer dest,
|
|
14
|
+
int start,
|
|
15
|
+
mixed source );
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* read_buffer() - 从文件中读取并返回一个缓冲区,或将缓冲区的一部分作为字符串返回
|
|
19
|
+
*
|
|
20
|
+
* 如果 'src' 是一个字符串(文件名),则将从字节 # 'start' 开始读取文件,读取 'len' 字节,
|
|
21
|
+
* 并作为缓冲区返回。如果没有提供任何参数,则读取整个文件。
|
|
22
|
+
*
|
|
23
|
+
* 如果 'src' 是一个缓冲区,则从字节 # 'start' 开始,从缓冲区中读取字符,并读取 'len' 字节,
|
|
24
|
+
* 并作为字符串返回。
|
|
25
|
+
*
|
|
26
|
+
* 请注意,从文件中读取到缓冲区的最大字节数是通过运行时配置文件中的 'maximum byte transfer' 参数控制的。
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
string | buffer read_buffer( string | buffer src,
|
|
30
|
+
int start,
|
|
31
|
+
int len );
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* crc32() - 计算缓冲区或字符串的循环冗余码
|
|
35
|
+
*
|
|
36
|
+
* 计算并返回给定缓冲区或字符串 'x' 的 CRC-32 码。
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
int crc32( buffer | string x );
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* bufferp() - 确定给定变量是否是一个缓冲区
|
|
43
|
+
*
|
|
44
|
+
* 如果 'arg' 是一个缓冲区值,则返回 1,否则返回零 (0)。
|
|
45
|
+
*
|
|
46
|
+
* int is_buffer = bufferp( allocate_buffer(10) ); // 1
|
|
47
|
+
* int is_buffer = bufferp( "Foo" ); // 0
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
int bufferp( mixed arg );
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* buffer_transcode() - 将缓冲区从一种编码转码到另一种编码
|
|
54
|
+
*
|
|
55
|
+
* 将给定的缓冲区从编码 'from_encoding' 转码到编码 'to_encoding'。
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
buffer buffer_transcode(buffer src,
|
|
59
|
+
string from_encoding,
|
|
60
|
+
string to_encoding);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* allocate_buffer() - 分配一个缓冲区
|
|
64
|
+
*
|
|
65
|
+
* 分配一个 <size> 元素的缓冲区。元素的数量必须 >= 0,并且不大于系统最大值(通常约为10000)。
|
|
66
|
+
* 所有元素都初始化为 0。
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
buffer allocate_buffer( int size );
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// calls.h
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* throw() - 强制对象发生错误。
|
|
5
|
+
*
|
|
6
|
+
* throw() efun 可用于强制对象发生错误。当与 catch()结合使用时,程序员
|
|
7
|
+
* 可以选择在运行时错误发生时显示的错误信息。当使用 throw() 时,它应
|
|
8
|
+
* 与 catch(3) efun 一起使用。以下是一个典型用法:
|
|
9
|
+
*
|
|
10
|
+
* string err;
|
|
11
|
+
* int rc;
|
|
12
|
+
*
|
|
13
|
+
* err = catch(rc = ob->move(dest));
|
|
14
|
+
* if (err) {
|
|
15
|
+
* throw("move.c: ob->move(dest): " + err + "\n");
|
|
16
|
+
* return;
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
void throw(mixed);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* this_object() - 返回调用对象的对象指针
|
|
24
|
+
*
|
|
25
|
+
* 返回该对象的对象指针。当对象想要调用不在同一源文件中的函数时,
|
|
26
|
+
* 该函数非常有用,但却在同一对象中(通过继承)。
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
object this_object( void );
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* shadow() - 在某个对象中影藏一个或多个函数
|
|
33
|
+
*
|
|
34
|
+
* 如果 'flag' 为 1 或缺失,则当前对象将影藏 'ob'。如果 'flag' 为 0,则
|
|
35
|
+
* 返回 0,或返回已经影藏 'ob' 的对象。
|
|
36
|
+
*
|
|
37
|
+
* 主对象定义了函数 "valid_shadow()"。如果返回 1,则目标对象无法
|
|
38
|
+
* 被影藏,并且 "shadow()" 函数将返回 0 而不是 'ob'。
|
|
39
|
+
*
|
|
40
|
+
* 如果对象 'a' 影藏了对象 'b',则对 'b' 的所有 "call_other(func)"
|
|
41
|
+
* 将被重定向到 'a'。如果对象 'a' 没有定义该函数,则调用将
|
|
42
|
+
* 转发到 'b'(就像没有影藏一样)。只有一个对象可以通过
|
|
43
|
+
* call_other() 调用 'b' 中的函数,那个对象是 'a'。甚至连对象 'b'
|
|
44
|
+
* 也不能 "call_other()" 自己。然而,所有 'b' 内部的正常(内部)函数
|
|
45
|
+
* 调用将依然保持在 'b' 内部。
|
|
46
|
+
*
|
|
47
|
+
* 有两种方法可以移除影藏。要么销毁它,要么销毁被影藏的对象。在后一种
|
|
48
|
+
* 情况下,影藏也会自动被销毁。
|
|
49
|
+
*
|
|
50
|
+
* 结果是,有可能在另一个对象后面隐藏一个对象,但一切都可以是完全透明的。
|
|
51
|
+
* shadow() efun 使得可以在不更改相关对象代码的情况下改变对象的行为。
|
|
52
|
+
* shadow() 的一个可能用途是为各种玩家类(盗贼、战士、法师等)添加
|
|
53
|
+
* 特殊能力。这个用法将使得玩家对象保持比如果各种类的代码必须
|
|
54
|
+
* 在玩家对象本身中时更简单。
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
varargs object shadow( object ob, int flag );
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* remove_call_out() - 移除待处理的 call_out
|
|
61
|
+
*
|
|
62
|
+
* 在第一种形式中,该函数移除当前对象中函数 <fun> 的下一个待处理
|
|
63
|
+
* 调用。返回值是未调用回调之前剩余的秒数,若没有待处理的调用
|
|
64
|
+
* 则返回 -1。
|
|
65
|
+
*
|
|
66
|
+
* 在第二种形式中,该函数移除已由 call_out() 函数返回的 <handle>
|
|
67
|
+
* 所标识的待处理调用。返回值是该 call_out 被调用之前的剩余秒数,
|
|
68
|
+
* 或 -1,如果指定的 <handle> 没有有效的 call_out。
|
|
69
|
+
*
|
|
70
|
+
* 在第三种形式中,将移除当前对象的所有待处理调用。在这种情况下,
|
|
71
|
+
* 返回值始终为 0。
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
int remove_call_out( string fun );
|
|
75
|
+
int remove_call_out( int handle );
|
|
76
|
+
int remove_call_out();
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* shadowp() - 确定给定对象是否正在影藏另一个对象
|
|
80
|
+
*
|
|
81
|
+
* 返回 'ob' 正在影藏的对象,如果它没有影藏任何对象,则返回零 (0)。
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
object shadowp( object ob );
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* previous_object() - 返回调用当前函数的对象(s)
|
|
88
|
+
*
|
|
89
|
+
* 返回指针到调用当前函数的对象(如果有的话)。注意,局部函数调用
|
|
90
|
+
* 不会将 previous_object() 设置为当前对象,而是保持不变。如果传递
|
|
91
|
+
* 正整数,则将返回调用链中之前的对象。previous_object(0) 与
|
|
92
|
+
* previous_object() 相同,previous_object(1) 是前一个对象的 previous_object(),
|
|
93
|
+
* 依此类推。previous_object(-1) 将返回一个包含所有之前对象的数组。
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
mixed previous_object( int | void );
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* origin() - 确定当前函数是如何被调用的
|
|
100
|
+
*
|
|
101
|
+
* 返回一个整数,指定当前函数是如何被调用的。当前值为:
|
|
102
|
+
*
|
|
103
|
+
* 1 驱动程序(心跳等)
|
|
104
|
+
* 2 本地函数调用
|
|
105
|
+
* 4 call_other()
|
|
106
|
+
* 8 通过一个 simul_efun 调用的 simul_efun 对象
|
|
107
|
+
* 16 call_out()
|
|
108
|
+
* 32 被 efun 调用(sort_array 等)
|
|
109
|
+
* 64 函数指针
|
|
110
|
+
* 128 函数式
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
int origin( void );
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* catch() - 捕获评估错误
|
|
117
|
+
*
|
|
118
|
+
* 评估 <expr>。如果没有错误,返回 0。如果有标准错误,将返回一个
|
|
119
|
+
* 字符串(带前导 '*')。
|
|
120
|
+
*
|
|
121
|
+
* 函数 throw() 也可以用来立即返回任何值,除了 0。catch() 不是真正的
|
|
122
|
+
* 函数调用,而是对编译器的指令。
|
|
123
|
+
*
|
|
124
|
+
* catch() 是有一定成本的,不应该随便使用。相反,应在错误会破坏一致性
|
|
125
|
+
* 的地方使用。
|
|
126
|
+
*
|
|
127
|
+
* void example1() {
|
|
128
|
+
* object ob ;
|
|
129
|
+
* mixed err ;
|
|
130
|
+
*
|
|
131
|
+
* err = catch( ob = load_object("/obj/weapon/sword") ) ;
|
|
132
|
+
* if(err) throw("加载指定文件时出错。") ;
|
|
133
|
+
* }
|
|
134
|
+
*
|
|
135
|
+
* void example2() {
|
|
136
|
+
* mixed err = catch {
|
|
137
|
+
* string file, *files = ({
|
|
138
|
+
* "/u/g/gesslar/one", // 好文件
|
|
139
|
+
* "/u/g/gesslar/two", // 坏文件
|
|
140
|
+
* "/u/g/gesslar/three", // 好文件
|
|
141
|
+
* }) ;
|
|
142
|
+
*
|
|
143
|
+
* foreach(file in files) load_object(file) ;
|
|
144
|
+
* } ;
|
|
145
|
+
*
|
|
146
|
+
* if(err) printf("ERR: %O", err) ;
|
|
147
|
+
* }
|
|
148
|
+
*
|
|
149
|
+
* // ERR: "*在加载对象 '/u/g/gesslar/two' 时出错"
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
// 这将通过解析器处理
|
|
154
|
+
// mixed catch( mixed expr );
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* call_stack - 返回关于调用此函数的函数的信息
|
|
158
|
+
*
|
|
159
|
+
* 如果 int `option` 参数为 0,call_stack() 返回在调用栈上的函数名称的
|
|
160
|
+
* 数组,第一个是最近的(即当前运行的程序)。如果 int 参数为 1,call_stack
|
|
161
|
+
* 返回正在执行该程序的对象。如果为 2,将返回函数名称。如果为 3,将返回
|
|
162
|
+
* 在该帧中的 origin() 的值。如果为 4,返回值将是完整的文件路径和行号。
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
varargs string *call_stack(int option);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* call_out_walltime - 同一对象中延迟的函数调用
|
|
169
|
+
*
|
|
170
|
+
* 此 efun 与 call_out 相同,只是它不在游戏循环中安排调用,而是在实际
|
|
171
|
+
* 秒中执行。延迟可以为秒或秒的小数部分。
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
int call_out_walltime( string | function fun, int | float delay, mixed arg ... );
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* call_out - 同一对象中的延迟函数调用
|
|
178
|
+
*
|
|
179
|
+
* 在 this_object() 中安排未来调用函数 <fun>。调用将在 <delay> 秒后进行,
|
|
180
|
+
* 所有提供的参数 <arg> 中都有。<arg> 可以是任何类型。
|
|
181
|
+
*
|
|
182
|
+
* 如果运行时配置中的游戏刻(gametick)小于 1000,则可以将 <delay> 指定
|
|
183
|
+
* 为毫秒中的浮点数(gametick / 1000)表示一个能被游戏刻整除的值。
|
|
184
|
+
* 不等于游戏刻值的 <delay> 将向上四舍五入到下一个游戏刻。
|
|
185
|
+
* 特殊的 <delay> 为 0,请参见下文。
|
|
186
|
+
*
|
|
187
|
+
* 例如,如果您的游戏刻设置为 250ms,您可以以四分之一秒的粒度执行
|
|
188
|
+
* callouts。call_out( "function", 0.75 ) 将在 3 个游戏刻(750 毫秒)内执行
|
|
189
|
+
* <fun>,从而在调用时提供更精确的定时。
|
|
190
|
+
*
|
|
191
|
+
* <delay> 为 0(或 0.0),将在调用的同一游戏刻执行 <fun>,在执行所有
|
|
192
|
+
* 之前的 call_out 之后。可能在同一游戏刻执行的 call_outs(0)s 的数量
|
|
193
|
+
* 可以通过运行时配置中的 "call_out(0) 嵌套级别" 属性进行配置。
|
|
194
|
+
*
|
|
195
|
+
* 请注意,不能依赖 <fun> 中的 write() 或 say(),因为 this_player() 设置为 0。
|
|
196
|
+
* 请改用 tell_object()。
|
|
197
|
+
*
|
|
198
|
+
* 运行时配置值 "this_player in call_out" 存在以解决上述问题。
|
|
199
|
+
*
|
|
200
|
+
* 返回值是一个整数,表示 call_out 的句柄,可用作 remove_call_out() 的参数。
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
int call_out( string | function fun, int | float delay, mixed arg ... );
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* call_other() - call a function in another object
|
|
207
|
+
*
|
|
208
|
+
* Calls a function in another object, with [optional] argument(s). The
|
|
209
|
+
* return value is returned from the other object, so it cannot be known
|
|
210
|
+
* at compile time and may need to be cast if using type checking. The
|
|
211
|
+
* function named 'func' will be called in 'ob', with arguments 3, 4, etc
|
|
212
|
+
* given as arguments 1, 2, etc to 'func' in 'ob'. call_other will return
|
|
213
|
+
* the return value of 'func'. If the first argument is an array instead
|
|
214
|
+
* of an object, then the call will be done in all elements of that array
|
|
215
|
+
* (all elements should be of type object), and an array of returns will
|
|
216
|
+
* be returned. If argument 2 is an array instead of a string, then the
|
|
217
|
+
* first element in the array should be a string, the function to call,
|
|
218
|
+
* and all other elements will be passed to the function in the order they
|
|
219
|
+
* appear in the array.
|
|
220
|
+
*
|
|
221
|
+
* There is a much more attractive way to do call_others:
|
|
222
|
+
*
|
|
223
|
+
* object ob | object *obs -> func ( ... );
|
|
224
|
+
*
|
|
225
|
+
* ie,
|
|
226
|
+
*
|
|
227
|
+
* call_other(ob, "query", "name");
|
|
228
|
+
*
|
|
229
|
+
* could be written as:
|
|
230
|
+
*
|
|
231
|
+
* ob->query("name");
|
|
232
|
+
*
|
|
233
|
+
* Using an array as second argument, the same call could be written:
|
|
234
|
+
*
|
|
235
|
+
* call_other(ob, ({ "query", "name" }));
|
|
236
|
+
*
|
|
237
|
+
* An example of using an array as the first argument:
|
|
238
|
+
*
|
|
239
|
+
* users()->quit();
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
242
|
+
mixed call_other( object|object* ob, string|mixed * funcArgs... );
|