@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.
Files changed (317) hide show
  1. package/README.md +255 -0
  2. package/bin/lpc +4 -0
  3. package/bin/lpcserver +4 -0
  4. package/cancellationToken/cancellationToken.d.ts +8 -0
  5. package/cancellationToken/cancellationToken.d.ts.map +1 -0
  6. package/cancellationToken/serverCancellationToken.d.ts +21 -0
  7. package/cancellationToken/serverCancellationToken.d.ts.map +1 -0
  8. package/cli/_namespaces/lpc.d.ts +2 -0
  9. package/cli/_namespaces/lpc.d.ts.map +1 -0
  10. package/cli/lpc.d.ts +2 -0
  11. package/cli/lpc.d.ts.map +1 -0
  12. package/compiler/LpcConfig.d.ts +17 -0
  13. package/compiler/LpcConfig.d.ts.map +1 -0
  14. package/compiler/_namespaces/lpc.d.ts +49 -0
  15. package/compiler/_namespaces/lpc.d.ts.map +1 -0
  16. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts +2 -0
  17. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts.map +1 -0
  18. package/compiler/_namespaces/lpc.performance.d.ts +2 -0
  19. package/compiler/_namespaces/lpc.performance.d.ts.map +1 -0
  20. package/compiler/binder.d.ts +2 -0
  21. package/compiler/binder.d.ts.map +1 -0
  22. package/compiler/builderPublic.d.ts +76 -0
  23. package/compiler/builderPublic.d.ts.map +1 -0
  24. package/compiler/checker.d.ts +2 -0
  25. package/compiler/checker.d.ts.map +1 -0
  26. package/compiler/commandLineParser.d.ts +47 -0
  27. package/compiler/commandLineParser.d.ts.map +1 -0
  28. package/compiler/core.d.ts +3 -0
  29. package/compiler/core.d.ts.map +1 -0
  30. package/compiler/corePublic.d.ts +19 -0
  31. package/compiler/corePublic.d.ts.map +1 -0
  32. package/compiler/debug.d.ts +71 -0
  33. package/compiler/debug.d.ts.map +1 -0
  34. package/compiler/diagnosticInformation.d.ts +518 -0
  35. package/compiler/diagnosticInformation.d.ts.map +1 -0
  36. package/compiler/emitter.d.ts +11 -0
  37. package/compiler/emitter.d.ts.map +1 -0
  38. package/compiler/executeCommandLine.d.ts +15 -0
  39. package/compiler/executeCommandLine.d.ts.map +1 -0
  40. package/compiler/expressionToTypeNode.d.ts +2 -0
  41. package/compiler/expressionToTypeNode.d.ts.map +1 -0
  42. package/compiler/factory/baseNodeFactory.d.ts +2 -0
  43. package/compiler/factory/baseNodeFactory.d.ts.map +1 -0
  44. package/compiler/factory/emitHelper.d.ts +2 -0
  45. package/compiler/factory/emitHelper.d.ts.map +1 -0
  46. package/compiler/factory/emitNode.d.ts +22 -0
  47. package/compiler/factory/emitNode.d.ts.map +1 -0
  48. package/compiler/factory/nodeChildren.d.ts +2 -0
  49. package/compiler/factory/nodeChildren.d.ts.map +1 -0
  50. package/compiler/factory/nodeConverters.d.ts +2 -0
  51. package/compiler/factory/nodeConverters.d.ts.map +1 -0
  52. package/compiler/factory/nodeFactory.d.ts +4 -0
  53. package/compiler/factory/nodeFactory.d.ts.map +1 -0
  54. package/compiler/factory/parenthesizerRules.d.ts +2 -0
  55. package/compiler/factory/parenthesizerRules.d.ts.map +1 -0
  56. package/compiler/factory/utilities.d.ts +2 -0
  57. package/compiler/factory/utilities.d.ts.map +1 -0
  58. package/compiler/factory/utilitiesPublic.d.ts +4 -0
  59. package/compiler/factory/utilitiesPublic.d.ts.map +1 -0
  60. package/compiler/lpcFileHandler.d.ts +10 -0
  61. package/compiler/lpcFileHandler.d.ts.map +1 -0
  62. package/compiler/lpcJsHelpers.d.ts +17 -0
  63. package/compiler/lpcJsHelpers.d.ts.map +1 -0
  64. package/compiler/lpcbuild.d.ts +2 -0
  65. package/compiler/lpcbuild.d.ts.map +1 -0
  66. package/compiler/lpcbuildPublic.d.ts +26 -0
  67. package/compiler/lpcbuildPublic.d.ts.map +1 -0
  68. package/compiler/moduleNameResolver.d.ts +55 -0
  69. package/compiler/moduleNameResolver.d.ts.map +1 -0
  70. package/compiler/moduleSpecifiers.d.ts +2 -0
  71. package/compiler/moduleSpecifiers.d.ts.map +1 -0
  72. package/compiler/nodeTests.d.ts +115 -0
  73. package/compiler/nodeTests.d.ts.map +1 -0
  74. package/compiler/parser.d.ts +65 -0
  75. package/compiler/parser.d.ts.map +1 -0
  76. package/compiler/path.d.ts +2 -0
  77. package/compiler/path.d.ts.map +1 -0
  78. package/compiler/perfLoger.d.ts +2 -0
  79. package/compiler/perfLoger.d.ts.map +1 -0
  80. package/compiler/performance.d.ts +2 -0
  81. package/compiler/performance.d.ts.map +1 -0
  82. package/compiler/performanceCore.d.ts +2 -0
  83. package/compiler/performanceCore.d.ts.map +1 -0
  84. package/compiler/program.d.ts +72 -0
  85. package/compiler/program.d.ts.map +1 -0
  86. package/compiler/resolutionCache.d.ts +6 -0
  87. package/compiler/resolutionCache.d.ts.map +1 -0
  88. package/compiler/resolver.d.ts +1 -0
  89. package/compiler/resolver.d.ts.map +1 -0
  90. package/compiler/scanner.d.ts +85 -0
  91. package/compiler/scanner.d.ts.map +1 -0
  92. package/compiler/sourcemap.d.ts +2 -0
  93. package/compiler/sourcemap.d.ts.map +1 -0
  94. package/compiler/sys.d.ts +56 -0
  95. package/compiler/sys.d.ts.map +1 -0
  96. package/compiler/tracing.d.ts +31 -0
  97. package/compiler/tracing.d.ts.map +1 -0
  98. package/compiler/transformers/declarations.d.ts +2 -0
  99. package/compiler/transformers/declarations.d.ts.map +1 -0
  100. package/compiler/transformers.d.ts +2 -0
  101. package/compiler/transformers.d.ts.map +1 -0
  102. package/compiler/types.d.ts +3284 -0
  103. package/compiler/types.d.ts.map +1 -0
  104. package/compiler/utilities.d.ts +57 -0
  105. package/compiler/utilities.d.ts.map +1 -0
  106. package/compiler/utilitiesPublic.d.ts +213 -0
  107. package/compiler/utilitiesPublic.d.ts.map +1 -0
  108. package/compiler/visitorPublic.d.ts +72 -0
  109. package/compiler/visitorPublic.d.ts.map +1 -0
  110. package/compiler/watch.d.ts +2 -0
  111. package/compiler/watch.d.ts.map +1 -0
  112. package/compiler/watchPublic.d.ts +44 -0
  113. package/compiler/watchPublic.d.ts.map +1 -0
  114. package/compiler/watchUtilities.d.ts +14 -0
  115. package/compiler/watchUtilities.d.ts.map +1 -0
  116. package/config-types.d.ts +33 -0
  117. package/config-types.d.ts.map +1 -0
  118. package/harness/harnessIO.d.ts +4 -0
  119. package/harness/harnessIO.d.ts.map +1 -0
  120. package/lpc/_namespaces/lpc.d.ts +6 -0
  121. package/lpc/_namespaces/lpc.d.ts.map +1 -0
  122. package/lpc/_namespaces/lpc.server.d.ts +2 -0
  123. package/lpc/_namespaces/lpc.server.d.ts.map +1 -0
  124. package/lpc/lpc.d.ts +2 -0
  125. package/lpc/lpc.d.ts.map +1 -0
  126. package/lpcserver/document.d.ts +1 -0
  127. package/lpcserver/document.d.ts.map +1 -0
  128. package/lpcserver/nodeServer.d.ts +25 -0
  129. package/lpcserver/nodeServer.d.ts.map +1 -0
  130. package/lpcserver/protocol.const.d.ts +46 -0
  131. package/lpcserver/protocol.const.d.ts.map +1 -0
  132. package/lpcserver/server.d.ts +3 -0
  133. package/lpcserver/server.d.ts.map +1 -0
  134. package/lpcserver/textRendering.d.ts +14 -0
  135. package/lpcserver/textRendering.d.ts.map +1 -0
  136. package/lpcserver/typeConverters.d.ts +44 -0
  137. package/lpcserver/typeConverters.d.ts.map +1 -0
  138. package/lpcserver/utils.d.ts +14 -0
  139. package/lpcserver/utils.d.ts.map +1 -0
  140. package/package.json +48 -0
  141. package/parse-fluff-docs.d.ts +2 -0
  142. package/parse-fluff-docs.d.ts.map +1 -0
  143. package/parse-ld-docs.d.ts +2 -0
  144. package/parse-ld-docs.d.ts.map +1 -0
  145. package/server/_namespaces/lpc.d.ts +5 -0
  146. package/server/_namespaces/lpc.d.ts.map +1 -0
  147. package/server/_namespaces/lpc.server.d.ts +11 -0
  148. package/server/_namespaces/lpc.server.d.ts.map +1 -0
  149. package/server/_namespaces/lpc.server.protocol.d.ts +2 -0
  150. package/server/_namespaces/lpc.server.protocol.d.ts.map +1 -0
  151. package/server/editorServices.d.ts +261 -0
  152. package/server/editorServices.d.ts.map +1 -0
  153. package/server/project.d.ts +143 -0
  154. package/server/project.d.ts.map +1 -0
  155. package/server/protocol.d.ts +962 -0
  156. package/server/protocol.d.ts.map +1 -0
  157. package/server/scriptInfo.d.ts +53 -0
  158. package/server/scriptInfo.d.ts.map +1 -0
  159. package/server/scriptVersionCache.d.ts +2 -0
  160. package/server/scriptVersionCache.d.ts.map +1 -0
  161. package/server/session.d.ts +150 -0
  162. package/server/session.d.ts.map +1 -0
  163. package/server/types.d.ts +24 -0
  164. package/server/types.d.ts.map +1 -0
  165. package/server/utilities.d.ts +2 -0
  166. package/server/utilities.d.ts.map +1 -0
  167. package/server/utilitiesPublic.d.ts +37 -0
  168. package/server/utilitiesPublic.d.ts.map +1 -0
  169. package/server.d.ts +2 -0
  170. package/server.d.ts.map +1 -0
  171. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts +2 -0
  172. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts.map +1 -0
  173. package/services/_namespaces/lpc.Completions.d.ts +4 -0
  174. package/services/_namespaces/lpc.Completions.d.ts.map +1 -0
  175. package/services/_namespaces/lpc.FindAllReferences.d.ts +3 -0
  176. package/services/_namespaces/lpc.FindAllReferences.d.ts.map +1 -0
  177. package/services/_namespaces/lpc.GoToDefinition.d.ts +2 -0
  178. package/services/_namespaces/lpc.GoToDefinition.d.ts.map +1 -0
  179. package/services/_namespaces/lpc.JsDoc.d.ts +2 -0
  180. package/services/_namespaces/lpc.JsDoc.d.ts.map +1 -0
  181. package/services/_namespaces/lpc.NavigationBar.d.ts +2 -0
  182. package/services/_namespaces/lpc.NavigationBar.d.ts.map +1 -0
  183. package/services/_namespaces/lpc.Rename.d.ts +2 -0
  184. package/services/_namespaces/lpc.Rename.d.ts.map +1 -0
  185. package/services/_namespaces/lpc.SignatureHelp.d.ts +2 -0
  186. package/services/_namespaces/lpc.SignatureHelp.d.ts.map +1 -0
  187. package/services/_namespaces/lpc.SymbolDisplay.d.ts +2 -0
  188. package/services/_namespaces/lpc.SymbolDisplay.d.ts.map +1 -0
  189. package/services/_namespaces/lpc.codefix.d.ts +3 -0
  190. package/services/_namespaces/lpc.codefix.d.ts.map +1 -0
  191. package/services/_namespaces/lpc.d.ts +30 -0
  192. package/services/_namespaces/lpc.d.ts.map +1 -0
  193. package/services/_namespaces/lpc.formatting.d.ts +7 -0
  194. package/services/_namespaces/lpc.formatting.d.ts.map +1 -0
  195. package/services/_namespaces/lpc.textChanges.d.ts +2 -0
  196. package/services/_namespaces/lpc.textChanges.d.ts.map +1 -0
  197. package/services/classifier2020.d.ts +2 -0
  198. package/services/classifier2020.d.ts.map +1 -0
  199. package/services/codefixes/helpers.d.ts +2 -0
  200. package/services/codefixes/helpers.d.ts.map +1 -0
  201. package/services/codefixes/importFixes.d.ts +2 -0
  202. package/services/codefixes/importFixes.d.ts.map +1 -0
  203. package/services/completions.d.ts +2 -0
  204. package/services/completions.d.ts.map +1 -0
  205. package/services/documentRegistry.d.ts +90 -0
  206. package/services/documentRegistry.d.ts.map +1 -0
  207. package/services/exportInfoMap.d.ts +5 -0
  208. package/services/exportInfoMap.d.ts.map +1 -0
  209. package/services/findAllReferences.d.ts +2 -0
  210. package/services/findAllReferences.d.ts.map +1 -0
  211. package/services/formatting/formatting.d.ts +2 -0
  212. package/services/formatting/formatting.d.ts.map +1 -0
  213. package/services/formatting/formattingContext.d.ts +2 -0
  214. package/services/formatting/formattingContext.d.ts.map +1 -0
  215. package/services/formatting/rule.d.ts +2 -0
  216. package/services/formatting/rule.d.ts.map +1 -0
  217. package/services/formatting/rules.d.ts +2 -0
  218. package/services/formatting/rules.d.ts.map +1 -0
  219. package/services/formatting/rulesMap.d.ts +2 -0
  220. package/services/formatting/rulesMap.d.ts.map +1 -0
  221. package/services/formatting/smartIndenter.d.ts +2 -0
  222. package/services/formatting/smartIndenter.d.ts.map +1 -0
  223. package/services/goToDefinition.d.ts +2 -0
  224. package/services/goToDefinition.d.ts.map +1 -0
  225. package/services/importTracker.d.ts +2 -0
  226. package/services/importTracker.d.ts.map +1 -0
  227. package/services/jsDoc.d.ts +2 -0
  228. package/services/jsDoc.d.ts.map +1 -0
  229. package/services/navigationBar.d.ts +2 -0
  230. package/services/navigationBar.d.ts.map +1 -0
  231. package/services/rename.d.ts +2 -0
  232. package/services/rename.d.ts.map +1 -0
  233. package/services/services.d.ts +54 -0
  234. package/services/services.d.ts.map +1 -0
  235. package/services/signatureHelp.d.ts +2 -0
  236. package/services/signatureHelp.d.ts.map +1 -0
  237. package/services/sourcemaps.d.ts +2 -0
  238. package/services/sourcemaps.d.ts.map +1 -0
  239. package/services/stringCompletions.d.ts +2 -0
  240. package/services/stringCompletions.d.ts.map +1 -0
  241. package/services/suggestionDiagnostics.d.ts +2 -0
  242. package/services/suggestionDiagnostics.d.ts.map +1 -0
  243. package/services/symbolDisplay.d.ts +2 -0
  244. package/services/symbolDisplay.d.ts.map +1 -0
  245. package/services/textChanges.d.ts +2 -0
  246. package/services/textChanges.d.ts.map +1 -0
  247. package/services/types.d.ts +901 -0
  248. package/services/types.d.ts.map +1 -0
  249. package/services/utilities.d.ts +3 -0
  250. package/services/utilities.d.ts.map +1 -0
  251. package/src/cli.js +58 -0
  252. package/src/cli.js.map +7 -0
  253. package/src/efuns/fluffos/arrays.h +205 -0
  254. package/src/efuns/fluffos/async.h +84 -0
  255. package/src/efuns/fluffos/buffers.h +80 -0
  256. package/src/efuns/fluffos/calls.h +275 -0
  257. package/src/efuns/fluffos/contrib.h +805 -0
  258. package/src/efuns/fluffos/db.h +125 -0
  259. package/src/efuns/fluffos/driver.h +107 -0
  260. package/src/efuns/fluffos/ed.h +48 -0
  261. package/src/efuns/fluffos/efuns.fluffos.h +75 -0
  262. package/src/efuns/fluffos/external.h +30 -0
  263. package/src/efuns/fluffos/filesystem.h +154 -0
  264. package/src/efuns/fluffos/floats.h +136 -0
  265. package/src/efuns/fluffos/functions.h +104 -0
  266. package/src/efuns/fluffos/general.h +548 -0
  267. package/src/efuns/fluffos/interactive.h +777 -0
  268. package/src/efuns/fluffos/internals.h +455 -0
  269. package/src/efuns/fluffos/lpc-config.json +10 -0
  270. package/src/efuns/fluffos/mappings.h +205 -0
  271. package/src/efuns/fluffos/misc.h +43 -0
  272. package/src/efuns/fluffos/mudlib.h +228 -0
  273. package/src/efuns/fluffos/numbers.h +41 -0
  274. package/src/efuns/fluffos/objects.h +365 -0
  275. package/src/efuns/fluffos/parsing.h +220 -0
  276. package/src/efuns/fluffos/pcre.h +75 -0
  277. package/src/efuns/fluffos/sockets.h +276 -0
  278. package/src/efuns/fluffos/strings.h +542 -0
  279. package/src/efuns/fluffos/system.h +408 -0
  280. package/src/efuns/fluffos/zh-cn/arrays.zh-cn.h +167 -0
  281. package/src/efuns/fluffos/zh-cn/async.zh-cn.h +81 -0
  282. package/src/efuns/fluffos/zh-cn/buffers.zh-cn.h +69 -0
  283. package/src/efuns/fluffos/zh-cn/calls.zh-cn.h +242 -0
  284. package/src/efuns/fluffos/zh-cn/contrib.zh-cn.h +767 -0
  285. package/src/efuns/fluffos/zh-cn/db.zh-cn.h +113 -0
  286. package/src/efuns/fluffos/zh-cn/ed.zh-cn.h +42 -0
  287. package/src/efuns/fluffos/zh-cn/efuns.fluffos.h +76 -0
  288. package/src/efuns/fluffos/zh-cn/external.zh-cn.h +25 -0
  289. package/src/efuns/fluffos/zh-cn/filesystem.zh-cn.h +140 -0
  290. package/src/efuns/fluffos/zh-cn/floats.zh-cn.h +129 -0
  291. package/src/efuns/fluffos/zh-cn/functions.zh-cn.h +87 -0
  292. package/src/efuns/fluffos/zh-cn/general.zh-cn.h +506 -0
  293. package/src/efuns/fluffos/zh-cn/interactive.zh-cn.h +659 -0
  294. package/src/efuns/fluffos/zh-cn/internals.zh-cn.h +356 -0
  295. package/src/efuns/fluffos/zh-cn/mappings.zh-cn.h +188 -0
  296. package/src/efuns/fluffos/zh-cn/misc.zh-cn.h +43 -0
  297. package/src/efuns/fluffos/zh-cn/mudlib.zh-cn.h +190 -0
  298. package/src/efuns/fluffos/zh-cn/numbers.zh-cn.h +36 -0
  299. package/src/efuns/fluffos/zh-cn/objects.zh-cn.h +280 -0
  300. package/src/efuns/fluffos/zh-cn/parsing.zh-cn.h +212 -0
  301. package/src/efuns/fluffos/zh-cn/pcre.zh-cn.h +67 -0
  302. package/src/efuns/fluffos/zh-cn/sockets.zh-cn.h +230 -0
  303. package/src/efuns/fluffos/zh-cn/strings.zh-cn.h +484 -0
  304. package/src/efuns/fluffos/zh-cn/system.zh-cn.h +366 -0
  305. package/src/efuns/ldmud/defines.h +69 -0
  306. package/src/efuns/ldmud/efun.h +10449 -0
  307. package/src/efuns/ldmud/efuns.ldmud.h +87 -0
  308. package/src/efuns/ldmud/lpc-config.json +9 -0
  309. package/src/efuns/ldmud/obsolete.h +2168 -0
  310. package/src/lpc.js +82486 -0
  311. package/src/lpc.js.map +6 -0
  312. package/src/server.js +129 -0
  313. package/src/server.js.map +7 -0
  314. package/types.d.ts +23 -0
  315. package/types.d.ts.map +1 -0
  316. package/utils.d.ts +21 -0
  317. package/utils.d.ts.map +1 -0
