[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]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7246 >
On Sun, Apr 18, 2004 at 09:37:38AM -0700, andrearo@xxxxxxxxxxxx wrote:
>
> <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?
This conn_id field wasn't added to the chat-REQUEST packet only to the
actual chat packet.
And since one client doesn't have a connection to another client there
it no problem here.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
reality.sys corrupt. Reboot Universe? (y,n,q)
|
|