[Freeciv-Dev] Re: (PR#6707) Announce server on LAN
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Oct 31, 2003 at 01:04:05PM -0800, andrearo@xxxxxxxxxxxx wrote:
>
> Hi everyone,
> One of the features I miss in Freeciv is to get a list of servers on the
> LAN that the client can connect to, when setting up local games. So I just
> had to implement it :)
>
> It works as follows: The client multicasts an UDP packet to the LAN, with
> TTL=4 so that the packet doesn't leave the LAN. The server then get's the
> packet, and send a response with it's info. The list of LAN servers in the
> connect dialog is updated, just like the list of Metaservers.
Nice idea. I have a problem however with the constants. Why TTL=4? Why
not 3 or 5? Why a SERVER_LAN_GROUP of 225.0.0.1? Can't this be
autodetected somehow? Also this
+ for (i = 0; i < 130; i++) {
130 looks like it wants a comment.
The same is true for this 1:
+ dio_output_init(&dout, buffer, sizeof(buffer));
+ dio_put_uint8(&dout, 1);
You know that in
+ unsigned char buffer[MAX_LEN_PACKET];
...
+ if (sendto(sock, buffer, sizeof(buffer), 0, (struct sockaddr *) &addr,
+ sizeof(addr)) < 0) {
you send 4096 bytes in which you only have 1 byte real payload?!
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
1) Customers cause problems.
2) Marketing is trying to create more customers.
Therefore:
3) Marketing is evil.
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN, andrearo@xxxxxxxxxxxx, 2003/11/01
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN,
Raimar Falke <=
- Message not available
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN, Todd Goodman, 2003/11/03
- Message not available
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN, Raimar Falke, 2003/11/05
- Message not available
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN, Todd Goodman, 2003/11/05
- Message not available
- [Freeciv-Dev] Re: (PR#6707) Announce server on LAN, Raimar Falke, 2003/11/05
|
|