Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4242) Clean up the goto route network protocol and

[Freeciv-Dev] Re: (PR#4242) Clean up the goto route network protocol and

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4242) Clean up the goto route network protocol and route execution
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 15 May 2003 13:20:53 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 15 May 2003, Raimar Falke wrote:
> The attached patch:
>  - cleans up the network protocol (struct packet_goto_route)


>  - a lot of the cruft of the old protocol was about handling
>  unlimited routes by splitting these into chunks. I removed this and
>  set a limit (MAX_LEN_ROUTE). MAX_LEN_ROUTE is 1200 steps. This is ~5
>  times the number to go around the largest world (255x255).

This is far, probably too much. But nevertheless, don't assert this
without capping it somewhere.

+  assert(src->length < MAX_LEN_ROUTE);

+  pf_print_path(LOG_DEBUG, src);

I hope you remove this for the final version :-)

+    for (i = 0; i < packet->length; i++) {
+      dio_put_uint8(&dout, packet->path[i].x);
+      dio_put_uint8(&dout, packet->path[i].y);
+      dio_put_bool8(&dout, packet->path[i].wait);

Hmm. Instead of sending a hard 'wait', why not mark dangers and let the
server sort out the waiting? This way we don't screw up if the server sits
on some information we don't have. Probably harder to code, though.

As for savegames, I say just nuke the punit->pgr info from old savegames.
It is not important information unless we want the savegame to debug. And
then we want new savegames anyway.

  - Per

[Prev in Thread] Current Thread [Next in Thread]