zengine/doc/html/classZE_1_1ZClient.html
2003-04-27 22:15:26 +00:00

370 lines
16 KiB
HTML
Executable File

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ZE::ZClient class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc2 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>ZE::ZClient Class Reference</h1><code>#include &lt;<a class="el" href="ZE__ZClient_8h-source.html">ZE_ZClient.h</a>&gt;</code>
<p>
<a href="classZE_1_1ZClient-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classZE_1_1ZClient.html">ZClient</a> net client class, used to create a simple TCP game client for use with <a class="el" href="classZE_1_1ZServer.html">ZServer</a>. <dl compact><dt><b>Since:</b></dt><dd>0.8.3 </dd></dl>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a0">ZClient</a> (bool verbose=false)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Default Constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a1">~ZClient</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Destructor, disconnects and frees memory.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a2">Connect</a> (char *server, Uint16 port)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Connects to a server on a given port.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a3">Disconnect</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Disconnect client.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a4">SetWaitTime</a> (int wait)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Sets wait time for recieves.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a5">Send</a> (<a class="el" href="ZE__Defines_8h.html#a7">ZByte</a> *data, int size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Send data too connected server.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a6">Receive</a> (<a class="el" href="ZE__Defines_8h.html#a7">ZByte</a> *data)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Recieve data if available.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a7">Connected</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Return connected state.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#a8">WaitTime</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Gets current wait time.</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="n0" doxytag="ZE::ZClient::rEngine"></a>
<a class="el" href="classZE_1_1ZEngine.html">ZEngine</a> *&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#n0">rEngine</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Pointer to <a class="el" href="classZE_1_1ZEngine.html">ZEngine</a> Object.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="n1" doxytag="ZE::ZClient::rSocket"></a>
TCPsocket&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#n1">rSocket</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>SDL_net socket for connection.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="n2" doxytag="ZE::ZClient::rSocketSet"></a>
SDLNet_SocketSet&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#n2">rSocketSet</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Socket set for connection.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="n3" doxytag="ZE::ZClient::rVerbose"></a>
bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#n3">rVerbose</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Verbose setting for connection logs.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="n4" doxytag="ZE::ZClient::rWaitTime"></a>
int&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZClient.html#n4">rWaitTime</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Wait timeout setting for recieves on connection. [Defaults to 0.].</em></font><br><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="ZE::ZClient::ZClient"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> ZE::ZClient::ZClient </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">bool&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>verbose</em> = false </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Default Constructor, does basic initialization. If verbose is true connection data will be added to log file. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>verbose</em>&nbsp;</td><td>Sets verbose setting of client. [Defaults to false.] </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a1" doxytag="ZE::ZClient::~ZClient"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual ZE::ZClient::~ZClient </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Destructor calls <a class="el" href="classZE_1_1ZClient.html#a3">ZClient::Disconnect()</a>. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a2" doxytag="ZE::ZClient::Connect"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZClient::Connect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">char *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>server</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>Uint16&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>port</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Connects to a server (given in dotted ip form) on a given port. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>server</em>&nbsp;</td><td>Dotted IP address to connect to. </td></tr>
<tr><td valign=top><em>port</em>&nbsp;</td><td>Port number to connect to. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true if connected, false otherwise. </dd></dl>
</td>
</tr>
</table>
<a name="a3" doxytag="ZE::ZClient::Disconnect"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZClient::Disconnect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Disconnect from server if connected. </td>
</tr>
</table>
<a name="a4" doxytag="ZE::ZClient::SetWaitTime"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZClient::SetWaitTime </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>wait</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Sets wait time in milliseconds , time which ZClient::Recieve will wait before returning if there is no data. Before this is called for the first time WaitTime is 0. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>wait</em>&nbsp;</td><td>Wait time. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a5" doxytag="ZE::ZClient::Send"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZClient::Send </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="ZE__Defines_8h.html#a7">ZByte</a> *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>data</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>size</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Sends data to server if available. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>data</em>&nbsp;</td><td>Pointer to data buffer to send. </td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>Size of data buffer. (Can't be larger than MAX_MSG_LEN as defined in <a class="el" href="ZE__Defines_8h.html">ZE_Defines.h</a>) </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>True if data could be sent, false upon error. </dd></dl>
</td>
</tr>
</table>
<a name="a6" doxytag="ZE::ZClient::Receive"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int ZE::ZClient::Receive </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="ZE__Defines_8h.html#a7">ZByte</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>data</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Recieves data from server if available, waiting for timeout period if no data is pending. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>data</em>&nbsp;</td><td>Pointer to buffer to store data in. (Must be large enough, needs not be more than MAX_MSG_LEN as defined in <a class="el" href="ZE__Defines_8h.html">ZE_Defines.h</a>) </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Size of recieved data stored to buffer. (&lt;MAX_MSG_LEN) </dd></dl>
</td>
</tr>
</table>
<a name="a7" doxytag="ZE::ZClient::Connected"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZClient::Connected </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns state of connection. <dl compact><dt><b>Returns:</b></dt><dd>true if connected, false otherwise </dd></dl>
</td>
</tr>
</table>
<a name="a8" doxytag="ZE::ZClient::WaitTime"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int ZE::ZClient::WaitTime </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Gets amount of time in milliseconds that is specified to wait for data on Recieve. <dl compact><dt><b>Returns:</b></dt><dd>Wait time. </dd></dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li>/include/<a class="el" href="ZE__ZClient_8h-source.html">ZE_ZClient.h</a></ul>
<hr><address style="align: right;"><small>Generated on Sun Apr 27 18:16:26 2003 for ZEngine by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.3-rc2 </small></address>
</body>
</html>