⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qc-netf.htm

📁 Quake 的 各 种 文 档 格 式 说 明
💻 HTM
字号:
<HTML><HEAD>
<TITLE>Quake-C Specificacions  v1.0</TITLE>
<LINK REV="MADE" HREF="mailto:100625.2622@compuserve.com">
</HEAD>  
<BODY BGCOLOR="#FFFFFF">

<H1><FONT COLOR="#007F00"><A NAME="QC-NETF">Quake-C Builtin Network functions</A></FONT></H1>


<p><b>Beware</b>: when generating messages, you had better respect
the format of the existing messages. Otherwise the game clients might
not be able to interpret them (and will likely crash).</p>

<p>The functions below all write to clients (players
connected via the network, or the local player).</p>


<h2>Global variable for network messages</h2>

<h4>Variable: <a name="msg_entity">msg_entity</a></h4>
<pre>
entity	<b>msg_entity</b>;
</pre>
If you want to send a message to just one entity <tt>e</tt>, then
set <b>msg_entity</b><tt>= e</tt> and send the message with
flag MSG_ONE, instead of MSG_ALL.<br>
Never used. Maybe it doesn't even work.


<h2>Builtin functions for composing network messages</h2>

<h4>Function: <a name="WriteByte">WriteByte</a></h4>
<pre>
void <b>WriteByte</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>

<h4>Function: <a name="WriteChar">WriteChar</a></h4>
<pre>
void <b>WriteChar</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>

<h4>Function: <a name="WriteShort">WriteShort</a></h4>
<pre>
void <b>WriteShort</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>

<h4>Function: <a name="WriteLong">WriteLong</a></h4>
<pre>
void <b>WriteLong</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>

<h4>Function: <a name="WriteCoord">WriteCoord</a></h4>
<pre>
void <b>WriteCoord</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>

<h4>Function: <a name="WriteAngle">WriteAngle</a></h4>
<pre>
void <b>WriteAngle</b>(float <i>to</i>, float <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>
This function writes a single byte, that represents 
<i>256*(angle/380)</i>.

<h4>Function: <a name="WriteString">WriteString</a></h4>
<pre>
void <b>WriteString</b>(float <i>to</i>, string <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>
This function writes a string, terminated by <i>\0</i> (the
null character in C).

<h4>Function: <a name="WriteEntity">WriteEntity</a></h4>
<pre>
void <b>WriteEntity</b>(float <i>to</i>, entity <i>value</i>)
       <i>to</i> = see <a href="qc-net.htm#d_messages" target="content">messages</a>
</pre>   
This function writes an entity reference, taking two bytes.


<hr>

</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -