Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12883) generate_packets.py bug: handle-per-conn do
Home

[Freeciv-Dev] Re: (PR#12883) generate_packets.py bug: handle-per-conn do

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12883) generate_packets.py bug: handle-per-conn doesn't work with handle-via-packet
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Mon, 25 Apr 2005 11:20:20 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12883 >

On Mon, Apr 25, 2005 at 12:14:21AM -0700, Jason Short wrote:
> 
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12883 >
> 
> If you set handle-per-conn for a packet in packets.def it is supposed to
> cause the connection rather than the player to be passed to the packet
> handler.  However with a handle-via-packet packet (declared either
> manually or automatically [when the packet gets large enough]) the
> handle-per-conn directive is simply ignored and the player is passed in
> rather than the conn.
> 
> With the new civworld design this is a particular problem, since all
> "edit" packets must be handled per conn and many will end up being large.

Does this patch solves it?

        Raimar

-- 
 email: i-freeciv-lists@xxxxxxxxxxxxx
  "With a PC, I always felt limited by the software available.
   On Unix, I am limited by my knowledge."
    -- Peter J. Schoenster <pschon@xxxxxxxxxxxxxxxxx>

Index: common/generate_packets.py
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/generate_packets.py,v
retrieving revision 1.17
diff -u -u -r1.17 generate_packets.py
--- common/generate_packets.py  21 Mar 2005 17:38:33 -0000      1.17
+++ common/generate_packets.py  25 Apr 2005 18:14:58 -0000
@@ -1511,7 +1511,10 @@
                 b=", "+b
             if p.handle_via_packet:
                 f.write('struct %s;\n'%p.name)
-                f.write('void handle_%s(struct player *pplayer, struct %s 
*packet);\n'%(a,p.name))
+                if p.handle_per_conn:
+                    f.write('void handle_%s(struct connection *pc, struct %s 
*packet);\n'%(a,p.name))
+                else:
+                    f.write('void handle_%s(struct player *pplayer, struct %s 
*packet);\n'%(a,p.name))
             else:
                 if p.handle_per_conn:
                     f.write('void handle_%s(struct connection *pc%s);\n'%(a,b))

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