Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: [RFC][Patch] Reduce bandwith by using deltas
Home

[Freeciv-Dev] Re: [RFC][Patch] Reduce bandwith by using deltas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC][Patch] Reduce bandwith by using deltas
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Fri, 8 Nov 2002 22:02:14 +0100

On Wed, Nov 06, 2002 at 06:19:09PM +0100, Raimar Falke wrote:
> > > are you talking about splitting packet_city_request into one for rename,
> > > one for worklist and one for each other use?
> > 
> > Yes.
> 
> I don't want packet_city_request_worklist, packet_city_request_rename
> and so on. Maybe we can have some more packet_generic_* and reuse
> them. But a struct packet_* for evey PACKET is a nightmare.

Per convinced me that it is a good idea to have one packet_* for every
PACKET_*. Combining this with direct calls will capsulate the packets
more or less completely away. What do I mean with direct calls? In
addition to

  int send_packet_new_year(struct connection *pc, const struct packet_new_year 
*packet);

there will be a

  int dsend_packet_new_year(struct connection *pc, int year, int turn);

and a

  void dlsend_packet_new_year(struct conn_list *dest, int year, int turn);

These will wrap the filling of the packet. Also the handle_* functions
get the packet fields one-by-one:

  void handle_city_sell(struct player *pplayer, int city_id, int build_id);

for this code for srv_main.c will be generated like this:

  case PACKET_CITY_SELL:
    handle_city_sell(pplayer,
      ((struct packet_city_sell *)packet)->city_id,
      ((struct packet_city_sell *)packet)->build_id);
    break;

All these are details. The more important thing is that we can agree
on the specification of the new packets. I have attached my current
working version which is almost finished.

Please comment.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "#!/usr/bin/perl -w
  if ( `date +%w` != 1 ) {
    die "This script only works on Mondays." ;
  }"
    -- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc

Attachment: packets_gen.in
Description: Text document


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