Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send bombardment combat when targets are visible #2363

Merged

Conversation

lmoureaux
Copy link
Contributor

Bombarding cities was very powerful because it was showing every unit inside the city, something only diplomats and spies can normally do. Stop sending this around.

@lmoureaux
Copy link
Contributor Author

Note that with this PR, there won't be any animation when bombarding.

@hugomflavio
Copy link
Contributor

hugomflavio commented Sep 7, 2024

With this PR I don't see an animation when bombarding a city, but I still get a message for each unit bombarded inside the city, so that information is still leaking through?

image

edit: Confirmed even with a newly created server.

@lmoureaux
Copy link
Contributor Author

I didn't touch messages because they are handled in #2362

@hugomflavio
Copy link
Contributor

but shouldn't these messages not be triggered if the server isn't sending the information to anyone but the defender? If the attacker receives this information, then the attacker can hack the client to make it visible.

@lmoureaux
Copy link
Contributor Author

The messages are created and sent by the server and the client only displays them. I think your PR already removes them

@hugomflavio
Copy link
Contributor

ooooh ok, my bad

@@ -3592,7 +3606,8 @@ static void see_combat(struct unit *pattacker, struct unit *pdefender)
Send combat info to players.
*/
static void send_combat(struct unit *pattacker, struct unit *pdefender,
int att_veteran, int def_veteran, int bombard)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've removed int bombard but #2362 needs it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the only compatibility issue between the two PRs - as far as I can tell

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see that #2362 uses this to not route bombardment towards the combat HUD. We may need to have a discussion about the client-side display of bombardment before we merge.

@lmoureaux lmoureaux force-pushed the bugfix/bombard-sees-inside-cities branch from 7a72b5c to 4aceed4 Compare September 8, 2024 02:32
Newly added packets shouldn't be sent to old clients. In order to permit
adding new packets, add the possibility to send a packet only when a
capability is available. The packet is silently ignored otherwise.

This is needed to add a packet for bombardment information.
@lmoureaux lmoureaux force-pushed the bugfix/bombard-sees-inside-cities branch from 4aceed4 to 4d9312a Compare September 8, 2024 02:35
This will allow reusing it to display bombardment.
Bombarding cities was very powerful because it was showing every unit
inside the city, something only diplomats and spies can normally do.
Stop sending this around.

Bombing a tile no longer shows every unit on the tile being bombarded
individually. Instead, an explosion is shown on top of the tile without
more information. This required adding a dedicated packet.
@lmoureaux lmoureaux force-pushed the bugfix/bombard-sees-inside-cities branch from 4d9312a to 461585a Compare September 8, 2024 02:43
@hugomflavio
Copy link
Contributor

Tested: Player C experience when player A bombs player B, both for a unit stack sitting outside and for units inside a city.
Confirmed that player C only sees one explosion - both for stacks and cities. No battle pop-up appeared.
client 3.1 with server 3.1
Note: Player A received 1 message per unit hit, but that's fixed by #2368

@hugomflavio
Copy link
Contributor

Tested: New server with both old and new client.

When the new client bombards:
New client sees a single explosion, gets a message for each unit attacked. no popup.
Old client sees nothing at all.
Both for cities and unit stacks.

When the old client bombards:
New client sees a single explosion, gets no message/popup.
Old client does not see an explosion, but gets a message for each unit attacked. no popup.
Both for cities and unit stacks

@hugomflavio
Copy link
Contributor

Just noticed one of the client (or both) were complaining about

[critical] freeciv21-client - Assertion nullptr != pplayer failed                                                  
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues  

I'll have to run them on separate consoles to see who's complaining.

Currently running the old server with the two clients and noticing a lot more of those than before.

@hugomflavio
Copy link
Contributor

hugomflavio commented Sep 8, 2024

Testing: Old server with both new and old clients

When new client bombards:
Both clients receive battle pop-ups
Both clients see the unit sprites being bombarded
Only attacker received messages
Same for cities and units.

When the old client bombards:
Both clients receive battle pop-ups
Both clients see the unit sprites being bombarded
Only attacker received messages
Same for cities and units.

Again, some of these popped up every now and again, but didn't appear to affect the game

[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues

@hugomflavio
Copy link
Contributor

On the PR client, destroying a city caused this:

[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues
[critical] freeciv21-client - Assertion nullptr != pplayer failed
[critical] freeciv21-client - Please report this message at https://github.com/longturn/freeciv21/issues

Bombarding is not related.

However, this only happened for the first city that was destroyed... Destroying other cities did not bring those up again.

The old client destroying a city of another nation didn't cause this either.

Old client didn't show assertion errors at all.

@hugomflavio
Copy link
Contributor

hugomflavio commented Sep 8, 2024

nevermind, the master client can pop up the same kind of assertion errors too. Happened when destroying a city as well. It happened after I disconnected and reconnected the new client - maybe related?

Disconnecting and reconnecting both clients and then destroying a city with the old client didn't cause any warnings. Not clear what is behind this - but it does not seem related to the bombard updates.

@hugomflavio hugomflavio merged commit 08b407f into longturn:master Sep 8, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants