734 lines
16 KiB
HTML
734 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<head>
|
|
<title>Reference</title>
|
|
<link rel="stylesheet" href="ldoc.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
|
|
<div id="product">
|
|
<div id="product_logo"></div>
|
|
<div id="product_name"><big><b></b></big></div>
|
|
<div id="product_description"></div>
|
|
</div> <!-- id="product" -->
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div id="navigation">
|
|
<br/>
|
|
<h1>ldoc</h1>
|
|
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Tables">Tables</a></li>
|
|
<li><a href="#Fields">Fields</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="$(kind=='Topics' and '' or 'nowrap'">
|
|
<li><strong>voice</strong></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>voice</code></h1>
|
|
<p>Voice is a system to make the chat of Minetest more like a voice.</p>
|
|
<p>
|
|
<p> The only function that should be called from the client is activate.</p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#abstruse">abstruse (message, rate)</a></td>
|
|
<td class="summary">Abstruses the given message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#activate">activate ()</a></td>
|
|
<td class="summary">Activates the voice system.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#activate_internal">activate_internal ()</a></td>
|
|
<td class="summary">Activates the system, without checking the configuration.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#in_range">in_range (distance, range, line_of_sight)</a></td>
|
|
<td class="summary">Checks if the given distance is in the given range, considering
|
|
the line of sight.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#invoke_message_callbacks">invoke_message_callbacks (player, type, message)</a></td>
|
|
<td class="summary">Invokes all registered message callbacks.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#muffle">muffle (message)</a></td>
|
|
<td class="summary">Muffles the given messages, meaning replaces everything with dots.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#on_chat_message">on_chat_message (name, message)</a></td>
|
|
<td class="summary">Callback for if a chat message is send.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#random">random (rate)</a></td>
|
|
<td class="summary">Gets a random chance based on the given rate.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#register_chatcommand">register_chatcommand (short, long, description, parameters)</a></td>
|
|
<td class="summary">Registers a chat chommand.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#register_global_chatcommand">register_global_chatcommand ()</a></td>
|
|
<td class="summary">Registers the chat command for global messaging.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#register_on_message">register_on_message (callback)</a></td>
|
|
<td class="summary">Registers a callback that is invoked for every message that is send.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#speak">speak (speaking_player, message, parameters)</a></td>
|
|
<td class="summary">Speaks the given message.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Tables">Tables</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#shout_parameters">shout_parameters</a></td>
|
|
<td class="summary">The parameters for shouting.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#whisper_parameters">whisper_parameters</a></td>
|
|
<td class="summary">The parameters for whispering.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Fields">Fields</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#TYPE_GLOBAL">TYPE_GLOBAL</a></td>
|
|
<td class="summary">Type constant for a global message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#TYPE_SHOUT">TYPE_SHOUT</a></td>
|
|
<td class="summary">Type constant for a shouted message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#TYPE_TALK">TYPE_TALK</a></td>
|
|
<td class="summary">Type constant for a talked message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#TYPE_WHISPER">TYPE_WHISPER</a></td>
|
|
<td class="summary">Type constant for a whispered message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#activate_automatically">activate_automatically</a></td>
|
|
<td class="summary">If the system should be activated automatically.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#active">active</a></td>
|
|
<td class="summary">If the system is active/has been activated.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#global_privilege">global_privilege</a></td>
|
|
<td class="summary">The privilege that is needed for using the global command.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#line_of_sight_mod">line_of_sight_mod</a></td>
|
|
<td class="summary">The line of sight modification, which means that if the target does not
|
|
have line of sight with the source, this mod will be applied to
|
|
the range to limit it.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#message_callbacks">message_callbacks</a></td>
|
|
<td class="summary">The callbacks for when a message is send.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#understandable">understandable</a></td>
|
|
<td class="summary">Everything within this range (inclusive) will be understandable.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#abstruse">abstruse</a></td>
|
|
<td class="summary">Everything within this range (inclusive) will be abstruse, which
|
|
means that only part of the message (depending on the distance) will
|
|
be understandable.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#incomprehensible">incomprehensible</a></td>
|
|
<td class="summary">Everything within this range (inclusive) will not be understandable.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2><a name="Functions"></a>Functions</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "abstruse"></a>
|
|
<strong>abstruse (message, rate)</strong>
|
|
</dt>
|
|
<dd>
|
|
Abstruses the given message. That means that parts of it will be blanked,
|
|
based on the rate.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">message</span>
|
|
The message to abstruse.
|
|
</li>
|
|
<li><span class="parameter">rate</span>
|
|
The rate at which to abstruse the message, a value between
|
|
0 and 1, with 1 being everything abstrused.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The abstrused message.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "activate"></a>
|
|
<strong>activate ()</strong>
|
|
</dt>
|
|
<dd>
|
|
Activates the voice system.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "activate_internal"></a>
|
|
<strong>activate_internal ()</strong>
|
|
</dt>
|
|
<dd>
|
|
Activates the system, without checking the configuration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "in_range"></a>
|
|
<strong>in_range (distance, range, line_of_sight)</strong>
|
|
</dt>
|
|
<dd>
|
|
Checks if the given distance is in the given range, considering
|
|
the line of sight.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">distance</span>
|
|
The distance.
|
|
</li>
|
|
<li><span class="parameter">range</span>
|
|
The range.
|
|
</li>
|
|
<li><span class="parameter">line_of_sight</span>
|
|
If there is line of sight.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
true if it is in range.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "invoke_message_callbacks"></a>
|
|
<strong>invoke_message_callbacks (player, type, message)</strong>
|
|
</dt>
|
|
<dd>
|
|
Invokes all registered message callbacks.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">player</span>
|
|
The player that is sending the message.
|
|
</li>
|
|
<li><span class="parameter">type</span>
|
|
The type of the message.
|
|
</li>
|
|
<li><span class="parameter">message</span>
|
|
The message to be send.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
true if the message should be suppressed, and the second return
|
|
value is the modified message.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "muffle"></a>
|
|
<strong>muffle (message)</strong>
|
|
</dt>
|
|
<dd>
|
|
Muffles the given messages, meaning replaces everything with dots.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">message</span>
|
|
The message to muffle.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The muffled message.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "on_chat_message"></a>
|
|
<strong>on_chat_message (name, message)</strong>
|
|
</dt>
|
|
<dd>
|
|
Callback for if a chat message is send.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">name</span>
|
|
The name of the sending player.
|
|
</li>
|
|
<li><span class="parameter">message</span>
|
|
The message that is send.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
true if the message has been handled and should not be send.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "random"></a>
|
|
<strong>random (rate)</strong>
|
|
</dt>
|
|
<dd>
|
|
Gets a random chance based on the given rate.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">rate</span>
|
|
The rate. A number between 0 and 1, with 1 being always true.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
true if there is a chance.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "register_chatcommand"></a>
|
|
<strong>register_chatcommand (short, long, description, parameters)</strong>
|
|
</dt>
|
|
<dd>
|
|
Registers a chat chommand.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">short</span>
|
|
The short command.
|
|
</li>
|
|
<li><span class="parameter">long</span>
|
|
The long command.
|
|
</li>
|
|
<li><span class="parameter">description</span>
|
|
The description of the command.
|
|
</li>
|
|
<li><span class="parameter">parameters</span>
|
|
The parameters to use.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "register_global_chatcommand"></a>
|
|
<strong>register_global_chatcommand ()</strong>
|
|
</dt>
|
|
<dd>
|
|
Registers the chat command for global messaging.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "register_on_message"></a>
|
|
<strong>register_on_message (callback)</strong>
|
|
</dt>
|
|
<dd>
|
|
Registers a callback that is invoked for every message that is send.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">callback</span>
|
|
The callback that is to be registered, a function that
|
|
accepts the player (Player object), the type of the message
|
|
(TYPE_* constants), if the message is going to be send and
|
|
the message itself. The callback can return two values,
|
|
the first, a boolean that is true if the message should
|
|
be suppressed, and the second being a message to be sent
|
|
instead. The last callback can determine if the message
|
|
should actually be send or not.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "speak"></a>
|
|
<strong>speak (speaking_player, message, parameters)</strong>
|
|
</dt>
|
|
<dd>
|
|
Speaks the given message.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">speaking_player</span>
|
|
The speaking player, a Player Object.
|
|
</li>
|
|
<li><span class="parameter">message</span>
|
|
The message that is spoken.
|
|
</li>
|
|
<li><span class="parameter">parameters</span>
|
|
The speak parameters, like talk_parameters.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2><a name="Tables"></a>Tables</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "shout_parameters"></a>
|
|
<strong>shout_parameters</strong>
|
|
</dt>
|
|
<dd>
|
|
The parameters for shouting.
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">understandable</span>
|
|
Everything within this range (inclusive) will be abstruse, which means that only part of the message (depending on the distance) will be understandable.
|
|
</li>
|
|
<li><span class="parameter">abstruse</span>
|
|
Everything within this range (inclusive) will not be understandable.
|
|
</li>
|
|
<li><span class="parameter">incomprehensible</span>
|
|
The type of these parameters.
|
|
</li>
|
|
<li><span class="parameter">type</span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
Everything within this range (inclusive) will be understandable.
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "whisper_parameters"></a>
|
|
<strong>whisper_parameters</strong>
|
|
</dt>
|
|
<dd>
|
|
The parameters for whispering.
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">understandable</span>
|
|
Everything within this range (inclusive) will be abstruse, which means that only part of the message (depending on the distance) will be understandable.
|
|
</li>
|
|
<li><span class="parameter">abstruse</span>
|
|
Everything within this range (inclusive) will not be understandable.
|
|
</li>
|
|
<li><span class="parameter">incomprehensible</span>
|
|
The type of these parameters.
|
|
</li>
|
|
<li><span class="parameter">type</span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
Everything within this range (inclusive) will be understandable.
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2><a name="Fields"></a>Fields</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "TYPE_GLOBAL"></a>
|
|
<strong>TYPE_GLOBAL</strong>
|
|
</dt>
|
|
<dd>
|
|
Type constant for a global message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "TYPE_SHOUT"></a>
|
|
<strong>TYPE_SHOUT</strong>
|
|
</dt>
|
|
<dd>
|
|
Type constant for a shouted message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "TYPE_TALK"></a>
|
|
<strong>TYPE_TALK</strong>
|
|
</dt>
|
|
<dd>
|
|
Type constant for a talked message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "TYPE_WHISPER"></a>
|
|
<strong>TYPE_WHISPER</strong>
|
|
</dt>
|
|
<dd>
|
|
Type constant for a whispered message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "activate_automatically"></a>
|
|
<strong>activate_automatically</strong>
|
|
</dt>
|
|
<dd>
|
|
If the system should be activated automatically.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "active"></a>
|
|
<strong>active</strong>
|
|
</dt>
|
|
<dd>
|
|
If the system is active/has been activated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "global_privilege"></a>
|
|
<strong>global_privilege</strong>
|
|
</dt>
|
|
<dd>
|
|
The privilege that is needed for using the global command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "line_of_sight_mod"></a>
|
|
<strong>line_of_sight_mod</strong>
|
|
</dt>
|
|
<dd>
|
|
The line of sight modification, which means that if the target does not
|
|
have line of sight with the source, this mod will be applied to
|
|
the range to limit it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "message_callbacks"></a>
|
|
<strong>message_callbacks</strong>
|
|
</dt>
|
|
<dd>
|
|
The callbacks for when a message is send.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "understandable"></a>
|
|
<strong>understandable</strong>
|
|
</dt>
|
|
<dd>
|
|
Everything within this range (inclusive) will be understandable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "abstruse"></a>
|
|
<strong>abstruse</strong>
|
|
</dt>
|
|
<dd>
|
|
Everything within this range (inclusive) will be abstruse, which
|
|
means that only part of the message (depending on the distance) will
|
|
be understandable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "incomprehensible"></a>
|
|
<strong>incomprehensible</strong>
|
|
</dt>
|
|
<dd>
|
|
Everything within this range (inclusive) will not be understandable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|