HUD/hudbars: Do not send useless HUDCHANGE packets #122
No reviewers
Labels
No Label
blocker
bug
code quality
confirmed
critical
discussion
high priority
incompatibility
incomplete feature
invalid
low priority
missing feauture
needs testing
packet spam
performance
project
regression
translations
unconfirmed
in review
ready for review
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Depends on
#123 Add script to show packets count from client logs
Mineclonia/Mineclonia
Reference: Mineclonia/Mineclonia#122
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix-hudchange-spam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
TRACKING ISSUE: #111
Minetest servers running Mineclonia send HUDCHANGE packets to each client to hide or show HUD bars several times a second, even when the HUD bar visibility did not change.
Solution
HUD bar state of a client is already cached on the server.
With this PR, when the visibility of a HUD bar does not change, no HUDCHANGE packet is sent.
Details
The patch was taken from the hudbars mod by Wuzzy:
https://repo.or.cz/minetest_hudbars.git/commitdiff/a44de6230bcde79b78749bc6024a5ee8614bc6c0
Testing Steps
Verify Bug
c1cf50ae15
.timeout 600 minetest --info >log1.txt 2>&1 >/dev/null
.packetspam
../tools/analyze-packet-spam <log1.txt
.PACKET_COUNT_TOCLIENT_HUDCHANGE
in the output of the previous step starts with a number over 50.Verify Patch
280aed484c
.timeout 600 minetest --info >log2.txt 2>&1 >/dev/null
.packetspam
../tools/analyze-packet-spam <log2.txt
.PACKET_COUNT_TOCLIENT_HUDCHANGE
in the output of the previous step starts with a number less than 10.To do
WIP: HUD/hudbars: Do not send useless HUDCHANGE packetsto HUD/hudbars: Do not send useless HUDCHANGE packetsHUD/hudbars: Do not send useless HUDCHANGE packetsto WIP: HUD/hudbars: Do not send useless HUDCHANGE packetsThis PR will be rebased once #123 is merged.
51d7d8e133
to280aed484c
Rebased.
WIP: HUD/hudbars: Do not send useless HUDCHANGE packetsto HUD/hudbars: Do not send useless HUDCHANGE packetsI've tested this - a number of times but 21 keeps failing
"Verify that the breath bar is invisible a short time after it has been recharged outside the water."
it is invisible as soon as it's reachared (I don't even see the last bubble full), there is no delay neither in
c1cf50ae15
nor in280aed484c
.I'm not sure why this is even part of the testing (a supposed delay after recharge). I'm also not sure why its necessary to repeat all the preparation steps from verify bug in the verify fix part (creating world, giving yourself armor) - with copy and paste being so bad in minetest I think it would be good to make testers do as little /give's as possible (unless there is some reason for it i don't see).
verify bug
c1cf50ae15
.This failed - it is invisible immediately upon recharge (you dont even see the last bubble full)
Verify fix
Checkout Mineclonia commit
280aed484c
.In Bourne shell, run Minetest with timeout 600 minetest --info >log2.txt 2>&1 >/dev/null.
Create a new world with mapgen v7 and the seed packetspam.
Enter the world in survival mode with damage turned on.
In the chat/terminal, execute the following commands:
/grantme give
/giveme mcl_armor:helmet_iron
/giveme mcl_armor:chestplate_iron
/giveme mcl_armor:leggings_iron
/giveme mcl_armor:boots_iron
Verify that you have the following items in your inventory:
1 iron helmet
1 iron chestplate
1 iron leggings
1 iron boots
Verify that the armor bar is not visible.
Verify that the breath bar is not visible.
Open the inventory screen.
Put on the pieces of armor one by one by moving them from the inventory to the appropriate armor slot.
Verify that the armor bar shows more armor points the more armor you put on.
Verify that the armor bar is visible as soon as you put on the first piece of armor.
Take off the pieces of armor one by one by moving them from the appropriate armor slot to the inventory.
Verify that the armor bar shows less armor points the more armor you take off.
Verify that the armor bar is not visible as soon as you take off the last piece of armor.
Dive into the water.
Swim down, wait about 2 seconds, then swim to the surface again.
Go on the land.
Verify that the breath bar is visible a short time after the player character is fully below the surface of the water.
Verify that as long as the player character is fully below the surface of the water, the breath bar shows a decreasing amount of breath bubbles.
[] Verify that the breath bar is invisible a short time after it has been recharged outside the water.
(same as in verify bug, no delay)
Wait until Minetest exits (about 10 minutes after it was started).
In Bourne shell, execute ./tools/analyze-packet-spam <log2.txt.
Verify that the line ending with PACKET_COUNT_TOCLIENT_HUDCHANGE in the output of the previous step starts with a number less than 10.
Include the number of the previous step in the testing protocol : .1
I think this is a perfect example of being overly specific - the delay is not what we are testing here and indeed neither the code suggests it should have anything to do with it nor does the behavior noticeably change between with and without the fix.
I will still approve it but i think this is less than ideal.
There is no delay on clamity or mcl5 either btw. I think this is a mistake.
@cora oh, you are right, there is no last bubble. I was overly specific when writing it and the delay is not what we should test here for. Sorry for that. :/
@cora you are also right that I should have not made testers (i.e. you) go through the motions twice. I apologize, please forgive me.
I was really lazy and copied the whole instructions, then changed some minor details like the commit.
Please forgive me.