@@ -0,0 +1,777 @@
1
+ // interactive.h
2
+
3
+ /**
4
+ * write() - send a message to current player
5
+ *
6
+ * Write a message 'str' to current player. 'str' can also be a number,
7
+ * which will be translated to a string.
8
+ *
9
+ * This efun does not invoke the receive_message() apply. so you may wish to
10
+ * override this efun if you wish it to be captured by this apply.
11
+ *
12
+ */
13
+ void write( mixed str );
14
+
15
+ /**
16
+ * users() - return an array of objects containing all interactive players
17
+ *
18
+ * @returns {__LPC_CONFIG_LIBFILES_PLAYER*} An array of objects, containing all interactive players.
19
+ *
20
+ */
21
+ object *users( void );
22
+
23
+ /**
24
+ * userp() - determine if a given object was once interactive
25
+ *
26
+ * @returns 1 if the arg was once interactive.
27
+ *
28
+ */
29
+ int userp(object ob);
30
+
31
+ /**
32
+ * this_user - the current interactive player object
33
+ *
34
+ * Return the object representing the player that caused the calling func‐
35
+ * tion to be called.
36
+ *
37
+ * This efun is an alias for `this_player(0)`, refer to the docs for
38
+ * this_player(3).
39
+ *
40
+ * @param {int} flag - if non-zero, return the interactive player object. Defaults to 0
41
+ * @returns {__LPC_CONFIG_LIBFILES_PLAYER} - the interactive player object
42
+ */
43
+ varargs object this_user(int flag);
44
+
45
+
46
+ /**
47
+ * this_player - the current player object
48
+ *
49
+ * Return the object representing the player that caused the calling func‐
50
+ * tion to be called. Note that this_player() may return a different
51
+ * value than this_object() even when called from within a player object.
52
+ * If this_player is called as this_player(1) then the returned value will
53
+ * be the interactive that caused the calling function to be called.
54
+ * this_player(1) may return a different value than this_player() in cer‐
55
+ * tain cases (such as when command() is used by an admin to force a
56
+ * player to perform some command).
57
+ *
58
+ * `this_user` and `this_interactive` are aliases for `this_player` with
59
+ * different default flags.
60
+ *
61
+ * @param {int} flag - if non-zero, return the interactive player object. Defaults to 0
62
+ * @returns {__LPC_CONFIG_LIBFILES_PLAYER} - the player object
63
+ */
64
+ varargs object this_player( int flag );
65
+
66
+ /**
67
+ * this_interactive - the current interactive player object
68
+ *
69
+ * Return the object representing the player that caused the calling func‐
70
+ * tion to be called. This returns what this_player() was originally even
71
+ * if it changed later due to enable_commands() or command().
72
+ *
73
+ * This efun is an alias for `this_player(1)`, refer to the docs for
74
+ * this_player(3).
75
+ *
76
+ * @param {int} flag - if non-zero, return the interactive player object. Defaults to 1
77
+ */
78
+ varargs object this_interactive( int flag );
79
+
80
+ /**
81
+ * telnet_nop() - send an TELNET NOP message
82
+ *
83
+ * if user is under telnet, then send an TELNET_IAC TELNET_NOP sequence, useful
84
+ * to keep the connection alive.
85
+ *
86
+ */
87
+ void telnet_nop();
88
+
89
+ /**
90
+ * telnet_msp_oob() - send an OOB MSP message
91
+ *
92
+ * if user is under telnet, then send an IAC SB TELOPT_MSP msg IAC SE sequence,
93
+ * as documented in https://wiki.mudlet.org/w/Manual:Supported_Protocols#MSP
94
+ *
95
+ */
96
+ void telnet_msp_oob(string);
97
+
98
+ /**
99
+ * telnet_ga() - send an TELNET GA message
100
+ *
101
+ * if user is under telnet, then send an TELNET_IAC TELNET_GA sequence,
102
+ * useful for prompts that don't terminate with a newline character.
103
+ *
104
+ */
105
+ void telnet_ga();
106
+
107
+ /**
108
+ * snoop() - snoop an interactive user
109
+ *
110
+ * When both arguments are used, begins snooping of 'snoopee' by
111
+ * 'snooper'. If the second argument is omitted, turns off all snooping
112
+ * by 'snoopee'. Security for snoop() is normally controlled by a
113
+ * simul_efun. snoop() returns 'snoopee' if successful in the two-argu‐
114
+ * ment case, and 'snooper' if it was successful in the single-argument
115
+ * case. A return of 0 indicates failure.
116
+ *
117
+ */
118
+ varargs object snoop( object snooper, object snoopee );
119
+
120
+ /**
121
+ * shout() - sends a message to all living objects
122
+ *
123
+ * Sends the string 'str' to all living objects except this_player().
124
+ *
125
+ * This efun does not invoke the receive_message() apply, so you may wish to
126
+ * override this efun if you wish it to be captured by this apply.
127
+ *
128
+ */
129
+ void shout( string str );
130
+
131
+ /**
132
+ * set_this_user - the current interactive player object
133
+ *
134
+ * This efun is an alias for `set_this_player(who)`, refer to the docs for
135
+ * set_this_player(3).
136
+ *
137
+ */
138
+ void set_this_user( object who );
139
+ void set_this_player( object who );
140
+
141
+ /**
142
+ * set_this_player - change the current player object
143
+ *
144
+ * set_this_player() causes 'who' to become the new value of
145
+ * this_player(). This efun is only available with __NO_ADD_ACTION__
146
+ * defined, and is included since with __NO_ADD_ACTION__ parsing and dis‐
147
+ * patching of commands is the mudlib's responsibility.
148
+ *
149
+ * 'who' can also be zero, in which this_player() is set to zero.
150
+ *
151
+ */
152
+ void set_this_player( object who );
153
+ void set_this_user( object who );
154
+
155
+ /**
156
+ *
157
+ *
158
+ * set output/input encoding for current player.
159
+ *
160
+ * If given encoding name is not avaiable, a error will be thrown. The avaiable encoding name
161
+ * depends on your ICU version, Generally, use GBK for chinese.
162
+ *
163
+ * If no argument present, reset the player to no encoding, which means UTF-8.
164
+ *
165
+ * Returns the canonical encoding name from ICU, and it will be the same as query_encoding() returns.
166
+ *
167
+ */
168
+ varargs string set_encoding( string encoding );
169
+
170
+ /**
171
+ * send_gmcp() - send a GMCP message
172
+ *
173
+ * Sends a GMCP 'message' for this_object() to the user's client.
174
+ *
175
+ * For payload formatting information see: http://www.gammon.com.au/gmcp,
176
+ * https://github.com/keneanung/GMCPAdditions
177
+ *
178
+ * Note: send_gmcp() should only be called from within a user object.
179
+ *
180
+ */
181
+ void send_gmcp( string message );
182
+
183
+ /**
184
+ * say() - send a message to all users in the same environment
185
+ *
186
+ * Sends a message to the environment of the originator, all items in the
187
+ * same environment, and all items inside of the originator. The origina‐
188
+ * tor is this_player(), unless this_player() == 0, in which case, the
189
+ * originator is this_object().
190
+ *
191
+ * The second argument is optional. If second argument 'obj' is speci‐
192
+ * fied, the message is sent to all except 'obj'. If 'obj' is not an
193
+ * object, but an array of objects, all those objects are excluded from
194
+ * receiving the message.
195
+ *
196
+ * This efun does not invoke the receive_message() apply, so you may wish to
197
+ * override this efun if you wish it to be captured by this apply.
198
+ *
199
+ */
200
+ varargs void say( string str, object obj );
201
+
202
+ /**
203
+ * resolve() - resolve an internet address to domain name, or vice versa
204
+ *
205
+ * resolve() resolves 'address', which should be an internet address in
206
+ * the form "127.0.0.1" or a domain name, into its domain name, or inter‐
207
+ * net address. When the resolve is complete, 'callback_func' will be
208
+ * called in the current object. The form of the callback is:
209
+ *
210
+ * void callback(string address, string resolved, int key);
211
+ *
212
+ * 'key' will match up with the number that the call to resolve()
213
+ * returned. 'address' will be the domain name of the host, and
214
+ * 'resolved' the dotted decimal ip address. The unknown value will be 0
215
+ * if the lookup failed.
216
+ *
217
+ */
218
+ int resolve( string address, string callback_func );
219
+ int resolve( string address, closure callback_func );
220
+
221
+ /**
222
+ * remove_action - unbind a command verb from a local function
223
+ *
224
+ * remove_action(3) unbinds a verb cmd from an object function fun. Basi‐
225
+ * cally, remove_action() is the complement to add_action(3) and
226
+ * add_verb(3). When a verb is no longer required, it can be unbound with
227
+ * remove_action().
228
+ *
229
+ */
230
+ int remove_action( string fun, string cmd );
231
+
232
+ /**
233
+ * receive() - displays a message to the current object
234
+ *
235
+ * This efun is an interface to the add_message() function in the driver.
236
+ * Its purpose is to display a message to the current object. It returns
237
+ * 1 if the current object is interactive, 0 otherwise. Often, receive()
238
+ * is called from within catch_tell(4) or receive_message(4).
239
+ *
240
+ */
241
+ int receive( string message );
242
+
243
+ /**
244
+ * query_snooping() - return the object than an object is snooping
245
+ *
246
+ * If 'ob' (an interactive object) is snooping another interactive object,
247
+ * the snooped object is returned. Otherwise, 0 is returned.
248
+ *
249
+ */
250
+ object query_snooping( object ob );
251
+
252
+ /**
253
+ * query_snoop() - return the snooper of an interactive object
254
+ *
255
+ * If 'ob' (an interactive object) is being snooped by another interactive
256
+ * object, the snooping object is returned. Otherwise, 0 is returned.
257
+ *
258
+ */
259
+ object query_snoop( object ob );
260
+
261
+ /**
262
+ * query_ip_number() - return the ip number for a player object
263
+ *
264
+ * Return the ip-number (dotted decimal form or IPv6 form) for player
265
+ * 'ob'.
266
+ *
267
+ */
268
+ varargs string query_ip_number( object ob );
269
+
270
+ /**
271
+ * query_ip_name() - return the ip name of a given player object.
272
+ *
273
+ * Return the DNS PTR record for player 'ob's IP . An asynchronous DNS
274
+ * reverse lookup is triggered on new connection to the server.
275
+ *
276
+ * Before lookup finishes, this function returns same result as
277
+ * 'query_ip_number(3)'.
278
+ *
279
+ * After lookup finishes, if lookup is succesful, this funciton will
280
+ * return the DNS PTR value for the IP of this object. If lookup failed,
281
+ * (due to network issues, PTR record not configured for this IP etc),
282
+ * this function will continue to return same result as 'query_ip_num‐
283
+ * ber(3)'.
284
+ *
285
+ * The result is cached, there is no overhead for this function.
286
+ *
287
+ */
288
+ string query_ip_name( object ob );
289
+
290
+ /**
291
+ * query_idle() - determine how many seconds an interactive player has
292
+ been idle
293
+ *
294
+ * Query how many seconds a player object (ob) has been idling.
295
+ *
296
+ */
297
+ int query_idle( object ob );
298
+
299
+ /**
300
+ * query_host_name() - return the host name
301
+ *
302
+ * query_host_name() returns the name of the host.
303
+ *
304
+ */
305
+ string query_host_name( void );
306
+
307
+ /**
308
+ *
309
+ *
310
+ * get the input/ouput encoding for current player.
311
+ *
312
+ * Note: the name you get are ICU internal names, which will be the same returned by set_encoding(), but may or
313
+ * maynot be the one you passed in, but they refer to the same encoding.
314
+ *
315
+ */
316
+ string query_encoding();
317
+
318
+ /**
319
+ * printf, sprintf - formatted output conversion
320
+ *
321
+ * An implementation of (s)printf() for LPC, with quite a few extensions
322
+ * Implemented by Lynscar (Sean A Reith).
323
+ *
324
+ * @param format the format string
325
+ * @param args the arguments to format
326
+ * @description
327
+ * This version supports the following as modifiers:
328
+ *
329
+ * " " pad positive integers with a space.
330
+ *
331
+ * "+" pad positive integers with a plus sign.
332
+ *
333
+ * "-" left adjusted within field size.
334
+ * NB: std (s)printf() defaults to right justification, which is
335
+ * unnatural in the context of a mainly string based language but
336
+ * has been retained for "compatability".
337
+ *
338
+ * "|" centered within field size.
339
+ *
340
+ * "=" column mode if strings are greater than field size. This is
341
+ * only meaningful with strings, all other types ignore this. Col‐
342
+ * umns are auto-magically word wrapped.
343
+ *
344
+ * "#" table mode, print a list of '\n' separated 'words' in a table
345
+ * within the field size. only meaningful with strings.
346
+ *
347
+ * n specifies the field size, a '*' specifies to use the corre‐
348
+ * sponding arg as the field size. If n is prepended with a zero,
349
+ * then is padded zeros, else it is padded with spaces (or speci‐
350
+ * fied pad string).
351
+ *
352
+ * "."n precision of n, simple strings truncate after this (if preci‐
353
+ * sion is greater than field size, then field size = precision),
354
+ * tables use precision to specify the number of columns (if pre‐
355
+ * cision not specified then tables calculate a best fit), all
356
+ * other types ignore this.
357
+ *
358
+ * ":"n n specifies the fs _and_ the precision, if n is prepended by a
359
+ * zero then it is padded with zeros instead of spaces.
360
+ *
361
+ * "@" the argument is an array. the corresponding format_info (minus
362
+ * the "@") is applyed to each element of the array.
363
+ *
364
+ * "'X'" The char(s) between the single-quotes are used to pad to field
365
+ * size (defaults to space) (if both a zero (in front of field
366
+ * size) and a pad string are specified, the one specified second
367
+ * overrules). NOTE: to include "'" in the pad string, you must
368
+ * use "\'" (as the backslash has to be escaped past the inter‐
369
+ * preter), similarly, to include "\" requires "\\".
370
+ *
371
+ * The following are the possible type specifiers.
372
+ *
373
+ * % in which case no arguments are interpreted, and a "%" is
374
+ * inserted, and all modifiers are ignored.
375
+ *
376
+ * O the argument is an LPC datatype.
377
+ *
378
+ * s the argument is a string.
379
+ *
380
+ * d, i the integer arg is printed in decimal.
381
+ *
382
+ * c the integer arg is to be printed as a character.
383
+ *
384
+ * o the integer arg is printed in octal.
385
+ *
386
+ * x the integer arg is printed in hex.
387
+ *
388
+ * X the integer arg is printed in hex (with A-F in capitals).
389
+ *
390
+ * f floating point number
391
+ *
392
+ * Basic Usage:
393
+ * ```lpc
394
+ * printf("%s is %i", "X", 1) = "X is 1"
395
+ * ```
396
+ *
397
+ * Alignment:
398
+ * ```lpc
399
+ * printf("%-20s", "left") = "left "
400
+ * printf("%20|s", "center") = " center "
401
+ * printf("%20s", "right") = " right"
402
+ * printf("%-20'-'s", "left") = "left----------------"
403
+ * printf("%20'-'|s", "center") = "-------center-------"
404
+ * printf("%20'-'s", "right") = "---------------right"
405
+ * ```
406
+ *
407
+ * Numeric:
408
+ * ```lpc
409
+ * printf("%.2f", 1.2345) = "1.23"
410
+ * printf("%10.2f", 1.2345) = " 1.23"
411
+ * printf("%10.6f", 0.123) = " 0.123000"
412
+ * ```
413
+ *
414
+ * Dynamic Field Size:
415
+ * ```lpc
416
+ * printf("%-*s", 10, "ten") = "ten "
417
+ * printf("%|*s", 20, "twenty") = " twenty "
418
+ * printf("%*s", 30, "thirty") = " thirty"
419
+ * ```
420
+ */
421
+ void printf( string format, mixed args... );
422
+ string sprintf( string format, mixed args... );
423
+
424
+ /**
425
+ * int notify_fail( string | function str );
426
+ *
427
+ * Store 'str' as the error message to be returned instead of the default
428
+ * message 'What?'. The message will be displayed if a 0 is returned from
429
+ * an action setup via add_action(). This is the preferred way to display
430
+ * error messages since it allows other objects a chance to respond to the
431
+ * same verb (command). Do not use write() to display the error message
432
+ * since this will require you to return a 1 (unless you want to see the
433
+ * result of the write() in addition to the 'What?' message). However, if
434
+ * you do return a 1, then no other objects will get a chance to respond
435
+ * to the user command.
436
+ *
437
+ * If a function is passed instead of a string, the function is called
438
+ * instead of printing a message. If the function returns a string, that
439
+ * string is used as the failure message. Also, this_player() is set cor‐
440
+ * rectly, so write() can be used.
441
+ *
442
+ * If "notify_fail()" is called more than once, only the last call will
443
+ * have an effect.
444
+ *
445
+ * The idea behind this function is to allow better error messages than
446
+ * 'What?'.
447
+ *
448
+ */
449
+ int notify_fail( string | function str );
450
+
451
+ /**
452
+ * message - deliver messages to "living" objects
453
+ *
454
+ * message() calls the apply receive_message(mixed type, string message) in
455
+ * all objects in the target list excluding those in the exclude list. This
456
+ * provides the objects with the message, allowing them to take appropriate
457
+ * actions based upon the type of message received.
458
+ *
459
+ * The type of message can be used for filtering, formatting, adjusting, or
460
+ * more. An example would be 'combat', 'shout', 'emergency', 'system', etc.
461
+ *
462
+ * Message is a string containing the text to send.
463
+ *
464
+ * Target is a list of objects to receive the message. This can be either
465
+ * a single object string or object pointer, or may be an array of either.
466
+ * If a target is non-living, all objects in its environment will receive
467
+ * the message.
468
+ *
469
+ * Exclude is a list of objects that should not receive the message. This
470
+ * can either be one object or an array of objects.
471
+ *
472
+ * message("say", "You say: Hello!", this_player());
473
+ * message("say", this_player()->query_cap_name() + " says: Hello!", environment(this_player()), ({ this_player() }));
474
+ *
475
+ */
476
+ void message( mixed type, string message, mixed target, mixed exclude );
477
+
478
+ /**
479
+ * interactive() - detects whether or not a given object is an interactive
480
+ *
481
+ * Return non-zero if 'ob' is an interactive player. 0 will be returned if
482
+ * he is link dead.
483
+ *
484
+ */
485
+ varargs int interactive( object ob );
486
+
487
+ /**
488
+ * input_to() - causes next line of input to be sent to a specified func‐
489
+ tion
490
+ *
491
+ * Enable next line of user input to be sent to the local function 'fun'
492
+ * as an argument. The input line will not be parsed by the driver.
493
+ *
494
+ * Note that input_to is non-blocking which means that the object calling
495
+ * input_to does not pause waiting for input. Instead the object contin‐
496
+ * ues to execute any statements following the input_to. The specified
497
+ * function 'fun' will not be called until the user input has been col‐
498
+ * lected.
499
+ *
500
+ * If "input_to()" is called more than once in the same execution, only
501
+ * the first call has any effect.
502
+ *
503
+ * If optional argument 'flag' is non-zero, the line given by the player
504
+ * will not be echoed, and is not seen if snooped (this is useful for col‐
505
+ * lecting passwords).
506
+ *
507
+ * The function 'fun' will be called with the user input as its first
508
+ * argument (a string). Any additional arguments supplied to input_to will
509
+ * be passed on to 'fun' as arguments following the user input.
510
+ *
511
+ */
512
+ varargs void input_to(string | function fun, mixed flag, mixed args... );
513
+
514
+ /**
515
+ * in_input() - determines if a player is inputting to an input_to
516
+ *
517
+ * Returns 1 if the object is currently inputting to an input_to or
518
+ * get_char.
519
+ *
520
+ * @param {object} ob - the object to check, defaults to F_THIS_OBJECT
521
+ */
522
+ int in_input( object ob );
523
+
524
+ /**
525
+ * in_edit() - determine if a player is in the editor
526
+ *
527
+ * If the given object is in the editor, the file being edited is
528
+ * returned, else zero.
529
+ *
530
+ * @param {object} ob - the object to check, defaults to F_THIS_OBJECT
531
+ */
532
+ varargs string in_edit( object ob );
533
+
534
+ /**
535
+ * has_zmp
536
+ *
537
+ * Return non-zero if interactive user has the ZMP protocol enabled in their
538
+ * client. 0 will be returned if the user does not.
539
+ *
540
+ */
541
+ int has_zmp(object user);
542
+
543
+ /**
544
+ * has_mxp
545
+ *
546
+ * Return non-zero if interactive user has the MXP protocol enabled in
547
+ * their client. 0 will be returned if the user does not.
548
+ *
549
+ */
550
+ int has_mxp(object user);
551
+
552
+ /**
553
+ * has_gmcp() - returns whether a given interactive user's client has
554
+ GMCP protocol enabled
555
+ *
556
+ * If the interactive user has the GMCP protocol enabled in their client,
557
+ * this function will return 1, otherwise 0 will be returned.
558
+ *
559
+ * Note:
560
+ * FluffOS requires the following option to be set in the runtime config
561
+ * in order to support the GMCP protocol.
562
+ *
563
+ */
564
+ int has_gmcp( object user );
565
+
566
+ /**
567
+ * get_char - causes next character of input to be sent to a specified
568
+ function
569
+ *
570
+ * Enable next character of user input to be sent to the function 'fun' as
571
+ * an argument. The input character will not be parsed by the driver.
572
+ *
573
+ * Note that get_char is non-blocking which means that the object calling
574
+ * get_char does not pause waiting for input. Instead the object contin‐
575
+ * ues to execute any statements following the get_char. The specified
576
+ * function 'fun' will not be called until the user input has been col‐
577
+ * lected.
578
+ *
579
+ * If "get_char()" is called more than once in the same execution, only
580
+ * the first call has any effect.
581
+ *
582
+ * If optional argument 'flag' is non-zero, the char given by the player
583
+ * will not be echoed, and is not seen if snooped (this is useful for col‐
584
+ * lecting passwords).
585
+ *
586
+ * The function 'fun' will be called with the user input as its first
587
+ * argument (a string). Any additional arguments supplied to get_char will
588
+ * be passed on to 'fun' as arguments following the user input.
589
+ *
590
+ */
591
+ varargs void get_char( string | function fun, int flag, mixed args... );
592
+
593
+ /**
594
+ * find_player() - find a player by name
595
+ *
596
+ * Similar to find_living(), but only searches through objects that are
597
+ * interactive, or were once interactive.
598
+ * @returns {__LPC_CONFIG_LIBFILES_PLAYER} - the player object
599
+ */
600
+ object find_player( string str );
601
+
602
+ /**
603
+ * exec() - switches a player (interactive) connection from one object to
604
+ another
605
+ *
606
+ * This efunction allows the interactive link to a given object to be
607
+ * migrated to another object. That is, after a successful exec(to, from)
608
+ * call, interactive(to) will return 1 and interactive(from) will return
609
+ * 0. The player that was controlling 'from' will begin controlling 'to'
610
+ * following the exec() call. Note that this is a powerful function and
611
+ * its use must be restricted if you wish to attempt to have a secure mud.
612
+ * The proper way to restrict the use of exec() is to make a simul_efun of
613
+ * the same name and then use valid_override(4) to restrict the use of a
614
+ * simul_efun override (i.e. efun::exec()). The exec() function returns 1
615
+ * if the switch is successful (and 0 otherwise).
616
+ *
617
+ */
618
+ int exec( object to, object from );
619
+
620
+ /**
621
+ * enable_commands() - allow object to use 'player' commands
622
+ *
623
+ * enable_commands() marks this_object() as a living object, and allows it
624
+ * to use commands added with add_action() (by using command()). When
625
+ * enable_commands() is called, the driver also looks for the local func‐
626
+ * tion catch_tell(), and if found, it will call it every time a message
627
+ * (via say() for example) is given to the object.
628
+ *
629
+ * Since FluffOS 3.0-alpha7: This function now accept int, default to 0.
630
+ * which has same meaning of old form. which merely re-enables commands,
631
+ * but don't setup actions. (it should have been cleared when previously
632
+ * called disable_commands())
633
+ *
634
+ * When setup_actions > 0, Driver will re-setup all the actions by calling
635
+ * init() on its environment, sibling and inventory objects. (in that
636
+ * order).
637
+ * @deprecated
638
+ */
639
+ void enable_commands( );
640
+
641
+ /**
642
+ * enable_commands() - allow object to use 'player' commands
643
+ *
644
+ * enable_commands() marks this_object() as a living object, and allows it
645
+ * to use commands added with add_action() (by using command()). When
646
+ * enable_commands() is called, the driver also looks for the local func‐
647
+ * tion catch_tell(), and if found, it will call it every time a message
648
+ * (via say() for example) is given to the object.
649
+ *
650
+ * Since FluffOS 3.0-alpha7: This function now accept int, default to 0.
651
+ * which has same meaning of old form. which merely re-enables commands,
652
+ * but don't setup actions. (it should have been cleared when previously
653
+ * called disable_commands())
654
+ *
655
+ * When setup_actions > 0, Driver will re-setup all the actions by calling
656
+ * init() on its environment, sibling and inventory objects. (in that
657
+ * order).
658
+ * @param {int} setup_actions - if non-zero, re-setup actions by calling init() on its environment, sibling and inventory objects. Defaults to 0
659
+ * @since 3.0-alpha7.1*
660
+ */
661
+ varargs void enable_commands(int setup_actions);
662
+
663
+ /**
664
+ * ed() - edit a file
665
+ *
666
+ * This efun is only available if __OLD_ED__ is defined.
667
+ *
668
+ * This is a funny function. It will start a local editor on an optional
669
+ * file. This editor is almost UNIX ed compatible. When in the editor
670
+ * type 'h' for help.
671
+ *
672
+ * The <write_fn> function allows the mudlib to handle file locks and
673
+ * administrative logging of files modified. When the editor writes to a
674
+ * file, the driver will callback the <write_fn> function twice. The
675
+ * first time, the function is called before the write takes place --
676
+ * <flag> will be 0. If the function returns TRUE, the write will con‐
677
+ * tinue, otherwise it will abort. The second time, the function is
678
+ * called after the write has completed -- <flag> will be non-zero. This
679
+ * callback function should have the form:
680
+ *
681
+ * int write_fn(string fname, int flag)
682
+ *
683
+ * When the editor is exited, the driver will callback the <exit_fn> func‐
684
+ * tion. This function allows the mudlib to clean up. This callback
685
+ * function has the form:
686
+ *
687
+ * void exit_fn()
688
+ *
689
+ * The optional <restricted> flag limits the editor's capabilities, such
690
+ * as inserting a file, and saving using an alternate file name.
691
+ *
692
+ */
693
+ varargs void ed( string file, string exit_fn, int restricted );
694
+ varargs void ed( string file, string write_fn, string exit_fn, int restricted );
695
+
696
+ /**
697
+ * disable_wizard() - remove wizard priveleges from an object
698
+ *
699
+ * The opposite of enable_wizard(). Disables wizard privileges from the
700
+ * current object.
701
+ *
702
+ */
703
+ void disable_wizard( void );
704
+
705
+ /**
706
+ * disable_commands() - makes a living object non-living
707
+ *
708
+ * Makes a living object non-living, that is, add_actions have no effects,
709
+ * livingp returns false, and, if the object is interactive, disallows the
710
+ * user to type in commands other than for an input_to. disable_commands
711
+ * always returns 0.
712
+ *
713
+ * calling disable_commands() also have side-effct of clearing all actions
714
+ * previously added by other object, it also removes actions that was
715
+ * defined by this object.
716
+ *
717
+ */
718
+ int disable_commands( void );
719
+
720
+ /**
721
+ * commands() - returns some information about actions the user can take
722
+ *
723
+ * Returns an array of an array of 4 items describing the actions that are
724
+ * available to this_object(). The first item is the command itself (as
725
+ * passed to add_action()). The second is the set of flags (passed to
726
+ * add_action as the third argument, often defaulted to 0). The third is
727
+ * the object that defined the action. The fourth is the function to be
728
+ * called ("<function>" if it is a function pointer).
729
+ *
730
+ */
731
+ mixed *commands( void );
732
+
733
+ /**
734
+ * command() - execute a command as if given by the object
735
+ *
736
+ * Execute 'str' for object 'ob', or this_object() if 'ob' is omitted.
737
+ * Note that the usability of the second argument is determined by the
738
+ * local administrator and will usually not be available, in which case an
739
+ * error will result. In case of failure, 0 is returned, otherwise a
740
+ * numeric value is returned, which is the LPC "evaluation cost" of the
741
+ * command. Bigger numbers mean higher cost, but the whole scale is sub‐
742
+ * jective and unreliable.
743
+ *
744
+ */
745
+ varargs int command( string str, object ob );
746
+
747
+ /**
748
+ * add_action() - bind a command verb to a local function
749
+ *
750
+ * Set up a local function <fun> to be called when user input matches the
751
+ * command <cmd>. Functions called by a player command will get the argu‐
752
+ * ments as a string. It must then return 0 if it was the wrong command,
753
+ * otherwise 1.
754
+ *
755
+ * If the second argument is an array, then all the commands in the array
756
+ * will call the second function. It is possible to find out which com‐
757
+ * mand called the function with query_verb().
758
+ *
759
+ * If it was the wrong command, the parser will continue searching for
760
+ * another command, until one returns true or give error message to
761
+ * player.
762
+ *
763
+ * Usually add_action() is called only from an init() routine. The object
764
+ * that defines commands must be present to the player, either being the
765
+ * player, being carried by the player, being the room around the player,
766
+ * or being an object in the same room as the player.
767
+ *
768
+ * If argument <flag> is 1, then only the leading characters of the com‐
769
+ * mand has to match the verb <cmd> and the entire verb is returned by
770
+ * query_verb(). If argument <flag> is 2, then again, only the leading
771
+ * characters must match, but query_verb() will only return the characters
772
+ * following <cmd>.
773
+ *
774
+ */
775
+ void add_action( string | function fun, string | string * cmd);
776
+ void add_action( string | function fun, string | string * cmd, int flag);
777
+