359 lines
15 KiB
HTML
Executable File
359 lines
15 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::ZServer 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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
|
|
<hr><h1>ZE::ZServer Class Reference</h1><code>#include <<a class="el" href="ZE__ZServer_8h-source.html">ZE_ZServer.h</a>></code>
|
|
<p>
|
|
<a href="classZE_1_1ZServer-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
<a class="el" href="classZE_1_1ZServer.html">ZServer</a> server class, used to create a simple TCP game server for use with <a class="el" href="classZE_1_1ZClient.html">ZClient</a>. A very simple turnaround server, all the server does is accept connections and relay all recieved data to all other clients. <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> </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a0">ZServer</a> (bool verbose=false)</td></tr>
|
|
<tr><td> </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 </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a1">~ZServer</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Destructor, disconnects server and frees memory.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a2">Start</a> (int maxClients, Uint16 port)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Starts server.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a3">Stop</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Stops server.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a4">SetWaitTime</a> (int wait)</td></tr>
|
|
<tr><td> </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>void </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a5">CheckSockets</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Check sockets for connections or data.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a6">Clients</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Gets number of clients.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#a7">WaitTime</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Gets current wait time.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
|
|
<tr><td colspan=2><br><h2>Private Methods</h2></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#c0">CloseSocket</a> (int num)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Closes a socket.</em> <a href="#c0"></a><em></em></font><br><br></td></tr>
|
|
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="o0" doxytag="ZE::ZServer::rEngine"></a>
|
|
<a class="el" href="classZE_1_1ZEngine.html">ZEngine</a> * </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o0">rEngine</a></td></tr>
|
|
<tr><td> </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="o1" doxytag="ZE::ZServer::rSocket"></a>
|
|
TCPsocket </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o1">rSocket</a></td></tr>
|
|
<tr><td> </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="o2" doxytag="ZE::ZServer::rSocketSet"></a>
|
|
SDLNet_SocketSet </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o2">rSocketSet</a></td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Socket set for client connections.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="o3" doxytag="ZE::ZServer::rClientSockets"></a>
|
|
TCPsocket * </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o3">rClientSockets</a></td></tr>
|
|
<tr><td> </td><td><font size=-1><em>SDL_net TCPSockets for client connections.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="o4" doxytag="ZE::ZServer::rMaxClients"></a>
|
|
int </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o4">rMaxClients</a></td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Maximum number of clients.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="o5" doxytag="ZE::ZServer::rVerbose"></a>
|
|
bool </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o5">rVerbose</a></td></tr>
|
|
<tr><td> </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="o6" doxytag="ZE::ZServer::rWaitTime"></a>
|
|
int </td><td valign=bottom><a class="el" href="classZE_1_1ZServer.html#o6">rWaitTime</a></td></tr>
|
|
<tr><td> </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 & Destructor Documentation</h2>
|
|
<a name="a0" doxytag="ZE::ZServer::ZServer"></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::ZServer::ZServer </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">bool </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>verbose</em> = false </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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> </td><td>Sets verbose setting of client. [Defaults to false.] </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a1" doxytag="ZE::ZServer::~ZServer"></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::ZServer::~ZServer </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap><code> [virtual]</code></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Destructor calls <a class="el" href="classZE_1_1ZServer.html#a3">ZServer::Stop()</a>. </td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a name="c0" doxytag="ZE::ZServer::CloseSocket"></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::ZServer::CloseSocket </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">int </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>num</em> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap><code> [private]</code></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Close a socket given by it's number. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>num</em> </td><td>Socket number to close. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a2" doxytag="ZE::ZServer::Start"></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::ZServer::Start </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">int </td>
|
|
<td class="mdname" nowrap> <em>maxClients</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="md" nowrap>Uint16 </td>
|
|
<td class="mdname" nowrap> <em>port</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Starts server with a number of maximum clients and on a specified port. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>maxClients</em> </td><td>Maximum number of clients possible to connect to server. </td></tr>
|
|
<tr><td valign=top><em>port</em> </td><td>Port to listen on for connections. </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>True if server started, false otherwise. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a3" doxytag="ZE::ZServer::Stop"></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::ZServer::Stop </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Closes port and disconnects all clients. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a4" doxytag="ZE::ZServer::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::ZServer::SetWaitTime </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">int </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>wait</em> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Sets wait time in milliseconds , time which <a class="el" href="classZE_1_1ZServer.html#a5">ZServer::CheckSockets</a> will wait before returning if there is no activity. Before this is called for the first time the wait time is 0. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign=top><em>wait</em> </td><td>Wait time. </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a5" doxytag="ZE::ZServer::CheckSockets"></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::ZServer::CheckSockets </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Check sockets for connections or data, accepting new connections or relaying data from existing connections. Waits the specified wait period. This should be called very often to keep events flowing. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a6" doxytag="ZE::ZServer::Clients"></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::ZServer::Clients </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Finds number of connected clients. <dl compact><dt><b>Returns:</b></dt><dd>Number of clients. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a name="a7" doxytag="ZE::ZServer::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::ZServer::WaitTime </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top">) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Gets amount of time in milliseconds that is specified to wait for data on CheckSockets. <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__ZServer_8h-source.html">ZE_ZServer.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>
|