Skip to content

fix: properly extract kick messages from downstream services#1399

Merged
derklaro merged 10 commits intonightlyfrom
fix/kick-messages
Apr 1, 2025
Merged

fix: properly extract kick messages from downstream services#1399
derklaro merged 10 commits intonightlyfrom
fix/kick-messages

Conversation

@0utplay
Copy link
Member

@0utplay 0utplay commented May 16, 2024

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.

@0utplay 0utplay added v: 4.X This pull should be included in the 4.0 release t: fix A pull request introducing a fix for a bug. in: module An issue/pull request releated to one of the internal modules labels May 16, 2024
@0utplay 0utplay added this to the 4.0.0-RC11 milestone May 16, 2024
@github-actions
Copy link

github-actions bot commented May 16, 2024

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 4ea6bfe. ± Comparison against base commit 1c96cfb.

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
…

♻️ This comment has been updated with latest results.

@derklaro derklaro modified the milestones: 4.0.0-RC11, 4.0.0-RC12 Oct 10, 2024
@Dangles
Copy link

Dangles commented Jan 29, 2025

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.

@0utplay 0utplay requested a review from derklaro February 22, 2025 19:01
@0utplay 0utplay self-assigned this Feb 22, 2025
@derklaro derklaro merged commit 860999f into nightly Apr 1, 2025
5 checks passed
@derklaro derklaro deleted the fix/kick-messages branch April 1, 2025 08:59
0utplay pushed a commit that referenced this pull request Apr 1, 2025
### Motivation
Currently, when a server unexpectedly closes the connection to the
proxy, the player gets disconnected as CloudNet does not provide a
fallback server. This is due to the fact that the ServerKickEvent is
only called when the server sends a kick packet. In case the server goes
down, BungeeCord tries to connect the player to the first priority (in
our case a dummy `lobby` server as BungeeCord won't start without a
priority) with the connection reason `SERVER_DOWN_REDIRECT`. We can
catch this reason and provide a proper fallback in `ServerConnectEvent`.

### Modification
Catch the `SERVER_DOWN_REDIRECT` reason in `ServerConnectEvent` and
provide a proper fallback. If no fallback is available, disconnect the
player with the new disconnection reason introduced in #1399.

### Result
Players will be provided with a proper fallback in case of an unexpected
connection close by the downstream service instead of being
disconnected.
GiantTreeLP pushed a commit to GiantTreeLP/CloudNet that referenced this pull request Jun 7, 2025
…Service#1399)

### 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.

### Result
Kick reasons are properly usable in disconnect messages.

---------

Co-authored-by: Pasqual Koschmieder <git@derklaro.dev>
GiantTreeLP pushed a commit to GiantTreeLP/CloudNet that referenced this pull request Jun 7, 2025
…#1602)

### Motivation
Currently, when a server unexpectedly closes the connection to the
proxy, the player gets disconnected as CloudNet does not provide a
fallback server. This is due to the fact that the ServerKickEvent is
only called when the server sends a kick packet. In case the server goes
down, BungeeCord tries to connect the player to the first priority (in
our case a dummy `lobby` server as BungeeCord won't start without a
priority) with the connection reason `SERVER_DOWN_REDIRECT`. We can
catch this reason and provide a proper fallback in `ServerConnectEvent`.

### Modification
Catch the `SERVER_DOWN_REDIRECT` reason in `ServerConnectEvent` and
provide a proper fallback. If no fallback is available, disconnect the
player with the new disconnection reason introduced in CloudNetService#1399.

### Result
Players will be provided with a proper fallback in case of an unexpected
connection close by the downstream service instead of being
disconnected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: module An issue/pull request releated to one of the internal modules t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants