Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#7246) Send origin of chat messages
Home

[Freeciv-Dev] Re: (PR#7246) Send origin of chat messages

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7246) Send origin of chat messages
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Sun, 18 Apr 2004 09:37:38 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7246 >

On Sun, 18 Apr 2004, Raimar Falke wrote:
> On Thu, Jan 15, 2004 at 09:03:31AM -0800, Raimar Falke wrote:
> > I would like to color the chat messages which come from other players
> > according to their player color. For this the chat packet has to
> > contain the player. I would also like to have another propery: a
> > type. IMHO there are 3 types:
> >  - out-of-game messages from other player
> >  - out-of-game messages from the server ("Welcome to server", "Unknown
> >  command", "Game saved",...)
> >  - in game messages from the server or client ("Next year", "Unit was
> >  attacked",...)
>
> The patch. Straightforward except some things:
>
>  - a new field has to be add to the packet. This causes the addition
>  of a parameter to a _lot_ of notify_* and other functions. And this
>  would cause the change of a lot of callers. The other solution (which
>  was used by the patch) requires less changes but is a but uncleaner:
>  the source of every outgoing chat packet is set to the id of the
>  current_connection. This global variable is set to !=NULL during the
>  processing of each packet.
>
>  - the added check in tech.c was necessary. We should really thing
>  about a proper solution here.
>
>  - adding player_id to connection: required since the player info is
>  sent but in pregame game.nplayers isn't valid yet and so conn->player
>  gets NULL.
>
>  - only gtk2 client changed

If you set the source of every outgoing packet to the id of the
current_connection in the client, then it's possible to forge this id to
make it appear as though it's coming from someone else, right?

Andreas Røsdal




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