#waterfall-dev

8550 messages · Page 2 of 9

civic valve
#

lmfao

#

i'll blame z for this one

twilit pewter
#

it used to be .remind

outer elbow
#

if u have dyno perms u can use ?remind but josh'd have to be the one doing it i believe

twilit pewter
#

?remind

#

?reminder

civic valve
#

bots have failed us

outer elbow
#

@west moth diagnose remind

#

do that

twilit pewter
#

let's see if banning still works

#

?help remind

civic valve
#

I'll just nuke this shit now

#

shouldn't be that hard

outer elbow
#

if u ping the bot u dont need its prefix lol

civic valve
#

copy-paste paper code

twilit pewter
#

?remindme 12h @civic valve is dum

outer elbow
#

also why is there dyno and dyno premium lol

twilit pewter
#

why not

#

I think that command is just disabled

civic valve
#

ill do it rn

#

give 10m

outer elbow
#

if u do the diagnose it tells if its enabled or not

#

kk

twilit pewter
#

?diagnose remindme

chilly windBOT
outer elbow
#

dunno why there was no output then but ight

twilit pewter
#

Because dyno+

outer elbow
#

dynos better than mee6 anyways ill give it that

civic valve
#

@outer elbow can you test a build rn?

outer elbow
#

sure

civic valve
#

try that @outer elbow

#

let me know if hex colors show or if its completely borked

outer elbow
#

looks like it works :D

civic valve
#

PagMan

#

pr'ing

chilly windBOT
outer elbow
#

maybe one day spigot will merge that upstream lol

#

oh gj dyno

civic valve
#

ik Spigot supported it

#

but Paper uses a whole other console so it didn't

outer elbow
#

ah

civic valve
#

but iirc bungee literally just uses Sys.out.println lmfao

twilit pewter
#

Dyno not working? I'm surprised

outer elbow
#

also was it MD's idea to make hex codes &x&R&R&G&G&B&B

civic valve
#

can you tell?

#

lmfao

outer elbow
#

dunno what could've given him the brilliant idea to make it that messy

#

&#RRGGBB is so much simpler and many plugins are doing that or something like that idk why spigot couldn't have just done it

#

gotta be unique ig

civic valve
#

&x&R&R&G&G&B&B makes sense from a parsing standpoint

#

but like he could have just not allowed them in legacy strings and forced people to use components

outer elbow
#

ah
anyways thanks josh!

vivid peak
#

Is Adventure going to be included in waterfall?

lean gobletBOT
#

see #waterfall-help

bleak current
trail plume
#

It's on the todo list

bleak current
#

👍

trail plume
#

it's not important enough that im gonna throw my health around for it

lofty ridge
#

opened a tracking issue for it, but it is not a priority

wide maple
trail plume
#

github is fun

wide maple
#

huuuh boi

#

No steam left to port today

brazen walrus
#

Does anyone know if there's an easy way to filter the commands sent to the player on BungeeCord/Waterfall?

#

On Spigot I can use PlayerCommandSendEvent and filter the mutable commands collection

#

but there's no similar event on BungeeCord

trail plume
#

bungee, no, waterfall, yes

#

should be like a define commands event

brazen walrus
#

ProxyDefineCommandsEvent, indeed, amazing

#

Oh, it only catches commands defined on the proxy, I'd also like to filter some commands sent by the game server

#

I guess I can just create a Spigot plugin too, but I'm open to suggestions if there's a way to do both directly from Waterfall

trail plume
#

I mean, technically could read the packet and modify the contents of the command definition

brazen walrus
#

Thanks, I've seen the project but I don't feel like adding a heavy library to my plugin just to hide some commands from the auto-completion :D

#

I just made a second plugin for spigot and used PlayerCommandSendEvent over there

bleak current
#

ok then ¯_(ツ)_/¯

bleak current
#

How ti use waterfall?

brittle panther
#

I know this is a little off topic, but it has to do with Waterfall dev so I'm going to ask anyway:

Is anyone able to update FabricProxy to the latest snapshot (21w08b as of now)? I have been for the last 3 snapshots, but in this last snapshot, I think they changed some stuff with the login system. And now whenever people try to login to my 21w08b server (that is on my Waterfall network), this error gets thrown: [see attachment]

I would fix it myself, but I don't know enough about Fabric to do so. :/

Sorry if this isn't the correct place to ask.

brazen hamletBOT
brittle panther
wide maple
#

@brittle panther that’d mean you have a 21w08a/b compatible snapshot proxy and without speaking about velocity there shouldn’t be one

brittle panther
#

Or do I need to do something weird to get it so I can connect to my snapshot server?

lean gobletBOT
#

you need snapshot support in the proxy

#

did you add that yourself? or what are you using for that to work?

brittle panther
#

I made a patch to Waterfall.

lean gobletBOT
#

I'm a bit confused about where the error is thrown? is that in the vanilla client?

#

or wait, that's from the fabric server?

brittle panther
#

Sorry for not clarifying. That is in the Fabric server.

lean gobletBOT
#

you might need to ask somewhere with people who know more about FabricProxy or fabric in general then. most people around here have never touched that I would assume

brittle panther
#

I have. I just wanted to ask here just to make sure I have all my bases covered. And it is a Bungee --> Fabric mod.

wide maple
brittle panther
#

Oh?

#

Well, can you tell me how to push to a different branch than the one I am currently pulling from? I've tried to follow a tutorial online, but it doesn't work.

#

Is it something with git rebase?

lean gobletBOT
#

set the remote

#

.g set git remote branch

#

well the push -u command will do that but there is also a --set-upstream-branch or something like that iirc

#

oh, apaprently -u is short for --set-upstream lol

brittle panther
#

nvm

#

It's 1.17-changes-pre. Not 1.17-pre-changes

#

@wide maple ^

wide maple
#

ohnononononononono

brittle panther
#

And here is the actual file, so you don't have to build it.

wide maple
#

w08a changed a whole host of packets

brittle panther
#

?

#

Hmmm.

brittle panther
#

Well, I can connect to my lobby some how.

wide maple
#

well yes. But try to enter combat or try to chat

#

commands should work

#

server switching should also crash you

brittle panther
#

You see, I looked on the wiki, and they didn't update their page for w08a/b... So, I just assumed everything is fine.

wide maple
brittle panther
#

I'll work on this tonight.

#

Oh. And another thing... I could switch servers.

#

¯_(ツ)_/¯

wide maple
#

I’ll push adventure later

#

Nearly forgot again

brittle panther
#

Okay. I just applied those patches to Waterfall. I will now test to see if it works.

brittle panther
#

Well... I'm not good enough with Java or Bungee / Waterfall patching to fix this... :/ Ugh.

trail plume
#

Could not initialize class net.md_5.bungee.protocol.Protocol

#

see earlier exceptions, you broke the Protocol class

brittle panther
#

There are no red lines in my IDE... Even more sadness...

trail plume
#

runtime error != compile time error

brittle panther
#

I know.

#

That's what I was saying.

#

I'm probably just going to wait for Five to fix it on his repo.

#

If he wants any of my code, I'll push to my repo.

brittle panther
#

Just kidding. I lied. Trying one more thing. :P

#

nope

#

more sadness

brazen hamletBOT
trail plume
#

provide the full logs

brittle panther
brazen hamletBOT
brittle panther
#

Thank you for trying and good luck. :D I will be here for a while so if you need anything else, I am here. Just ping if I don't see it. :P

trail plume
#

erm, apparently the source exception was lost

brittle panther
#

?

trail plume
#

the reason why the Protocol class failed to init has not been logged

brittle panther
potent lichen
#

what's the cause of the InvocationTargetException?

#

oh I saw it, NoClassDefFoundError

#

yeah you need to do further debugging

blazing oar
#

how can i fix that

#

ok i solved that i didnt need help anymore

unborn tangle
#

Is this the right way to make a TabCompleter? (I'am new to Java)

    public List <String> playerList = new ArrayList<>();
    
    @EventHandler
    public void onComplete(TabCompleteEvent event) {
        if (event.getCursor().equals("unban") ) {
            playerList.addAll(Main.plugin.configuration.getKeys());
            for (String string : playerList) {
                event.getSuggestions(string);
                             ///string is marked red
            }
        }
    }
}
brittle panther
#

@unborn tangle are you trying to make it so you can tabcomplete a command? Or so it will trigger an event when you tabcomplete a command?

trail plume
#

wrong channel?

brittle panther
#

If it's the first, you need to extends TabExecutor on your command class. Then, at the bottom of your command class, you need to make a method for tabcompleting. There's a lot better tutorials on the web for this. And I suck at explaining,

#

Also, zzzCat, this is the correct channel (unless he is making a Paper plugin), right? Or am I like completely wrong?

#

(rhetorical question)

trail plume
#

Yea, am just, erm, mentally drunk

#

TabCompleter sounded like they where tryna use some bukkit interface or something

brittle panther
#

I think he just didn't know what it was called.

