fix: properly extract kick messages from downstream services
Motivation
When players are kicked from e.g. a Lobby service, the message the Lobby kicked them with is lost. This is a problem when having issues with version mismatches or plugins kicking someone from a fallback as the kick message is lost there too.
Modification
When getting kicked from a service and no other fallback is available the player will be kicked with the kick message of the downstream service. If there is no kick message, the newly introduced "server-kick-no-other-hub" message will be used.
Also if a player joins and there is no fallback and the "proxy-join-disconnect-because-no-hub" is not set to null, the player will be disconnected with the set message. If the message is not set, cloudnet won't do anything. This ensures that other plugins can overwrite the decision.
Result
Kick reasons are properly displayed.
Test Results
48 files ±0 48 suites ±0 1m 40s ⏱️ +6s 432 tests ±0 432 ✅ ±0 0 💤 ±0 0 ❌ ±0 763 runs ±0 763 ✅ ±0 0 💤 ±0 0 ❌ ±0
Results for commit 4ea6bfe0. ± Comparison against base commit 1c96cfb6.
This pull request removes 34 and adds 34 tests. Note that renamed tests count towards both.
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"insane":"!","hello":"world","this":"is"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-03-01
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 11:57:41.277541977
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 11:57:41.280720656Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 11:57:41.280746675Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 11:57:41.280769678+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 11:57:41.280786860-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-03-01T11:57:41.280919619
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-03-01T11:57:41.281105277Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-03-01T11:57:41.271596711Z
…
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"this":"is","insane":"!","hello":"world"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-04-01
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 08:51:07.053805807
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 08:51:07.055079597Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 08:51:07.055105155Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 08:51:07.055132556+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 08:51:07.055150931-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-04-01T08:51:07.055272518
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-04-01T08:51:07.055405457Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-04-01T08:51:07.045310967Z
…
:recycle: This comment has been updated with latest results.
I ask the developers to fix this problem as soon as possible and add this Pull because plugins on punishment, like LibertyBans and LiteBans outside the proxy system, don't work because of it. LibertyBans 100% does not work. Other plugins on my servers that kick players with a reason don't work either, there are conflicts with messages from CloudNet, for example “proxy-join-disconnect-because-no-hub” in Bridge. If some plugin outside the proxy tries to ban/kick or send a message to the client, the message “proxy-join-disconnect-because-no-hub” will appear or in some cases account lockout may not happen.
I don't understand how to make my server support bans/kicks without spending money on my Cloudnet plugin to fix such a serious incompatibility issue with other plugins. That said, I don't want to give up Cloudnet for this. Hopefully the problem will be resolved.