Git Product home page Git Product logo

Comments (15)

Outfluencer avatar Outfluencer commented on June 27, 2024

@md-5 Is there a reason we don't call the event at this point?
I also noticed that the event is not always called (if the server is closed for example). And that's why fallback plugins don't always work properly on BungeeCord

from bungeecord.

md-5 avatar md-5 commented on June 27, 2024

If there's actually a kick it should be called

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

Yes there is no kick i have read your old comments on old prs, but what do we do? how can we handle it so the player does not get disconnected from the proxy

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

I am also a bit confused if i kill the backend server, the first event called is the PlayerDisconnectEvent and the handlerboss first closes the players connection and after that the connection to the server.And than the ServerDisconnectEvent is called

Shoulnt it be the other way around?

https://outfluencer.dev/data/bungeelog.txt

for contect bungee is on 25577 backend on 25565

from bungeecord.

md-5 avatar md-5 commented on June 27, 2024

If there's no kick then a different event should be used and this bug is invalid.

Wouldn't the event be ServerDisconnectEvent?

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

yes but you cant cancel the disconnection of the player

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

look into my log please the PlayerDisconnectEvent is called before the ServerDisconnectEvent
and the handlerboss has instantly marked the connection from the player as closed

Edit:
I printed the executed events in the logs
also i printed channelInactive of HandlerBoss

Edit of edit:
ignore that it was bullshit

from bungeecord.

Elikill58 avatar Elikill58 commented on June 27, 2024

If there's actually a kick it should be called

In fact, it's not a kick by the code, but a kick by the force connection closed with the backend server.

It's not a basic move or basic disconnect, so it more apply to kick, and that would be helpful for more compatibility with waterfall users and less dev for you to use the ServerKickEvent

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

If there's actually a kick it should be called

In fact, it's not a kick by the code, but a kick by the force connection closed with the backend server.

It's not a basic move or basic disconnect, so it more apply to kick, and that would be helpful for more compatibility with waterfall users and less dev for you to use the ServerKickEvent

nvm i think i was just stupid and dont understand what actually happend

You need to put the priorities inyou bungeecord config.

If en exception is thrown it will send the player to one of the specified server. if we get a kick the ServerKickEvent is called

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

@md-5 i made a test spigot plugin to show the exact problem

This is the bukkit code. I close the connection without kicking the player

@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
    CraftPlayer player = (CraftPlayer) event.getPlayer();
    player.getHandle().playerConnection.networkManager.channel.close();
}

this will only call the disconnected(ChannelWrapper channel) method in the DownstreamBridge of BungeeCord

THE PROBLEM IS THAT:
server.isObsolete() returns false and BungeeCord handels it like this

if ( !server.isObsolete() )
{
    con.disconnect( bungee.getTranslation( "lost_connection" ) );
}

ServerDisconnectEvent serverDisconnectEvent = new ServerDisconnectEvent( con, server.getInfo() );
bungee.getPluginManager().callEvent( serverDisconnectEvent );

It closes the connection of the player without calling any events before it (i printed all events) here:

11:48:28 [INFORMATION] ChatEvent(super=TargetedEvent(sender=Outfluencer, receiver=net.md_5.bungee.ServerConnection@5ec7547f), cancelled=false, message=gf)

11:48:28 [INFORMATION] localhost/127.0.0.1:25565 [frame-decoder, decompress, packet-decoder, timeout, frame-prepender, compress, packet-encoder, inbound-boss, DefaultChannelPipeline$TailContext#0]

11:48:28 [INFORMATION] MinecraftDecoder channelInactive GAME false

11:48:28 [INFORMATION] inactive localhost/127.0.0.1:25565 -> ChannelHandlerContext(inbound-boss, [id: 0x99867119, L:/127.0.0.1:57169 ! R:localhost/127.0.0.1:25565])

11:48:28 [INFORMATION] disconnect !server.isObsolete()

11:48:28 [INFORMATION] [Outfluencer] disconnected with: Proxy lost connection to server.

so you cant cancel the disconnection of the player by any chance

We would need to call the ServerDisconnectEvent before

we execute this code

if ( !server.isObsolete() )
{
    con.disconnect( bungee.getTranslation( "lost_connection" ) );
}

and add a way to cancel the disconnection

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

@Elikill58 i hope #3696 will help you out

from bungeecord.

Elikill58 avatar Elikill58 commented on June 27, 2024

@Elikill58 i hope #3696 will help you out

So, with that, I should simply set the reconnect server ?

Also, why doesn't simply call the kick event as waterfall did ?

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

because we do not receive a Kick packet from the backend and we already have a fallback functionality with priorities in bungeecord that we can use. (what i did in my pr)

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

@Elikill58 i hope #3696 will help you out

So, with that, I should simply set the reconnect server ?

Also, why doesn't simply call the kick event as waterfall did ?

Also waterfall is a fork of bungeecord
It is not our responsibility to adapt to them.

from bungeecord.

Outfluencer avatar Outfluencer commented on June 27, 2024

@Elikill58 i hope #3696 will help you out

So, with that, I should simply set the reconnect server ?

Also, why doesn't simply call the kick event as waterfall did ?

and yes not it searches for the next server to fallback like it should, i looked it ub btw watefall does the same but also calling a server kick event. But you dont need that you can use the ServerDisconnectEvent with this PR

from bungeecord.

Related Issues (20)

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.