#

¯_(ツ)_/¯

unborn tangle
trail plume
#

is unban a command registered on the proxy?

#

also, not entirely sure you should be checking the command like that

#

You'd more wanna look at splitting that and getting the first arg

outer elbow
#

do i have to use maven/gradle to use waterfall in my project or is there a jar i can just add to the libraries

trail plume
#

you don't have to, but it's the only machanism we support

brittle panther
#

If you don't use those, you'll have a fun time building your project.

rough trout
#

what are you going to use, eclipse compiler + individual jars? haha

stone sail
#

Hey, how can i debug in waterfall without timeouts/waterfall crashes?

trail plume
#

Erm, you kinda, "good luck"

#

breakpoints, assuming your IDE exposes it, allows you to configure if you pause the JVM as a whole or just the thread

#

just pausing a thread may offer better luck, but, stuffs in the event loop, which is shared by other connections, which means that you're gonna stall the proxy anyways

stone sail
#

Ok, thanks m8

#

Yea its an EventHandler i try to debug 😄

boreal veldt
#

can someone recommend me a good Configuration Lib for Bungeecord?

lean gobletBOT
#

typesafe config (uses HOCON format which is bae)

boreal veldt
#

typesafe?

#

Let me check it real quick

lean gobletBOT
#

.g typesafe config

boreal veldt
#

do you know a Yaml lib?

lean gobletBOT
#

Configurate is pretty widespread but I personally just use Bungee's inbuilt system when I don't want to build complex stuff

boreal veldt
#

can you reload the config with the inbuilt system?

lean gobletBOT
#

sure

boreal veldt
#

Can you explain me that?

#

The folder wont create and the content wont set

#

Someone please help, i want to publish a bungeesystem but now i have these problems

potent lichen
boreal crown
#

I just changed the method to instead return the Map used for the pie stuff...

#

Good enough solution for me

rough trout
#

don't blame you though, dazzle is pretty good

potent lichen
#

i can only recommend the best

lean gobletBOT
#

can you register your own parsers for that?

potent lichen
#

for custom types, yes

trail plume
#

depends, outside of the ONLINE target, should be queued

#

Just, won't be recieved until somebody actually logs in

#

use a proper messaging broker like rabbit or redis

atomic kelp
#

is there an api for setting player names for the tab list? not the header/footer, the player entries

boreal crown
#

Will Waterfall get changes to the logging? Like the current logging is a bit... white (BungeeCord highlights the Log level name and also seems to use System text (loclized text))

wide maple
#

Not really possible without breaking API- the logger md_5 uses is ass and hard to adapt

ruby dust
tawdry narwhal
#

.paste it

lean gobletBOT
trail plume
#

they flooded up enough connections and you ran out of memory

#

use a rate limiter or load balance or increase the direct memory allocation

#

jvm flags?

ruby dust
#

this is from my bungeecord fork (botfilter)

#

4gb direct memory

trail plume
#

iptables, there is also a jvm flag for it, can alllso disable direct memory but that will incur a perf hit

dapper temple
#

Anyone know the reasoning behind this diff https://github.com/PaperMC/Travertine/blob/fe43b76d7cac4b1d6179b6901fdc5bb93dac0f03/Waterfall-Proxy-Patches/0003-1.7.x-Protocol-Patch.patch#L1577-L1600? From what I can tell, the only difference between serializing with gson vs gsonLegacy is that gsonLegacy uses a different type adapter for ServerPing.PlayerInfo, however the only difference in that adapter seems to be that it removes dashes from serialized uuids? Besides it using a different gson instance for 1.7.2, I'm also confused why it's sending a legacy text string for the description instead of a component for <=1.8, as 1.7+ supports components there.

#

Locally I removed that entire diff, and kind of as expected, the server ping still worked totally fine on a 1.7.2 client

#

as expected because it works on Waterfall too which doesn't have this diff

trail plume
#

seems to be the case

#

I guess it's just a consistency thing, most tools reading that going back can probably just read both

dapper temple
#

So you mean the 1.7.2 vanilla server excludes - from serialized uuids as well?

#

and it's done to match

#

the whole diff seems kind of redundant to me given that the server ping works just fine for 1.7.x clients on Waterfall

dapper temple
#

Yeah I was checking history of that page to try and understand too

#

I found this

#

idk how to properly link things on this wiki

#

but the diff for those revisions had a comment

#

"Fix the uuid used"

#

thats when they added the dashes

trail plume
#

that edit was after 1.7.10 was released

dapper temple
#

oh ok, so the vanilla server actually did change the format it serialized UUIDs to?

trail plume
#

well, 2 days before the full release of 1.7.10

dapper temple
#

and travertine is reflecting that I guess?

trail plume
#

based upon the existence of the diff, seems to be the case

#

I don't got sources for 1.7.2 to check

dapper temple
#

yeah thats fine lol

#

the weird thing is how a 1.7.2 client seems to handle it just fine with the dashes in it

trail plume
#

They've used both formats for time over the years

#

pretty sure that there is a util method in the server which can handle both, probs shared with the client too given the nature of the method

dapper temple
#

ok so that makes sense

#

any idea about why the description is being turned into legacy text for <=1.8 tho

#

waterfall sends a component and 1.7.2 client handles it fine as well

paper fjord
#

How do i get the players UUID when the player has just connected to the server?

lean gobletBOT
#

just get it from the player object?

wide maple
#

@ zzzCat about the scoreboard "issue"

#

the team/objective already registered one

#

this exception is only thrown to the bridge if a plugin registers a team/objective after the proxy has already done so (in a switch event event presumably)

#

this always happens because the event concludes before the server is able to send the data itself

#

otherwise the offending plugin would have to swallow the exception

#

how do we deal with this

trail plume
#

the new server sends the team, etc, before the proxy has cleared itself of all of that stuff

wide maple
#

No- Thats not what happens

trail plume
#

this happens from server plugins

wide maple
#

I have zero ability to reproduce this without proxy plugins

trail plume
#

I mean, unless these people have plugins on the proxy messing with stuff, hm

wide maple
#

normally server > scoreboard. SWITCH! -> clear -> join ->scoreboard

#

no issue there

#

but then server > scoreboard. SWITCH! -> clear -> proxy sends scoreboard via plugin -> join ->scoreboard !Conflict!

#

this might just be a bycatch issue I found

#

if so I havent been able to reproduce the original issue yet

#

Also if I may; I think adding events to decide server/proxy authority over scoreboards isnt a /bad/ idea

#

for Velocity I have planned to do it this way;

ScoreboardEvent
 -> source: ? instanceof PluginContainer | instanceof ServerConnection
 -> result: ? DEFER : FORWARD
ScoreboardChangeFocus
 -> from: ? instanceof PluginContainer | instanceof ServerConnection
 -> to: ? instanceof PluginContainer | instanceof ServerConnection
 -> result: ? DEFER : ALLOW

Connection instance stores the server authorative/given scoreboard
Player stores the proxy given scoreboard if any
trail plume
#

my brain hurts, but, yea, I see that the original theory doesn't make sense, hm

#

the proxy literally cleans the entire list on cleaning

#

switching

#

hm

wide maple
#

the problem is stored/referenced objects and stupid logic

#

logic meant only to be used if there is only one possible source for a scoreboard/ objective

wide maple
#

speaking for Velocity

wide maple
#

I will come back to this on Waterfall once I have made a good solution for Velocity

outer elbow
#

what's the best way to get the rest of the args in a message like args[2] and up for example

outer cosmos
#

You copy over the rest of the array and the String.join

south locust
#

What event would you guy listen on when trying to catch a command executed from the console?

#

