Commit 3239eed
authored
feat: replace [pin] on initial kick and fix pinCheck boot warning (#33)
* feat: replace [pin] on initial kick and fix pinCheck boot warning
Listen to PlayerBannedEvent on all 6 platforms to call handlePin when a
kickMessage is present, enabling [pin] replacement on the first kick of
an online player (not just reconnect denial).
Change ExpiresSync from extends BmRunnable to implements Runnable to
eliminate the spurious "unknown last checked pinCheck" log on every boot.
Add e2e tests verifying the kick message contains a 6-digit pin when
banning/tempbanning an online player. Add waitForKick() helper to
TestBot with proper listener cleanup and race-safe settlement.
* fix: add [pin] placeholder to ban/tempban kick message templates
The e2e message configs only had [pin] in the disallowed (reconnect
denial) templates but not in the kick (online player) templates,
causing the Online Kick Pin tests to fail.
* fix: improve e2e test resilience for kick and denial tests
- Handle NBT compound chat components in kick reasons (Paper 1.20.5+)
- Add delay in waitForKick end handler to avoid socketClosed race
- Increase denial retry attempts and sleeps for async ban persistence
- Disconnect bot before unban in afterEach to avoid stale kick on reconnect
* fix: prevent stale SNAPSHOT dependencies in CI
- Add --refresh-dependencies to build step to force fresh SNAPSHOT resolution
- Use run_id in Loom cache key to prevent serving stale remapped dependency JARs
* fix: compile against BanManager from source and clean up bot on kick
- Checkout BanManager and publishToMavenLocal in both CI workflows so
WebEnhancer always compiles against the latest API (Fabric Stonecutter
artifacts are not reliably published to Maven Central snapshots)
- Clean up mineflayer bot (removeAllListeners + end) on kick/error during
connect() and waitForKick() to prevent physics timers running after
Jest teardown
* fix: force fresh BanManager dependency resolution and await bot cleanup
- Clear BanManager artifacts from Gradle and Loom caches before build
so publishToMavenLocal takes priority over stale cached SNAPSHOTs
- Add --refresh-dependencies to Gradle build commands to bypass
dependency resolution cache entirely
- Wait for mineflayer 'end' event before resolving waitForKick() and
connect() cleanup, so the physics timer is cleared before Jest
teardown begins (prevents prismarine-physics ReferenceError)
- Stop calling removeAllListeners() before bot.end() which stripped
mineflayer's internal cleanup handlers
* chore: bump version to 7.11.0-SNAPSHOT to match BanManager
* fix: remove --refresh-dependencies from Fabric remapJar step to avoid OOM
Dependencies are already freshly resolved by the preceding build step.
The redundant --refresh-dependencies on the memory-intensive Loom
remapping step caused OutOfMemoryError.
* fix: improve denied-pin test cleanup and timing for Fabric
- Clear both permanent and temp bans in afterEach (bmunban + bmuntempban)
- Disconnect bot before unban to avoid stale state
- Add 2s sleep after cleanup for async processing to settle
- Increase sleep after bmtempban from 3s to 5s for Fabric enforcement lag
* fix: use short connect timeout in denied connection checks
On Fabric 1.21.4, tempbanned players sometimes enter a limbo state
(connected but neither spawned nor kicked) consuming the full 30s
connect timeout per attempt. Use a 10s timeout with 8 retries instead,
and increase the test timeout to 120s for headroom.1 parent 5a592d9 commit 3239eed
18 files changed
Lines changed: 309 additions & 44 deletions
File tree
- .github/workflows
- bukkit/src/main/java/me/confuser/banmanager/webenhancer/bukkit/listeners
- bungee/src/main/java/me/confuser/banmanager/webenhancer/bungee/listeners
- common/src/main/java/me/confuser/banmanager/webenhancer/common/runnables
- e2e
- platforms
- bukkit/configs/banmanager
- bungee/configs/banmanager
- fabric/configs/banmanager
- sponge7/configs/banmanager
- sponge/configs/banmanager
- velocity/configs/banmanager
- tests/src
- helpers
- fabric/src/main/java/me/confuser/banmanager/webenhancer/fabric/listeners
- sponge-api7/src/main/java/me/confuser/banmanager/webenhancer/sponge/listeners
- sponge/src/main/java/me/confuser/banmanager/webenhancer/sponge/listeners
- velocity/src/main/java/me/confuser/banmanager/webenhancer/velocity/listener
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
53 | 68 | | |
54 | 69 | | |
55 | 70 | | |
56 | | - | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
| |||
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
174 | | - | |
| 183 | + | |
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
0 commit comments