Commit 7fdc624
authored
fix: provide fallback when server dies on bungeecord (#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 #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.1 parent 860999f commit 7fdc624
1 file changed
Lines changed: 17 additions & 9 deletions
File tree
- modules/bridge/impl/src/main/java/eu/cloudnetservice/modules/bridge/impl/platform/bungeecord
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| |||
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
156 | 164 | | |
157 | 165 | | |
158 | 166 | | |
| |||
0 commit comments