Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] Re: (PR#11805) Store chat and notify messages for later re

[Freeciv-Dev] Re: (PR#11805) Store chat and notify messages for later re

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: edoverton@xxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11805) Store chat and notify messages for later retrieval
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jan 2005 13:39:47 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: >

Ed Overton wrote:
> <URL: >
> In a long turn game where players are disconnected most of the time,
> messages (both chat and notifications) are not seen.  It would be nice
> if chat and notifications were stored for each player, and the player
> could retrieve those that were missed when the player reconnects.

Absolutely.  I made a ticket for this a long time ago but have never 
done any coding on it.

My design would be this: when an event is generated it is saved 
(probably in an event specvec).  When the game is saved these arrays are 
saved; when they're loaded they are loaded.  The array is cleared at the 
end of every turn.  When a player connects they are sent all events in 
the array.  There is no need for the client to request these events I 
think - it certainly shouldn't come via a chatline request but should be 
a separate packet if it is done.

One possible new packet is sent server->client to tell the client when 
to clear its events array at the end of the turn.  Currently the client 
does this automatically but I think the timing is wrong so some 
end-of-turn messages are dropped immediately.

Now, for the server design.  We have grand plans for events (see and any changes here should be 
done with that in mind.  Currently there is a set of functions 
notify_player and friends.  These are "dumb" functions that just send 
data about the event to the client.  I suggest a new set of functions 
that sit on top of those and are called instead: perhaps named 
create_event() or some such.  These functions not only call 
notify_player() but also save the event for later retrieval.


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