Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [Patch] turn_founded
Home

[Freeciv-Dev] Re: [Patch] turn_founded

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] turn_founded
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 4 Mar 2002 19:28:56 +0000 (GMT)

On Mon, 4 Mar 2002, Raimar Falke wrote:

> On Mon, Mar 04, 2002 at 06:00:04PM +0000, Gregory Berkolaiko wrote:
> > On Mon, 4 Mar 2002, Raimar Falke wrote:
> > 
> > > On Mon, Mar 04, 2002 at 12:25:57PM +0000, Gregory Berkolaiko wrote:
> > > > Marginally related thing:
> > > > 
> > > > turn_changed_target doesn't seem to be _used_ anywhere.  It is set 
> > > > and saved alright, but not used.
> > > > 
> > > > even if it was used, it would be logical to convert it to bool too.
> > > 
> > > Yes it should be removed.
> > 
> > Easier said than done.  I made a patch but it breaks the compatibility.  
> > How do you go about this?
> 
> Capability?!

yes, I know.  But isn't it a bit silly, having a capability for 
_not_having_ a variable.

a cunning solution exists though.
in your turn_founded patch you introduce int turn_founded
in my patch I kill int turn_changed_target.

we can unite the patches!

so, in packets.c we would do

        cptr = put_uint32(cptr, req->turn_founded);

instead of 

        cptr=put_sint16(cptr, req->turn_changed_target);

not conditional on capability, but read

+  if (has_capability("turn_founded", pc->capability)) {
+    iget_uint32(&iter, &packet->turn_founded);
+  } else {
+    /* get it and ignore it */
+    iget_uint32(&iter, &packet->turn_founded);
+    packet->turn_founded = -1;
+  }

conditional on capability.  uint should be changed to sint of course.

If we send turn_founded instead of turn_changed_target to an older 
program, it wouldn't break since the value is ignored anyway.

I guess it's a nasty trick, but I think it's imaginative.
Do you want to do it, do you want me to attach your patch to mine or you 
don't even want to talk about it?

> > The patch is attached.  It works unless you try to connect to an older 
> > server or vv.
> 
> What is vv?

vice versa  (older client connecting to newer server).

G.




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