CloudNetService / CloudNet

A modern application that can dynamically and easily deliver Minecraft oriented software
https://cloudnetservice.eu
Apache License 2.0
367 stars 115 forks source link

fix: properly extract kick messages from downstream services #1399

Open 0utplay opened 1 month ago

0utplay commented 1 month ago

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.

github-actions[bot] commented 1 month ago

Test Results

 47 files  ±0   47 suites  ±0   1m 33s :stopwatch: +5s 395 tests ±0  395 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  726 runs  ±0  726 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit 4603add3. ± Comparison against base commit 3e594152.

This pull request removes 23 and adds 23 tests. Note that renamed tests count towards both. ``` eu.cloudnetservice.driver.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","hello":"world","insane":"!"}}, PRETTY eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [10] 23967, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [23] 2024-04-30T16:32:20.774212185Z eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [24] 2024-04-30T16:24:00.774216353Z eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] XR0PG9HU2WB39113D5YO5WZSG, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [38] 2024-04-30 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] -2075990072, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:39e282e6-7c59-4201-b6ae-2b004b744d3d eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [47] 16:32:20.774405716 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] -5370570321487156996, null … ``` ``` eu.cloudnetservice.driver.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.network.rpc.object.DefaultObjectMapperTest ‑ [10] 26992, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [23] 2024-05-16T14:19:40.186573265Z eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [24] 2024-05-16T14:11:20.186577744Z eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] T06WBEXOIOW1VD0P1MGTVB5L1, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [38] 2024-05-16 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] 1999253207, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:8ebe5e09-7cf7-4812-af87-dfa58dafe2e3 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [47] 14:19:40.186847875 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] -7637708601134030526, null … ```