<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jonathan Hodgkinson wrote:
<blockquote
cite="mid:30bbff720908131452o516f0e80n99ca0508628ea50c@mail.gmail.com"
type="cite">Sorry if this is a basic question: I'm trying to setup a
local game over wifi. So one client will create the 'server' and the
other clients will try and join as clients. The problem is on a local
LAN it seems they have to connect to the locally assigned IP of that
server but I dont know how to get this through the code.<br>
<br>
I can get the client to connect to the server by manually finding the
IP say 192.168.4 but I need to get this through the code. <br>
<br>
Does this mean I have to get the server to do some kind of
broadcasting? <br>
<br>
Thanks in advance!<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
ENet-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a>
<a class="moz-txt-link-freetext" href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
</blockquote>
The client-side needs to know either the ip address (whether local or
external) of the server, or a hostname which resolves to the right ip
address.<br>
You can use a free dns service, such as dyndns, to resolve to an ip
address which you can change at any time without modifying the code.
This would require you to have external internet access though, and
wouldn't work on a local lan which isn't connected to the internet.
Other than that, the only way to do it would be to have the user supply
the ip address to connect to. All of the games I've played which
support tcp/ip play use this method if they don't have a centralized
server with a static ip that organizes all other servers.<br>
</body>
</html>