[Freeciv-Dev] Re: (PR#13833) SEGV in movement.c
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13833 >
White Raven wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13833 >
>
> On Thu, 2005-09-01 at 13:38 -0700, Jason Short wrote:
>
>><URL: http://bugs.freeciv.org/Ticket/Display.html?id=13833 >
>>
>>White Raven wrote:
>>
>>><URL: http://bugs.freeciv.org/Ticket/Display.html?id=13833 >
>>>
>>>CVS version of 1 September 2005:
>>>
>>>Start a game; immediate SEGV.
>>>
>>>It appears that unit class is not properly initialized. If understand
>>>correctly, it should be initialized in packhand.c, but it looks like
>>>there is no corresponding field in the packet_ruleset_unit structure.
>>
>>Indeed. This is apparently a long-standing (post-2.0) bug. The unit
>>class isn't sent to the client. Thus all unit classes were 0 (NULL)
>>causing all units to behave (in some ways...not much since the unit
>>class doesn't do much yet) like a Missile (crash).
>>
>>This patch fixes it. I will commit immediately.
>
> Interesting. Your patch adds a unit-id to the packet, plus a function
> to recreate the class struct from it. I had worked out a patch I was
> about to send that added a string class field to the packet, and used
> existing functions to get the string from the class on the server side,
> and recreate the class from the string on the client side. However, I
> did forget about modifying capstr.c (I'm still new to freeciv coding).
> Just for fun, here's my version:
We use ID/binary values when sending data over the network. See
punit->type, pplayer->nation, etc. For putting data in savegames we
have to use string values however.
-jason
|
|