Kinda like the onServerCommand(ServerCommandEvent event) { from bukkit.

trail plume
#

don't think that there is one?

south locust
#

Ah, thank you.

coarse bridge
#

Hi, does anyone know how to change Entity#setVelocity so it doesn't slow down when moving?

org.bukkit.util.Vector vector = new org.bukkit.util.Vector(0, 1/50, 0); // Go up 1 block (Yes, I don't know why but for it to be only 1 block I have to divide it into 50)
m.getEntity().setVelocity(vector);
trail plume
#

you'd need to keep setting the velocity with the scheduler if you want it to keep moving

coarse bridge
trail plume
#
  1. wrong channel, #paper-dev
  2. Entities lose their velocity over time because gravity
coarse bridge
trail plume
#

Please don't ping

#

unless there is an method in the API to disable gravity on the entity, no

#

even without gravity, the speed drops slowly without movement

#

you're gonna need to use the scheduler

coarse bridge
#

okay

latent scarab
#

Hi
I want make my plugin that send message when player changes server. It works but it throws NullPointerException: null when player connects to proxy and I don't know how to fix it

java.lang.NullPointerException: null
        at tom.bungeemessages.serverswitch.onServerConnected(serverswitch.java:15) ~[?:?]
        .................```
```public class serverswitch implements Listener {
    @EventHandler
       public void onServerConnected(ServerConnectedEvent event) {
              ProxiedPlayer player = event.getPlayer();
              String server2 = event.getServer().getInfo().getName();   
              if (player.getServer().getInfo() == null) {    //NullPointerException
                  System.out.println("nice");
              } else {
              String server1 = player.getServer().getInfo().getName();    
              ProxyServer.getInstance().broadcast(new TextComponent( "test " + player.getName() + "§7 " + server1 + " -> " + server2  ) );
              }
        }
}```
trail plume
#

you're assuming that the player has a current server

#

they just donnected, they don't

coral lichen
#

Is there any way for me to change the username of a joining player?

brittle panther
#

Iirc ProxiedPlayer is read only.

coral lichen
#

Found the way to modify the pendingConnection by loading bungeecord instead of bungeecord api

lean gobletBOT
#

pretty sure you can just modify it in the query event

old trail
#

What are waterfall commands, all?

trail plume
#

same as the bungeecord ones, wrong channel too I'd guess

winter dirge
#

Hey, I'm just learning to write Bungeecord plugins, and I get this error https://prnt.sc/11cam4h
I'm not great at Java, and I don't really understand what the problem is.
mnYAML class


import net.md_5.bungee.config.Configuration;
import pl.myrame.mnBungee;

public class mnYAML {
    private static Configuration cfg;

    public mnYAML(mnBungee core){
        cfg = core.getConfig().get();
    }

    /**
     * @param path Path to value in YAML
     * @return Object from File
     */
    public static String getYAMLValue(String path){
        return cfg.getString(path);
    }
}```
shell lagoon
#

cfg is null, did you create an instance of your mnYAML class?

winter dirge
#

i forgot, my bad

#

thanks

shell lagoon
#

No problem

outer elbow
#

whats the best way to get a player's prefix, should i just use the LP API or is there a way without dependencies?

trail plume
#

I mean, the proxy doesn't know any of that stuff

#

So, using the LP API if you wanna talk to LP is basically the only way to go, and on the basis that there is no vault or such for bungee, etc

outer elbow
#

gotcha

#

how do plugins like bungee chat do that, does it use vault on the backend server and send it to the proxy or something

trail plume
#

that's one way to do it

#

I mean, at the end of the day you gotta get that info from the server somehow

#

be that using some bridge plugin which throws that info around, there was a placeholder plugin for bungee which throws that crap over the network too, etc, etc

outer elbow
#

gotcha

outer elbow
#

is using player.chat("/command") the best way to make the player run a command

trail plume
#

from the proxy to the server, only way bar a plugin

outer elbow
#

kk

#

finally i can get rid of this terrible skript lol

bleak current
#

Is there a event for if moving a player to another server failed?

#

or any kinda of way i could catch that

trail plume
#

there miiight be a callback?

bleak current
#

ah you can set a fallback for if server movement failed?

#

*callback

#

i will check it out

trail plume
#

ServerConnectRequest.builder()

bleak current
bleak current
#

Is there a way to not send the error message?

#

this message may be a bit irritating for users

trail plume
#

no

bleak current
#

ok thanks. I will just add to it that the user can ignore it

velvet lake
trail plume
#

rainbow brackets plugin

velvet lake
#

i need that

#

now

brittle panther
bleak current
#

I will take a look later. Thanks.

brittle panther
#

When I say "then just cancel the event", this is a way where you can make the error message go away.

#

Or. Not get called.

quartz nimbus
#
@EventHandler
    public void onConnected(PostLoginEvent event)
    {
        ProxiedPlayer player = event.getPlayer();

        if(player.getServer().getInfo().equals(this.plugin.getProxy().getServerInfo("limbo"))) {
            ServerInfo target = this.plugin.getProxy().getServerInfo("hub");
            this.plugin.getProxy().getScheduler().schedule(this.plugin, new Runnable() {
                @Override
                public void run() {
                    player.connect(target);
                }
            }, 5, TimeUnit.SECONDS);
        }
    }```
#

Error:

#
java.lang.NullPointerException: null
        at listener.JoinListener.onConnected(JoinListener.java:28) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19) ~[Bungee.jar:git:Waterfall-Bootstrap:1.16-R0.5-SNAPSHOT:c031df1:395]
        at net.md_5.bungee.event.EventBus.post(EventBus.java:47) ~[Bungee.jar:git:Waterfall-Bootstrap:1.16-R0.5-SNAPSHOT:c031df1:395]
        at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:453) ~[Bungee.jar:git:Waterfall-Bootstrap:1.16-R0.5-SNAPSHOT:c031df1:395]
        at net.md_5.bungee.connection.InitialHandler$6$1.run(InitialHandler.java:555) ~[Bungee.jar:git:Waterfall-Bootstrap:1.16-R0.5-SNAPSHOT:c031df1:395]```
#

I want that if the player joins the server named limbo he will get after 5 seconds directed to the server named hub?

#

I always get this warn and it dont work. Can anyone help me?

civic valve
#

line 28 has something null on it

quartz nimbus
#

Yes.

#

But what?

civic valve
#

what is line 28

quartz nimbus
#

Is something not loaded when the player is post logged in?

#
if(player.getServer().getInfo().equals(this.plugin.getProxy().getServerInfo("limbo"))) {```
#

Sorry. I forgot

civic valve
#

getServer or getInfo is null

#

PostLoginEvent is called before the player is actually connected to any server

#

so probably getServer is null

quartz nimbus
#

Which Event I can use then?

#

Which is called when the player joined?

civic valve
#

ServerConnectEvent is called when the proxy is trying to decide which server to connect to

#

you can use ServerConnectEvent#setTarget

quartz nimbus
#

Okay. Thanks. I will try.

#

Hopefully it will work.

chilly coral
#

Hey, trying to update my waterfall fork to the newest version (1 commit diff), i get this when applying my patches:

error: sha1 information is lacking or useless (protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java).
error: could not build fake ancestor

i never saw this "conflict" when applying my patches and i don't realy understand what Google says. Am I the only one with this issue ? I didn't have issue few days ago on my last update.

trail plume
#

the hunk failed

#

there is no reference to the old info when trying to 3-way, basically

#

easiest option is generally to use apatch or wiggle to try to get it to merge, otherwise, merge manually

chilly coral
#

ok will try

outer elbow
#

is there a way to use the plugin messaging channel to make the proxy run a command?

trail plume
#

directly, no

#

can easily write a plugin which will execute commands its sent over a plugin channel

#

Just, make sure that you handle those messages properly

#

don't leak them and make sure it's the server sending it

chilly coral
#

@ zzzCat i managed to fix my issue with this command:

patch -p1 < ../Waterfall-Proxy-Patches/0016-my-patch-that-wont-apply.patch

after this i just had to manually fix the hunk that did not apply and delete the .orig and .rejected files

#

i don't know if it could help other people here, but sharing just in case

trail plume
#

I just use apatch like I said

chilly coral
#

i don't know this :/

trail plume
#

it's a magical script bundled in the paper repo

chilly coral
#

ho

#

i searched in the scripts directory, but i'm based on Travertine and i don't have this one. Will look at it.

trail plume
#

it's in the paper repo

#

I just keep a copy of it it my PATH, needs wiggle to be installed though

solar sage
#

Hello, i made a Travertine fork, but how can i update the upstream (Travertine) correctly=

brittle panther
#

Make a pull request.

tawdry narwhal
#

A great example how to not update your fork is doing that ^

trail plume
#

I mean, it's git

#

Beyond that, we can't comment on your specific setup

#

best guess is look at rebasing against our repo, add trav as a remote and rebase, assuming you're not using some patch framework which makes it easier 🤷‍♂️

brittle panther
#

Did I misunderstand the question?

trail plume
#

they're asking how they can update their own fork

brittle panther
#

Don't you want to pull request? Or have I been doing it wrong?

tawdry narwhal
#

That's not the general procedure how to update any fork of anything.

#

That's the the procedure if you want to contribute.

brittle panther
#

No.

tawdry narwhal
#

Yes

trail plume
#

they want to pull commits from travertine into their own fork

tawdry narwhal
#

I don't open paper prs to paper if I want to fetch the latest commits.

trail plume
#

Well, creating a PR works

#

It's just the dumb way to go about it

tawdry narwhal
#

Yeah lol

trail plume
#

e.g. any merge conflicts and you're SOL

tawdry narwhal
#

Guess that's what you do if you don't know git panda_shrug

trail plume
#

Wrong... god damn it NMF...

tawdry narwhal
#

I don't/can't spell.

trail plume
#

I went to delete my own message, and then he edited and it borked the placement of my cursor

brittle panther
#

That's the thing... I don't know git.

tawdry narwhal
#

Luckily documentation exists 👏

brittle panther
#

Everything I've learned about it was by myself or from articles online.

#

And the articles online are just confusing.

brittle panther
trail plume
#

when you wanna pull from an upstream repo, you basically either rebase, or, merge it manually, git pull remote branch will pull from a remote branch and shove you into merge mode if needed

brittle panther
#

I don't know what "rebase" is.

tawdry narwhal
#

I prefer rebasing if I don't need/want everything

brittle panther
#

I've heard tons of documents try to explain it... but, either I'm dumb, or they are not explaining well.

tawdry narwhal
#

Or I just drop the commits afterwards

azure kayak
#

i need a way to duplicate/mirror certain players across all the servers on my waterfall server, is there any way that i can do this with a waterfall plugin or would I have to fork waterfall? Could I do this by just forwarding the packets from certain players to every single server or would it require more work?

trail plume
#

you could do it with a plugin, just, you'd be diving deep into internals to the degree that forking would probably be easier

brittle panther
#

What is a good way to reload my plugin's config.yml? I am using Bungee's (Waterfall's?) built-in Configuration properties.

I need a way without fully disabling / re-enabling the plugin or fully stopping and restarting the Waterfall instance.

wide maple
#

#631 I think boils down to; don’t have your servers do stupid sh*t?

trail plume
#

We allow the servers to do stupid shit, they're saying it's coming from the client unless I was drunk when I made it apply to only servers

wide maple
#

I can’t do irony in the morning

#

But yes. Clients shouldn’t be allowed to do that kind of nonsense

trail plume
#

irony thonk

#

merlins?

ruby dust
#

looks like server variable means that true is client <--> bungee and false is server <--> bungee

trail plume
#

Yeaaaa....

#

Forgot to look into that, when I saw the issue this morning I had a feeling it was potentially the wrong way around, what I get for assuming that variable names make sense...

trail plume
#

gives time for connections to flush

#

iirc

tidal sparrow
#

I'm looking for a plugin that will spin up a backend server if it is offline when a player tries to access it.
Ideally, also if no one is in the world for, lets say an hour, it will shut down the backend server, but that could be a separate plugin as well.
Appreciate anyone having any suggestions.

steady prawn
#

idk...

trail plume
#

did you run the script?

steady prawn
trail plume
#

clone the repo

#

the word "clone" is used intentionally in the readme

steady prawn
#

ok..

tawdry narwhal
#

I'm desperately waiting for the day downloading normal repositories will be discouraged

raw arrow
#

..

boreal crown
#

Is there a dedicated class to recognize Travertine?

trail plume
#

don't think so

#

like, well, yea, i guess, see the patches

boreal crown
#

I assume io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17 would perhaps work

simple escarp
#

Hey guys so I have this problem, how do I detect in bungeecord if a server is online or not. I've look into the hole net, but I just can't find the way
by now I have this, but it's not working. It was just an idea

public sendServerStatus( String serverTarget, String server){
        Collection<ProxiedPlayer> networkPlayers = ProxyServer.getInstance().getPlayers();
        if (networkPlayers == null || networkPlayers.isEmpty()){return;}
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF( "SServerStatus" );
        out.writeUTF( serverTarget );
        boolean online = false;
        ServerInfo target = ProxyServer.getInstance( ).getServerInfo( serverTarget );
        online = target != null;
        out.writeBoolean( online );
        out.writeUTF( server );
        for (Map.Entry<String, ServerInfo> testPlayer : ProxyServer.getInstance().getServersCopy().entrySet()){
            try{
                ProxyServer.getInstance().getServerInfo(testPlayer.getKey()).sendData("hc:msg", out.toByteArray());
            } catch (NullPointerException ignored){}
        }
    }```
deft compass
#

Hello! Is it planned to add Adventure to Waterfall natively?

trail plume
#

as per the issue tracker, yes

#

There is a ping method somewhere in the API, you're not gonna get a response from the server over the plugin channel as it uses plugin messages which requires a player connection, so, you're not gonna see alive but empty servers

#

ServerInfo#ping, probably

slow token
#

Hi! I just wanted to ask how long it takes for a PR to be reviewed, since I am waiting for over 18 days already.

trail plume
#

I'm sorta like, ill, and so going crazy over PRs is not something I do unless they're critical

slow token
#

okay, thank you.

simple escarp
trail plume
#

the callback has your response

simple escarp
#

yeah I know, but
online = ProxyServer.getInstance().getServerInfo( serverTarget ).ping( what do I put in here? );

#

I'm sorry, I'm kinda new at this

trail plume
#

as I said, it's a callback

#

ping is not a blocking method, i.e. it won't sit there waiting for a response

#

the ballack is where you handle the response

#

So, basically, instead of like,
Ping ping = server.ping()
if (ping ==......)

you, basically do, server.ping((response) -> { if (response == .....) }

simple escarp
# trail plume So, basically, instead of like, Ping ping = server.ping() if (ping ==......) yo...

I end up with this working fine

public sendServerStatus( String serverTarget, String server){
        Collection<ProxiedPlayer> networkPlayers = ProxyServer.getInstance().getPlayers();
        if (networkPlayers == null || networkPlayers.isEmpty()){return;}
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF( "SServerStatus" );
        out.writeUTF( serverTarget );
        ProxyServer.getInstance().getServerInfo( serverTarget ).ping( ( response, error ) -> {
            if ( error.getCause() == null ){
                onlineServers.put( serverTarget, true );
            } else {
                onlineServers.put( serverTarget, false );
            }
        } );
        try {
            out.writeBoolean( onlineServers.get( serverTarget ) );
        } catch ( NullPointerException error ){
            out.writeBoolean( false );
        }
        out.writeUTF( server );
        onlineServers.clear();
        for (Map.Entry<String, ServerInfo> testPlayer : ProxyServer.getInstance().getServersCopy().entrySet()){
            try{
                ProxyServer.getInstance().getServerInfo(testPlayer.getKey()).sendData("hc:msg", out.toByteArray());
            } catch (NullPointerException ignored){}
        }
    }```
simple escarp
#

actually no

#

hahaha I'v got another problem

trail plume
#

stuff in the callback happens in the future

simple escarp
#

so when I try to change a boolean to true, it just wont change

trail plume
#

it could be a second from now, it could be 200 seconds from now

#

You need to do all the work with the response in the callback itself

simple escarp
#

I didn't thought about that, thanks now it works perfectly

spare knot
#

Hello guys, I try to figure out how to start with waterfall. I cant find a getting started documentation. Do someone has a nice GettingStarted?

Where is the main entry point to start the programm? I just implemented the API but do not know where is the "onEnable()" or sth.

trail plume
#

see the bungeecord documentation, if you're using IJ, there is a plugin which can cleanly set all of this up for you automagically

spare knot
trail plume
#

plans are to redo the docs ourselves, just, erm, keyboard looks like a cozy pillow

trail plume
#

debated on that one but seems kinda meh

ember arrow
#

Server crashes while spamming a command that access a database using c3p0 connection pool. Anyway know a way on how to fix this?

trail plume
#

if using async stuff, increase the connections or use a bounded thread pool

trail plume
#

don't ping

ember arrow
#

F sry for the ping

#

ye sry

trail plume
#

connections are not thread safe

ember arrow
#

forgot to disable it

trail plume
#

use a pool properly

#

I don't use that pool, so, if that's correct, god knows 🤷‍♂️

ember arrow
#

Wich one do you use?

trail plume
#

But, i mean, use a thread pool which has a max thread count and use that for mysql stuff

#

hikari

ember arrow
#

I am going to try hikari

#

So the proxy stops responding like normally.

Here is the code:

trail plume
#

you're not supposed to create 200 pools...

#

You create one pool, and pool connections

#

and, don't do sql stuff on the current thread

#

You literally block the networking loop

ember arrow
#

How do I do all of that in the practical way and not in theory?

trail plume
#

I'm not sure what step you're stuck at

#

Use a single pool, not a pool for everything, beyond that, errr...

#

if you're asking for help with threadding, threading is complex and a lot of stuff boils down onto what you're doing, I can't hold your hand here

ember arrow
trail plume
#

oh, then, you'll have to use a pool per database i guess

ember arrow
trail plume
#

each pool has to have its own set of connections

#

connections are not an infinite thing

wide maple
# lusty elk https://media.discordapp.net/attachments/835454090145824769/835542010219855902/u...

there is a whole number of reasons why this isnt a good "fix" and I will indeed list those:

  1. You shouldn't throw exceptions there. Cached exceptions would be preferrable- If you are going there might as well do it right
  2. If youre checking the capacity then its already too late to do something about that, the memory has been allocated already
  3. If you are so concerned about size, might as well have a channel overflow handler for size checking the streamed packet contents. Slow sending of tons of data is also a problem
trail plume
#

Yea, that's just literally... defo not suitable for paper

wide maple
#

The last one is the correct way to go about it, but it breaks nearly all plugins that interact with channels in bungeecord

trail plume
#

I grabbed tux's patch for setting the bom

#

I mean, not bom

#

size of pools

#

Then, I wanna grab his patch for limiting reads when the buffer gets too large

#

I think that should solve it?

#

at the end of the day if you get enough connections going you're gonna crap it out anyways, so...

wide maple
#

Its gonna help at least and its a clean solution

trail plume
#

if the buffer gets large enough and can't read a connection, it should stall out the conn I'd imagine

wide maple
#

I was also looking into a kind of "bot check"- for channel reading. See- most attack bots currently send lots of data but slow to hog memory. But they always have to respond to keepalive in timeframes that dont work for that

#

its so insanely stupid I want to scream

wide maple
sharp isle
#

if yes, well this is not going to work to prevent memory attack

lusty elk
#

flame cord....

#

ohh wait

#

got it

#

got the issue

#

nvm

sharp isle
#

you have to act in Varint21FrameDecoder

#

from my understanding of the attack, they are sending a very big packet size decoded by Varint21FrameDecoder
then sending very slowly the bytes of the packet

wide maple
brittle panther
#

I have 2 questions...

  1. Is there a way to get the output of to the console of the bungee / waterfall server? I am wanting to send the console to a Discord channel.

  2. (Maybe this isn't the correct Discord to ask this, but) Someone that uses my plugin is using Gyser (so that people can connect with Bedrock Edition) and it is causing an error with my plugin because my plugin looks up player info with the Java Edition api. For instance, if someone connects called "TacosAreCool", it will look up their name on the api and get and cache their UUID. This is more used so that I can store player configs and info in files designated by their UUID (and can match the username with the UUID and vise versa). Does anyone know what I should do? I don't really want to just tell him to not use Gyser.

trail plume
#
  1. waterfall uses log4j, you'd basically just add an appender or whatever it's called to the root logger and read from there, iirc
#
  1. No idea, avoid calling that api if you can detect that it's a geyser client? geyser would know better on how to handle that
brittle panther
trail plume
#

I'd suggest seeing their documentation

brittle panther
#

ok

brittle panther
#

I can't find a good walk through. And the docs don't really help.

#

It says to use AbstractAppender, but it doesn't exist.

trail plume
#

it's not API

#

At least, not the impl stuff, iirc

#

not 100%

brittle panther
#

?

trail plume
#

I ain't done it before and I ain't reading the docs for you

brittle panther
#

I'm not asking you to.

thorny eagle
#

Is there any way to find out if a player is new to the server?

wide maple
#

Bungeecord and in addition Waterfall doesn't track that

#

You'll need a plugin if you want that

thorny eagle
#

spigot or paper plugin?

lean gobletBOT
#

technically speaking it does track it if you don't have force_default_server enabled

slow token
#

Hi! How do I check if CommandSender instanceof CONSOLE? ConsoleCommandSender, as like in Paper/BungeeCord , does not exist.

trail plume
#

sender == Console, I'd imagine

slow token
#

java.io.Console? This is not possible:

trail plume
#

No

#

get the console from the API

slow token
trail plume
#

proxy.getConsole()

#

that

#

that gives you the proxies console

slow token
#

oh, thank you!

lean gobletBOT
#

oof, the javadocs search is broken

trail plume
#

yea, the javadocs kinda went sideways, I've not really had the time/capacity to look into fixing it

#

Did give it a try, and finally got the darned thing onto java 11, so, that's nice...

lean gobletBOT
trail plume
#

oh god that stupid ass thing

#

It's because we don't have a module, iirc

chilly coral
trail plume
#

seemingly, no

civic valve
#

jesus that codestyle

bleak current
chilly coral
twilit pewter
#

what that's cool

tawdry narwhal
#

Unsigned commits are a sin

chilly coral
#

i never set this up until now

twilit pewter
#

Its not too hard

shell lagoon
#

Until it breaks, then it's a complete wtf

tawdry narwhal
#

How would it break

#

Simple let your key not expire for the next 50 decades think_smart

shell lagoon
#

I don't know, sometimes it just does for me. Last time it broke my key was set to expire in May this year, commits were no longer being signed in March this year, because who knows why.

echo vault
#

right, better to ask these questions in the appropriate channel in here rather than in the Kyori Discord lol
currently working on adding native Adventure support to Waterfall, just a little bit stuck at ServerPing though, as getDescriptionComponent requires me to return a single BaseComponent, and the serializer for BungeeCord components returns an array of BaseComponent

#

so should I take the result from this and return the first element or what?

#
public BaseComponent getDescriptionComponent()
{
    // Waterfall start - rewrite component return to return the first element if not empty, or null if is - we're going on an adventure!
    final BaseComponent[] result = BungeeComponentSerializer.get().serialize(description);
    if (result.length > 0) {
        return result[0];
    }
    return null;
//    return description;
    // Waterfall end
}
```maybe this would work
brittle panther
echo vault
#

lol

#

taking a page out of kashike's book with that one lol

#

oh also, is it worth having BungeeCord's getTranslation return a TranslatableComponent instead of a String and have it use a translation registry?

bleak current
#

Hey there, is there a way to add an waterfall server's restricted check on login?
If the bungge remind the last server of an player, this player is also connected although he has not permission for that.

trail plume
#

with a plugin, sure, basically

#

the proxy only really cares to check that on /server

bleak current
#

Ahh ok.

#

Did you know any blugin what can handle that? 😕

trail plume
#

No, this channel is also for devs, you likely want -help

echo vault
#

anyone know the best way I can test if Adventure support works in Waterfall? should I make a test plugin? write some unit tests? manually test? all three? (I just finished adding it)

trail plume
#

Need to test API

#

Need to ensure that it doesn't break packets going through it

echo vault
#

yeah

#

which waterfall do I want btw? is it waterfall proxy? (looking for the JAR that runs the proxy)

trail plume
#

bootstrap was a seperate module iirc

echo vault
#

ah that might be it

#

you guys got one of those hidden directories for a test server in .gitignore like what Paper has?

#

ah yes, run

echo vault
#

lol

#

is there a way I can get hold of the underlying Gson type adapter for the Gson component serializer to register it with BungeeCord's Gson instance?

#

maybe I could just create my own type adapter

#

I wonder if ```java
public final class ComponentTypeAdapter extends TypeAdapter<Component> {

@Override
public void write(JsonWriter out, Component value) throws IOException {
    TypeAdapters.STRING.write(out, GsonComponentSerializer.gson().serialize(value));
}

@Override
public Component read(JsonReader in) throws IOException {
    return GsonComponentSerializer.gson().deserialize(TypeAdapters.STRING.read(in));
}

}

#

or is there a way you can combine Gson instances or something

#

or am I being really stupid and it's literally right in front of me

lofty ridge
#

@echo vault Just so you are aware, it took nearly 8 (eight) months for Adventure support in Paper to be completed and merged - I started working on it in July 2020, and it was merged in February 2021

#

So I have high expectations if someone else is PR'ing it to Waterfall

echo vault
#

yeah that's fair enough

#

I'll try my best to delight you rather than making you start to question how I sleep at night lol

tame sparrow
#

Is there a proper way to sleep/block ChatEvent for up to 100ms (network call) without fucking up the netty thread underlying? So like a async cancellable?

trail plume
#

Er, cancel it and then send it yourself, basically

tame sparrow
#

Okay, thx good one indeed, do you know or it matters from which thread you use con.getServer().unsafe().sendPacket, assuming I should call this for sending it myself

trail plume
#

can call that from any thread, basically

echo vault
#

yeah BungeeCord isn’t single-threaded since it doesn’t need to be

#

well, neither does vanilla, but ya know... Mojang

lean gobletBOT
#

making games multi-threaded is really hard to do right, you can't blame Mojang for not decididing to rewrite the whole game from the ground up... oh wait, they did. It's called Bedrock and it's not better

#

runs

echo vault
#

lol

#

I mean, at least packet handling could’ve been async

#

Netty helps you out with that one

lean gobletBOT
#

pretty sure it is?

#

or at least to a point

#

you need to sync it eventually

echo vault
#

nah they put the packets into a queue that’s processed in the ticking

#

maybe not such a bad idea to queue them though

lean gobletBOT
#

I assume that's done to preserve the order or something like that

echo vault
#

probably

trail plume
#

Sending packets is context heavy, sending a packet off the event loop inside of netty is basically a case of scheduling a runnable in the event loop, and then basically telling the event loop to wake up, it's not something you wanna be doing on the main thread all the time

#

ordering is not an issue afaik as netty already promises the FIFO aspect with its channels

echo vault
#

a lot of stuff that only reads data and doesn’t write any can likely be async with a few changes

#

since reading is hardly ever the problem that plagues asynchronous execution afaik

trail plume
#

the game already does a good chunk of stuff off the main thread too, there is probably a small amount which can be moved off the main thread, making "reading" safe in many cases also means setting up memory barriers which can be costly to performance to the degree that if you don't have much going on in terms of reads, it's just cheaper to sync vs deal with the overheads of those barriers, etc

#

There is a lot of complexity, very few games take a threaded approach to anything because it's so easy to do right

#

Just, very few games are as expensive as MC is

echo vault
#

yeah

#

I mean, one thread can only do so much

#

doesn’t vanilla handle chunk generation and loading sync?

#

or did that change with 1.13 with the new threaded anvil storage

lean gobletBOT
#

yes*? xD

trail plume
#

mojang made it async, just, async is a fun word

lean gobletBOT
#

async but on the main thread thinksmart

echo vault
#

seems legit

echo vault
#

omg I'm actually stupid

#

I spent all of last night on adding Adventure to Waterfall and I've just accidentally ran ./waterfall patch and now it's all gone 🥲

#

okay well IJ's local history is officially now god tier

chilly coral
#

lmao

lean gobletBOT
#

yes it is

echo vault
#

is it worth me replacing all of the usage of deprecated methods in the built-in commands with the new Adventure stuff?

#

e.g. replacing all the string sendMessages with ones that use Component.text

echo vault
#

so you know how the Adventure patches for Paper were put very early so later patches could depend on them? do you guys think it would be worth doing the same for Waterfall?

civic valve
#

ye

echo vault
#

any idea where abouts? or is that for me to determine?

civic valve
#

make it patch 4

echo vault
#

so do I have to manually increment every number after that then?

#

or is there a tool I can use to do that for me?

#

just curious before I do this manually lol

civic valve
#

uh

#

you could rename them by hand sure

#

then just ./waterfall p and ./waterfall rb

echo vault
#

alright

trail plume
#

git rebase -i upstream/upstream

#

move the patch up the list manually

#

(in the -Proxy folder)

echo vault
#
error: sha1 information is lacking or useless (api/pom.xml).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0004 Adventure
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
  Something did not apply cleanly to Waterfall-Proxy.
  Please review above details and finish the apply then
  save the changes with rebuildPatches.sh
```any ideas?
#

just tried running ./waterfall patch and I get that

trail plume
#

the patch failed to apply

#

see the paper contrib guide, might be info there, beyond that, apatch/manually fix it

#

welcome to git

echo vault
#

lol

#

ik how patches work, just confused on why tf that failed

#

it applied just fine before

trail plume
#

then you don't know how patches work

#

it's a commit which modifies a file, something else modifies that file after it, you changed the order in which those changes are applied, hence breaking the application

echo vault
#

looks like the patch equivalent of a merge conflict to me

echo vault
#

or make manual changes to my patch

twilit pewter
#

If you make manual changes to your patch it usually also fails because the indexes and stuff aren't right anymore

echo vault
#

ah okay

#

it's complaining that SHA1 info for pom.xml is lacking or useless

#

ah that may make sense actually, since the hash it has for the file will be different to the hash in the patch

#

not sure how tf I'm gonna manually change the SHA1 hashes though, I don't think that's very viable

trail plume
#

You don't change the sha hashes.

#

You fix the patch manually

#

or use something like wiggle to help

#

This is literally just a typical git rebase/merge

#

Only, maybe slightly more bastardised as the patch was actually moved, but, still

echo vault
#

never done rebases like this before

#

right, I've undone the move changes now, is there a better way that I can move patches without breaking everything?

trail plume
#

You're changing the order of changes to a file

#

99% chance you're gonna have to fix stuff

#

There are tools out there to help aid in this, like I've already said.

echo vault
#

alright

echo vault
#

finally got fed up enough with Windows that I've finally forced myself to move back to my Arch install lol

wide maple
echo vault
#

looks good

#

totally didn't just skim read it and find nothing of interest

twilit pewter
#

IntelliJ EAP works pretty awesome on wsl now as well, you just gotta select the JDK you have installed in wsl instead of the one on Windows

velvet lake
#

Yeah, but since it is running inside a VM, it can be a bit of a performance hit when it starts up

#

And indexes

twilit pewter
#

I noticed that as well, especially when opening up Paper

echo vault
#

hey, so I switched to Linux and now for some reason, trying to run the waterfall script seems to tell me this: /usr/bin/env: ‘bash\r’: No such file or directory

#

I recopied it from the repo and it seems to persist

#

ik why this occurs, just not sure why it's occurring here

bleak current
#

the script was made on windows since windows line endings are \r\n, right

echo vault
#

yeah that's what I thought it was

#

ah ik what my issue is

#

I'm gonna guess that all the scripts were made on Windows as well

echo vault
#

submitted the Adventure PR, didn't move the patches because I'm not big brain enough for that lol

#

I tried, but it just wasn't worth me trying to do something that I definitely do not have the skills and knowledge to be able to do properly

broken temple
#

sup

brittle panther
#

Am I just dumb or is should this work like I expected? The left is my messages.yml the right is a class I use to bus my messages info to other parts of my project (so I don't have to change everything every time I change one period...)

The gspyOn and gspyOff keep coming back as empty strings... (So do the rest of my _spys.) And the messages.yml is the same on my actual development server.

#

The gspy is the root of its section (doesn't look like it on the image).

#

I've been trying to fix this error for the last week... I feel like I'm losing my mind.

chilly coral
#

What is message

brittle panther
#

It is the Configuration (Buneecord) of my messages.yml

chilly coral
#

show how you load your file

brittle panther
brazen hamletBOT
brittle panther
#

Btw, the loading of the file is fine.

chilly coral
#

What is your issue ? Error ?

brittle panther
#

I have other strings in there that work just fine.

#

There is no error.

trail plume
#

try renaming the file on the disk?

#

I mean, do those strings exist in the file on the disk?

brittle panther
#

This SHOULD be Toggled GSPY <on / off>!

chilly coral
#

The way you mixed static fields with others is strange

#

You load a static config field from the constructor of your Config class

brittle panther
#

I've self taught all the stuff I know about java.

brittle panther
#

oof. Didn't mean to ping... I forgot to turn off the ping.

trail plume
#

I mean, the fact that it does something suggests that your issue is elsewhere, outdated version of the file?

brittle panther
#

Nope.

trail plume
#

Can't really say, maybe try deleting it, beyond that, eerrr...

#

I mean, it's gotta be pulling that string from somewhere

brittle panther
#

This is why I feel like I'm going insane.

trail plume
#

stop the server, delete the jar, do a clean build, restart the server

brittle panther
#

It's definitely something with gspyOn / gspyOff being "". Also, I have restarted the server, rebuilt the jar, clean built it, etc.

trail plume
#

unzip the jar, use your debugger, etc

brittle panther
#

This is what I tried in hopes to figure it out... (This is run when you run the /gspy command.) Output will come.

#

don't mind the double parenthesis.

chilly coral
#

Where do you new Config() ?

brittle panther
chilly coral
#

Doesn't help me

brittle panther
#

My main class. The one that is the main for the plugin

#

StreamLine.java to be exact.

chilly coral
#

still doesn't help me

#

Don't know how to help you more.

chilly coral
#

Add debug messages on config loading, static fields definition, print value directly from config

brittle panther
#

let me try the last one.

chilly coral
#

The firsts ones was to see what order it executes

#

because the way you init your config is realy bad

brittle panther
#

What kind of debug messages?

chilly coral
#

anything

hybrid parcel
#

why doesnt portal farms work in paper?

#

its kinda cringe

chilly coral
brittle panther
#

^

brittle panther
brazen hamletBOT
brittle panther
#

I gotta go now though... :/

chilly coral
#

it has to be your loading

#

are you sure the file on the plugin directory is not empty ?

#

anyway you mix static with non static things, i can't help you more

boreal crown
#

Hello everyone,

Would love to get some help with a minor issue that I experience right now.
I currently try to make a method which uses generics to allow being used for two different types of classes, which both use the same Constructor parts (String and UUID) one being from Bungee, the other from Velocity.
Someone already helped me making some code that seems to make sense, but when the method is executed do I get a ClassCastException returned which I don't really understand why that is the case.

Here are the methods used:

    public <T> T[] getPlayers(Class<T> clazz, List<String> lines, List<Integer> serverProtocols, int userProtocol, boolean majorOnly){
        try{
            final List<T> players = new ArrayList<>(lines.size());
            final Constructor<T> constructor = clazz.getDeclaredConstructor(String.class, UUID.class);
            constructor.setAccessible(true);
    
            for(String line : lines){
                players.add(constructor.newInstance(
                        Parser.toString(line, serverProtocols, userProtocol, majorOnly), UUID.randomUUID()
                ));
            }
            
            // noinspection unchecked
            return (T[])players.toArray();
        }catch(NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ex){
            return null;
        }
    }

// This is in a different class and used as convenience method.
    public ServerPing.PlayerInfo[] getPlayers(List<String> lines, List<Integer> serverProtocols, int userProtocol, boolean majorOnly){
        // This is the line that triggers the CCE (See linked stacktrace)
        return core.getPlayers(ServerPing.PlayerInfo.class, lines, serverProtocols, userProtocol, majorOnly);
    }

And here's the Stacktrace for this:
https://paste.helpch.at/olipovesoq.rb

I'm fairly new to Generics so not sure if all this code makes sense and is actually right. I appreciate any help in fixing this issue.

#

(1 character short of 2k limit lol)

echo vault
#

yeah I think I should probably rate my Adventure PR about 4/10 at this point lol

#

I guess these sorts of mistakes are why PR reviewers are so important

potent dirge
#

hey guys im having promlams with some mods support

shell lagoon
# boreal crown Hello everyone, Would love to get some help with a minor issue that I experienc...

I think your issue is that you (implicitly) try to cast an array that is actually an Object[] to a ServerPing.PlayerInfo[], which isn't allowed. Keep in mind that your generics are removed at runtime, so the method you wrote will be working with Objects. Hence, your final array is of the type Object[]. An Object[] cannot be cast to a ServerPing.PlayerInfo[], which is the cause of the exception. Since generics are removed at runtime, Java adds a cast for you in your bottom method to ensure that the method still returns the correct type. This cast fails and generates the exception.

echo vault
#

ah the beauty of type erasure

boreal crown
trail plume
#

You'd need to cast individual elements

boreal crown
#

okay?

trail plume
#

There is no fix

#

either you implictly retain the type information or you cast individual elements in the array instead, basically

boreal crown
#

Then how could I create a method that allows me to have a way of returning either SamplePlayer[] or PlayerInfo[] based on stuff provided?

trail plume
#

You'd need to override that class with an impl which retains that type info

#

(or, basically, pass that info in there in a way which the output type can be seen)

#

you'd be much better off just using a List vs an Array, as it actually supports generics

boreal crown
#

I need to turn it into an array tho

#

At least at some point

#

I'm also not too sure how this would now look like with a list instead of an array...

trail plume
#

ArrayList

#

vs a primative array

boreal crown
#

Still doesn't answer my question about how this would look like.

#

I never worked with that stuff before

trail plume
#

The idea of using an ArrayList instead of an array is that worse case you can cast it over to List<Type> implictly and it won't CCE

#

best case is that it acts as a container able to retain the type information for you vs being forcefully downcasted to Object because of how generics work

boreal crown
#

Would it be like this now?

    public <T> List<T> getPlayers(Class<T> clazz, List<String> lines, List<Integer> serverProtocols, int userProtocol, boolean majorOnly){
        try{
            final List<T> players = new ArrayList<>(lines.size());
            final Constructor<T> constructor = clazz.getDeclaredConstructor(String.class, UUID.class);
            constructor.setAccessible(true);
    
            for(String line : lines){
                players.add(constructor.newInstance(
                        Parser.toString(line, serverProtocols, userProtocol, majorOnly), UUID.randomUUID()
                ));
            }
            
            return players;
        }catch(NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ex){
            return null;
        }
    }
trail plume
#

Yes

boreal crown
#

Okay. And I guess at one point could I just do a List#toArray(new ServerPing.PlayerInfo[0]) to turn it into an array to use for Bungee

trail plume
#

yup

boreal crown
#

Let's see if that stuff works...

#

Seems to work!

#

Velocity part works too!

#

Nice

plush hatch
#

My command that sends to player length of args not works when I execute command with args on client. On console it works fine

public class RegisterCommand extends Command {

    public RegisterCommand(Auth plugin) {
        super("register");
    }

    @Override
    public void execute(CommandSender sender, String[] args) {
        sender.sendMessage(args.length);
    }
}
trail plume
#

That code literally cannot work on the console

plush hatch
#

i know

#

but if i remove if statement it works

wide maple
#

@echo vault yes java is fun

echo vault
#

lol

#

also, still questioning kashike's decision to have everything fully qualified because of that

#

net.kyori.adventure.text.@org.checkerframework.checker.nullness.qual.NotNull Component lol

#

just not very readable for developers imo

wide maple
#

Doesn’t matter. Has to be this way

echo vault
#

why?

trail plume
#

minimal diff

wide maple
#

^

echo vault
#

ah right

trail plume
#

Please actually read the contrib guides

echo vault
#

is there a note in it that mentions this? because I'm looking at it rn and I don't see anything about minimising patch diffs

#

unless I'm blind or something lol

trail plume
#

See the paper one, that's the more over-arching guide here

echo vault
#

ah right

placid sinew
#

upstream merge pls :p

#

I can PR it if you like, but should be fairly trivial / no conflicts

wide maple
#

PR it, cat will pull it

echo vault
#

would anyone have any idea why IntelliJ's just deciding nah m8 today and not picking up the Waterfall-Proxy folder as something it should index?

#

nvm, seemed to work now

#

somehow

#

typical

forest flume
#

IntelliJ is weird sometimes, i often have to invalidate caches for indexing to work normally

echo vault
#

yeah it does some whack sometimes lol

placid sinew
chilly coral
#

i thought you forgot so i did it

placid sinew
#

thanks for merging & doing travertine too, cat <3

brittle panther
#

Does anyone know of any good tutorials (YouTube?) for making APIs for BungeeCord / Waterfall plugins?

trail plume
#

np luck ❤️

#

API is API, there's nothing really special about bungee, works the exact same as bukkit, either they get an instance of your API through some singleton or get it through the plugin manager and your main class implements the classes in your API

wide maple
#

I’ve looked through the waterfall config system and I’m pretty sure we can justify not loading packet mappings if some things are disabled

trail plume
#

justify, yes

#

passing that info to the correct place, eer...

wide maple
#

Bungeecords reload system is the problem

trail plume
#

who cares

wide maple
#

It will not reconstruct packet mappings

trail plume
#

the behavior of reload is not promised

#

especially when it comes to lower level stuff, only guranteed method to "reload" the config is to restart

wide maple
#

Right, changing the bind address also does nothing

#

On the other hand, disable-unused-features default true?

trail plume
#

am confusion

#

changing bind address does work last I knew, but, that's a nice thing, not a promise 😛

#

I was gonna look at having some system where it can determine if a packet should be parsed by bungee or not, but, fell into some concerns with how the logic for that would look given that we don't have an actual "registry" per sei

#

Or, at least, nothing named

wide maple
#

Well

#

Encode-only is one thing velocity does

trail plume
#

I was debating on a block of a few instanceofs or whatever, but, was never 100% fond of it, but, other alternative is to throw some logic in the packet classes themselves for a "should read", but, hen we gotta check the config option in the packet classes themselves, and, it gets all contrived between gross hack and pretty solution

wide maple
#

For some packets anyway

trail plume
#

velocity is flat packed, so, passing things like config options around easily is childs play

#

over in waterfall I've got as gross as to use system properties

#

hurls

wide maple
#

But in all seriousness there needs to be change

trail plume
#

I think I'm gonna have to create like a common module or something just for some of this shit

#

I did wanna avoid that but the entire system seems to make it look like a nicer and nicer option as time goes by, even if it's just be able able to throw stupid shit around the place

#

or maybe shuffle the module paths around a bit

wide maple
#

We still follow upstream so that is the option of most resistance by all means

#

In all fairness, you could probably replace wide parts of the proxy and protocol package with velocity parts

trail plume
#

issue with all is generally plugins

#

I got my ass bit far too many times tryna get that entity metadata disable stuff to work as good as it does in 99% of environments

wide maple
#

Just funny side-note

#

It’s broken in 1.16.x

#

There are two invalid offsets with projectiles

trail plume
#

FIVE

wide maple
#

But that doesn’t seem to matter

trail plume
#

I thought this was gonna be war

wide maple
#

1: it’s never used

#

2: There is a bug preventing this from working right on the client either way

#

3: that bug exists since 1.14 and still exists in the latest snapshot

wide maple
trail plume
#

I thought you was gonna say that disabling the metadata stuff was borked again

#

upstreams maintanance of the metadata highly appears to be copy + paste between versions, attempt to map the changes and wait for it to blow up post release

wide maple
#

This entire thing is stupid

trail plume
#

it's such a cludge-fuck of a system

wide maple
#

You’re telling me

trail plume
#

when I was having issues with getting the option to work persistently, I honestly debated on just fucking rm -rf'ing that entire damned thing

wide maple
#

We are comparing NBT objects with == to decide wether to use the entity map in 1.16

#

In my defense I’m fine with that

#

There is no way that this is ever true

#

So md played himself and I’m fine with that

trail plume
#

lol

#

I think I remember seeing that

#

Being confused on like "there is no fucking way this works"

#

being all confuzzled around some stuff and then was like "fuck it, that's his problem"

wide maple
#

In his defense

#

The object that uses == to compare can be a primitive type too

#

But that he never even bothers to discern types….

trail plume
#

if it's the one i'm thinking of, it can never be a primative in that block of code iirc

#

But, 🤷‍♂️

wide maple
#

It can

#

It’s either an int (pre 1.16) or an NBTTagCompound (1.16 and newer)

#

I mean improved-switching-logic is a patch I can reasonably contribute

wide maple
#

You know you don’t need to cast anything here? CommandSender is the providing class for sendMessage

plush hatch
wide maple
#

?! Console? You’re sending a chat message

subtle epoch
#

I'm looking into moving a player to a different server and at the same time send some data to the server. Two questions:

  1. Is there a way to send a plugin message on the specified player's connection to the server? player.sendData seems to send to the client, while player.getServer().sendData seems to choose a random player's connection for sending the message?
  2. Is the plugin message channel ready when ServerConnectedEvent fires?
lean gobletBOT
#

just send the player's UUID on the channel

subtle epoch
#

Yeah, that's the obvious workaround. Is there a reason why Bungee/Waterfall doesn't expose the player specific connection to the server, though?

lean gobletBOT
#

it probably just doesn't matter in most cases

#

so it wasn't included in the API

#

you need to ensure or validate that the data is coming from your proxy anyways, otherwise a malicious client could send arbitrary data to your backend servers

subtle epoch
#

For the second question, though. If I use event.getServer().sendData in ServerConnectedEvent, can I be sure the data arrives, even when the player is the only player on the network?

lean gobletBOT
#

easiest is probably to block data that comes from the client on the proxy but a different solution is to just use keys

#

you can be sure the data arrives because it will be queued by default if no player is on that server

subtle epoch
#

Great, thanks

lean gobletBOT
#

(but I would assume that the event gets called after the connection is ready)

subtle epoch
#

I hadn't thought about authentication, but it's not an issue in this case, as the plugin is for internal use, so the channel name will not be known

lean gobletBOT
#

docs say " It is useful if you wish to send information to the server before the player logs in." so i would assume sending data has no issues there

#

the channel name will be advertised to the client when you register it

#

also security through obscurity is no security

subtle epoch
#

I am aware security through obscurity is not security, but I will except this in my risk tolerance

#

Also, why is the channel advertised to the client, when it is for use between proxy and server?

lean gobletBOT
#

whelp

#

the channel is for the use between the client and the server, the proxy just piggybacks on it

subtle epoch
#

Shouldn't it be perfectly feasible for the proxy to register a channel with the server, and prevent the packets advertising that channel from reaching the client?

lean gobletBOT
#

although I think the proxy might block channels from being advertised to the client if the proxy has it registered but I'm not sure

subtle epoch
#

Yeah, this is my point

lean gobletBOT
#

but pretty sure I have seen backend server channels a couple years ago when I fiddled with exploiting this stuff 👀

#

(hint: adding untrusted servers to your proxy network exposes one to a lot of shit lol)

subtle epoch
#

Thanks for the help

lean gobletBOT
#

but yeah, I strongly suggest to always assume that a client could send plugin message data that reaches the backend server

subtle epoch
#

Sure. In my case it is an effort/time/risk tradeoff. There won't be any trouble even if this is exploited

lean gobletBOT
#

can't really find anything about the server messages not getting sent to the client btw but I might just not be looking at the right places

plush hatch
wide maple
#

1: I have zero idea what you’re trying to prove or show
2: You haven’t shown us that you’re registering the command correctly
3: A more detailed explanation would be helpful

chilly coral
#

Your code sends a message to the command sender

#

If you perform the command from console then it sends the message to the console, if a player performs the command, the message is sent to the player

#

So it's logic that nothing is sent to the console in the 2nd case.

#

If you need to print something in the console whatever the command sender is, then get the Logger of your plugin and log thougth it.

wide maple
#

Bungeecord should have a getConsoleCommandSender method iirc

plush hatch
#

o m g. I say when console executes command with args, it logs and send message to console. When player executes, no log and messages

#
ProxyServer.getInstance().getPluginManager().registerCommand(this, new TelegramCommand(this));
chilly coral
#

1 - deep breath
2 - your code can't compile, sendMessage doesn't take integers 🙂
3 - your plugin is messing with player input if the command is not executed
4 - "Auth" "/register" really sounds unsupported setups

pale sandal
#

Hey guys, trying to work with JoinGame packet on bungee via protocolize but getting Unexpected packet received during server login process! 0d0100, any ideas? Seems like the packet is being read correctly.

wide maple
pale sandal
#

Let me try

#

@wide maple getting the same thing in offline mode

wide maple
#

Explain to me why you want to alter the JoinGame packet?

pale sandal
#

I'm not trying to alter it, I'm trying to read data off it

wide maple
#

which data?

pale sandal
#

entityId

#

But data is being read correctly

wide maple
#

.... how are you reading the packet?

pale sandal
#
  @Override
  public final void read(final ByteBuf buf, final ProtocolConstants.Direction direction, final int version) {
    this.entityId = buf.readInt();
    this.isHardcode = buf.readBoolean();
    this.gamemode = buf.readUnsignedByte();
    this.previousGamemode = buf.readByte();
    this.worldCount = readVarInt(buf);

    for (int i = 0; i < getWorldCount(); i++) {
      worldNames.add(readString(buf));
    }

    this.dimensionCodec = readTag(buf);
    this.dimension = readTag(buf);
    this.worldName = readString(buf);
    this.hashSeed = buf.readLong();
    this.maxPlayers = readVarInt(buf);
    this.viewDistance = readVarInt(buf);
    this.reducedDebugInfo = buf.readBoolean();
    this.enableRespawnScreen = buf.readBoolean();
    this.isDebug = buf.readBoolean();
    this.isFlat = buf.readBoolean();
}```
wide maple
#

let me guess, this is read before the proxy reads it?

pale sandal
#

Not sure? Protocolize handles that

wide maple
#

do me a favor and add int marker = buf.readerIndex(); before you read the entity ID and buf.readerIndex(marker); after the last line

pale sandal
#
19:05:24 [INFO] buf=PooledUnsafeDirectByteBuf(ridx: 1, widx: 30809, cap: 32768)
19:05:24 [INFO] direction=TO_CLIENT
19:05:24 [INFO] version=754
--- 19:05:24 [INFO] marker$1=1
19:05:24 [INFO] entityId=2
19:05:24 [INFO] isHardcode=false
19:05:24 [INFO] gamemode=1
19:05:24 [INFO] previousGamemode=0
19:05:24 [INFO] worldCount=1
19:05:24 [INFO] worldNames <0> =minecraft:overworld
19:05:24 [INFO] dimensionCodec=TAG:named
19:05:24 [INFO] dimension=TAG:named
19:05:24 [INFO] worldName=minecraft:overworld
19:05:24 [INFO] hashSeed=8397198840432902021
19:05:24 [INFO] maxPlayers=20
19:05:24 [INFO] viewDistance=10
19:05:24 [INFO] reducedDebugInfo=false
19:05:24 [INFO] enableRespawnScreen=true
19:05:24 [INFO] isDebug=false
19:05:24 [INFO] isFlat=true
--- 19:05:24 [INFO] marker$2=30809```
wide maple
#
@Override
  public final void read(final ByteBuf buf, final ProtocolConstants.Direction direction, final int version) {
+   int marker = buf.readerIndex();
    this.entityId = buf.readInt();
    this.isHardcode = buf.readBoolean();
    this.gamemode = buf.readUnsignedByte();
    this.previousGamemode = buf.readByte();
    this.worldCount = readVarInt(buf);

    for (int i = 0; i < getWorldCount(); i++) {
      worldNames.add(readString(buf));
    }

    this.dimensionCodec = readTag(buf);
    this.dimension = readTag(buf);
    this.worldName = readString(buf);
    this.hashSeed = buf.readLong();
    this.maxPlayers = readVarInt(buf);
    this.viewDistance = readVarInt(buf);
    this.reducedDebugInfo = buf.readBoolean();
    this.enableRespawnScreen = buf.readBoolean();
    this.isDebug = buf.readBoolean();
    this.isFlat = buf.readBoolean();
+   buf.readerIndex(marker);
}
pale sandal
#

Did exactly that 🙂

wide maple
#

same issue?

pale sandal
#

Let me try to restart the server instead hot swapping

#

Awesome, we moved a little.

#
19:07:49 [INFO] [lackoSK] disconnected with: Exception Connecting:DecoderException : net.md_5.bungee.protocol.BadPacketException: Did not read all bytes from packet class path/to/class/.JoinGamePacket 36 Protocol GAME Direction TO_CLIENT @ io.netty.handler.codec.MessageToMessageDecoder:98```
wide maple
#

okay at least now I know it does expect to have read it

trail plume
#

erm, that screams that it's replacing the packet in the registry

wide maple
#

oh youre right

#

in that case

#

yea this cant work

pale sandal
#

Yeah it's putting it into a map, any other ideas how can I do this?

trail plume
#

Issue is that you're replacing a packet in the proxies packet registry

wide maple
#

^

trail plume
#

Which means that the proxy ain't gonna actually process this packet

pale sandal
#

Yes, I understand the issue. How can I work around it?

wide maple
#

listen to the original packet instead?

trail plume
#

Never worked with that library

#

what Five said, you'd ned to see if you can access the original packet class

wide maple
#

well then you'll have to do it without a library