Giter Site home page Giter Site logo

4drian3d / kickredirect Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 5.0 501 KB

Redirect your players to a server after a server shutdown

Home Page: https://modrinth.com/plugin/kickredirect

License: GNU General Public License v3.0

Java 100.00%
java minecraft minecraft-plugin plugin velocity velocity-plugin velocitypowered

kickredirect's Introduction

Hi, I'm 4drian3d

  • โ˜• Java and Kotlin Developer
  • ๐Ÿ“— Knowledge of Velocity API, Paper API, Sponge API and more

I'm mostly known for making a bunch of Velocity plugins, a few for Paper and others cross-platform

All my plugins are available at Modrinth

Modrinth

My stats

GitHub stats

kickredirect's People

Contributors

4drian3d avatar powercasgamer avatar renovate[bot] avatar sliman4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kickredirect's Issues

Unable to make it redirect

I have a bit of an issue that my players get kicked out no matter what message try to set whitelist to blacklist but that didn't help:
My config:

# KickRedirect | by 4drian3d

# Sets whether to perform whitelist or blacklist detectionAvailable options:
# WHITELIST: It will check if the expulsion string contains any of this strings
# BLACKLIST: It will check if the expulsion string not contains any of this strings
check-mode=WHITELIST
# Enables debug mode
debug=true
# Sets the priority of the main KickRedirect listener.
# This may solve compatibility issues with other plugins.
# Available Values: EARLY, FIRST, NORMAL, LATE
listener-priority=LATE
# Set the messages to be checked by blacklist or whitelist in case they are present in the expulsion message
messages-to-check=[
    "Server closed",
    "kicked from server",
    "Server closed",
    "Your connection to survival encountered a problem",
    shutdown,
    restart,
    closed,
    "server closed"
]
# Sets the limit of times the random server will be calculated to send in case the sending mode is RANDOM
random-attempts=5
# Redirect the player if the expulsion message is null or empty
redirect-on-null-message=true
# Sets the sending modeAvailable options:
# TO_FIRST | It will send the player to the first available server configured in serversToRedirect
# TO_EMPTIEST_SERVER | Send the player to the emptiest server that is available according to the serversToRedirect configuration
# RANDOM | Send to a random server from the configured servers
send-mode="TO_FIRST"
# Sets the list of available servers to forward to the player
# Depending on the configuration of sendMode it will be sent to one server or another
servers-to-redirect=[
    lobby
]

My debug info:

[21:23:54] [Netty epoll Worker #4/INFO] [com.velocitypowered.proxy.connection.client.ConnectedPlayer]: [connected player] artuditu (/XX.XX.XXX.XX:XXXXX): kicked from server survival: Server closed
[21:23:54] [Netty epoll Worker #4/INFO] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] artuditu -> survival has disconnected
[21:23:54] [Velocity Async Event Executor - #2/INFO] [kickredirect]: ----- INITIAL DEBUG ----- 
 Player: artuditu
 Server: lobby
 Kick Reason: Server closed
 Kicked in Server Connect: false
 Calculated result: com.velocitypowered.api.event.player.KickedFromServerEvent$RedirectPlayer
 Step: AVAILABLE_SERVER
[21:23:54] [Velocity Async Event Executor - #2/INFO] [kickredirect]: ----- FINAL DEBUG -----
 Player: artuditu
 Server: lobby
 Kick Reason: Server closed
 Kicked in Server Connect: false
 Final Event Result: com.velocitypowered.api.event.player.KickedFromServerEvent$RedirectPlayer
 Step: AVAILABLE_SERVER

Please note that I am kicked from survival server.

Servers white/black list

I suggest adding a whitelist/blacklist option for servers as well. That is, if:

  • e.g. the "lobby" server is blacklisted, a kicked player from the lobby server will not be redirected to the servers-to-redirect, but completely kicked out of the server.
  • e.g. the "survival" server is whitelisted, a kicked player from the survival server will be redirected to the servers-to-redirect

Use a higher priority on KickedFromServerEvent

Currently, the plugin uses the EARLY priority level. This can cause conflicts with utility plugins that implement a similar feature but intentionally use EARLY so they can be overridden. Considering that this plugin has no other use than redirecting players after kick, it would be IMO better to use NORMAL or even LATE.

Infinite reconnection loop in `TO_FIRST` mode when all `servers-to-redirect` are down

I have servers-to-redirect=["lobby"] in config and when I restart the lobby, console immediately becomes red. I think it should just kick the players if no server is available.

[20:17:45 ERROR]: Exception during connect; status = null
java.util.concurrent.CompletionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:25567
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347) ~[?:?]
        at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:874) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:25567
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
        at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.unix.Socket.finishConnect(Socket.java:320) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:470) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        ... 4 more
[20:17:45 ERROR]: [connected player] Sliman4 (/m.y.i.p:48158): unable to connect to server lobby
io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:25567
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
        at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.unix.Socket.finishConnect(Socket.java:320) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:470) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-proxy-3.1.2-SNAPSHOT-all.jar:3.1.2-SNAPSHOT (git-3ae93875-bunknown)]
        at java.lang.Thread.run(Thread.java:833) [?:?]

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-java v4
  • nick-invision/retry v3.0.0
  • actions/upload-artifact v4
gradle
gradle.properties
settings.gradle.kts
  • org.gradle.toolchains.foojay-resolver-convention 0.8.0
build.gradle.kts
  • org.junit:junit-bom 5.10.2
gradle/libs.versions.toml
  • com.velocitypowered:velocity-api 3.3.0-SNAPSHOT
  • org.bstats:bstats-velocity 3.0.2
  • org.spongepowered:configurate-hocon 4.1.2
  • io.github.miniplaceholders:miniplaceholders-api 2.2.3
  • org.slf4j:slf4j-api 2.0.12
  • org.assertj:assertj-core 3.25.3
  • org.mockito:mockito-core 5.10.0
  • net.kyori.blossom 2.1.0
  • com.github.johnrengelman.shadow 8.1.1
  • xyz.jpenilla.run-velocity 2.2.3
  • org.jetbrains.gradle.plugin.idea-ext 1.1.7
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.6

  • Check this box to trigger a request for Renovate to run again on this repository

Message-to-check ignorecase

I suggest that the message-to-check function ignores case.
When, for example, in the configuration I set the message to "opening the server", and the content of the kick is "Opening the server", the plugin will interpret it as the value set in the configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.