[Freeciv-Dev] [patch #1280] add offline events
Update of patch #1280 (project freeciv): Status:None = Done Assigned to: cazfi = pepeto Open/Closed:Open = Closed ___ Follow-up Comment #27: As nobody complained, I assume this is done. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #24, patch #1280 (project freeciv): I committed my patch by mistake at revision 16236 and 16237. Should I revert it or close this one? ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #25, patch #1280 (project freeciv): I think as it is now committed it should stay. I tested it for two local players; one disconnects and reconnects one turn later and it is running fine! Are options planed to set the number of messages, the number of turn and to (de)activate chat messages in offline events? ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #26, patch #1280 (project freeciv): Are options planed to set the number of messages, the number of turn and to (de)activate chat messages in offline events? Certainly later, but it should be configurable with the server settings. Normal users (!= longturn) don't need it. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #23, patch #1280 (project freeciv): Updated patch against current svn. Also send public message on new connection and *only player messages* when issuing /take or /observe. (file #7098) ___ Additional Item Attachment: File name: trunk_S2_2_event_cache3.diff.bz2 Size:5 KB ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #20, patch #1280 (project freeciv): bitvector? It's a simple vector of bits. Look at utility/shared.h how it is implemented. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #21, patch #1280 (project freeciv): This is a first version of my mind. * All events are stored (256 at max) for particular target type: ** For all connections. ** For players (doesn't work on pregame because they are not fixed yet). ** For global observers. * Added special chat case: using '.' prefix when being global observer send message to all global observers (like on warserver). * Changed all notify_conn(pplayer-connections, ...) to notify_player(pplayer, ...) (file #6982) ___ Additional Item Attachment: File name: trunk_S2_2_event_cache.diff.bz2 Size:5 KB ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] [patch #1280] add offline events
Anonymous posting to the patch tracker should be working now. Thanks for the heads-up. Daniel On Tue, Oct 6, 2009 at 12:18 PM, Marko Lindqvist cazf...@gmail.com wrote: 2009/9/6 Marko Lindqvist: Update of patch #1280 (project freeciv): Assigned to: None = cazfi Planned Release: None = 2.2.0 Pepeto: Since this is one of the most important things to go in before 2.2.0-beta1, feel free to commit this if it seems ok to you. Daniel: Patch tracker, unlike bug tracker, does not allow comments from anonymous. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #17, patch #1280 (project freeciv): I tried to work on it. But, seeing more details of this patch, it looks like very longturn designed. It seems to admit that player are always played by the same user. The observers cases will probably have random behaviour... Offline events are only saved if a player has no connections (= no user connected to this player). For the next user who takes this player, all events are shown. No offline events are saved for observers as they are not players ... Also this patch contains some errors like checking pplayer-connections == NULL which will always be evaluated to FALSE. I checked the patch and replaced the following line: -if (aplayer-connections) { +if (conn_list_size(aplayer-connections) != 0) { I think what would be great to simulate longturn offline events in regular freeciv would just be to keep messages in a queue and clear it every turn. All users, including players, observers and other people using /take, /observe or anything else would be allowed to see what were the message this turn. This also would fix that people crashing would be able to see the messages they didn't have time to check. The available framework could be used for that. All messages are saved for each player independently if he is connected or not. If he reconnects or the player is taken by another user or an observer connects all messages are send. This requires that the query is not deleted after the messages is send but only if the max number of messages or max number of turns is reached. (file #6939) ___ Additional Item Attachment: File name: version4-0001-add-offline-events.diff Size:21 KB ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #18, patch #1280 (project freeciv): Offline events are only saved if a player has no connections (= no user connected to this player). This is not a very good test, the only connection of a player can be an observer. For the next user who takes this player, all events are shown. Your patch doesn't do that. It sends only the offlines messages when connecting. And I really think that if 2 users takes the player they would like to see the messages both. The available framework could be used for that. All messages are saved for each player independently if he is connected or not. If he reconnects or the player is taken by another user or an observer connects all messages are send. This requires that the query is not deleted after the messages is send but only if the max number of messages or max number of turns is reached. I was thinking set a global queue where a bitvector would say what connection to notify when its state changes. It would also be used to store messages after a game was loaded. It would also solve that this code wouldn't affect the common part at all. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #19, patch #1280 (project freeciv): I see your points but this is way behind my knowledge about the freeciv codebase and also coding skills (bitvector?). I will focus on the city radii patch. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] [patch #1280] add offline events
2009/9/6 Marko Lindqvist: Update of patch #1280 (project freeciv): Assigned to: None = cazfi Planned Release: None = 2.2.0 Pepeto: Since this is one of the most important things to go in before 2.2.0-beta1, feel free to commit this if it seems ok to you. Daniel: Patch tracker, unlike bug tracker, does not allow comments from anonymous. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #8, patch #1280 (project freeciv): Just over-read the last patch... * Is there a reason to use a packet_chat_msg pointer instead of a plain structure? * To be sure to don't forget any place to add the offline events, I think it should be included inside notify_conn_packet(). * player_add_offline_event_v() is not needed. A simple call to player_add_offline_event() should be added in send_chat_msg(). ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #9, patch #1280 (project freeciv): Just over-read the last patch... * Is there a reason to use a packet_chat_msg pointer instead of a plain structure? you are right; a plain struct is enough * To be sure to don't forget any place to add the offline events, I think it should be included inside notify_conn_packet(). the problem is, that notify_conn_packet() is called for _connections_ but an offline player has no connections ... * player_add_offline_event_v() is not needed. A simple call to player_add_offline_event() should be added in send_chat_msg(). for chat_msg_allies() it would be OK (but see above: connection = player). Within chat_msg_privat() two different players are the recipients: player_add_offline_event_v() is used for the offline player while send_chat_msg() is used for the player how wants to send the message. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #10, patch #1280 (project freeciv): the problem is, that notify_conn_packet() is called for connections but an offline player has no connections ... Hehe, you are right, I totally missed this point. So you seems to be right. for chat_msg_allies() it would be OK (but see above: connection = player). Within chat_msg_privat() two different players are the recipients: player_add_offline_event_v() is used for the offline player while send_chat_msg() is used for the player how wants to send the message. I still think this function is not needed, and confusing with the rest of the code. There is no advantage to compute the packet twice. So I think that the function send_chat_msg() should be spread into chat_msg_privat(), chat_msg_allies() and chat_msg_public(). About chat_msg_privat (I think correct english is privat*e*), you handled the 2 different cases well. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #11, patch #1280 (project freeciv): * Is there a reason to use a packet_chat_msg pointer instead of a plain structure? you are right; a plain struct is enough but is not possible ... I can use struct packet_chat_msg as this would mean to include packet.h which will result in some dependency errors (or I don't understand the errors I get) A solution would be to save all the data without using this struct. But I would to keep it as it represent the data which needs top be send later ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #12, patch #1280 (project freeciv): but is not possible ... I can use struct packet_chat_msg as this would mean to include packet.h which will result in some dependency errors (or I don't understand the errors I get) How come it's not possible. Such structures are already included directly in the civ_game structure. What errors do you get? ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #13, patch #1280 (project freeciv): I still think this function is not needed, and confusing with the rest of the code. There is no advantage to compute the packet twice. So I think that the function send_chat_msg() should be spread into chat_msg_privat(), chat_msg_allies() and chat_msg_public(). send_chat_msg() is used 7 times in this file with different message texts. Only in chat_msg_allies() the same text is used for this function and the offline event. I attached an updated version of the patch; changes: * change chat_msg_privat*e* * additional check for connections in chat_msg_allies() (file #6912) ___ Additional Item Attachment: File name: version3-0001-add-offline-events.diff Size:21 KB ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #14, patch #1280 (project freeciv): after changing from '*packet' to 'packet' I get: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../utility -I.. -I../../common -DLOCALEDIR=\/usr/local/share/locale\ -DDEFAULT_DATA_PATH=\.:data:~/.freeciv/2.3:/usr/local/share/freeciv\ -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Werror -g -O2 -MT aisupport.lo -MD -MP -MF .deps/aisupport.Tpo -c aisupport.c -o aisupport.o In file included from ../game.h:27, from aisupport.c:25: ../player.h:350: error: field ‘packet’ has incomplete type make[4]: *** [aisupport.lo] Error 1 adding '#include packets.h' result in libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../utility -I.. -I../../common -DLOCALEDIR=\/usr/local/share/locale\ -DDEFAULT_DATA_PATH=\.:data:~/.freeciv/2.3:/usr/local/share/freeciv\ -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Werror -g -O2 -MT aisupport.lo -MD -MP -MF .deps/aisupport.Tpo -c aisupport.c -o aisupport.o In file included from ../map.h:21, from ../packets.h:24, from ../player.h:21, from ../game.h:27, from aisupport.c:25: ../tile.h:40: error: expected specifier-qualifier-list before ‘bv_player’ In file included from ../packets.h:75, from ../player.h:21, from ../game.h:27, from aisupport.c:25: ../packets_gen.h:413: error: array type has incomplete element type ../packets_gen.h:1335: error: expected specifier-qualifier-list before ‘bv_player’ make[4]: *** [aisupport.lo] Error 1 and there I stopped trying ... ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #15, patch #1280 (project freeciv): You cannot include packets.h in player.h because it already include it. Anyway, I don't like most of the code is in the common part because it is a server-only feature. Leave this for now, I will probably check it in the end of the week. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #7, patch #1280 (project freeciv): to include bug #14285 all server messages could be additional added to the list of offline events with a flag 'save'. If the game is saved this events (current + last(?) turn) will be written into the file. If the savegame is loaded this events will be restored from the savegame and send to the player(s) ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #5, patch #1280 (project freeciv): complete rewrite of the offline events code; in the first patches I did only applied the patches by book to mainline. This patch includes the chat messages as well as other cleanups of the code. It depends on patch #1296. add offline events * if a player is not connected events are saved and send if he reconnects * all messages are saved (game events as well as chat messages) * default: events of 1 turns are saved based on patches for longturn by book: git-svn-id: https://pagema.net/svn/lt-civser...@4345 81e79487-72da-0310-8e13-94f5ef8dd271 git-svn-id: https://pagema.net/svn/lt-civser...@4324 81e79487-72da-0310-8e13-94f5ef8dd271 (file #6672) ___ Additional Item Attachment: File name: 0002-add-offline-events.diff Size:21 KB ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
Follow-up Comment #3, patch #1280 (project freeciv): Reading this patch, I'm not totally convinced by some ways: * Only notify_player() and notify_embassies() have en entry for offline events. Shouldn't at least notify_team() and notify_research() have it too? And what about notify_conn()? * Why do you overwrite the event type and the tile in notify_embassies() with E_TREATY_EMBASSY and NULL? * I don't think that offline chat and offline events should be split in different features. They do exactly the same. And I don't see any application of using only 1/2. ___ Reply to this item at: http://gna.org/patch/?1280 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1280] add offline events
URL: http://gna.org/patch/?1280 Summary: add offline events Project: Freeciv Submitted by: syntron Submitted on: Samstag 05.09.2009 um 22:22 Category: general Priority: 1 - Later Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: None ___ Details: * if a player is not connected events are saved and send if he reconnects * default: events of 1 turns are saved * nothing is missed if the client crashs Patch by: book for longturn Adapted for mainline by: Matthias Pfafferodt syntron git-svn-id: https://pagema.net/svn/lt-civser...@4345 81e79487-72da-0310-8e13-94f5ef8dd271 git-svn-id: https://pagema.net/svn/lt-civser...@4324 81e79487-72da-0310-8e13-94f5ef8dd271 ___ File Attachments: --- Date: Samstag 05.09.2009 um 22:22 Name: 0001-add-offline-events.patch.diff Size: 13kB By: syntron http://gna.org/patch/download.php?file_id=6577 ___ Reply to this item at: http://gna.org/patch/?1280 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev