#waterfall-dev

1 messages · Page 17 of 1

wide maple
#

If you have a custom bungee fork you can probably re-base your changes on waterfall and create a patch from them

tame sparrow
#

Is it possible/okay to run blocking code (up to 100 ms) for a ServerKickEvent?
As I want to make to make it so when someone get kicked, it will grab a fallback server from a remote service, to kick redirect the user towards that server

wide maple
#

Should be fine, but I wouldn’t delay it much longer

sage crypt
#

i'm writing a bungeecord plugin and trying to run it on a waterfall server. it loads properly, but none of the events appear to be working. i'm reasonably certain that i've followed the instructions detailed here accurately

https://www.spigotmc.org/wiki/event-api/

but it still doesn't respond to any events whatsoever.

  1. I have a class that extends Listener (from the net.md_5.bungee.api.plugin package)
  2. This class has methods in it that take events as parameters, and have @EventHandler annotations above their method headers
  3. In the onEnable method in my plugin's main class, i register the listener class mentioned above

i'm really not sure why this isn't working. i've put print statements inside of the onEnable method, and they all show -- so the plugin is getting loaded and its onEnable method is being called. yet none of the events work

#

please let me know if this is more appropriate for the #waterfall-help channel

chilly coral
wide maple
#

Can do in a few

trail plume
#

You've not really given us anything to go off and I generally don't like tryna drag info out of people or pissing in the wind

eager hill
#

I assume importing net.md_5.bungee.connection.InitialHandler, when using the Waterfall API, is disabled for a reason?

trail plume
#

it's not API

eager hill
#

Understandable, have a great day.

chilly coral
#

@wide maple, I gave it a try and opened a PR

chilly coral
#

There is no main thread in BungeeCord

chilly coral
trail plume
#

no

sage crypt
#

this is from the event listener

#

this is from the main class's onEnable method

#

the print statements shown in the onEnable method all get printed. none of the event handlers get fired at all, though

#

i have tried building this with the bungeecord API as well as with the waterfall API. neither works

#

i understand that you don't like trying to drag information out of people, but if there's any more information that you need, please ask.

trail plume
#

use the logger, not system.out

#

generally looks fine, can't say, try doing a clean build

sage crypt
#

hasn't changed anything.

trail plume
#

logs?

sage crypt
#

there are no compiling errors and checking the .jar indicates that this class is compiled

#

just a moment.

#

upon connecting, the PostLoginEvent handler should have fired and printed something

trail plume
#

I have no idea, best I could say is maybe look at it through a decompiler and see if everything is there

sage crypt
#

i'll give it a shot. thanks

sage crypt
#

i decompiled it and everything is there. added a constructor in the Events class and put a logger statement there, and it gets printed to the log

#

so the class is definitely compiling and its constructor gets executed; it's just that waterfall isn't recognizing the event handlers for whatever reason

neither does normal bungeecord, for that matter.

trail plume
#

only guess is make sure that you've not somehow thrown bukkit into the classpath and aren't using the wrong annotations or something 🤷‍♂️

sage crypt
outer elbow
#

is waterfall still built with java 8 or something

uneven pendant
#

iirc it isn't

outer elbow
#

huh for some reason it just doesn't like it if i do sender instanceof ProxiedPlayer player but is fine with the older ProxiedPlayer player = (ProxiedPlayer) sender thonk

uneven pendant
#

check your project jdk?

trail plume
#

It is

#

Your project has the lang level set to 8, however, version waterfall is compiled against is irrelevant

outer elbow
#

odd cuz the project and the module are both set to 16

#

even forcing the module to be 16 doesn't work 🤔

shell lagoon
#

Check Settings | Build, Execution, Deployment | Compiler | Java Compiler and make sure the project bytecode version and per-module bytecode versions in there are also set to 16.

outer elbow
#

oh yep for some reason that one module was set to 1.8

shell lagoon
#

Otherwise, check your pom.xml/build.gradle and make sure all of those are set to 16. As well as Settings | Build, Execution, Deployment | Build Tools | Maven | Runner set that JRE to 16 for Maven.

outer elbow
#

i dont recall ever setting that but oh well

#

yeah it works fine now thanks

shell lagoon
#

IJ sets that to some default and then when you update Java suddenly it doesn't work

outer elbow
#

good to know

shell lagoon
#

Should be an option to override that for newly created projects, but I have no idea where that is.

#

Ah, File | New Project Settings | Settings for New Projects...

brazen walrus
#

Waterfall doesn't seem to wait for all tasks to be complete before shutting down, am I doing something wrong or do I have to wait before using end?

#

I have a bunch of tasks started using getProxy().getScheduler().runAsync, if I end the server these tasks aren't executed entirely

#

(it's just a bunch of MySQL queries saving each player logout time, so it's not a big deal but I noticed that most of them are missing when the proxy restarts)

trail plume
#

that's bungee, basically

#

if you want control over your tasks,etc, use a thread pool

brazen walrus
#

I see, and I should just wait for my executor to complete in onDisable()

trail plume
#

yup

wide maple
#

#667 merge pls

random comet
#

Who I gotta creamyeggplant for update

wooden edge
#

How do you merge changes from upstream with a Waterfall fork? I keep running into errors whenever I run ./waterfall p after merging

wide maple
trail plume
#

You should use travertine as a base as then your patches apply over waterfall

chilly coral
trail plume
#

hm?

chilly coral
#

idk, was checking recent bungeecord PRs and found this, made me puzzled

trail plume
#

string concat is often fast especially as, iirc, it's boiled down into a string builder where 'efficient' or something iirc

grave fulcrum
#

With the Configuration class, if I getStringList for a key that doesnt exist, what happens? does it return an empty list?

#

or does it just return null

trail plume
#

you'd need to try it

#

pretty sure it just returns an empty list

grave fulcrum
#

what happens if i ProxyServer.getServerInfo for a server that doesn't exist? does it return null?

trail plume
#

yes

grave fulcrum
#

is there a way to see a ServerInfo's max players

trail plume
#

think there is a ping method which returns the servers ping info

grave fulcrum
#

Turd, it takes a callback. Is there a way to do it synchronously?

trail plume
#

yes, use a future, basically

grave fulcrum
#

Hmm, I've never messed around with concurrency in Java. I hope it functions similarly to how it does in Python since that's where all my experience comes from lol

#

Could you provide an example?

trail plume
#

i mean, really you should use the callback

#

but, if you need it sync, create a completable future, in the callback, complete that future, (make sure to handle the throwable, completeExceptionally), and then outside of the callback you can join on that future or whatever

grave fulcrum
#
            CompletableFuture<ServerPing> completableFuture = new CompletableFuture<>();
            serverInfo.ping((serverPing, exception) -> {
                if (exception != null) {
                    completableFuture.completeExceptionally(exception);
                } else {
                    completableFuture.complete(serverPing);
                }
            });

            ServerPing serverPing;
            try {
                serverPing = completableFuture.get();
            } catch (Exception ignored) {
                continue; // Server didn't respond, or something else went wrong.
            }```
I think that should do it
#

is there a way to see if a player gets kicked from a server they try to connect to

grave fulcrum
#

i want to see if a player gets kicked from a server they are trying to connect to

grave fulcrum
#
                    CompletableFuture<Boolean> serverConnectionFuture = new CompletableFuture<>();
                    player.connect(serverInfo, (status, throwable) -> {
                        if (throwable != null) {
                            serverConnectionFuture.completeExceptionally(throwable);
                        } else {
                            serverConnectionFuture.complete(status);
                        }
                    });
                    boolean connectionStatus = serverConnectionFuture.get();```
whats wrong with the code here? the callback never returns
#

the server ping future works but this one doesnt

trail plume
#

probs because you deadlock the thread i'd guess

#

if that happens in the network code, that will break

#

hence why the callbacks exist

grave fulcrum
#

Hmm

#

Not sure how I'd do this code without waiting on the callback

trail plume
#

You should probs read up on how to use callbacks and such property

#

Properly

#

This feels like you lack the understanding of the concept and are tryna shoot yourself in the foot to avoid it

grave fulcrum
#

I mean

grave fulcrum
#

So yeah thats about it

lean gobletBOT
#

futures are nicer anyways 👀

grave fulcrum
#

#2 on reasons why i hate node.js

#

so is there no other way to query a server to see if its connectable

uneven pendant
#

you can wait for it to time out :p

grave fulcrum
#

wait for what to time out, the connection? that wont happen because the thread is blocked

#

i could do it in a spawned process but it does things that arent thread-safe so thats not gonna happen

uneven pendant
grave fulcrum
#

what if backend servers are configured to reject pings from things that arent the proxy

#

a ping wont tell me if the server will accept attempted connections

grave fulcrum
pulsar remnant
#

@grave fulcrum can you just put the follow-up logic in the callback instead of blocking on a future? your call to .get() at the end will prevent the function from completing, which may stop the connect() call from proceeding as well depending on how it's implemented.

grave fulcrum
#

i have another solution now

pulsar remnant
#

typically you want like a 'trampoline' model where you do a deferred dispatch to a thread that's built to service a dispatch queue; or else an executor model where you build a threadpool and stick processes into it

wispy steppe
#

For bungeecord, why don't we just use a concurrenthashmap for connectionsByOfflineUUID? Only get/remove/put is called on the map, and using a lock is just tossing performance out the window

#

Unless I'm missing something...

#

Or if really need-be, just create a lease system to temporarily lease the object to a task. That way the lock would only be called once for heavy stuff like the TabList rewriter

trail plume
#

thread safety

wispy steppe
#

@trail plume All I can foresee is a potential desync problem. But that shouldn't cause any issues?

trail plume
#

if something relies on them being consistent, yes

wispy steppe
#

Ah you mean the actual values in UserConnection not being consistent among other threads

#

I was thinking too shallow

trail plume
#

hurr duurr CMH NO CME!

#

;P

wispy steppe
#

Maybe a single lock for loops then at least

trail plume
#

Tbqh, disable entity metadata writing and that stuff is irrelevant

wispy steppe
#

Like my other "lease" kind of idea

#

Yeah but TabList "rewrite" is needed sadly

trail plume
#

meanwhile has had people wanting him to yeet that thing as it causes nothing but issues

wispy steppe
#

You want to drop the Tablist system?

trail plume
#

Theres been people who've wanted that thing disabled because it creates issues for them

wispy steppe
#

There's no winning pepelaugh

trail plume
#

from what I see, it's only relevant for offline mode servers on an otherwise ip forwarded network?

wispy steppe
#

Or plugins

#

Which are also generally for cracked servers so

trail plume
#

that's offline mode though

wispy steppe
#

But without this system, wouldn't the spigot server then be sending PlayerListItem packets with offline players data?

trail plume
#

no

wispy steppe
#

How so? The spigot server is offline mode

trail plume
#

ip forwarding

wispy steppe
#

Oh it forwards the UUID too?

trail plume
#

the UUID and the IP is passed through in the handshake

#

yup

wispy steppe
#

Ahhhhh alright that makes sense

trail plume
#

spigot picks that up and uses it for the connection

#

So, that system is basically useless outside of people for some reason not having online mode on their setup

#

damn

#

I could literally skip that entire logic if there is a v4 UUID

#

WHO WANTS TO BREAK SOME SHIT

wispy steppe
#

Another thing I noticed is, we don't need to copy the ByteBuf if EntityRe-write is disabled.

#

Just a waste

trail plume
#

Yea, that's something I've been kinda meaning to look into, just been mostly kinda dead for the past far too long

wispy steppe
#

NO memory leak/issues. Confirmed it today/yesterday

trail plume
#

Yea, there won't be as it doesn't modify the packets going through there

#

biggest issue iirc is that if you slice you can't mutate the data or something

#

one day I'll get a copy of NIA and read it

wispy steppe
#

What was strange though is on my test server, I also tested with entity-rewrite enabled and a slice. No issues either..

#

Only 2mb of memory allocated too

#

Which doesn't make much sense

trail plume
#

issue is that it can't resize the buffer

#

So, if the mutated data ends up being larger than the original it will work

grave fulcrum
#

Should plugin messaging channels be full duplex (one channel each for input/output) or is half duplex fine (shared channel)

grave fulcrum
#

How can I cancel a player connecting to a server on join? I want the player to connect to a different server.

trail plume
#

generally you just replace the reconnect handler thingy

#

one of the earlier events let you set the server to connect to I think

grave fulcrum
#

mind linking?

trail plume
#

.jd

lean gobletBOT
grave fulcrum
#

well yeah lol

#

i mean to like the class entry on the javadoc

grave fulcrum
#

Yeah, that. Thanks

trail plume
#

I mean, I was getting it, stuff takes time

grave fulcrum
#

Sorry then. Does that handler only get fired on reconnect?

#

Like if a player is connecting to the proxy for the first time, will it still get fired?

trail plume
#

yes

grave fulcrum
#

Neat

wispy steppe
#

👀

#

I guess that's still not really a solution to the exploit as it would still be possible regardless. Just a bit harder. Crazy how big these damn packets are getting from Mojang though lol

wide maple
grave fulcrum
#

If a player will be kicked from the network when they are kicked from the server, will ServerKickEvent#getCancelServer be null?

surreal iron
#

When I change the command name, tab completer works, but now it doesn't work because the same command exists in bukkit. how can i solve this

#

can i write on it?

#
@Override
    public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
        if(args.length == 1){
            List<String> playerNames = new ArrayList<>();
            for(ProxiedPlayer player: ProxyServer.getInstance().getPlayers()){
                if(!sender.getName().equals(player.getName())){
                    playerNames.add(player.getName());
                    //don't add if player has ban protection permission
                }
            }
            return playerNames;
        }
        return null;
    }```
wide maple
#

All of that is intended behavior on bungeecord and waterfall doesn’t change it

surreal iron
#

Let's say I asked the question for a bungee plugin. why does the tab completer feature use bukkit tab completer as priority?

uneven pendant
#

because the backend server is usually more important?

trail plume
#

the buffer size limit would of just reduced the harm factor by like 4, but, with the packets being larger now potentially, wooo...

surreal iron
#

and tab executor

lean gobletBOT
#

what exactly is your issue?

#

there is nothing stopping you from doing that?

trail plume
#

last I knew, bungee doesn't deal with that stuff all too properly

#

Issue here iirc is that it won't replace the existing command def but basically just add another one into the list, so, the old command still exists in there, and was the first to define it, the thing will still be executed by the proxy and tab completed (where ask_server) first

lean gobletBOT
#

there's two events which can easily be used to handle that

surreal iron
#

For example, I use another bungee plugin and tab complete works fine.

#

When I use the command in the plugin I made, the result is like this

lean gobletBOT
#

without knowing your code that's hard to say

surreal iron
#

one second

#
@Override
    public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
        if(args.length == 1){
            List<String> playerNames = new ArrayList<>();
            for(ProxiedPlayer player: ProxyServer.getInstance().getPlayers()){
                if(!sender.getName().equals(player.getName())){
                    playerNames.add(player.getName());
                    //don't add if player has ban protection permission
                }
            }
            return playerNames;
        }
        if (args.length == 2){
            List<String> reason = new ArrayList<>();
            reason.add("Reason...");
            return reason;
        }
        return null;
    }
lean gobletBOT
#
  1. not the full code
surreal iron
#

okey wait

lean gobletBOT
#
  1. you are not using the event
#

3:

#

.paste

surreal iron
#

sorry

#

onEnable()```java
getProxy().getPluginManager().registerCommand(this, new BanCommand("ban", "ban.use"));

lean gobletBOT
#

use the event, pretty sure the executor has been borked for years now

surreal iron
#

In the sources I researched, it was said that it should work when I do it like this.

trail plume
#

it should work

#

I explained why it ain't

surreal iron
#

i am learning new. I thought it would work.

#

hmm

#

I didn't quite understand because of the translation. So do I have to cancel the old command first?

#

so bukkit ban command

lean gobletBOT
#

just use the event, it's a lot easier ¯_(ツ)_/¯

trail plume
#

Not that simple.

#

The client has the servers command definiation of that command

#

if you register a command in brig, the old "conflicting" entry is not replaced iirc

surreal iron
#

I'm confused because you two said different 😄

trail plume
#

So, theres now two ban command definitions in there, but, the game doesn't deal with dupes

lean gobletBOT
#

which is why you replace the completions with your own in the event, yes

trail plume
#

what event?

surreal iron
#

hmmm understand now zzcat

#

how can i disable other command

trail plume
#

afaik there is no remove command method in brig

#

permissions is the easiest one

lean gobletBOT
#

TabCompleteEvent

trail plume
#

otherwise you'd need to rip it out of the command def

#

that's not the command structure

lean gobletBOT
#

or remove the old with TabCompleteResponseEvent

#

they don't care about the command structure? they just want the completions gone?

trail plume
#

the client doesn't even send a completion for vanilla commands.

#

Yes, they do

surreal iron
#

I'm going to try using permission

lean gobletBOT
#

otherwise ProxyDefineCommandsEvent

trail plume
#

Because the ban command in vanilla uses brig components which are done on the client

#

that event only covers proxy commands

lean gobletBOT
#

but their code is clearly targetting the command completions, not the command registration

#

"Called when the proxy intercepts the command packet" no

trail plume
#

Can't modify the brig structure without reflection or modifying brig

#

Yes

#

There is no removal methods, etc, in brigadier, so we can only prevent adding new defs to it

lean gobletBOT
#

so you can just remove the backend command...

trail plume
#

modifying brig to allow removals was something I was considering but never got around to, was assuming that that was better dealt with on the client anyways

lean gobletBOT
#

either via the event or proper permission setup

#

or you just replace the argument suggestions in the tab complete (response) event ¯_(ツ)_/¯

trail plume
#

There is is no REQUEST for that

lean gobletBOT
#

for what?

lean gobletBOT
#

that's a normal argument tab complete isn't it?

surreal iron
lean gobletBOT
#

why would that not call the event?

trail plume
#

That's 100% handled on the client

lean gobletBOT
#

Mehmet: you need to revoke the permission for the command from the player on the paper side

surreal iron
#

this works but in the other plugin I was using it was only showing the bungee command even though I was an op.

#

I guess the permission check didn't work either

#

how can i do not disable other command

#

let me try it

trail plume
#

that's just how the proxy and brig work together

#

you'd basically need to hijack the servers command structure and remove the command defined by the server or something

lean gobletBOT
#

tbh I never had issues with commands that were both on the server and the proxy

trail plume
#

if they're just ask_server completions which bukkit itself creates it's basically a non-factor as the proxy can just intercept them

#

issue there is that the servers built-in ones aren't just an ask_server

lean gobletBOT
#

ah, I see. so it's basicall just an issue with vanilla/brigadier registered commands

surreal iron
#

After deoping the paper server, tab complete started working

lean gobletBOT
#

yes, that's what we have been telling you

surreal iron
#

There was a situation like EventPriority.highest in bukkit, is there something similar here?

trail plume
#

no

surreal iron
trail plume
#

I need to make the brig structure modifiyable

#

Or, as I've literally already said, you'd need to find a way to hijack the brig structure

lean gobletBOT
#

they have the same problem unless they register with brigadier directly

surreal iron
#

I looked at the source code. I think it installed the commands in a similar way to what I did.

#

finally it returns a list like I did and the commands work fine

grave fulcrum
#

Are APIs in BungeeCord thread-safe?

wide maple
#

Some yes some no

grave fulcrum
#

What about like... pinging a server or sending a plugin message?

#

Those would be the only APIs I am doing async

#

They seem to work, just want to make sure I'm not doing anything stupid

trail plume
#

yes

grave fulcrum
#

good

#

i now have 4 layers of CompetableFuture#applyAfter

#

how nice

#

Is ReconnectListener#getServer fired async?

trail plume
#

pretty much every event in the proxy is fired on the network thread, outside of the async ones

surreal iron
#

If there is an online player with the specified name, if there is no player, I just want to get the name, but it gives a null error in the isconnected part

#

If the player is active, how can I get only the specified name and not the player object?

outer cosmos
surreal iron
#

I still have minor errors like this. i couldn't get used to it

outer cosmos
#

Okay

grave fulcrum
#

How do I use the modules system? Is it documented?

trail plume
#

You don't, basically

#

It's basically just a bastardised plugin loader for automatically fetched plugins

grave fulcrum
#

Ah

#

I heard "on top of existing source" and thought i may be able to make a change to internals

grave fulcrum
#

is the only difference that it updates automatically

hard fox
#

That and they load before plugins iirc

stark valve
#

hello, i'm looking for something like ProxyDefineCommandsEvent but with spigot/sub server commands (i want do this in bungee plugin), exist something like that in waterfall?

trail plume
#

no

#

you do that on the server itself

stark valve
#

ok, thanks 😄

marsh furnace
#

Is there a way for chunk generation in the overworld to remove all the generators apart from the "bedrock floor generation" that you see at Y0 to Y5

surreal iron
#

how can i use new line in TextComponent

trail plume
#

should be a seperate component

surreal iron
#

so we can't do it with a single component. understood thanks

trail plume
#

I mean, you can

#

the clients support for that is shaky af

#

So, like, you probs don't wanna

surreal iron
#

hmm

#

so I don't know how many lines of messages the user will write. for that i need to create TextComponent according to that number. How do I send all the components at once? I guess the disconnect method only allows one.

trail plume
#

you put it in a component

surreal iron
#

i find a method for this. ComponentBuilder

#
ComponentBuilder("asd").append("asd").append("asd").create();```
frosty tusk
#

Hello, has the Waterfall got an update for mysql connector like PaperSpigot?

trail plume
#

No, I honestly forgot that the mysql connector was in there

slender heart
#

I just try to test a bungee plugin, now i set depend (also used softdepend) before in the plugin/bungee.yml. Still my plugin will be loaded before the plugin it depends on. Is there smth different to spigot/paper plugins I forgot to consider?

lean gobletBOT
#

it's dependS

#

depends and softDepends to be exact

slender heart
#

oo there is an s, thanks

supple bane
lean gobletBOT
#

nothing

supple bane
#

But I guess if i register the outging plugin channel i have to use "Waterfall" instead of BungeeCord?

lean gobletBOT
#

no

boreal veldt
#

How can i set the motd?

#

on which event is it?

#

i tried on the ServerPIng event

#

with #setDescription

lean gobletBOT
#

that should do it

supple bane
#

Its says that a seperator is requiered?

lean gobletBOT
#

.g spigot wiki plugin message channel

#

looks like that's not updated yet

#

might be BungeeCord:main or something like that

supple bane
#

okay I will try

boreal veldt
#

@EventHandler public void onServerPing(ServerPing event) { event.setDescriptionComponent(new TextComponent("")); }

#

is this okay?

supple bane
trail plume
#

I mean, just follow the code on that page

#

The bungee channel has been horrifically special cased in the server, so, technically doesn't matter

#

bungeecord:main is the "correct" channel but the bastardisation for that in the server technically makes that a non issue

supple bane
#

The exception is gone but

#

ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);

    try{
        dataOutputStream.writeUTF("Connect");
        dataOutputStream.writeUTF("PvP");
    } catch (IOException e){
        e.printStackTrace();
    }

    player.sendPluginMessage(MainWorldMain.instance,"bungeecord:main", byteArrayOutputStream.toByteArray());
#

Player doesent change the server

trail plume
#

god knows

#

might need to use the literal channel they state to use on the wiki page

#

I forget all the stupid caveats of the messaging stuff

#

I mean, if you wanna maintain your own set of patches over bungee, you'd wanna fork waterfall, or, for maintaining patches over waterfall, use travertine

#

if using our tooling, see our contrib guides

#

otherwise, search up on how to use git format-patches

#

8

trail plume
#

yes

#

if you're using waterfalls tooling just use ./waterfall rb, your patches will be in the patches folder

#

no, you need to commit the changes and then rebuild

#

yea...

#

github is irrelevant to git

#

Well, yes, but, you just apply the patch, fix any merge conflicts, and then rebuild

#

if you are planning to maintain changes over waterfall, you'd probs be best off forking travertine instead, as that's specifically setup for maintaining patches over waterfall

surreal iron
#

I want to have a gettype function inside this function. can i do this?

public void isBanned(){
  //some code...
  if (result.next()) {
    if (result.getString("type").equals("ban") ||
      result.getString("type").equals("ipban") ||
      result.getString("type").equals("tempban")) {
        return true;
        //public String getType(){
        //}
    }
  return false;
  }
}```
wide maple
surreal iron
#

What are you trying to do here? This doesnt look possible in java
😄

#

eg: getProxy().getPluginManager().registerListener()

#

like this

wide maple
#

.... that still doesnt explain anything

chilly coral
#

just assign it to a variable instead of getting it from result each time

#

but yeah, as Five said, what you said just doesn't make any sense

boreal veldt
#

Hello, i coded an /hub command but when a player executes the command and the server isnt on i want to send him a message but the "Could not connect" message comes too. How can i prevent that?

             player.connect(ProxyServer.getInstance().getServerInfo("Citybuild"), new Callback<Boolean>() {
                @Override
                public void done(Boolean aBoolean, Throwable throwable) {
                    if(!aBoolean)
                        player.sendMessage(new TextComponent("§cDer Citybuild Server ist derzeit nicht Online!"));
                    return;
                }
            });
trail plume
#

not possible in the API

#

I have a branch with a change for that iirc but not pulled it

lean gobletBOT
#

what is your goal?

#

