Using enet to query for statistics also means that every machine making these queries would be eating away at your game server's connection limit, which isn't remotely ideal. You'd also be incurring the overhead involved in setting up an enet connection, and you'd have to be able to use UDP to reach your webserver (most webservers are going to be behind a firewall which may or may not forward UDP packets)
<br><br>Instead of having your PHP server(s) poll the game server for statistics, why not have the game server(s) send heartbeat statistics to the PHP server(s) periodically? Heartbeat statistics are the method used by most game servers, and they&#39;re much easier to implement - you can basically just fire off a GET or POST to your web server with the appropriate statistics in the request, and forget about it. If you feel like you want something more flexible, you could use XMLRPC, SOAP, or something similar, since there are good libraries for doing those in PHP.
<br><br><div><span class="gmail_quote">On 9/26/07, <b class="gmail_sendername">Bjørn Lindeijer</b> &lt;<a href="mailto:bjorn@lindeijer.nl">bjorn@lindeijer.nl</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Looking back at what you&#39;re trying to achieve, I&#39;d have to ask why do<br>you want to use ENet just to query some statistics? Since this needs<br>sequenced and reliable communication anyway, the easiest thing to do in
<br>my opinion is to use a basic TCP socket separate from the socket(s)<br>driven by the ENet protocol.<br><br>Bjørn<br><br>GhostManZero wrote:<br>&gt; That was what i feared the most, i wonder if i&#39;ll be able to do some
<br>&gt; bindings for ENet then, considering how i&#39;ve never written any<br>&gt; bindings for any languages before...<br>&gt;<br>&gt; Also, my main language is C++.<br>&gt;<br>&gt; Quoting Giuseppe Greco &lt;<a href="mailto:giuseppe.greco@agamura.com">
giuseppe.greco@agamura.com</a>&gt;:<br>&gt;<br>&gt;&gt; To connect to an ENet server you need an ENet client since both peers<br>&gt;&gt; must implement the same protocol (or if you prefer &quot;talk the same<br>&gt;&gt; language&quot;). You cannot just use a raw socket and expect it is able to
<br>&gt;&gt; communicate with an ENet server. Of course, ENet provides also a simple<br>&gt;&gt; socket API (enet_socket_...) but it just hides the differences between<br>&gt;&gt; the Socket API on Windows and the Socket API on UNIX.
<br>&gt;&gt;<br>&gt;&gt; What you can do is to write PHP bindings for ENet (I don&#39;t know if<br>&gt;&gt; they already exist - I use to program in C, period).<br>&gt;&gt;<br>&gt;&gt; j3d.<br>&gt;&gt;<br>&gt;&gt;&gt;<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;Hello everyone,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;I would like to know if it would be possible to use PHP&#39;s socket<br>&gt;&gt;&gt; library to connect to a ENet server and be able to send and receive<br>
&gt;&gt;&gt; messages, as i&#39;d like to try to do a simple PHP script where my script<br>&gt;&gt;&gt; connects to a ENet Game Server and fetches the total ammount of<br>&gt;&gt;&gt; players online.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;Would such thing be possible under PHP? If so, would anyone mind
<br>&gt;&gt;&gt; telling me a bit of how i should proceed?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;I&#39;m not a PHP newbie, so if you just point me out to the functions<br>&gt;&gt;&gt; i must use, and in what way, i can take care of it myself.
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;Thank you for your time!<br>&gt;&gt;&gt; --<br>&gt;&gt;&gt; ~Zero<br><br>_______________________________________________<br>ENet-discuss mailing list<br><a href="mailto:ENet-discuss@cubik.org">
ENet-discuss@cubik.org</a><br><a href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br></blockquote></div><br>