#waterfall-dev

8550 messages · Page 6 of 9

graceful kestrel
#

ok ok sorry

trail plume
#

there, finally pushed it from the branch, i tested it time ago and it worked

edgy hedge
#

Omg, thank you Cat!

edgy hedge
#

Isn't it a good idea to add a new method to the ProxiedPlayer interface as well? For now the only way to use the suppression is by using request builder

trail plume
#

maybe, kinda prefer the builder over several dozen overloads, only added that one cos I noticed that the retry thing would lose that

edgy hedge
#

Well, builder looks much more cleaner for me, yeah, that super long method looks ugly

#

Anyway, thanks!

knotty gazelle
#

this is the kick message

#

This is called in the server switch event

knotty gazelle
#

here's the version my server is running

trail plume
#

it's supposed to be a json component, not legacy text

#

at least for whatever element it's upset about, it clearly says that it's tryna parse something as json

knotty gazelle
trail plume
#

don't mention

#

2 second look at wiki.vg says that the value is a component

#

or, no, "the score name"

knotty gazelle
#

hmmm okay

trail plume
dusky agate
#

i have some code that updates the priority order of servers to join, and i was concerned about potential concurrency issues (mutating data/updating the backing array storage while another thread is iterating/reading it)java for (ListenerInfo listenerInfo : proxyServer.getConfig().getListeners()) { List<String> servers = listenerInfo.getServerPriority(); servers.clear(); servers.addAll(serversByPriority); }would this code run into any concurrency issues of that nature? or is it safe?

lean gobletBOT
#

if anything reads from that from a different thread than the one modifying it then it would of course not be safe

#

if you really think that would become an issue syncronize on the list I guess but that seems like a hacky solution

#

I personally would just not use the inbuilt priorities but handle that in the plugin yourself

dusky agate
dusky agate
lean gobletBOT
#

oh, yeah, I guess it wouldn't work either with synchronized

#

what you are doing is already pretty hacky, usually one wants to just use listeners and do the logic in the plugin

#

there are server connection events where you can send the target server directly

#

or if your goal is to only do that on connect then set a custom reconnect handler

dusky agate
#

alright i'll handle sending the player in some class that implements Listener, thanks 👍

#

ah wait i see what you mean by a reconnect handler, ill do that instead

civic valve
#

new mesage in #waterfall-github

[PaperMC/Travertine] New star added

react with kekwhyper

funniest thing 😆😆😆😆

dusky agate
#

what's the most idiomatic way to maintain configuration in a waterfall plugin? i have something like this going on```java
import net.md_5.bungee.api.plugin.Plugin;

public class HeadControllerPlugin extends Plugin {
@Override
public void onEnable() {
String controllerIp = getConfig().getString("controllerIp");
}
}
```but since getConfig() isn't implemented, i'm wondering if there's something simple like bukkit's getConfig() lying around or if i'd have to implement getConfig() myself

oak prairie
#

.javadoc

#

.jd

alpine bone
#

I heard bungee priorities work contrary to bukkit, is that true?
HIGHEST is first?
and
LOWEST is last?

lean gobletBOT
#

no

#

they work exactly the same

trail plume
#

no

#

there is bungeeguard

#

waterfall doesn't support modern forwarding

#

there is no plugin to fix that

#

somebody did start on a PR for adding that to waterfall but idk what the state was

#

(They told me to hold on review of it or something because of that)

lean gobletBOT
#

tbh I would question why you need a separate bungee instance in the first place

trail plume
#

I mean, maybe?

#

as said, there is a PR which was started on

#

like, it's an entire set of extra state, so, no idea if you can do it from a plugin, that's a question you'd need to answer yourself

lean gobletBOT
#

I see. might be easier to just use BungeeGuard on all your servers or add a feature to set that on a per-server in velocity itself

#

I mean they could also try using Velocity with Snap but that's a pretty huge change for them for something that is basically an issue on your end 👀

trail plume
#

I mean, either try that PR or modify WF yourself to add modern forwarding/see if you can skim it in a plugin, or use bungeeguard across the entire setup, or give up

lean gobletBOT
#

I mean if your setup doesn't allow outside access anyways you could just not use forwarding secrets 👀

upbeat crest
#

There’s Protocolize

#

Oh that’s 3 days old

#

Sorry

lean gobletBOT
#

pretty sure it supports all packets between the client and the proxy

#

what do you mean by "LoginPayloadRequest"? the login plugin request packet/custom query packet?

lean gobletBOT
#

what's your LoginPayloadRequest implementation?

#

uh

#

no, you need to use a Protoclize packet

#

their API works completely without you messing with bungee internals

#

see the Protocolize docs for the provided packets, the rest you need to implement yourself e.g. by looking at https://wiki.vg/Protocol

#

or the bungee/minecraft source

#

yeah pretty sure that's the one

wicked lantern
#

Actually i need help creating an new patch (I already saw the guide, but when i commit my changes github just says that it's clean and nothing to commit) Even the git plugin of the IDE creates a patch but that system suck, is buggy as hell.
I don't find any solution because i did nothing wrong.
(I built waterfall cleanly)
Did all two times to ensure that wasn't my fault.

trail plume
#

make commit in -Proxy, use script to rebuild patches, commit in the root project

wicked lantern
#

Thanks, also i want to edit an patch but i thing that upstream/upstream it's an example, but when i put the rigth command it throws this git rebase origin/master Current branch master is up to date
So, i don't know what im doing bad.

bleak current
#

It's not an example, upstream/upstream is the right branch

wicked lantern
trail plume
#

then you probs ran it in the wrong folder

wicked lantern
trail plume
#

No, it's in the -Proxy folder

#

Read the contrib guide for paper, stuff in -Server/-API is in -Proxy and upstream/upstream instead of base

eager hill
#

Can you modify a ChatEvent just for 1 receiver/player?

trail plume
#

well, no

eager hill
#

Better tell me how to do it then.

trail plume
#

chat event is just when the player chats and the message is sent to the client

#

if you where dealing with chat on the proxy you'd be cancelling that event for handling it yourself and then do whatever you want with it in terms of who/what you send

eager hill
#

Just want to get what's send, don't really care what event it is, modify it just for 1 player and that's it.

eager steppe
trail plume
#

I mean, the event is there, you can modify it all you want, idk if it does what you're expecting though

eager steppe
#

When you try to type "§" you get kicked.

#

I want to prevent that

trail plume
#

fork the server and remove that check?

eager steppe
#

When I try to fork Waterfall and build it, it just says "Waterfall-Proxy" module is missing.

trail plume
#

cos you need to apply the patches

eager steppe
#

And how can I do that?

trail plume
#

read the readme

#

see the build steps

#

otherwise, see the waterfall script

eager hill
#

So. What would be the best solution to my problem?
Without rewriting too much stuff?

eager steppe
#

got it

#

thanks

trail plume
#

krusic, waterfall basically doesn't handle chat

#

the event is fired and the stuff is just passed through

#

if you wanna modify chat itself for a single player you'd need to deal with a packet library or something

eager hill
#

Alright.

#

I'll figure something out. Hope they don't mind duplicate messages. 🛌

wicked lantern
#

xD

eager steppe
#

How can I modify waterfall's code? I tried to change it but everytime I build it, it turns back to the old code.

trail plume
#

make sure that you rebuild patches

#

or just build with mvn

#

read the contrib guide, etc

eager steppe
#

I tried to build it with maven but still the same results. my changes don't have a effect

trail plume
#

if your patches are applied and you build with maven, then the changes will be compiled

#

if it's not working idk what to tell you

eager steppe
#

my patches applied? is there a command?

trail plume
#

you did modify waterfall-proxy?

eager steppe
#

yes

trail plume
#

then, if you run mvn package, your stuff will be in -proxy/bootstrap/target

eager steppe
#

yeah, but it still doesn't work. Or do i need to use the -shaded jar?

trail plume
#

whateverjar was the largest

eager steppe
trail plume
#

don't run stuff in onedrive

#

should just be the Waterfall jar

#

but, the fact that they're all the same size, idk what you did there

eager steppe
#

I just used maven

trail plume
#

the fact that all those files are the same size, idk what to tell you

#

as said, don't run in onedrive

#

make sure that you've commited and rebuilt patches and such if you're gonna use the scripts to build; but, running maven directly should work fine

eager steppe
#

Onedrive is not the problem. Everything I did in onedrive before works flawlessly

trail plume
#

onedrive has caused many issues in the past for people using our tooling and such, but, 🤷‍♂️

eager steppe
#

nvm... It worked now

#

maybe you are right with onedrive. I've deleted the entire target folder and rebuilt. Then it worked.

#

Thanks

#

Weird, never happened before tbh.

vale fossil
#

hey, i'm new to bungeecord development and i'd like to know how to add configuration values in my config.yml

inland pendant
potent birch
shadow ore
lean gobletBOT
#

no, that's for paper, not waterfall

shadow ore
shadow ore
lean gobletBOT
#

yes, it's linked on teh javadocs site

shadow ore
#

Is there any reason why my plugin wouldnt be firing this event?

lean gobletBOT
#

do you have it registered?

shadow ore
shadow ore
lean gobletBOT
#

you do

shadow ore
lean gobletBOT
#

probably

shadow ore
#

yep :))

#

ty <33

#

Been a while so I'm a bit rusty

#

but forgetting that I guess im more dull then rusty 😂

lean gobletBOT
#

wrong TextComponent import

zenith grotto
#

how can I broadcast a message only to the staff?

shadow ore
zenith grotto
#

it works only for a single server

shadow ore
#

idk then

#

wait send rq

shadow ore
marsh dew
#

hello i have this warn in the console waterfall 😢


[23:54:54 WARN]: Plugin listener be.shark_zekrom.Events took 97ms to process event PostLoginEvent(player=shark_zekrom)!
[23:54:54 WARN]: Plugin listener me.lucko.luckperms.bungee.listeners.BungeePermissionCheckListener took 113ms to process event PermissionCheckEvent(sender=shark_zekrom, permission=HolocronMC.bypassMaintenance, hasPermission=true)!

[23:54:54 WARN]: Plugin listener be.shark_zekrom.listener.OnJoin took 306ms to process event PostLoginEvent(player=shark_zekrom)!

[23:54:55 WARN]: Plugin listener be.shark_zekrom.discord.Link took 104ms to process event PostLoginEvent(player=shark_zekrom)!

[23:54:55 WARN]: Event PostLoginEvent(player=shark_zekrom) took 513ms to process!

[23:54:55 WARN]: Plugin listener be.shark_zekrom.listener.OnJoin took 90ms to process event ServerConnectEvent(player=shark_zekrom, target=BungeeServerInfo(name=Station, socketAddress=/92.222.199.97:25567, restricted=false), reason=JOIN_PROXY, request=net.md_5.bungee.api.ServerConnectRequest@4c492611, cancelled=false)!```
it's my bungeecord plugin
#

I don't quite understand where it can come from

#

(ping me)

torpid rampart
marsh dew
# torpid rampart `be.shark_zekrom.listener.OnJoin took 90ms to process event ServerConnectEvent` ...

i have this

  public void serverConnectEvent(ServerConnectEvent event) throws SQLException {
      if(!event.getReason().equals(ServerConnectEvent.Reason.JOIN_PROXY)){
          return;
      }

      ProxiedPlayer player = event.getPlayer();

      Connection connection = Database.getConnection();

      PreparedStatement preparedStatementActualProfile = connection.prepareStatement("select * from players_profiles where uuid = ?");
      preparedStatementActualProfile.setString(1, player.getUniqueId().toString());
      ResultSet rsettingActualProfile = preparedStatementActualProfile.executeQuery();
      if (rsettingActualProfile.next()) {
          Integer actualProfile = rsettingActualProfile.getInt("actual_profile");

          PreparedStatement preparedStatementLocation = connection.prepareStatement("select * from players_location where uuid = ? and profile = ?");
          preparedStatementLocation.setString(1, player.getUniqueId().toString());
          preparedStatementLocation.setString(2, String.valueOf(actualProfile));

          ResultSet rsettingLocation = preparedStatementLocation.executeQuery();
          if (rsettingLocation.next()) {
              String planet = rsettingLocation.getString("planet");


              if (!event.getRequest().getTarget().getName().equals(planet)) {

                  Main.getInstance().getProxy().getServers().get(planet).ping((result, error) -> {

                      if(error != null){
                          event.setTarget(ProxyServer.getInstance().getServerInfo("Limbo"));
                      } else {
                          event.setTarget(ProxyServer.getInstance().getServerInfo(planet));
                      }

                  });

                  //player.connect(ProxyServer.getInstance().getServerInfo(planet));
              }

          }


      }
  }```
#

it's a server target

torpid rampart
# marsh dew i have this ``` @EventHandler public void serverConnectEvent(ServerConne...
  1. You should use try-with-resource blocks to automatically close the connections to the database
  2. You execute 2 querys on the database. Connections use a lot of time (in a programming sense) Try to use a join so it is only one query.
  3. Don't do a ping if possible. A ping will also travel over the (internal) network and take time. Try connecting the player directly to the planet and add another handler for when that connection doesn't work.
marsh dew
#

okay i will try all 🙂

#

@torpid rampartI made a system that if the server or the player must be put it is closed it is tp on another server

dusk heart
#

Hello,

I've created the command "/p h" with my bungeecord plugin but it's not working

#

And yes it's registered into the main class

misty jewel
#

i don't think you can have spaces in your command

trail plume
#

commands can't have spaces in their name

dusk heart
#

mm

#

so i would need to make the command /p and then listen to the args?

misty jewel
#

exactly

trail plume
#

yes

dusk heart
#

thanks

misty jewel
#

everything after /p will be considered an argument, separated by spaces

vivid steeple
shrewd root
#

Also you cannot compile if you have existing errors.

vivid steeple
shrewd root
#

If you reload the project, IntelliJ will detect that automatically.

vivid steeple
#

Which one?

trail plume
#

generally you use build itself

vivid steeple
#

Every time it builds it says there's errors lol

#

And won't build

trail plume
#

Well, as literally already said, you don't want the BungeeCord class, that's not part of the API

vivid steeple
#

Ah that might be why

#

I'm literally braindead

vivid steeple
#

Everything seems to work but the JAR is no where to be found :{

trail plume
#

jar is in the build/libs folder

vivid steeple
#

All that's in the build folder though

trail plume
#

don't mention.

vivid steeple
#

Sorry just did the reply thing lol

trail plume
#

I mean, the thing places it in the folder I said

vivid steeple
#

Wellll it's not here... I tried gradle build, gradle clean build, gradlew build, gradlew clean build, etc.

#

None of them lead to a JAR for some reason

trail plume
#

build goal should dump out the jar into build/libs unless you changed something in the gradle setup to move it

#

I can't really comment based on the small info of what I can see

vivid steeple
#

What information do you need?

vivid steeple
#

Ah alright I got it now

slate parcel
#

What I've done wrong? My IDE can't find waterfall-api 😮

    <repositories>
        <repository>
            <id>papermc</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.github.waterfallmc</groupId>
            <artifactId>waterfall-api</artifactId>
            <version>1.18-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
```(Java 17, IntelliJ)
trail plume
#

try building

slate parcel
#
error: release version 5 not supported

Language level is invalid or missing in pom.xml. Current project JDK is 17. Specify language level in <Here my plugin name>
trail plume
#

set the source/target level thing in maven

slate parcel
#

Ohh lol, got it xD yea, there went something wrong while settig up ^^ Thanks anyways 🙏

tiny nest
#

If I'm using BungeeCord right now and plan to change it to Waterfall will my BungeeCord plugins work with Waterfall without any changes?

shrewd root
#

Waterfall is like a copy of BungeeCord.

tiny nest
#

I see, thank you

vestal robin
#

I would not call it a copy. Technical term is "fork". Waterfall is based on BungeeCord with changes here & there to improve performance, security and configurability.

shrewd root
vestal robin
#

Wrong channel and no, this will never be possible.

potent birch
#

kinda impossible because the JVM has to load the new jar into classpath and unload the current paper jar and if you simply do that it may cause issues unless you restart the JVM itself

somber cedar
#

How do i prevent Mysql connection using JDBC driver from disconnecting after idle?

trail plume
#

use hikaricp

#

it will keep connections alive by keeping them active, safely, as well as ensuring that there are connections available, etc

haughty schooner
#

Hello, is there any AsyncJoinEvent in waterfall like the "AsyncPlayerPreLoginEvent" in bukkit? 🙂 Thanks

trail plume
#

pretty sure that the login event in waterfall was already an async event

haughty schooner
#

Oh yes, youre right 😄 Thanks cat

fair flame
trail plume
#

don't crosspost

zenith grotto
#

I dont know if I can ask for bungeecord development, but does getStringList(example) returns a list even if example in the config isn't a list but a "normal" string?

trail plume
#

no

#

well

#

it might return an empty list, idr

zenith grotto
#

ok, thank you. How can I dynamically have a String List or a string based on the value of example?

trail plume
#

you'd need to check if it's a String or not

potent lichen
#

there's a method which will return an Object, I believe getObject. Use that

wide maple
#

That’s easy to do; but it’ll break the game. There’s a reason it’s a new protocol version and without translating the version you’ll break the client
ViaVersion + ViaBackwards is something you can use to do just what you said

#

For that kind of use Via should also be rather light in resource usage because there isn’t a lot to translate overall

boreal crown
#

I wanted to update a plugin, but it seems like the used API version is outdated?
There are some missing imports such as net.md_5.bungee.UserConnection and idk what I could do to fix this.
The plugin in question uses the original BungeeCord API 1.16 Snapshot version (As mentioned in the outdated wiki from them)

My personal guess is that the original dev probs used a local jar or had a different dependency in their MavenLocal...

trail plume
#

UserConnection is not API

boreal crown
#

I guessed as much

#

Question for me is now how they actually accessed those particular classes.

#

Normal maven download doesn't provide them (obviously)... So a local jar?

#

Tho, would that then not also be defined in the pom.xml?

trail plume
#

idr, mabe just waterfall-proxy or something, or whatever bungees equiv is

#

you'd need to install to maven local or something

lean gobletBOT
#

or just use the api...

obsidian pivot
#

do the classloaders in bungeecord nor waterfall supports multi-release jars?

trail plume
#

probably not

obsidian pivot
#

Does anyone know of a specific reason why md5 never pulled the multi-release patch that paper has into spigot? I assume that happens a lot for patches that arent super significant?

trail plume
#

We stopped speaking to md years ago when he was basically blanking us

obsidian pivot
#

-Djdk.util.jar.enableMultiRelease=true exists fortunately

zenith grotto
#

Does ProxyServer.getInstance().getPlayer("example") return null if the player specified isn't connected/doesn't exist?

sleek jackal
#

yes

#

iirc

vivid steeple
#

How can I download the latest Waterfall JAR via the API?

#

Trying to make a custom Pterodactyl egg to do all the work for me lol

#

https://papermc.io/api/v2/projects/Waterfall/builds/???

#

So far I have this, but where the question marks are I have no clue lol

#

Looking at this but no clue for the latest part

trail plume
#

You'd need to query the list of builds

#

and then get the latest from that

vivid steeple
shrewd root
#

yea ofc dude

trail plume
#

given waterfall has nothing to do with worlds, in this context, basically, no

#

as for on the server? within the bounds of the API? no

#

if you wanna mess with server internals, etc, sure

trail plume
#

don't mention

#

from the proxy, i.e. the context of this channel, basically, no

#

from the context of the server, "yes"

#

but, 100% unsupported

vestal robin
obsidian pivot
#

i think paper uses reflection lol

#

and yeah its something -Djdk.util.jar.enableMultiRelease=force :)

trail plume
#

paper builds against java 17 and so can just set the flag

#

waterfall builds against 8 because jenkins is a bitch

wicked lantern
#

True

outer cosmos
#

Waterfall GitHub Actions when?
Or is there a reason why you're keep using Jenkins?

trail plume
#

Well, we moved away from jenkins now

outer cosmos
#

Ok, so just a artifact from the past.

trail plume
#

I couldn't bump past 8 because jenkins just kept breaking with waterfall, me and z spent many hours upon tryna work out why and gave up, so, when paper was pushed forward, we didn't bother to see if it was magically working yet

#

Now that we're off jenkins, I generally am kinda burned out from waterfall, and don't really care to deal with tryna move the min java version forward

outer cosmos
#

Yeah, fully understand Waterfall is eol enough that it isn't worth it.
It's only worth it when new Java features are utilised.

bitter ibex
#

i am trying to understand this but is there going to be no more updates for waterfall or am i just reading this wrong?

bitter ibex
#

so what would be the best proxy to go to then, because i want one that will be updated when new minecraft versions come out?

trail plume
#

waterfall will still be updated for a while but long term you should be looking towards modern solutions like velocity

bitter ibex
#

thank you very much

zenith grotto
#

differences between TextComponent#toString() and TextComponent#getText() ?

lean gobletBOT
#

onw gets the text of the component, the other generates the string representation of that object which is usually not really useful for much (beyond reading it as a human)

#

*one

zenith grotto
#

thanks

#

if I need to convert the TextComponent which is formatted to a String with the colorcode character (& or $) what method I have to use ?

#

example:
TextComponent:
Stop (in red)

String:
&cStop

somber prism
#

you'd use the legacy ampersand/section serializer

lament flare
#

is it possible to get instance of OfflineProxiedPlayer
I need to check there ip I got there uuid
but I get null point if I try to get ProxiedPlayer
and I am hooking to litebans to check if they are banned and LiteBans need there ip

tepid dagger
#

You'd have to store the player info yourself

#

But I am a bit confused that LiteBans needs the ip to check if a player is banned, that should work on an uuid basis as well PandaThink

trail plume
#

there is no "offline" proxied player

potent lichen
#

The litebans API really isn't the best. I suggest a superior punishment plugin

vital hedge
#

This is more of an operational question that I couldn't find the answer to while googling and reading the docs: how does one trigger a graceful stop eg. when running through systemd or other such service layers? Many pieces of software listen for various signals, eg USR1 or USR2 to do graceful stop / restarts, and I was wondering if waterfall had something similar. If stop/end can only be triggered through STDIN then using a named TTY or even wrapping it all in screen / tmux are options, but those are quite frankly somewhat dirty solutions. Graceful service handling would be sweet, so any tips / pointers are greatly appreciated.

vital hedge
#

Additionally: if these facilities don't already exist, are you open to considering a patch that adds that functionality?

trail plume
#

java should already handle the standard kill signals and afaik the shutdown hooks already exist in bungee for them

#

I can ctrl-c just fine

vital hedge
#

Ah, so a graceful shutdown on SIGINT should work?

trail plume
#

yes

vital hedge
#

That is great 🙂 Thank you for replying. I'll just have systemd SIGINT it instead of SIGTERM'ing it, then all should be fine.

vital hedge
#

I see now what confused me earlier. When runnning manuallu from a terminal and from another tty doing a kill -s SIGINT $pid the process logs that it is stopping gracefully. When running the samme start command using systemd and doing a kill -s SIGINT $pid then the messages about a graceful shutdown are not printed / journaled through systemd. So presumably the process either detaches stdout in some way when run through systemd, or I have messed up something. Or both.

#

Oh, no something else is afoot. In waterfalls own logs the log lines for graceful termination are present in the former scenario, but in the latter (systemd) then even though the process is sent the same kind of signal then waterfall does not log anything about a graceful shutdown.

#

So there seems to be a difference in how it operates based on how it is started.

trail plume
#

maybe down to log4j

#

chances are it shutdowns properly but the logger just doesn't deal with it

vital hedge
#

Good point. Might very well be that.

#

Would that be considered a bug in your opinion? Or just a quirk?

vital hedge
#

Ok, so I have checked with a couple other Java applications that also use log4j and I haven't found instances where the messages logged during shutdown aren't picked up by systemd's journal. So might this just be something with waterfalls usage of log4j? I don't really do any java myself so I have no knowledge about these specifics of log4j.

trail plume
#

I potentially patched it yesterday

#

it's all down to the order that stuff shuts down

#

the logger was shutting down before the proxy did

vital hedge
#

Ah, that would do it I imagine. 🙂 Super cool that you have patched though. Would you like for me to try a specific build and see if it has been fixed?

trail plume
#

I mean, you can try the latest build

vital hedge
#

I'll do that, and report back. Thank you for your time so far.

vital hedge
#

Tried with build 483, but unfortunately observe the same behaviour as previously. Can it be that the output buffer log4j uses is not flushed soon enough, and the process is terminated before that is done?

civic epoch
#

is there any waterfall plugin template thats cloneable from github?

toxic radish
#

Is it possible to check if a server is online/running from a plugin on another server? I saw some people using sockets, but those say the server is running when it's still starting up.

wide maple
zenith grotto
#

is there a way for create a placeholder and make it available for all the servers under the proxy?

lean gobletBOT
#

possible? sure

zenith grotto
#

with developing only a proxy plugin ?

lean gobletBOT
#

depends on what your actual goal is

zenith grotto
#

i want to create a chronograph but it needs to be handled by a proxy plugin

#

i want to make available this chronograph through a placeholder

lean gobletBOT
#

a what?

zenith grotto
#

stopwatch*

#

that thing that counts the time elapsed

lean gobletBOT
#

ok and what partare you struggling with?

zenith grotto
#

i dont know how to make it available through a placeholder to the backend servers

lean gobletBOT
#

you just send the data to them?

zenith grotto
#

do i have to create a back-end plugin for this? (receive the data, handle it and create a placeholder)

lean gobletBOT
#

yes

#

unless whatever placeholder plugin you are using already allows registration from the procy

zenith grotto
#

does Placeholder api support it?

lean gobletBOT
#

no idea, last time I checked it didn't

surreal iron
#

Is it possible for multiple players to have the same uuid when offline mode is on in waterfall?

wide maple
surreal iron
#

I got it thanks

bleak current
#

Hi! When working with waterfall is it needed to get back to the "main thread" after executing something async? Or it's fully thread-safe?

trail plume
#

there is no main thread

#

things are designed to be reasonable thread safe

bleak current
#

Oh I see. But that makes me wonder : Is it even as useful to run database queries async? As I think that listeners are all executed in their own threads?

#

Like if I don't work async with such slow things will I slow down my whole proxy and/or others plugins?

trail plume
#

listeners are executed in place

#

i.e. generally in the network pipeline

wide maple
#

Bungee has some horrifying undocumented breaks in threading continuity

#

If you find some I’ll try to fix them but usually these aren’t reproducable easily

torpid rampart
#

What is a good way to find out what part of my plugins uses a lot of memory / allocates a lot of short-lived objects?
What tools should i use / What websites have good, useable guides or documentation?
I already have visualvm set up, but i can't find anything interesting in it.

#

please ping me when replying.

lean gobletBOT
#

@torpid rampart make a heap dump and use eclipse memory analyzer to see the content

#

spark also has a heap overview but I'm not sure how detailed that is

indigo locust
#

So I currently have an Issue where Maven can't build because the Checksum of the waterfall components can't be validated. IntelliJ outright says it can't resolve it, while my CI Pipeline states that it can't validate the Checksum. Any Idea how to fix this

#

org.eclipse.aether.transfer.ChecksumFailureException: Checksum validation failed, no checksums available

#

Thats the error

compact topaz
#

is there a way to check if a player was kicked by an operator or if the server shut down?

indigo locust
lean gobletBOT
#

@ionic inlet first will be the join on the new, then the quit on the old. which is pretty reliable afaik

ionic inlet
#

thanks phoenix

flat pawn
#

What is the problem

#

Bungee cord/waterfall server can't load plug-in!

trail plume
#

it says all anybody here can say right there in english

#

is viaversion installed?

flat pawn
#

Yes

trail plume
#

well, something went wrong

#

check the full log, all we can say is what is right there in english

#

otherwise, speak to the relevant plugin authors

#

(also, wrong channel)

#

not reading that

#

if you want me to look at it provide the actual log file

flat pawn
brazen hamletBOT
trail plume
#

that's not waterfall

#

You have bukkit plugins on bungeecord...

#

and literally nowhere is viaversion

flat pawn
#

W8 1 sec

flat pawn
brazen hamletBOT
trail plume
#

And that's not waterfall either

flat pawn
#

How fix that

#

It's waterfall

#

Check again

trail plume
#

That's Aegis

#

which is not waterfall

flat pawn
#

💔

wicked lantern
#

Because when some attack or just a lot of connections are beeing established is ass to see the console like that

#

nvm i saw it on waterfall-help, but should be a way to mask

lapis bison
#

Hello, i just wanna ask about netty pipelines in bungeecord and all forks of this - where excatly it handles bukkit packets? As far i seen MinecraftDecoder/Encoder parse just packets added in Protocol map so can't deduce any other pipelines that just forward it to spigot directly without parsing

trail plume
#

it just passes the packets it doesn't need to care about through

lapis bison
trail plume
#

"bukkit packets" makes 0 sense

#

the server sends a packet

#

the packet hits the decoder

#

if the packet type is in the registry, it's decoded and dealt with, if not, it's basically passed through as the raw bytes

lapis bison
#

By bukkit packets i mean all of them that are not added to protocol map in bungeecord

#

it's basically passed through as the raw bytes yes i'm just looking place of this, where and how or where i can add my pipeline to handle with them

trail plume
#

depends on your goal

lapis bison
#

For example i want send raw packets from bungeecord to spigot about Head Rotation (Entity Head Look 0x3E) player's B to player A, but pipeline parse only DefinedPacket i guess

#

I tried it in this way ```java
player.getPendingConnection().unsafe().sendPacket(array);

trail plume
#

use a library or something which deals with that

lapis bison
#

When i registered 0x3E in protocol map and wrote parsing it works, but raw data no

trail plume
#

because it's not designed to let you just shove in a bunch of raw bytes

#

You'd send a ByteBuf, idk what exact it would expect in there in terms of data

#

I ain't really touched this mess in a while

lapis bison
#

and handle it to spigot

trail plume
#

don

#

't mention

lapis bison
#

sure, i'm sorry

trail plume
#

client -> bungee packets are passed through the deframer, the decoder, IF they're mapped packets, they're decoded, if not, they're wrapped and passed through the chain

#

bearing in mind that the clent connection and the server connection are two entirely different things

lapis bison
#

that makes sense, but MinecraftDecoder ```java
} else
{
in.skipBytes( in.readableBytes() );
}

trail plume
#

the main stream is, yes.

#

You'll note that the slice is passed over, however.

lapis bison
#

Oh excatly, haven't seen before. You gave me a little different look at this, I'll try to do it again. Thank you

rain axle
#

Do waterfall/Bungee have the jdbc driver shaded?

weary grove
lavish parcel
#

Hi, I need to do some time demanding stuff in PreLoginEvent (takes about half a second, I can't speed it up), but I get this annoying message:

Plugin listener <listener> took 504ms to process event .... 

Is there anything I can do with it?

#

Oh, I can register an intent and do the stuff async

sturdy garnet
#

Does adventure work on Waterfall?

trail plume
#

using adventure platform, yes

#

it's not built in to waterfall

exotic robin
#

I need to disconnect a player and I'm only able to use disconnect(BaseComponent[] message)
Is it possible to have MiniMessage in the config and somehow make it to BaseComponent?

trail plume
#

yes, use the gson serialiser tocreate json and then deserialise that with bungee chat

exotic robin
#

it's the parse method, isn't it?

trail plume
#

what?

exotic robin
#

ComponentSerializer.parse(json);

trail plume
#

apparently so

exotic robin
#

I got this now and it throws two exceptions: NoClassDefFoundError: net/kyori/adventure/text/serializer/gson/GsonComponentSerializer;

ClassNotFoundException: net.kyori.adventure.text.serializer.gson.GsonComponentSerializer

MiniMessage miniMessage = MiniMessage.miniMessage();
Component component = miniMessage.deserialize("<red> test </red>");
String json = GsonComponentSerializer.gson().serialize(component);
BaseComponent[] bc = ComponentSerializer.parse(json);
player.disconnect(bc);

The pom.xml is most likely working as I took everything from the docs

<repository>
  <id>sonatype-oss-snapshots1</id>
  <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

...

<dependency>
  <groupId>net.kyori</groupId>
  <artifactId>adventure-text-minimessage</artifactId>
  <version>4.10.1</version>
</dependency>

trail plume
#

you' d need to shade that stuff into your own plugin

#

waterfall doesn't bundle adventure

exotic robin
#

compile into scope tags?

zenith grotto
#

hey! I want to have an auto update config function for my plugin. The problem is that i don't known how to get the "internal" config (inside the .jar) and the "external" (in the plugin data folder) and then compare them.

Thank you

exotic robin
#

you just need a version: in your config and compare it against a static final variable you declared somewhere in your code

zenith grotto
#

yes i already heave that, but if it founds an update what do i have to do?

#

if the user already installed the lastest jar

trail plume
#

depends on what you're doing

#

you'd have logic which deals with renaming config options

#

if you wanna compare against the default config you'd need to load it from the classloader or something

exotic robin
#

i would just get everything out of the old config, move it to config-old-date.yml and create the new config with these old variables

#

really depends on what you want to do as electroniccat said

#

thanks, my problem's solved.
Have a great remaining day / evening / night, really appreciate your help ^^

zenith grotto
# zenith grotto hey! I want to have an auto update config function for my plugin. The problem is...

I made a progress for the configuration thing.
My config looks like this:

messages:  
  error:
      noperm: '&cInsufficient Permissions'
      nocommand: '&cThis command doesn''t exist!'
      noplayer: '&cSpecify a player'
config:
  clearchat: true
commandblocker:
  enabled: true
  whitelistedcommands:
    - "/example"

For checking if the config inside the .jar coincidence with the external config I iterate on it using internalConfig.getKeys() and then check if the external config contains the value.

But this method doesn't check if "sub-values" (like message.error.nocommand) are missing,

How can I do it ?

trail plume
#

it's a nested data structure

#

so, basically, you'd need to nest

echo flax
#

Hey, I'm wondering if Waterfall has something equivalent to "RegisteredServer" that Velocity has

trail plume
#

that would generally just be ServerInfo i'd imagine

echo flax
#

That actually worked out a lot better than I expected, thanks dawg

indigo locust
#

I currently get this error while trying to build my Project. Maven tries to resolve a Snapshot Version that neither exists in my Repo nor in the Paper Repo I have mirrored. Any Idea on how to fix this. I already tried to force maven to update SNapshots with the -U Flag but that didn't work

trail plume
#

Because we publish the API, not the entire set of packages

#

if you want access to -parent, you'd need to install it yourself

#

oh, nvm, -parent is published

#

But, you have some other repo which is interferring

indigo locust
#

I have the API as a Dependency, Maven just tries to download the transitive Dependencies of it. And the Version Maven is looking for doesn't exist in the Paper Repo either. I tried Removing my Repo and switching it to the official Paper Repo. Same Result

trail plume
#

I mean, am just looking at the version info that it's looking for

#

such a version never existed on the paper repo

#

that once again screams that it was pulled from another repo

#

see the metadata info stored in the local maven repo, I guess

trail plume
#

no

wicked lantern
trail plume
#

Because people ask for support, and not having basic info of why something happened works against that?

#

You can literally just use a log filter if you don't wanna see it, I don't see the need to add a boolean for every single bit of "something unexpected happened"

wicked lantern
#

rip

zenith grotto
#

honestly i never worked with nested data structures so I dont know what I have to do

bleak current
#

I want each server to write its own name at the beginning of bungeecord messages
e.g:
%server_name% >> this server is down

bleak current
#

Is there anyone to help?

lean gobletBOT
#

if you ask a specific question then someone might answer it, yes

spark anvil
#

At what point in the login events is a player's username verified with Mojang?

wide maple
#

If you’re asking about when the authentication takes place: between prelogin and loginevent

bleak current
#

you are already connected to this server

#

I want to make it the prefix fixed at the beginning of the message it the name of each server

lean gobletBOT
#

if you want to do it on the proxy then you might need to completely replace the chat handling unfortunately

bleak current
lean gobletBOT
#

would be better to do it on the individual paper servers as they provide proper chat rendering api

#

I mean you are in the dev channel so I assumed you wanted to create a plugin?

bleak current
#

yes i know but i don't know how to set up algorithm so i wanted to ask in developer channel

lean gobletBOT
#

well did what I said answer your question then?

bleak current
#

i don't understand yet

#

I'm confused

lean gobletBOT
#

which part do you not understand?

bleak current
#

I want each server to write its own name at the beginning of bungeecord messages
e.g:
%server_name% >> this server is down

#

you are already connected to this server

#

At the beginning of this message I want it to prefix the name of each server

#

i don't know how to do this

lean gobletBOT
#

you listen for the event that triggers it and replace the logic with your own which sends that message

#

there is no good way to modify any inbuilt messages or the chat

bleak current
#

I got it, can you show a code as an example?

lean gobletBOT
#

there's lots of examples on the internet (different wikis, forums, videos, whatever you prefer)

#

or just look at how other plugins do it

bleak current
#

I couldn't find a sample plugin or I couldn't find a sample code

#

I don't know how to search

lean gobletBOT
#

"bungeecord plugin tutorial" should lead to tons of results

#

also learning how to google is one of the most important things you can learn nowadays

spark anvil
bleak current
#

no i'm not talking about that

#

I want each server to write its own name at the beginning of bungeecord messages
e.g:
%server_name% >> this server is down

lean gobletBOT
#

...

#

nobody is going to write it for you

bleak current
#

okay thank you

#

bro

lean gobletBOT
#

(unless you pay or are lucky I guess)

bleak current
#

I'm looking for a developer for 40 thousand dollars already for BungeeCord Proxy

lean gobletBOT
#

well I hope you find one. this is not the correct place to hire someone though.

bleak current
#

okay 🙂

wicked lantern
#

Just create an boolean on ProxyConfig named "logExceptions" for example i guess and add it on the Waterfall config but is for debug i guess.

frigid ruin
wicked lantern
#

I can do it for you

#

idc

frigid ruin
# wicked lantern idc

that would be extremely helpful but if possible the latest version of waterfall would be good

wicked lantern
#

Well obvuisly, im cloning the lastest commit on github

fallow vault
trail plume
#

no

fallow vault
#

okay thanks

wary hamlet
#

can i use net.kyori.adventure.text.Component in waterfall or is there other component with the same features?

bleak current
#

you need adventure-platform-bungeecoord

#

I believe there is a (dead) waterfall PR to add adventure support though

wary hamlet
#

thx

wind grail
#

Hello i have a bug with waterfall.yml

wicked lantern
fallow elbow
#

heyo, I'm tryna make an mc server and I have a plugin that needs access to a mysql database (im using mariadb) but it always denies permission.

I have enabled remote root login (not that it matters), created an admin account and both of them still doesn't work

trail plume
#

create a new user, noting that the biggest thing is that the hostname matches

#

i.e. lazy option of using the % for network access, or localhost, which iirc is only for the local socket (which, you're probably not using)

potent birch
#

is there a function that returns the max player count?

#

oh it's show max players

#

loll

fallow elbow
#

do u know how to fix this?

#

i am using mariadb and i've heard that they have messed up some ssl connection stuff

trail plume
#

?useSSL=false

#

or, setup SSL, basically

zenith grotto
#

How do i check if the player had some problems while connecting to a server ?

#

like not whitelisted, banned, connection refused, etc.

wide maple
#

Dont ping cat.
Remove using a client mod? Fine. Remove without? good luck.
What youd need to do:
Full entity-ID rewriting,
Full location tracking,
Full player state & other player state tracking.
Optional: Client location rewriting
Stateful ID tracking (maps etc) and rewriting

#

nevertheless not impossible

#

just not worth the effort

wide maple
#

Go ahead. You’ll desync and break the client in a whole bunch of different ways, but that was true back then too

#

Because if you aren’t able to clear the client then the next server doesn’t know what the client already has or knows

#

You’ll run into conflicts and desyncs

#

Most of the things you need to track are only reset on respawn or even worse only on joingame

#

No.

sleek jackal
#

wasn’t there a fabric mod that fixes that?

#

unless i’m thinking of something else

wide maple
#

Still no. I’ll throw you a bone though, rather than tracking and rewriting you’re better off hiring someone to make plugins for proxy and server that syncs that data so the next server knows what is given

#

That solution is easier to pull of on velocity as it requires less edits internally

wide maple
#

Anything that has an increasing volatile ID and anything that has cache on the client

#

Which is quite a lot of stuff

#

Also waterfall is lacking api to make this easy

#

Well easier

#

But this is as far as I’m gonna help with that

#

You were probably saved by bungeecord having this feature in the past, but it won’t be helpful in modern versions. The rewritten entity IDs in 1.16 and newer was limited to things that couldn’t be cleared on a respawn, so you’re gonna be desynched either way

#

You removed the respawn?

#

Tough luck. The modern versions always require JoinGame if you’re not reconnecting to the same server

#

The dimension and biome registry is the reason

#

If those match 1:1 you can skip it

#

But only if that applies

#

No, well yes, but not if you tell the client it’s the same world

#

Then it won’t clear any data

#

That idea went out the window with 1.16. Those are there by default but don’t need to be

#

World > respawn > other world
Where the other world can be of the same dimension type from the dimension registry but doesn’t have to be
If the name of the next world is the same then no data is cleared
That makes it unusable to switch servers on bungeecord
But if you want a detailed draft on the issue you’re in luck; I had an extensive one here:
This doesn’t include the changes to the respawn packet later on so keep that in mind

https://github.com/SpigotMC/BungeeCord/pull/2861

#

No. Future versions enforce a list that the client also gets

zenith grotto
#

How do i check if the player had some problems while connecting to a server ?
like not whitelisted, banned, connection refused, etc.

trail plume
#

best there is is the kick events, afaik

#

I don't recall the API exposing that stuff too well, unless there was a callback? idr

zenith grotto
#

ok thanks

#

is there something that I can use without events?
I'm working on command that send the players to another server and I have to "interrupt" it if the users have problems to connect

trail plume
#

See the send command implementation?

#

As said, pretty sure that there was a callback or something

lean gobletBOT
#

28

#

meh xD

indigo locust
#

Has anyone here experience with Unit Testing Waterfall. If so, are there some examples you can share

wide maple
#

Waterfall doesn’t have unit tests itself, what are you trying to do

zenith grotto
#

Where I can see all the exceptions that can be thrown by ProxiedPlayer#connect(ServerInfo target, Callback<Boolean> callback) ?

#

so the Throwables

trail plume
#

that's not documented

wide maple
#

(Not surprising)

trail plume
#

Well, the thing itself shouldn't throw any exceptions, outside of if the server info is null

#

Just, the exceptions aren't passed to anything afaik

zenith grotto
#

I have to check if the plugin is trying to connect someone who is already in the target server

trail plume
#

use the connection builder

zenith grotto
#

the one in the package java.sql ?

trail plume
#

No

#

ServerConnectRequest

zenith grotto
#

oh nice, that was what i wanted

#

thank you

indigo locust
trail plume
#

There's very little to mock

#

Unit testing is just writing tests to ensure functionality, having to mock 3rd party stuff is often a test smell/indicative of bad design

indigo locust
#

I already use Dependency Inversion for most stuff. But I can't use it for everything

#

And I would mainly just do unit tests in bungeecord to get the coverage up

#

But I'll look into writing the mocks myself

zenith grotto
# zenith grotto oh nice, that was what i wanted

i tried it but i actually dont know how to wait for an async task to finish.

Code:

p.connect(ServerConnectRequest.builder().target(serverTarget).reason(ServerConnectEvent.Reason.COMMAND).callback(((result, error) -> {
            if (!(result == ServerConnectRequest.Result.ALREADY_CONNECTED || result == ServerConnectRequest.Result.ALREADY_CONNECTING || result ==  ServerConnectRequest.Result.SUCCESS)) {
                staff.sendMessage(format("&cThere was an error while connecting you to the Server!"));
                cantConnect = true;
                return;
            }
        })).build());

if (cantConnect) {
            return;
  }
trail plume
#

the callback is called when the thing is finished

zenith grotto
#

yeah, that's the problem

trail plume
#

The ideal pattern is that you do stuff in the callback vs blocking, because, you can't safely block

zenith grotto
#

how can I do it? if I return in the callback it doesn't block the entire execution of method containing it

trail plume
#

I mean, as I said, ideally, don't

#

do your stuff in the callback

#

otherwise, use a future

zenith grotto
#

ok, thank you for the patience

turbid mural
#

is it possible to hook into item-despawn-rate? I want to make an advertisement hooking into this default spigot.yml setting to alert players when there are less than 30 seconds before despawning

lean gobletBOT
#

wrong channel?

trail plume
#

wrong channel...

lean gobletBOT
#

sniped :P

turbid mural
#

Ah yeah, I was sure it was paper-dev xD

zenith grotto
#

I tried to use CompletableFuture but i probably misunderstood how it works because the if (cantconnect) is still executed before the callback of ProxiedPlayer#connect(ServerConnectRequest scr)
https://pastebin.com/BrtbR3qu

trail plume
#

your future is returning the wrong thing

#

you need to complete the future in the callback for it to work

#

You're literally just returning the result of connect()

zenith grotto
#

something like this?

staff.connect(ServerConnectRequest.builder().target(ss).reason(ServerConnectEvent.Reason.COMMAND).callback(((result, error) -> {
            CompletableFuture<Void> connectS = CompletableFuture.runAsync(() -> {
                if (!(result == ServerConnectRequest.Result.ALREADY_CONNECTED || result == ServerConnectRequest.Result.ALREADY_CONNECTING || result == ServerConnectRequest.Result.SUCCESS)) {
                    staff.sendMessage(format("&cThere was an error while connecting the suspect to the &4ScreenShare Server!"));
                    cantConnect = true;
                }     
            });
        })).build());
trail plume
#

create a future outside of connect

#

inside of connect, comp,lete that future

#

You probs wanna pass in the actual result to the future instead of using void, given that tryna update a field like that is basically dumb

zenith grotto
bleak current
#

Hello, what could explains my CompletableFuture taking a very long time to complete during peak hours until basically my whole bungeecord is lagging?

Initially the CompletableFuture will take around 20ms to complete, sometimes I see it taking 200-600ms (Already too much I guess?). But when it start lagging requests will pill up and it can takes up to 20 seconds to complete. I am using a FixedThreadPool with 5 threads.

#

My theory is that for some reason threads are not released in the pool until a saturation point is reached which means all the new requests are throttled but what I can't understand is how the saturation of this pool would make my whole bungee lag

vocal tide
#

What is the CF doing?

trail plume
#

Well, I mean, CFs "complete" when the thing trying to complete them completes

#

if you're using a fixed thread pool, that means that it's not gonna resize and so if work starts piling up, it's gonna pile up

#

one might suggest actually using a profiler or something and doing some digging to see where the time is spent

bleak current
#

What the CFs are doing :

#

And then these managers are called by a javalin webserver ran when waterfall launch:

#

I know there is non-existant handling of exceptions in these CFs I wasn't aware of how it was working when I wrote this code, I need to implement it asap

#

About monitoring I would like to do a thread dump but while using docker containers with pterodactyl I don't really have an idea of how to do it

#

SparkBungee seems to provide some good tools but you can't create a thread dump afaik

lean gobletBOT
#

what exactly is your goal by doing a thread dump?

bleak current
#

Seeing what happens on the threads backed up by CFs, what precisely is taking so much time making the whole plugin stucked?

But I've never done a thread dump before so maybe I am not aware of the actual usage of them?

lean gobletBOT
#

sounds like you want to use spark's profiler

bleak current
#

but that's out of this channel purpose I guess

lean gobletBOT
#

make sure you are running the latest version but yeah, that would be an issue for them

#

seeing as you aren't even running waterfall it's really out of scope anyways lol

bleak current
zenith grotto
obsidian pivot
#

Can someone confirm that bungeecord/waterfall isn't respecting my depends

#

I would also expect errors from floodgate & protocolize since i softdepend on them, but luckperms is the first lib that i reference

twilit pewter
#

I think it's case sensitive softDepends

lean gobletBOT
#

28

#

meh xD

obsidian pivot
#

fuck my life

#

thank you

weak thunder
#

I have this code to check if a server is online


private boolean pingServer(InetSocketAddress addr) {
        try {
            Socket s = new Socket();
            s.connect(addr, 10);
            s.close();
        } catch (IOException e) {
            return false; // Not online
        }

        return true;
    }
#

it always returns false though, idk why

#

debug mode shows this, the server ip is a perfectly fine server

trail plume
#

The connection timed out

weak thunder
#

yeah but why

#

the server is up

#

If I remove this check i connect perfectly fine

trail plume
#

I mean, I can't really say

#

10ms is not that long in the scheme of things

#

and that's ignoring networking issues

#

(i.e. routing, network config, etc)

weak thunder
#

this checks if the server is up before sending a player there. When I removed the check my player connected

#

so it cant be a network thing

#

ill try increasing the timeout ig

#

that worked 😅

languid wagon
#

if i've got a #Configuration, how would i clear it?

#

could i just set it to a new instance of Configuration

primal grove
#

So I know that sending an actionbar to a player is possible with velocity, is there a way to do that using waterfall as well?

wicked lantern
#

Send an ChatMessageType as actionbar like "player.sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.translateAlternateColorCodes('&',"blabla"));

#

If you want to keep it for time, do an timertask

primal grove
#

got it, thank you

wicked lantern
dusk heart
#

Hello, I need some help with the bungeecord javadocs

#

"ServerConnectEvent" will be called when the "ServerSwitchEvent" is called?

trail plume
#

Should be

#

it signifies a connection to a server being completed, iirc

latent valve
viscid thunder
#

Now I have a readme

#

You can read.

#

Basically modern forge support

verbal blaze
#

how do I have my plugin save a config file into the main waterfall proxy folder?

trail plume
#

Well, the default PWD is the main proxy folder

#

(and, File, etc, is relative by default)

#

(but really, put your stuff in your own folder)

verbal blaze
#

so how do I like get a config file to save to the waterfall proxy?

trail plume
#

new File("mymagicalfile.wat")

#

will place mymagicalfile.wat, alongside where the bungee config, plugins folder, waterfall config, is

verbal blaze
trail plume
#

Well, yes

#

I mean, if you want it somewhere else, either use the full, or a relative path, to that folder

verbal blaze
#

I would assume I need to replace "this.plugin.getDataFolder()" with the location of the Waterfall plugin folder

#

but idk how to get that location

trail plume
#

File has a method to get the parent

#

you can even literally just hardcode the path, etc

verbal blaze
trail plume
#

waterfall doesn't have a data folder

#

and as I keep saying, paths are relative

verbal blaze
#

ok, so how do I get the plugin folder of the waterfall folder using a function

trail plume
#

you don't

#

there is no method.

#

either get the parent folder of your plugins data folder, or, hardcode the path

verbal blaze
#

I don't think my plugin has a data folder inside of waterfall

trail plume
#

this.plugin.getDataFolder()

#

File literally has a method to get the parent

verbal blaze
#

what do I do with the parent of that though?

#

that will be inside of a random node of the server

#

not the main Waterfall proxy

trail plume
#

wait

#

if that's actually a server plugin

#

the server doesn't know a single thing about where your proxy is

#

But, I mean

#

if you're actually tryna share data between multiple servers, using a file would be stupid

verbal blaze
verbal blaze
verbal blaze
#

so yeah, does anyone know how I can share that a yml between servers, maybe by saving it in the proxy?

verbal blaze
trail plume
#

waterfall is not bukkit

#

it does not have bukkit classes

verbal blaze
#

Waterfall plugins can't have anything from Bukkit in them?

trail plume
#

Bukkit does not exist within bungee

#

You can't call bukkit stuff in an environment where bukkit doesn't exist

wide maple
#

It can exist as long as you don’t access or reference (load) it

verbal blaze
#

so how does SkinsRestorer save data in the proxy

wide maple
#

It’s open source but please don’t use it as a reference.
It has some of the worst code conventions and style I’ve ever seen

verbal blaze
#

Like in the plugins folder

#

Of waterfall

wide maple
verbal blaze
#

But also while not doing in like in a waterfall plugin

#

I want to know how to access that from a server plugin

#

Like have one total shared dataFolder between multiple different nodes on the same waterfall network

#

And I only say that it could be in the plugin folder on the waterfall proxy because that is where it is located in the SkinsRestorer plugin

wide maple
verbal blaze
#

this.plugin.getDataFolder() just gets a datafolder in the server

#

and the waterfall plugins can't use bukkit sstuff

ruby trout
#

this server is gay

verbal blaze
steel gulch
wicked lantern
zenith grotto
#

is there a runTaskTimer in the bungeecord api or something similar? I need it for a stopwatch/chronograph

trail plume
#

use a scheduled executor

#

well, I mean, there is the schedule methods on the TaskScheduler

verbal blaze
#

How can I send a string between a plugin on the proxy and a server plugin? Do I need to use a socket… how do I use that?

wide maple
verbal blaze
#

Understood

primal grove
#

is there a way to check if a certain server is online or not?

trail plume
#

Well, basically, ping it

primal grove
#

hmm

#

yeah

#

good idea

lean gobletBOT
#

the plugin api even has a method for that

compact gulch
#

When will Waterfall 1.19 combability be released?

tulip pivotBOT
compact gulch
#

Okay, because the version that allows you to join with 1.19 usually comes on the same day as the update.

#

Or should that already be possible with the latest version?

trail plume
#

Not happening this time around, too many changes.

compact gulch
sturdy garnet
compact gulch
deft kiln
#

Is there any documentation on how Velocity Modern Forwarding Protocol works? I'd like to implement it into my server software.

lean gobletBOT
#

can't find any but I suggest just looking at the paper patch

proud condor
#

@bleak current I think something is wrong with public key reading

trail plume
#

No

#

there is a limiter for the packet length

proud condor
#

yeah

#

thats what I mean

#

so whats the new max?

#

whats the length of a public key?

trail plume
#

Five had the math somewhere

proud condor
#

@wide maple you around?

trail plume
#

or I thought he had

#

just return -1 for 1.19 for now

proud condor
#

sure

#

five did math before the last change

bleak current
#

limit seems to be 4096 bytes

trail plume
#

I ain't touching it anymore

proud condor
#

am building now

bleak current
proud condor
#

there are more limits

#

woo

bleak current
#

oh, this is borked on bungee too

#

apparently

proud condor
#

kek didnt see cat fixed stuff already

trail plume
#

if somebody knows the real numbers, feel free to sub, but 🤷‍♂️

outer cosmos
proud condor
#

waterfull is really slow to build, holy hell

trail plume
#

Yea

#

I mean, if I cared, I'd migrate the thing over to gradle

zenith vapor
#

You're already building Waterfall 1.19?

#

Paper isn't even updated yet 😮 what is this sorcery?

trail plume
#

it's a bunch of patches over bungeecord

chilly coral
lean gobletBOT
#

I mean, minimal diff and whatnot

#

why change what's not broken?

#

runs

#

arguing on something like this is just a waste of time anyways ¯_(ツ)_/¯ (on all sides though...)

tulip pivotBOT
lean gobletBOT
#

the code is on the github?

#

there are?

#

if you are asking for a download (in the wrong channel): use the download api

#

not for version changes

#

that needs manual modification on the website iirc

#

of course it will

#

it's a major minecraft update, that stuff breaks all the time

#

yeah, no

#

...

#

of course it has packet wrappers lol

#

how else do you think plugins would work

#

you just described a packet wrapper, good job

#

sure, you know what was a major change in 1.19?

#

chat

trail plume
#

the website needs updating, there are still issues and such

lean gobletBOT
#

so yes, it needs to be updated

#

and all the cases that were actually changed and are required for the proxy to work need to be found

#

first off: wat

#

second: completely unrelated to this channel

narrow shard
#

.

tawny field
#

Why are new versions not added to the website?

twilit pewter
#

They will be soon

sacred rose
scarlet nova
#

Hey guys anyone know how i can take only servers name from this?

ProxyServer.getInstance().getServersCopy()
vocal pumice
#

BTW, can anybody tell me if adventure support is soon coming to the waterfall api as it was implemented to paper api?

trail plume
#

probably not, my inclination to spend too much time these days on waterfall is minimal

vocal pumice
#

ah okay, thank you
i just found it weird that in paper i now had to get rid of my ComponentBuilders and stuff but in waterfall i still have to use them

trail plume
#

You can use the adventure platform stuff in waterfall, they have a bungee module thing

#

I'm honestly burned out of working on waterfall much these days, last time I put in much effort into tryna deal with anything component related I generally got screwed by bungee refusing to deal with modern things and plugins catering to bungee

vocal pumice
#

oof thats hard 😬

ruby vortex
#

That's sad :(
Really want to switch to velocity but it's far from ready for the switch. Massive incompatibilities force me and a majority of other larger servers to stick with waterfall.

queen fossil
#

Updated to Waterfall 1.19
And using the latest ViaVersion ViaVersion-4.3.2-SNAPSHOT.jar

But I get connection reset

#

And using 1.18.2 also is now now working, I assume because of the Tab plugin?

lean gobletBOT
#

that error is from a plugin, yes

wicked lantern
#

Is not a wf problem imself

#

And dont use vía on proxy, instead on backends

tiny nest
#

What are the plans about when will you release officially the 1.19 version of waterfall?

bleak current
#

can someone help me?

rich tulip
#

Is it possible to make a plugin for waterfall for the server motd that allows for mini messages to be used in the config?

scarlet nova
#

Hey anyone know what condition i need add for only console command?

if ((sender instanceof ProxiedPlayer)) {}

this is for the players but for the console?

I've tryied this but don't work

if ((sender instanceof ProxyServer)) {}
#

( i found another solution , if (!(sender instanceof ProxiedPlayer)) )

bleak current
#

?

scarlet nova
chilly coral
#

thats also bungee

#

maybe that's not included in api module

#

if it's not in api module then you're out of luck and can only check "if not player"

#

@scarlet nova

scarlet nova
#

Here *

bleak current
#

Does anyone also have the problem when bedrock players start trading with enchantment villagers that they don't work, this problem is with enchantment villagers

wary hamlet
#

i have a custom PluginMessage channel. I send strings to the subservers, which then perform actions based on these data. This data is transmitted via a player in the PluginMessage channel, isn't it? Can the player theoretically manipulate this data by e.g. recording his traffic?

lean gobletBOT
#

no

#

it's sent on the player connection between the proxy and the minecraft server, it never reaches the client

#

they could theoretically sent their own plugin message on that channel though if that's not properly blocked on the proxy (not sure if that's done by default once registered)

wary hamlet
#

ah thx but how can i block this

lean gobletBOT
#

just don't forward plugin messages coming from the client in your proxy plugin

#

should be enough to just register an incoming listener to stop that but I suggest testing it if you sent sensible data via that

#

alternatively you could require an authentication token on each message I guess

wary hamlet
#

i have only one PluginMessageListener which i registered in onEnable for my channel. is it possible that the players also send data on this channel?

lean gobletBOT
#

the player can send data on any channel

#

you need to make sure that it's comming from the server

wary hamlet
#

is there a simple way to prevent it?

#

or check it

lean gobletBOT
#

you check who sent it, yes

wary hamlet
#

yes but in the event this information is not available

wary hamlet
#

ah thx.
in paper there is also this event. do you also have to check the sender or can only the bungeecord use this channel there?

lean gobletBOT
#

on paper you cannot check who sent it

#

it will all show as the player

wary hamlet
#

so i have to make sure that no player uses this channel? e.g. by encryption?

lean gobletBOT
#

well authentication or as I suggested blocking messages from the player on the proxy would be enough

wary hamlet
#

ok thx

full berry
#

Hey, maybe mis thread. Where i can get 1.18.2 waterfall?

trail plume
#

use latest version.

twilit pewter
#

(it supports 1.19, 1.18, as well as a lot of other versions)

full berry
#

Okay, thank you. You helped very much

bleak current
#

how can I use mojang api to get the name of a player from their UUID?
Everything on google is a few years out of date, so doesnt work that well

trail plume
#

afaik, that API literally hasn't changed in a good while bar some trivial things

#

otherwise, cross ref wiki.vg, they have a page which goes over how mojangs API works

scarlet nova
#

Hi guys its possible autogenerate a yml on bungee?
i have added config.yml on resoruces but don't create it
And this create lang.yml in plugins folder
file = new File(ProxyServer.getInstance().getPluginsFolder() + "/lang.yml");

lean gobletBOT
#

you need to handle that yourself via saveResouces iirc

zenith grotto
#

Ehy, when i try to create a scoreboard, it appears like this without some spaces, even if some lines have only "&r"

hexed rune
#

What's going on with 1.19? serverkickevent isn't being fired if a server shutdown and yeah, in 1.18 was working

hexed rune
zenith grotto
#

i think i figured it out

hexed rune
zenith grotto
#

i cant use the same character for make a space

hexed rune
#

Opened a issue on github for serverkickevent, the issue is pretty weird i'd say

zenith grotto
#

is there a Configuration#getConfigurationSection(String path) in bungeecord/waterfall?

lean gobletBOT
#

iirc it's getSection

zenith grotto
#

I don’t think there is

#

At least, I can’t check atm and I can’t find a bungeecord configuration documentation

trail plume
#

I'd imagine you just call get() and get a Map<String, ?> back more or less

zenith grotto
#

The configuration look like this, so I should get reports.buttons, then iterate on the map and get all the present buttons with their “properties”?

reports:
     buttons:
            ban: 
                 button: “&4&l[&c&lBAN&4&l]”
                  command: “”

            goto: 
                 button: “&2&l[&a&lTP&2&l]”
                  command: “”

sorry if it isn’t aligned but I’m using the phone rn

lean gobletBOT
#

eww, the waterfall javadocs site doesn't include all artifacts

#

waterfall-chat, waterfall-config and waterfall-event are missing

wide maple
lean gobletBOT
#

👍

fluid monolith
#

Hello, is there any aikar flags for Waterfall?

lean gobletBOT
#

start.sh has a selector for proxies and iirc there is also a message pinned in the help channel

somber cedar
#

Yo, i got simple plugin for /lobby command but its crashing when server get up [21:24:43 ERROR]: Exception in thread "main" java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap') [21:24:43 ERROR]: at net.md_5.bungee.conf.YamlConfig.load(YamlConfig.java:113) [21:24:43 ERROR]: at net.md_5.bungee.conf.YamlConfig.load(YamlConfig.java:67) [21:24:43 ERROR]: at net.md_5.bungee.conf.Configuration.load(Configuration.java:82) [21:24:43 ERROR]: at io.github.waterfallmc.waterfall.conf.WaterfallConfiguration.load(WaterfallConfiguration.java:67) [21:24:43 ERROR]: at net.md_5.bungee.BungeeCord.start(BungeeCord.java:279) [21:24:43 ERROR]: at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67) [21:24:43 ERROR]: at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

public class LobbyCommand extends Command {
    public LobbyCommand() {
        super("lobby");
    }
    public void execute(CommandSender sender, String[] args) {
        if ((sender instanceof ProxiedPlayer)) {
            ProxiedPlayer p = (ProxiedPlayer)sender;
            p.sendMessage(new ComponentBuilder("").append("Trwa przenoszenie na serwer Lobby...").color(ChatColor.GREEN).create());
            p.connect(ProxyServer.getInstance().getServerInfo("lobby1"));
            return;
        }
        sender.sendMessage(new ComponentBuilder("").append("This command can be used only by players").create());
    }
}```
How do i fix?
trail plume
#

your bungee config is bad

somber cedar
#

Okay, i found out that is caused by group: []

trail plume
#

{} for empty map

scarlet nova
#

Hi guys i want add the status of server in mine plugin, did anyone know any solution for implement it?

        if (!(sender instanceof ProxiedPlayer)) {
            String[] Servers = ProxyServer.getInstance().getServersCopy().keySet().toArray(new String[0]);
            System.out.println(ChatColor.GREEN + "" + configuration.get("info-server"));
            for (int i = 0; i < ProxyServer.getInstance().getServersCopy().keySet().size(); i++){
                System.out.println( ChatColor.AQUA + "" + Servers[i] + ": " +
                        String.valueOf(ProxyServer.getInstance().getServerInfo(Servers[i]).getPlayers().size()));
                System.out.println(configuration.get("player-list") + "(" + Servers[i] + ") \n" + ChatColor.DARK_AQUA +
                        String.valueOf(ProxyServer.getInstance().getServerInfo(Servers[i]).getPlayers()));
            }

            System.out.println(ChatColor.YELLOW + "" + configuration.get("total-players") + " " + ProxyServer.getInstance().getOnlineCount());
        }
trail plume
#

ping it

scarlet nova
#

With what?

trail plume
#

with the ping method?

scarlet nova
#

Yes, but how i can ping certain server?

#

I see the method with ProxiedPlayer

#

But another method without ProxiedPlayer?

trail plume
#

on ServerInfo or something

trail plume
#

yes

scarlet nova
#

🤔 🤨

#

Oh ok i see

scarlet nova
#

i do the method isReachable, for semplified all things

rich tulip
#

Hi, I am working on a prototype of syncing multiple waterfall instances together. I have round robin dns handled, but what would be the best way of syncing configurations on the servers? I was thinking some sort of wrapper on the waterfall jar that downloads a zip with the whole server config (waterfall.jar, plugins, etc). Does anyone have any better ways of doing it?

outer cosmos
rich tulip
#

Ahh, I didnt even think of that lol

fringe pumice
#

server send class

public static void SendConnection(Player player) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("_connection");
        out.writeUTF(ServerCore.getInstance().getServer().getName());
        player.sendPluginMessage(ServerCore.getInstance(), "oak:connection", out.toByteArray());
    }

Server main

getServer().getMessenger().registerOutgoingPluginChannel( this, "oak:connection" );

Bungee lsitener

@EventHandler
    public void onPluginMessage(PluginMessageEvent event) {
        Messenger.log("PLUGIN MESSAGE = " + event.getTag());
        if (event.getTag().equalsIgnoreCase("oak:connection") ) {
            DataInputStream in = new DataInputStream( new ByteArrayInputStream( event.getData() ) );
            try {
                String channel = in.readUTF();
                if ( channel.equals( "_connection" ) ) {
                    String serverName = in.readUTF();
                    ServerInfo server = Oakland.getInstance().getProxy().getServerInfo(serverName);
                    sendConnection(server);
                    Messenger.log("PLUGIN MESSAGE 2");
                }
            } catch (IOException ignored) { }
        }
    }

Bungee listener isnt receiving messages from spigot plugin.
Its logging the normal minecraft ones, but not the oak:connection one

trail plume
#

You need to actually register the channel somewhere

#

otherwise it won't send the register packet to the server, and then the server will basically just ignore it

fringe pumice
# trail plume otherwise it won't send the register packet to the server, and then the server w...

I have this in the server plugins class

getServer().getMessenger().registerOutgoingPluginChannel( this, "oak:proxy" ); // Register the outgoing channel, to Bungee
        getServer().getMessenger().registerOutgoingPluginChannel( this, "oak:connection" ); // Register the outgoing channel, to Bungee
        getServer().getMessenger().registerIncomingPluginChannel( this, "oak:outconnection", BungeeChannel.getInstance() ); // Register the incoming channel, from Bungee
        getServer().getMessenger().registerIncomingPluginChannel( this, "oak:staffaccess",  BungeeChannel.getInstance() );
#

and in bungee I have

ProxyServer.getInstance().registerChannel("oak:outconnection");
        ProxyServer.getInstance().registerChannel("oak:staffaccess");
#

Im sending the message in the playerjoinevent event

lean gobletBOT
#

meh, I wish there was a good way to get all listeners of an Event :S

lunar quail
#

How do I detect server socket disconnection?
ServerDisconnectEvent only detects ... <-> DownstreamBridge <-> [lobby] has disconnected (when the player was already connected to the paper server)
I want to detect <-> ServerConnector [survival] has disconnected (when the socket between waterfall and the target paper server is disconnected)

trail plume
#

Well, basically, iirc the server conectior request builder thingy had a callback just for that

#

otherwise, outside of the events, you literally have no info of that without being set in the pipeline

lunar quail
#

So there is no way to detect this solely using a plugin?

trail plume
#

did you try the connection request thing?

lunar quail
#

I am not sure which thingy you mean

trail plume
#

the connection request builder

#

as I said, p. sure it lets you set a callback

lunar quail
#

Yes I have found it, there is a callback but I am not sure how do I use it to connect a player to a server. I normally use ProxiesPlayer.connect

trail plume
#

use the builder to create the connection request

lunar quail
#

I cannot set target on it

trail plume
#

then you just pass that to the connect method or something

#

Yea you can

lunar quail
#

There is only getTarget method

trail plume
#

P. sure it was in the method to create the builder

lunar quail
#

There is only stuff like setTimeout, retry..

trail plume
wicked lantern
lunar quail
#

oh, didn't notice that xd

#

Its usually named like setTarget

#

How do I pass the ServerConnectRequest to the player now?

#

oh, just player.connect(ServerConnectRequest )

#

This callback does not detect when the socket is closed before logged in, result is "SUCCESS" right after the socket is opened, does not care about that the socket was closed right after that before responding with minecraft login packet.

trail plume
#

oh, ouch then

#

idk, bungee never did a good job of exposing that mess

#

(and, I got tired of tweaking smaller things in the API and breaking shit)

#

To fix that, I'd need to add another concurrent connection request system alongside the existing one

lunar quail
#

there is no option for windows?

trail plume
#

git bash

#

that's literally a windows program

lunar quail
#

oh

#

xd

lunar quail
#

How do I edit this thing, everything i do is always restored back to original when i build it

trail plume
#

build with maven directly

#

otherwise, make sure to rebuild patches

#

heavily suggest reading the contrib guide