(and no, that's not how java works)

bleak current
#

result.getString("type").contains("ban")

slender heart
#

If I want the child notes of an bungee config what are not a list of strings, like a map, there is no method for that already part of the api, am I right? So best thing would be to use either get(path) for a generic object or getSection(path)getKeys() … and build what ever you would expect?

trail plume
#

"child notes"

#

if you mean the keys in a section of the config, yes

#

the latter is specifically catered towards dealing with the sections and is generally preferred if you know it's gonna be a section

slender heart
#

not sure what the correct term might be, like

   stuff1: "blabla"
   child2: "bloblo"```
#

I okay, than I go with the section

trail plume
#

yea, keys

slender heart
#

thanks

trail plume
#

ConfigSection is basically a "glorified map" more or less

slender heart
#

A okay, thx. Will do it like that than

rough bronze
#

Hey just wanted to know what is the status of the forge packet spoof for waterfall that Five is working on. (Or smth like that can't remember to be honest)

lean gobletBOT
#

@CCCFan as stated in the error message: relocate it into your own package

brittle panther
#

How do I remove unused Configuration keys?

For instance, I have a yml file that has bans in it, when someone gets unbanned, I want to remove all the information associated with their ban (in the yml file). Is there a way to do this that isn't too complex?

#

Sorry if that made no sense.

trail plume
#

set the value to null

brittle panther
#

Will that actually remove the key? Or will it just be like

section:
  foo:
  bar:
section2:
  foo: ban
  bar: info

(Specifically the section part.)

trail plume
#

iirc it shouldn't save it when it's saved to the disk

brittle panther
#

?

trail plume
#

basically, it should be gone

brittle panther
#

Ok.

trail plume
#

null values are not saved to the disk

brittle panther
#

I will have to try this later.

trail plume
#

if you want a more concrete soluton, gtf-away from the yaml crap in bungee

brittle panther
#

But I like the yaml.

#

;)

boreal veldt
#

Someone know why its always false?

    public boolean serverOnline(String name) {
        AtomicBoolean bool = new AtomicBoolean(false);
        ProxyServer.getInstance().getServerInfo(name).ping((serverPing, throwable) -> {
            bool.set(true);
        });
        return bool.get();
    }
wide maple
#

the atomic boolean already has a value

#

what youre trying to do would result in an infinite deadlock

bleak current
untold geyser
#

or dont and just return a CompletableFuture<Boolean>

#

Then you can choose later in the program whether you want to block with .join(), or wait for completion asynchronously

nocturne ridge
#

also, how do you dynamically add and remove servers from waterfall
because getServers() is deprecated

untold geyser
#

Its one of the great deprecation warnings thats not pending removal of the method

#

just warns about concurrent access and it being the live internal map

nocturne ridge
#

so its fine to use that?

untold geyser
#

Yah

nocturne ridge
#

what is fastutil?

tawdry narwhal
nocturne ridge
#

do i have to include it as a dependency?

tawdry narwhal
#

In your waterfall plugin?

hard fox
#

It comes with fastutil already

nocturne ridge
#
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve it.unimi.dsi:fastutil:{strictly 8.2.1}.
     Required by:
         project : > com.sk89q.worldedit:worldedit-core:7.2.5
         project : > com.sk89q.worldedit:worldedit-bukkit:7.2.5
      > Cannot find a version of 'it.unimi.dsi:fastutil' that satisfies the version constraints:
           Dependency path ':BR:unspecified' --> 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT' (apiElements) --> 'it.unimi.dsi:fastutil:8.2.2'
           Constraint path ':BR:unspecified' --> 'com.sk89q.worldedit:worldedit-bukkit:7.2.5' (apiElements) --> 'it.unimi.dsi:fastutil:{strictly 8.2.1}' because of the following reason: Mojang provides FastUtil
           Constraint path ':BR:unspecified' --> 'com.sk89q.worldedit:worldedit-core:7.2.5' (apiElements) --> 'it.unimi.dsi:fastutil:{strictly 8.2.1}' because of the following reason: Mojang provides FastUtil

   > Could not resolve it.unimi.dsi:fastutil:8.2.2.
     Required by:
         project : > io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT:20210726.164944-52
      > Cannot find a version of 'it.unimi.dsi:fastutil' that satisfies the version constraints:
           Dependency path ':BR:unspecified' --> 'io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT' (apiElements) --> 'it.unimi.dsi:fastutil:8.2.2'
           Constraint path ':BR:unspecified' --> 'com.sk89q.worldedit:worldedit-bukkit:7.2.5' (apiElements) --> 'it.unimi.dsi:fastutil:{strictly 8.2.1}' because of the following reason: Mojang provides FastUtil
           Constraint path ':BR:unspecified' --> 'com.sk89q.worldedit:worldedit-core:7.2.5' (apiElements) --> 'it.unimi.dsi:fastutil:{strictly 8.2.1}' because of the following reason: Mojang provides FastUtil


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.```
hard fox
#

It comes with fastutil already

nocturne ridge
#

so why is it saying i need to include it as a dependency

#

or am i misunderstanding this

tawdry narwhal
#

Waterfall doesn't provide fastutil

nocturne ridge
#

this is a paper plugin (i just realised im in the wrong channel)

tawdry narwhal
#

But, you have a dependency which demands an older version of fastutil than paper provides.

nocturne ridge
#

oh ok

#

for some reason it fails to resolve it. Even though i copied it from maven central and have included the repo in my config

#

in fact its failing to resolve even the latest version

#

anyone have any idea why it cant find these packages?

hard fox
#

I don't really follow why you need fastutil in the paper plugin side

#

getServers() returns the list you want in Waterfall

#

Then stonks

tawdry narwhal
#

If that is paper related, actually use the paper dev channels

lofty sky
#

Hello, how to create a waterfall fork? I'm newbie herethonk

somber prism
#

see travertine as an example

nocturne ridge
sly crown
#

why tf is a waterfall plugin depending on paper/worldedit

#

also outdated WE is the issue there, that version doesn't support 1.17 so libs are pinned to older versions

nocturne ridge
#

no this is the wrong channel. I just continued the conversation here because i already pasted the error

#

apologies

#

its a paper plugin

lean gobletBOT
#

you know you can delete messages, right?

nocturne ridge
#

doesn't matter now

bleak current
#

what is the best way to store mini msg in config files?

hard fox
#

How unreasonable would it be to PR setting ip-forwarding to true given it's... the defacto setup

rough bronze
#

PalpLaugh Do it

barren silo
#

is there an event for when someone disconnects due to a server restart/shutdown? I read that the ServerKickEvent did that, but it's not seeming to work as intended

lean gobletBOT
#

depends, ServerKickEvent should catch most cases

barren silo
#

what would the cause be for a restart/shutdown? I presume Server?

lean gobletBOT
#

pretty sure it can be any cause

#

it's kinda random which one gets triggered, "server" is for when the server actually kicks the player

barren silo
#

ah okay thanks a lot

lean gobletBOT
#

it's just that in a case of a shutdown it might not kick the player (at least not in a way noticable for the proxy) which might trigger a connection loss (or maybe even an exception)

#

best to just listen for all of them and check the kick message tbh

barren silo
#

okii will do ^^

smoky spindle
#

How do I get a player's IP address? Player#getAddress is deprecated

tawdry narwhal
#

This is waterfall dev

smoky spindle
#

oops

#

wait no

#

its right, i'm working on a waterfall plugin

tawdry narwhal
#

Waterfall has no Player class, do you mean ProxiedPlayer? But that has no getAddress()

smoky spindle
#

I meant ProxiedPlayer, and it apparently had a getAddress which is probably gone now

#

getSocketAddress returns a SocketAddress, which has no methods to get just the IP

tawdry narwhal
#

That is their IP?

#

Or cast it to InetSocketAddress if you meant the IP without the port

#

But the docs outline that

wide maple
brittle panther
trail plume
#

work out what's borking tab complete

mossy junco
#

I'm sorry, but is there actually a way to force a player to execute a BungeeCord command from a Bungee plugin

#

I chat ProxiedPlayer#chat as well as #performCommand, but it attempts to execute it on spigot side, and fails with a message that no such command exist

lean gobletBOT
#

Pluginmanager#dispatchCommand

mossy junco
#

Im so stupid, thank you : )

boreal veldt
#

Hello, i coded my own /server command but when i use it i get a time out for any reason.

    public Future<Boolean> serverOnline(String name) {
        CompletableFuture<Boolean> completableFuture = new CompletableFuture<>();

        ProxyServer.getInstance().getServerInfo(name).ping((serverPing, throwable) -> {
            if(throwable != null) {
                completableFuture.complete(false);
            } else {
                completableFuture.complete(true);
            }
        });
        return completableFuture;
    }
#

But only when you use it often

#

like 3 or 4 times

trail plume
#

I mean, that gives us 0 context

#

99% chance that that block right there is 100% unrelated

boreal veldt
#

its related because when i try it the other way it works fine:

      public boolean serverOnline(String name, int port) {
        bool = false;
        Socket socket = new Socket();
        try {
            socket.connect(new InetSocketAddress("**", port), 10);
            bool = true;
            socket.close();
        } catch (IOException e) {
            bool = false;
        }
        return bool;
    }
#

so the problem is the "ping()" method

#

are there any examples for the ping() method?

trail plume
#

I mean, the ping method returns a callback and runs on a different thread

#

what you're doing there looks fine assuming that you don't join on the future you return

boreal veldt
#

I just dont understand how to use it, any example would help me

trail plume
#

It's a callback

#

just don't block the current thread waiting for a response from it

#

We don't exactly have examples for every trivial thing and "don't block the thread" is really not great

#

I for one got no idea how your socket wasn't causing issues given that you're blocking the current thread there too

#

I guess opening a socket connection is often more cut and dry than waiting for an actual response

boreal veldt
#
    public boolean serverOnline(String name, int port) {
        CompletableFuture<Boolean> completableFuture = new CompletableFuture<>();

        ProxyServer.getInstance().getServerInfo(name).ping((serverPing, throwable) -> {
            if(throwable != null) {
                completableFuture.complete(false);
            } else {
                completableFuture.complete(true);
            }
        });
        return completableFuture.join();
    }
#

I tried it this way, still the same

trail plume
#

-.-

boreal veldt
#

my friend told me to do that

trail plume
#

and I told you not to.

boreal veldt
#

without examples im kinda lost

trail plume
#

Don't block the fucking thread

#

it's not that hard

#

if you return a future, do NOT use join

boreal veldt
#

where do i block the thread?

trail plume
#

By calling join.

boreal veldt
#

and now?

trail plume
#

exact same issue

#

you CANNOT get a result and NOT block for the result

#

This is not rocket science

#

if you wanna return a future, sure, but youre gonna need to use the methods to schedule the work to do once the future is completed

boreal veldt
#

sry i never worked with futures

trail plume
#

This is a basic programming concept

#

You can't go do work and return the value of the work before the work is done

#

I'd suggest getting familiar with actually working with callbacks and futures first as there is many considerations there

boreal veldt
#

so i need to create a schedule and wait till the schedule is done or what?

trail plume
#

Please go read up on how to use futures and callbacks

boreal veldt
#

do you have some good websites for that?

trail plume
#

no

boreal veldt
#

when i use Thread.sleep is it blocking too?

trail plume
#

"is making the thread stop and do nothing but wait blocking the thread"

boreal veldt
#

ok

trail plume
#

That example is blocking the completables thread, not the thread you created the future on, entirely different scope

boreal veldt
#

i give up, i wont use this method

fossil talon
#

where is the water fall.

tawdry narwhal
brittle panther
# boreal veldt and now?

I already figured out a 1/2 working way of doing this. I can send you some code for you to look at when I get home.

brittle panther
#

in fact...

#

I have it on my github

#

Can I dm you?

surreal iron
#

Does it tire the server to check the data in a map every second and act on them?

trail plume
#

wrong channel?

#

I mean, general gist is that "doing stuff takes time", interacting with a Map takes time, but, probs not enough to care, but, depends on the size of the map, how expensive your checks are, etc; nobody can make an accurate statement on what you've asked

surreal iron
#

I'm assuming a server with an average of 200 active players.

trail plume
#

literally gives 0 info

surreal iron
#

Can you ask some important parts?

#

i can answer them

trail plume
#

as I said, it depends on the size of the map and what you're doing with the data

surreal iron
#

I will take the timestamps of the objects in the map and check

#

Map<Punishment>
if(punishment.isExpired)

#

like this

lean gobletBOT
#

why?

#

just check it on login or use a task to remove it once expired (or just use an expiring cache directly although that might not cleanup instantly on expiration depending on the type you use)

surreal iron
#

I have to do a few actions on them when they expire.

#

like delete from database or send message

trail plume
#

There are already collections which aid with that, considering how little you're probs gonna be inserting/removing, a sorted collection or something would also probs be ideal

#

I mean, doing stuff like that off the main thread if you know what you're doing would be trivial

surreal iron
#

what is the mean "prob"

trail plume
#

probably

surreal iron
#

Punishment(String playerName, String uuid, String ip, PunishType punishType, String reason, String operator, long start, long end) This is the object I'm talking about. I want to check whether they expire one by one in a map with 100 of these objects in every second.

#

I don't know, but I think it's overworking the server.

trail plume
#

I mean, doing that on the main thread would be moronic

#

and we've already highlighted ways to do it more efficently

lean gobletBOT
#

really doesn't make sense to check them if you can just check that on player join/server switch but if you really need to check them then just schedule a task for when the next entry expires

trail plume
#

heck, doing that stuff in a database would be cheaper

surreal iron
trail plume
#

Yes?

#

You know how to work with a database, right?

surreal iron
#

So do I need to use a repeating task for this?

trail plume
#

yes

#

It works the exact same as if you where doing it in a collection

surreal iron
trail plume
#

so, do a select for expired entries

#

for each one, do whatever, e.g. message people

#

then, do another transaction which deletes the entries you selected

#

make sure you have a sane primary key

surreal iron
bleak current
#

names can change

#

uuids can't

surreal iron
trail plume
#

that's not a sane primary key if you have multiple entries

#

you generally want some auto incremental number of something

surreal iron
bleak current
#

offline players can use any name they want

#

offline uuids are based on the username

#

(unless on bungee ^)

surreal iron
surreal iron
wind dove
#

is it possibile to change a player's displayed name in the tablist?

wide maple
#

I’m not sure if you can do it with API though

slender rune
#

Hi

#

when i try to connect to the waterfall server i'm getting "disconnected" and this errror:

#
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
        at net.md_5.bungee.UserConnection.addGroups(UserConnection.java:565) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at net.md_5.bungee.UserConnection.init(UserConnection.java:172) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at net.md_5.bungee.connection.InitialHandler$6$1.run(InitialHandler.java:543) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]```
trail plume
#

sounds more like a help thing, bad config?

rain axle
#

If I change the target server at ServerConnectEvent does it override the default server?

white ferry
#

Hi everyone,
I’m currently using Bungeecord, and I would like to replace it with Waterfall for new functionnalities and stuff. But I have my own fork of Bungee with custom functionnalities.
So I would like my fork of bungeecord to become a fork of Waterfall, but I’m not familiar with forks that uses pathes in their repositories, instead of using commit and branches, as I do currently with my fork of Bungee.
I there any tutorial or else that can explain how to deal with patch based fork ? I couldn’t find anything online, except some other examples of patch based projects. I tried reading the contributing file of PaperMC/Waterfall repository but it looks like the explanations are for contributing to the current project, not creating a new fork with a new set of patches

dapper temple
#

can use travertine as a base

#

it's not longer maintained but it is a patch-based waterfall fork

white ferry
#

Gonna check that, thanks 🙂

bleak current
#

Hello, it won't let me enter my network, I don't know why, it seems that it is starting up and it stays there

somber prism
rain axle
#

How do I get the IP of a player

#

As ProxiedPlayer#getAddress is deprecated

trail plume
#

there is another method, instanceof to INet address or whatever it was cast

#

InetSocketAddress or something iirc

#

(read the deprecation notes, pretty sure it's covered in there what method to use)

brittle panther
#

Is there a way to make a paper plugin that tells a waterfall plugin that a player is apart of a LuckPerms team? I'm pretty sure it is able via some sort of plugin messaging right?

trail plume
#

what? why?

brittle panther
#

Why do I want to do this?

trail plume
#

Yes

#

I see no valid reason to do so

#

I mean, you can use plugin messaging channels to send whatever data you want to the proxy and back and forth

#

But, at least specifically for LP, you can just query that data from LP?

brittle panther
#

I am adding a chatting system to my plugin, where when you talk in chat it sends it to the server. I did this because it is a lot easier to mess with the message on the proxy end rather than making a plugin specifically for each server.

The problem lies when I am wanting to send a chat message to a server that that player has a different rank on than the rest of the network.

Is there a simple way to set up LP to do a sort of database that only allows certain "ranks" to be updated. i.e. if a player has an Iron rank and I only want them to have that rank on one server, but not on others.

#

I can ask in the LP discord if you don't know. And I'm not asking for an explanation on how to do so (although, one would be helpful).

trail plume
#

Well, yes, you can construct whatever query you want against LPs context system

brittle panther
#

oh

trail plume
#

beyond that, if you wanted to send messages to the proxy, you can just do that using the plugin messaging system

brittle panther
#

ok

brittle panther
brittle panther
#

btw. I figured it out.

bleak current
#

How to capture and modify set slot or window items packet?

trail plume
#

from waterfall? you'd either need to hook into the networking stuff manually and register your own packets or use a library like protocolize (but, never used it)

bleak current
#

How to hook to it?

trail plume
#

if you have to ask, you probs just wanna use a library

hexed fractal
#

If a player had a permission on the bungeecord and this permission is removed he can still tab complete it until the reconnect. How can I remove it? Permissions are checked at the PermissionCheckEvent the same is when a player gets a permission he cannot tab complete but use it.

trail plume
#

the server would need to resend the commands to the client

hexed fractal
#

how can i do it?

trail plume
#

You'd need to create a server plugin which can resend the commands

hexed fractal
#

is that in paper PlayerCommandSendEvent? player.updateCommands()?

trail plume
#

update

hexed fractal
#

thank you btw couldn't write because I had to go to work. love u

viscid cipher
#

What's the reason why servers that are connected via bungeecord/waterfall need to be set to offline mode?

trail plume
#

because unless you have a way to bypass mojangs authentication mechanism, you can't just jump between servers

simple nacelle
#

Hi, I have a little issue with the ProxiedPlayer.getLocale() Methode return null.

@Override
public Locale getLocale(CommandSender sender) {
    if (sender instanceof ProxiedPlayer) {
        var p = (ProxiedPlayer)sender;
        var locale = p.getLocale();
        if (locale == null) {
            locale = Locale.getDefault();
            try {
                throw new NullPointerException("Player hat no Language: " + sender.getName());
            } catch (NullPointerException e) {
                getLogger().log(Level.SEVERE, e.getMessage(), e);
            }
        }
        return locale;
    } else {
        return Locale.getDefault();
    }
}

StackTrace indicates that the issue are in the PostLoginEvent.. (9 out of 10 joins have a NullPointerException)
So I rewrote that logic: Player joins a Server, Server (Paper) PlayerJoinEvent send a PluginMessage to Proxy... 1 out of 20 Joins NullPointerException
Any Idea at what time it is save to "ask" the ProxiedPlayer.getLocale() Methode?

trail plume
#

there is no specific time where it's safe

#

it's just sent to the server "at some point" during the initial join

simple nacelle
#

Before I test it, is SettingsChangedEvent fired in that initial join time?

trail plume
#

should be

simple nacelle
#

Thanks for the fast response.. (And back to coding)

#

And another issue with the Player joins a Server, Server (Paper) PlayerJoinEvent send a PluginMessage to Proxy
1 out of 50 times the PluginMessage don't reach the Proxy any Idea why?

#

Code is not that complex..

@EventHandler
public void onJoin(PlayerJoinEvent event) {
var player = event.getPlayer();        
var out = ByteStreams.newDataOutput();
out.writeUTF(PluginSubChannel); // Sub-Channel
out.writeUTF(player.getUniqueId().toString());
player.sendPluginMessage(plugin, PluginChannelName, out.toByteArray());
}
trail plume
#

PJE has always been kinda weird as it's around where the state of the protocol is changed

haughty schooner
#

Is there a tool for forking waterfall like paperweight? 🙂

trail plume
#

basically, use the travertine repo as it has all the scripts and such

haughty schooner
#

The description says with 1.7 support. Does 1.17.1 work correctly without any problems? 🙂

trail plume
#

Well, if you're maintaining a fork you'll wanna update it

haughty schooner
#

Thank you 😄

haughty schooner
trail plume
#

don't ping

#

in the bootstrap project iirc

haughty schooner
bleak current
#

Waterfall-Proxy/bootstrap/target/

trail plume
#

reply pings by default

haughty schooner
#

Ahhh thank you guys 😄

bleak current
#

Travertine would put it in Travertine-Proxy/bootstrap/target

haughty schooner
#

okay thank you a lot 😄

surreal iron
#

can i get CommandSender with name

trail plume
#

what?

#

if you mean a player, yes, pretty sure there is a method on ProxyServer or whatever it was called for that

surreal iron
#

I learned that commandsender can be a ProxiedPlayer. thanks

#

plugin.getproxy.getplayer

deft kiln
#

Hey guys, I want to dynamically add servers to the waterfall proxy and the way I used before was to do config = proxyServer.getConfig(); and then config.addServer() or directly adding the servers to proxyServer.getServers(). But both methods got deprecated in Waterfall, what do I need to use, since using deprecated methods is not really an option. Thanks in in advance.

trail plume
#

Pretty sure that there was a more frontline method for adding servers

#

Oh, so, basically

#

addServer is technically not deprecated outside of fucking lombok being a complete ass

#

wooo...

deft kiln
#

The Problem with the first approach is that ProxyConfig class is deprecated. At least according to Intellij

trail plume
#

See the deprecation reason...

deft kiln
#

Ah well, thanks for the help so I will keep using that and keep an eye out for changes.

deft kiln
#

Is there a way to getproxyServer.getConfig().addServer() to properly sync back to proxyServer.getServers(). Because using the first one doesn't work whilest the second one does work properly but is deprecated.

trail plume
#

!ban @bleak current steam scam

inner birchBOT
#

:raised_hands: Banned BobLeeNigma#8215 (steam scam) [1 total infraction] -- electronicboy#8869.

frozen echo
#

hey, i'm trying to teleport a player to a location in a server when they run a spawn command, is there any way to do that?

trail plume
#

You'd need a plugin on the server to do that which can recieve the location and tp them

frozen echo
#

how would i do that?

trail plume
#

plugin messages

frozen echo
#

ah, thanks!

brittle panther
dense ridge
trail plume
#

should work fine in many cases afaik assuming the client is the correct version

dense ridge
#

My Client is 1.16.5 and i use the lastest waterfall.

#

On Waterfall are the ViaVersion and the ViaBackwards plugin.
But when i delete that, that not work.

dense ridge
#

At chat work that, only in MOTD not

solid ferry
#

Does the WaterfallAPI also have an adventure implementation like Paper?

trail plume
#

no

solid ferry
#

okay thanks.

trail plume
#

it's basically on the list of 200 things I may get to one day

solid ferry
#

😂

frank junco
#

not sure if this ist he right place for this question, apoologies if it's not. can a waterfall plugin prevent a player chat message from going through even if the chat is not handled by bungeecord plugins?

bleak current
#

Pretty sure bungee has a chatevent that you can cancel

frank junco
#

okay I didnt think it would prevent the chat message going through

#

good, ill give it a go then thanks

rain axle
#

Hi, Do I still need a player to send a Bungee Message?
Even for things like Server list?

dense ridge
trail plume
#

Waterfall just passes the json through, I don't really see how waterfall on its own would break that

dense ridge
#
  @EventHandler
  public void onMOTD(ProxyPingEvent event) {
    ServerPing serverPing = event.getResponse();
    TextComponent textComponent = new TextComponent();
    textComponent.setText("Text");
    serverPing.setDescriptionComponent(textComponent);
    event.setResponse(serverPing);
  }

Isn't that right?

trail plume
#

pretty sure proxy ping is the legacy shit

versed egret
#

i need help with then server(paper1.8)(is conecting to waterfall)

brazen hamletBOT
somber prism
#
  1. wrong channel, 2. update minecraft or downgrade java. 1.8 won't support modern java versions with native epoll
versed egret
#

uff

#

then is a bungeeproblem

somber prism
#

no, it's not

#

this has nothing to do with bungee/waterfall

versed egret
#

i start the server and wenn i start bungee it crash the 1.8 server

somber prism
#

yes, as I said downgrade java or update minecraft

versed egret
#

in bungee i have this

#

[18:22:15 INFO]: Using mbed TLS based native cipher.
[18:22:15 INFO]: Using zlib based native compressor.
[18:22:15 INFO]: Enabled Waterfall version git:Waterfall-Bootstrap:1.17-R0.1-SNAPSHOT:93773f9:448
[18:22:15 INFO]: Not on Windows, attempting to use enhanced EpollEventLoop
[18:22:15 INFO]: Epoll is working, utilising it!
[18:22:15 INFO]: Discovered module: ModuleSpec(name=cmd_alert, file=modules/cmd_alert.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Discovered module: ModuleSpec(name=cmd_find, file=modules/cmd_find.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Discovered module: ModuleSpec(name=cmd_list, file=modules/cmd_list.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Discovered module: ModuleSpec(name=cmd_send, file=modules/cmd_send.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Discovered module: ModuleSpec(name=cmd_server, file=modules/cmd_server.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Discovered module: ModuleSpec(name=reconnect_yaml, file=modules/reconnect_yaml.jar, provider=JenkinsModuleSource())
[18:22:15 INFO]: Loaded plugin reconnect_yaml version git:reconnect_yaml:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 INFO]: Loaded plugin cmd_find version git:cmd_find:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 INFO]: Loaded plugin cmd_server version git:cmd_server:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 INFO]: Loaded plugin cmd_alert version git:cmd_alert:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 INFO]: Loaded plugin cmd_send version git:cmd_send:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 INFO]: Loaded plugin cmd_list version git:cmd_list:1.17-R0.1-SNAPSHOT:93773f9:448 by WaterfallMC
[18:22:15 ERROR]: Exception in thread "main" java.lang.IllegalArgumentException: Server lobby (priority 0) is not defined
[18:22:15 ERROR]: at com.google.common.base.Preconditions.checkArgument(Preconditions.java:359)
[18:22:15 ERROR]: at net.md_5.bungee.conf.Configuration.load(Configuration.java:160)
[18:22:15 ERROR]: at io.github.waterfallmc.waterfall.conf.WaterfallConfiguration.load(WaterfallConfiguration.java:50)
[18:22:15 ERROR]: at net.md_5.bungee.BungeeCord.start(BungeeCord.java:279)
[18:22:15 ERROR]: at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
[18:22:15 ERROR]: at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

somber prism
#

1.8 isn't supported here, especially not in the waterfall-dev channel, and hasn't been updated in over 5 years

dusk raft
#

I was always curious on how you change this text, would anyone know how you would obtain that? just out of curiosity

summer lily
dusk raft
bleak current
bleak current
#

<@&748618676189528155> ^

empty quest
#

Could someone briefly explain to me how Waterfall stores its Scoreboard and Team data? I'm getting an error saying that "Team <teamName> already exists in this scoreboard". I have ran through my plugin code numerous times to check for any duplicate team creations that might be taking place. I even go as far checking if the team exists on a scoreboard each time I am trying to access a team using:

boolean hasTeam = scoreboard.getTeam(teamName) == null ? scoreboard.registerNewTeam(teamName) : scoreboard.getTeam(teamName);
lean gobletBOT
#

it doesn't store anything

#

that error simply means that some other server behind the proxy already registered that team

#

(and I'm pretty sure that fact isn't accessible via API)

empty quest
#

Ok, is there anyway to get waterfall to print out the servers in question?

lean gobletBOT
#

unless you register a custom packet handler I don't think so

empty quest
#

kk

#

Wait, I may have a flawed understanding of scoreboards in the first place. If I create 2 scoreboards (board1 & board2), can each scoreboard have a team with the same name?

For example:
Board1 has teams: Team1, Team2, Team3
Board2 has teams: Team1, Team2, Team3

#

Or do team names have to be unique across all scoreboard instances

lean gobletBOT
#

what do you mean by "create two scoreboards"?

empty quest
#

So lets say you have the main scoreboard

#

And then you create another by calling Bukkit.getScoreboardManager().getNewScoreboard();

#

Effectively i'd have 2 instances of a Scoreboard object right?

lean gobletBOT
#

that's not part of the proxy?

#

the proxy doesn't know which scoreboard you are referencing, Minecraft only has a single scoreboard

#

and yes, I'm pretty sure it would break when using Bukkit's per-player scoreboard hacks but using the same team names

#

just use unique names (or open a PR to spigot/paper do that automatically)

trail plume
#

waterfall stores some info about teams on its side given that it has to remove them manually, as well as the API

#

But, multiple scoreboards are basically a bukkit concept, using a 2nd scoreboard basically just "hacks" out the MC one more or less and just deattaches them from the avanilla one

lean gobletBOT
#

pretty sure it only caches until the next restart 👀

empty quest
#

Yeah, that makes much more sense now. I was under the impression that you could have multiple in vanilla

trail plume
#

bungee/WF basically store the team data on the player

#

it's why server switching across servers with dupe team names causes issues is because of what is more or less a race condition there \o/

lean gobletBOT
#

I guess the Vanilla client just silently ignores duplicate team registrations?

trail plume
#

it shouts about it in the logs, but, yea

lean gobletBOT
#

I see

empty quest
#

Thanks for all the info, that was super insightful 😄

lean gobletBOT
#

oof, team names are limited to 16 chars :S I thought one could just automatically add a scoreboard ID or something

trail plume
#

I have some ideas for a fix

#

It's just do I wanna eat more memory during server switches or break API

wicked lantern
#

Yo electronic could u fix this waterfall exploit

glossy marsh
#

exploit ?

wicked lantern
#

Yeah

bleak current
#

How is that an exploit?

wicked lantern
#

Well actually when i trow a attack kills the proxy with that msg.

trail plume
#

something opened a connection to it

#

It's literally the sole job of the proxy to process connections

wicked lantern
#

Well happens when i attack

trail plume
#

there is very little we can do

#

load balance and configure your firewall to rate limit connections, etc

wicked lantern
trail plume
#

At the end of the day, it's the job of the software to accept connections

wicked lantern
#

I know that with firewall that it's easy fixed but without it they're some exploits

trail plume
#

There is no magical fix here, the proxy seems to be doing what it's supposed to be doing

wicked lantern
#

True^^

trail plume
#

Well, yes, but, what do we do?

#

The proxy is processing connections as was intended, there is no magical way to determine that they're malicious until they start actually doing stuff

wicked lantern
#

Well, u could check BotFilter.

trail plume
#

There are plugins for that

wicked lantern
#

Use plugins for antibot oof

trail plume
#

Our inclination to build plugin wide solutions for stuff like that is basically 0, we have enough to maintain as-is

#

plugins can do it just as efficently as we could if they use the correct events, etc

wicked lantern
#

Well currently antibots sucks

trail plume
#

It's far too wide of a scope for us to deal with

#

And that's part of the entire issue

wicked lantern
#

+1

trail plume
#

These tools all rely on 3rd parties for data, we can't magically fix that one

wicked lantern
#

Yeah, it's hard to fix it

#

Ah and it's worth remove scoreboard packets (Actually tried on waterfall)

trail plume
#

was something I was kinda aiming to do at some point along with the option to disable entity metadata crap, afaik, with that system we shouldn't even need the scopreboard crap we have

wicked lantern
#

The only problem it's that doesn't handle good to remove them

#

on spigot

trail plume
#

please don't mention in replies

#

for server switches?

wicked lantern
#

Yeah

#

When u switch server if u remove scoreboard/bossbar packets brokes the board.

orchid prism
#

I mean, everyone should use at least an decent firewall pepe

orchid prism
#

Then just ask your hoster shrug

wicked lantern
#

Me when they dont want

orchid prism
#

Why tho?

wicked lantern
#

no idea

orchid prism
#

but im pretty sure that i can handle your attack without any iptables shrug

orchid prism
#

well, you can try if you want to

wicked lantern
#

😎 A-E OR N-U-LL

#

Uk what i mean

orchid prism
#

no idea what n-u-ll means

wicked lantern
#

wow that's really hard

orchid prism
#

ah

#

now i know nvm

wicked lantern
#

XD

orchid prism
#

dunno if null can handle it

#

i dont have it

wicked lantern
orchid prism
#

You are also using cloudflare spectrum harold

wicked lantern
#

but doesn't stop any bot attack or similar

orchid prism
#

🤷‍♂️

wicked lantern
#

Epic AntiDDoS

trail plume
#

TCPShield exists and thwarts a good chunk of stuff, but, the free plan ain't exactly a ton of bandwidth last I recall

wicked lantern
#

TCPShield got bypassed i saw it with my eyes some days ago

#

And how u said, it's easy to f-off TCPShield on free plan

surreal iron
#

Is it possible to create a gui with a bungee plugin

trail plume
#

no, but, technically yes

#

there was some plugin somewhere which exposed an API for that

surreal iron
queen cave
#

you can use bungee plugins to send info to other servers using plugin channels and catch those on the server to show gui's but thats the only way

surreal iron
#

No, it can only be done with the bungee plugin with the packages. Instead of using a separate plugin for subservers, I wanted to do it all in one plugin.

bleak current
#

Uhm, hi. I'm currently trying to build BungeeCord but have this issue now: https://i.imgur.com/IsfEDgs.png I deleted the project and get from VCS again and still the same mistake. Tried multiple times "Download Sources and Documentation".

#

1-2 days ago, it did work. Do you guys know why this mistake could happen?

trail plume
#

make sure you're running build in the correct folder, i.e. not in one of the BungeeCord- folders or whatever

bleak current
#

I think I'm in the correct folder and building the correct version of it or what would you say?

trail plume
#

run it on the parent

bleak current
#

Alright, it works now. Thanks for the help. I got "bootstrap" letting work too by "mvn install" all of the modules (and submodules) of bungeecord-proxy too.

orchid prism
stark valve
#

Hello, is possible to check if other, not depend, plugin is enabled? (not on enable)

lean gobletBOT
#

I think you can get it via the plugin manager?

stark valve
trail plume
#

The plugin manager is pretty rudimentary

#

maybe dead plugins won't be in there, but, it's not designed to care if stuff is enabled or not

stark valve
#

dead plugins is listed in get plugins

trail plume
#

maybe it's exposed somewhere in the plugin classloader stuff, but, otherwise 🤷‍♂️

#

bungee doesn't have the concept of plugins disabling/enabling at runtime

stark valve
#

i need only information if is working but i haven't any idea how make that check universal for any plugin

trail plume
#

as I said, such a mechanism probs doesn't exist

stark valve
#

ok, thanks 😄

torpid agate
#

Will there be support for forge 1.16 and higher ?

#

Or does anyone know a bungee fork or waterfall fork that supports the forge 1.16 ?

runic grove
#

Does velocity support forge 1.16? Not a fork but an alternative

high oak
#

FML1(~1.12) has packets that can reset the Handshake state, but this packet does not exist from FML2(1.13~).
Waterfall doesn't support Forge above 1.13
Even if there is a proxy or fork that supports this, client modifications are required.

glossy marsh
torpid agate
glossy marsh
torpid agate
#

alrighty

torpid agate
#

When the paper server is in the lightfall network

high oak
#

No, Paper doesn't support Forge Handshake, so it is not required.

torpid agate
#

nice

torpid agate
high oak
torpid agate
#

do i just drop it in the waterfall server ?

torpid agate
#

when i start the server with the lightfall i get this error when im trying to join the forge server.

tawdry narwhal
#

Take fork support into their appropriate spot of communication

torpid agate
#

what do u mean?

tawdry narwhal
#

That you should not clog this channel up with third party stuff

torpid agate
#

where can i get help with this ?

tawdry narwhal
#

Not here, this channel is for waterfall, not fork or third party support.

glossy marsh
#

@torpid agate On Archlight discord afaik

#

But as I said too, you won't get support here

torpid agate
#

👌🏽

upbeat narwhal
#

Is it normal for ServerConnectEvent to return the same server twice?

#

As if I was logging into the server twice at the same time...

#

It is printing twice the name of the same server when I enter

wide maple
#

how do you know that I still exist

#

lmao

sudden nest
# upbeat narwhal

doesn't it normally announce it? and the 2nd one is because you just told it to do it again?

bleak current
#

if a server doesn't have /server permission how else can you see a list of servers connected to a proxy?

#

/glist

bleak current
#

i.e default bungeecord config users don't have permissions for it so 99% of servers don't have it

lean gobletBOT
#

well usually people grant the permission if they want players access to that list

bleak current
bleak current
trail plume
#

Your question makes 0 sense in the context of the dev channel

bleak current
#

you know how when you join a bungee server you can't see everyone on the tablist unless they have a global one?

wide maple
#

Yea- I really have no clue what you're trying to do and how

#

from where?

trail plume
#

Which still makes literally 0 sense in the context of the dev channel

bleak current
#

a bungeecord server

wide maple
#

you want to ping that server?

trail plume
#

if you're actually a dev and running a plugin on the bungee server, you can literally get that info from the API

bleak current
#

most servers don't show players in ping

#

notchian server only shows 12 random ones

trail plume
#

12 random

#

random

#

So...

#

keep pinging?

bleak current
#

yeah i know

#

but most servers dont

#

sec

wide maple
#

query the server instead if you're so inclined?

trail plume
#

If the server doesn't expose that info publically, you can't get it, it's as simple as that

wide maple
#

^

bleak current
#

only about 13% are accessible

trail plume
#

the query protocol is often enabled which exposes that info

#

as well as literally pinging the heck out of it where the small list exists

bleak current
#

query is likely even rarer, it took me ages to find a server that works with it

trail plume
#

outside of that, the info doesn't exist publically

#

Which means that you're not dealing with waterfall dev, you're dealing with client dev

wide maple
#

then modify the tab list to do that? You're in the dev channel

bleak current
#

there isn't really a more suitable channel

trail plume
#

and, within the scope of the client, if that info isn't sent to you, and you don't have perms to the commands to get that info, you don't got that data

wide maple
#

this sounds to me like you're trying to build a server scraper

bleak current
#

the problem is essentially idk how to move between those servers

#

if only glist was enabled by default 🥲

wide maple
#

?? That makes even less sense

bleak current
#

what are you even trying to do

wide maple
#

you move between servers by using /server while connected through the bungeecord

#

yea Waterfall is not suited to do that without heavy modification

bleak current
#

/server isn't enabled by default so most servers don't have permission for laypeople

trail plume
#

then you're fucked

bleak current
#

😦

trail plume
#

Unless you're gonna work on a bot capable of actually fuaxing using a server, you're screwed, as we keep saying

bleak current
#

its gonna be painful to make a universal way

trail plume
#

There is no magical backdoor in our software for exposing information which server owners have hidden

bleak current
#

ig most servers use compasses etc

wide maple
#

and well, online mode and things

trail plume
#

There is no universal way

wide maple
#

you'd have to mod that in if you needed it

trail plume
#

That's the entire fucking thing here...

wide maple
#

a lot of servers also intentionally hide player info

#

¯_(ツ)_/¯

bleak current
#

ok

lean gobletBOT
#

just run a VM with the client and simulate mouse clicks/run a mod thinksmart

wide maple
#

@midnight sparrow @tawdry narwhal pls remove

midnight sparrow
#

!ban 472411758443626506 nitro scam

inner birchBOT
#

:raised_hands: Banned acirrox33#1923 (nitro scam) [1 total infraction] -- Larry#6086.

midnight sparrow
#

ty five

simple escarp
#

Heyy are there any way to get raid of this message, and change it for a custom?

uneven pendant
#

not without digging into proxy internals

flat arrow
#

Heyo! Bit of a strange error someone reported and I'm not sure where to proceed from here. There's only been one report of it, but we recently started using all Google libraries from the proxy jar instead of our own, so it may be related.

#

Error:

brazen hamletBOT
lean gobletBOT
#

have you tried explicitely loading the class before?

#

also might want to test on BungeCord, it might just be a bug in the bungee plugin class loader

wide maple
#

Cannot reproduce, I want the info about the JVM

#

posted as such on the issue

flat arrow
#

Thanks for commenting.

#

have you tried explicitely loading the class before?
I'd be fine with doing that, but I'd like to know why it happens first.

wide maple
#

There is a bug in an older openjdk build

#

so I want to rule that out

flat arrow
#

I'm sure I can get them on Discord if need be. Hopefully it's just an older Java build though.

lean gobletBOT
#

might want to add that info to the log lol

#

(in bungee/waterfall)

simple escarp
#

Hi how can I detect when a server close and is sending players to the fallback server, but detect which type of server the player is coming from, and if its 'X' type of server, then cancell that fallback connection and send him to the specific lobby for that 'X' type of servers

#

I know how to do this, all I need to know is where can I catch that information

#

which event

lean gobletBOT
#

there's a kick event

sharp cave
bleak current
bleak current
sharp cave
#

wat

#

ah

trail plume
#

That's just dumb use of reflection, not reflection itself

lean gobletBOT
#

@bleak current thanks, you wont be killed in the ai acapolypse :)

trail plume
#

I'll piss on your PSU

lean gobletBOT
#

;_;

#

NO PETS TODAY!

bleak current
#

i would like to apologize

frank meteor
#

Anyone know why its not transfering the player to the hub?
@EventHandler
fun playerJoin(event: PostLoginEvent){
val player = event.player
val hub = main.serverHandler.getHub()
player.connect(hub)
}
the ServerInfo is valid

trail plume
#

Because the proxy does its own "deciding where they go" after that

#

What you generally wanna do is implement the ReconnectHandler or find what the relevant event was

frank meteor
#

oh shoot sorry for pinging you forgot to turn it off on the reply

trail plume
#

it's an interface

#

there is a method somewhere to set it to be the one the proxy uses

frank meteor
#

oh

#

ic

#

would it be in the ProxyServer class

#

ah its just ProxyServer#setReconnectHandler

#

If I have no server to send the player to can I just return null?

trail plume
#

Yes, will just use the default list

#

But, do note that replacing that will prevent people from rejoining the server they logged out from on relog

frank meteor
#

I actually prefer that

#

So right now I have this code:

class SandboxReconnectHandler(val main:SandboxServerManager) : ReconnectHandler {
    init {
        ProxyServer.getInstance().reconnectHandler = this
    }
    override fun getServer(player: ProxiedPlayer): ServerInfo? {
        val server = main.serverHandler.getHub()!!
        println("Player ${player.displayName} is being sent to hub: ${server.name}")
        return main.serverHandler.getHub()
    }

    override fun setServer(p0: ProxiedPlayer?) {
    }

    override fun save() {
    }

    override fun close() {
    }
}

And this is the console output:

[03:58:37 INFO]: Player PrinceOfToxicity is being sent to hub: sandbox_hub_1
[03:58:37 INFO]: [PrinceOfToxicity|/REDACTED] <-> ServerConnector [sandbox_hub_2] has connected
[03:58:37 INFO]: [PrinceOfToxicity|/REDACTED] <-> ServerConnector [sandbox_hub_2] has disconnected

But I'm just getting a ReadTimeoutException:

frank meteor
#

^ Server wasn't configured correctly

#
override fun getServer(player: ProxiedPlayer): ServerInfo? {
        if(onlinePlayers.containsKey(player.uniqueId)) return onlinePlayers[player.uniqueId]!!
        if(!player.isStaff()){
            player.disconnect(ComponentBuilder(ChatHelper.format("&cServer is in maintanence mode!")).currentComponent)
            return null
        }
        if(main.serverHandler.hubs.isEmpty()){
            player.disconnect(ComponentBuilder(ChatHelper.format("&cNo hubs online!")).currentComponent)
            return null
        }
        val server = main.serverHandler.getHub()!!
        onlinePlayers[player.uniqueId] = server
        println("Player ${player.displayName} is being sent to hub: ${server.name}")
        return server
    }

Does anyone know the right way to do this? Because I'm getting a NullPointerException and the player isnt getting kicked.

trail plume
#

Don't use !!...

#

see what's null

frank meteor
#

ok

trail plume
#

Like, there are sometimes valid use-cases for !!, but, Kotlin offers much better tooling around nullability and you should take proper advantage of it rather than relying on "forcing" it

frank meteor
#

I thought it was ok since i used containskey

trail plume
#

I mean, more lower down than that

frank meteor
#

oj

#

*oh

trail plume
#

But, that's basically a double get too, just get once and check if it's null or not

frank meteor
#
    override fun getServer(player: ProxiedPlayer): ServerInfo? {
        if(!player.isStaff()){
            player.disconnect(ComponentBuilder(ChatHelper.format("&cServer is in maintanence mode!")).currentComponent)
            return null
        }
        val server = main.serverHandler.getHub()
        if(server==null){
            player.disconnect(ComponentBuilder(ChatHelper.format("&cNo hubs online!")).currentComponent)
            return null
        }
        onlinePlayers[player.uniqueId] = server
        println("Player ${player.displayName} is being sent to hub: ${server.name}")
        return server
    }
#

like that?

trail plume
#

that's better

frank meteor
#

Is it possible to do a global tab in bungee or should i just make individual ones for each of my servers?

trail plume
#

you'd need a plugin or something

lean gobletBOT
#

it's possible with plugins, yes

frank meteor
#

Yeah I was planning on implementing it into the plugin im working on currently