チケット #45429

Send counter value updates to client

登録: 2022-08-23 06:37 最終更新: 2022-10-22 13:17

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
3

詳細

Counter values need to be updated also on client side.

チケットの履歴 (15 件中 3 件表示)

2022-08-23 06:37 更新者: cazfi
  • 新しいチケット "Send counter value updates to client" が作成されました
2022-09-14 23:01 更新者: lachu
コメント

@cazfi. How do that (in which way)? Should be new value generated by server send to each client for city counters, or (perhaps?) only to city owner? Maybe introduce special field, called "publicity" or "visible_other". It could be similar to range, so world, continent, ally, others.

2022-09-17 11:09 更新者: cazfi
コメント

Reply To lachu

Should be new value generated by server send to each client for city counters, or (perhaps?) only to city owner? Maybe introduce special field, called "publicity" or "visible_other". It could be similar to range, so world, continent, ally, others.

I think we should start by sending them to city owner only - probably some counters are such that other players are not supposed to know them,

Visibility ranges are a good idea, but let's leave it to a bit later -> can you open a new ticket?
Can maybe align with other things needing such visibility ranges (at least for achievements those have already been wanted for some time)

2022-10-15 00:22 更新者: lachu
コメント

Reply To cazfi

Reply To lachu

Should be new value generated by server send to each client for city counters, or (perhaps?) only to city owner? Maybe introduce special field, called "publicity" or "visible_other". It could be similar to range, so world, continent, ally, others.

I think we should start by sending them to city owner only - probably some counters are such that other players are not supposed to know them, Visibility ranges are a good idea, but let's leave it to a bit later -> can you open a new ticket?
Can maybe align with other things needing such visibility ranges (at least for achievements those have already been wanted for some time)

I think it was done.

2022-10-15 04:23 更新者: lachu
コメント

Reply To cazfi

Reply To lachu

Should be new value generated by server send to each client for city counters, or (perhaps?) only to city owner? Maybe introduce special field, called "publicity" or "visible_other". It could be similar to range, so world, continent, ally, others.

I think we should start by sending them to city owner only - probably some counters are such that other players are not supposed to know them, Visibility ranges are a good idea, but let's leave it to a bit later -> can you open a new ticket?
Can maybe align with other things needing such visibility ranges (at least for achievements those have already been wanted for some time)

It may require https://osdn.net/projects/freeciv/ticket/45489 . If you prefer, I will rebase it on master.

2022-10-15 10:08 更新者: cazfi
コメント

Reply To lachu

It may require https://osdn.net/projects/freeciv/ticket/45489 . If you prefer, I will rebase it on master.

It applies as is.

- handle_city_update_counter() needs function header
- handle_city_update_counter() should check also against negative 'counter'
- It doesn't make much sense to implement sending inside part of the code specific to the one counter we have (updated at turn change). You should probably make a separate (server side) function to update a city counter, which would then take care of sending info to client side too
- "if (is_human(pplayer) && NULL != pplayer->current_conn) {" breaks a lot of things, e.g., clients observing AI players, and latter part also global observers
- "send_packet_city_update_counter(pplayer->current_conn, &packet);" - send to player's all connections (including observers), not just to controlling connection; use "lsend_...(pplayer->connections...)"
- Send the info to global observers too. The "game.glob_observers" should cover them, though most parts of server still(?) do more cumbersome iteration over all connections and sending individually to each of them being a global observer

2022-10-15 10:16 更新者: cazfi
コメント

Also, it doesn't compile. Is the packet definition still older than #45567, which has been in for over a month?

2022-10-16 00:44 更新者: lachu
コメント

Reply To cazfi

Reply To lachu

It may require https://osdn.net/projects/freeciv/ticket/45489 . If you prefer, I will rebase it on master.

It applies as is. - handle_city_update_counter() needs function header
- handle_city_update_counter() should check also against negative 'counter'
- It doesn't make much sense to implement sending inside part of the code specific to the one counter we have (updated at turn change). You should probably make a separate (server side) function to update a city counter, which would then take care of sending info to client side too
- "if (is_human(pplayer) && NULL != pplayer->current_conn) {" breaks a lot of things, e.g., clients observing AI players, and latter part also global observers
- "send_packet_city_update_counter(pplayer->current_conn, &packet);" - send to player's all connections (including observers), not just to controlling connection; use "lsend_...(pplayer->connections...)"
- Send the info to global observers too. The "game.glob_observers" should cover them, though most parts of server still(?) do more cumbersome iteration over all connections and sending individually to each of them being a global observer

Rebased on master, so it should compile now. I also add per-client update_city_dialog_information/description for future usage (currently, we update only on end of turn, but maybe it should be added).

2022-10-17 20:01 更新者: cazfi
コメント

- Send the info to global observers too.

- This part seems still to be missing?
- 'git diff' shows trailing spaces on the empty line between "pcity->counter_valuescounter = packet->value;" and "update_city_description(pcity);"

Otherwise I guess this is something to improve iteratively on later tickets, and should itself to go in enable people to use (= test) the feature.

2022-10-17 21:32 更新者: lachu
コメント

Reply To cazfi

- Send the info to global observers too.

- This part seems still to be missing?
- 'git diff' shows trailing spaces on the empty line between "pcity->counter_valuescounter = packet->value;" and "update_city_description(pcity);"
Otherwise I guess this is something to improve iteratively on later tickets, and should itself to go in enable people to use (= test) the feature.

2022-10-17 21:30 Updated by: lachu

File 0001-OSDN-TICKET-45429-S-awomir-Lach-slawek-lach.art.pl.patch (File ID: 10617) is attached

Sorry for I missed something you told. Space was removed and I add sending counter value to global observers instruction into routine responsible for sending this info to city owner's.

2022-10-20 07:27 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
2022-10-22 13:17 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

添付ファイルリスト

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする