#waterfall-dev
8550 messages · Page 2 of 9
it used to be .remind
if u have dyno perms u can use ?remind but josh'd have to be the one doing it i believe
bots have failed us
if u ping the bot u dont need its prefix lol
copy-paste paper code
?remindme 12h @civic valve is dum
also why is there dyno and dyno premium lol
?diagnose remindme
dunno why there was no output then but ight
Because dyno+
dynos better than mee6 anyways ill give it that
@outer elbow can you test a build rn?
sure
looks like it works :D
ah
but iirc bungee literally just uses Sys.out.println lmfao
Dyno not working? I'm surprised
also was it MD's idea to make hex codes &x&R&R&G&G&B&B
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
&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
ah
anyways thanks josh!
Is Adventure going to be included in waterfall?
see #waterfall-help
Is anyone going to fix the javadocs anytime soon?
Delombok isn't happening
Example https://papermc.io/javadocs/waterfall/
There are none of the methods there should be
It's on the todo list
👍
it's not important enough that im gonna throw my health around for it
opened a tracking issue for it, but it is not a priority
#waterfall-github wot the heck
github is fun
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
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
I mean, technically could read the packet and modify the contents of the command definition
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
ok then ¯_(ツ)_/¯
How ti use waterfall?
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.
Btw, this is my repo for it: https://github.com/xNitrate/FabricProxy
@brittle panther that’d mean you have a 21w08a/b compatible snapshot proxy and without speaking about velocity there shouldn’t be one

I'm pretty sure I have one. I can connect to my lobby with 21w08b.
Or do I need to do something weird to get it so I can connect to my snapshot server?
you need snapshot support in the proxy
did you add that yourself? or what are you using for that to work?
I made a patch to Waterfall.
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?
Sorry for not clarifying. That is in the Fabric server.
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
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.
Link? I'm ready to be impressed. I am currently working on a solution to the problem of the discontinued packet
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?
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
ohnononononononono
And here is the actual file, so you don't have to build it.
w08a changed a whole host of packets
Well, I can connect to my lobby some how.
well yes. But try to enter combat or try to chat
commands should work
server switching should also crash you
You see, I looked on the wiki, and they didn't update their page for w08a/b... So, I just assumed everything is fine.

I'll work on this tonight.
Oh. And another thing... I could switch servers.
¯_(ツ)_/¯
Okay. I just applied those patches to Waterfall. I will now test to see if it works.
Well... I'm not good enough with Java or Bungee / Waterfall patching to fix this... :/ Ugh.
Could not initialize class net.md_5.bungee.protocol.Protocol
see earlier exceptions, you broke the Protocol class
There are no red lines in my IDE... Even more sadness...
runtime error != compile time error
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.
Just kidding. I lied. Trying one more thing. :P
nope
more sadness
zzzCat do you mind taking a look at my Protocol class? Or anyone else who wants to try to take a crack at it. :P Paste.gg --> https://paste.gg/p/anonymous/3f91b8166c5c4227836ce334d2fa55f6
provide the full logs
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
erm, apparently the source exception was lost
?
the reason why the Protocol class failed to init has not been logged

what's the cause of the InvocationTargetException?
oh I saw it, NoClassDefFoundError
yeah you need to do further debugging
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
}
}
}
}
@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?
wrong channel?
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)
Yea, am just, erm, mentally drunk
TabCompleter sounded like they where tryna use some bukkit interface or something
I am trying to tabcomplete the command
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
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
you don't have to, but it's the only machanism we support
If you don't use those, you'll have a fun time building your project.
what are you going to use, eclipse compiler + individual jars? haha
Hey, how can i debug in waterfall without timeouts/waterfall crashes?
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
can someone recommend me a good Configuration Lib for Bungeecord?
typesafe config (uses HOCON format which is bae)
do you know a Yaml lib?
Configurate is pretty widespread but I personally just use Bungee's inbuilt system when I don't want to build complex stuff
can you reload the config with the inbuilt system?
sure
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
I recommend this configuration library: https://github.com/A248/DazzleConf
Wow
Could someone help me solving this issue?
I get a NPE on startup for my plugin, when it tries to load metrics, particularely when it tries getting a custom Pie Chart from the core module it has.
I made the Pie thing generic (Put it in core module) to reduce duplicate code, but for that to work do I need to use bstats' base lib which I believe isn't properly retrieved from core or something? (Jar itself seems to have it tho. Idk)
The error: https://paste.helpch.at/niliyicaxo.css
Where it points to (in order):
- https://github.com/Andre601/OneVersionRemake/blob/feature/move-drilldownpie-method/bungeecord/src/main/java/com/andre601/oneversionremake/bungeecord/BungeeCore.java#L65
- https://github.com/Andre601/OneVersionRemake/blob/feature/move-drilldownpie-method/core/src/main/java/com/andre601/oneversionremake/core/OneVersionRemake.java#L138
- https://github.com/Andre601/OneVersionRemake/blob/feature/move-drilldownpie-method/core/src/main/java/com/andre601/oneversionremake/core/OneVersionRemake.java#L48
- https://github.com/Andre601/OneVersionRemake/blob/feature/move-drilldownpie-method/bungeecord/src/main/java/com/andre601/oneversionremake/bungeecord/BungeeCore.java#L45
I just changed the method to instead return the Map used for the pie stuff...
Good enough solution for me
the self promo is strong with this one 😉
don't blame you though, dazzle is pretty good
i can only recommend the best
can you register your own parsers for that?
for custom types, yes
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
is there an api for setting player names for the tab list? not the header/footer, the player entries
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))
Not really possible without breaking API- the logger md_5 uses is ass and hard to adapt
hello. i think there is another attack causes OOM
waterfall - 403, XMX is 9G
log:
https://mega.nz/file/eU4k0ATJ#uAzhU8_3OFxqPnbrFQNSWYbWjUBd423GKCNwA23nUSA
.paste it
Please paste large logs to a pastebin: https://paste.gg
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?
iptables, there is also a jvm flag for it, can alllso disable direct memory but that will incur a perf hit
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
seems to be the case
I guess it's just a consistency thing, most tools reading that going back can probably just read both
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
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
that edit was after 1.7.10 was released
oh ok, so the vanilla server actually did change the format it serialized UUIDs to?
well, 2 days before the full release of 1.7.10
and travertine is reflecting that I guess?
based upon the existence of the diff, seems to be the case
I don't got sources for 1.7.2 to check
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
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
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
How do i get the players UUID when the player has just connected to the server?
just get it from the player object?
@ 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
the new server sends the team, etc, before the proxy has cleared itself of all of that stuff
No- Thats not what happens
this happens from server plugins
I have zero ability to reproduce this without proxy plugins
I mean, unless these people have plugins on the proxy messing with stuff, hm
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
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
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
@weary grove Do you think this should be in the server connection events as a flag to pre-set proxy/server authority for scoreboards? I don't want a mixed mode. That causes the issues seen in Bungeecord. Even if the Focus is deferred, the scoreboard event will still fire for the deferred side, but as deferred. If that is changed it will chain a focus change

speaking for Velocity
I will come back to this on Waterfall once I have made a good solution for Velocity
what's the best way to get the rest of the args in a message like args[2] and up for example
You copy over the rest of the array and the String.join
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.
don't think that there is one?
Ah, thank you.
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);
you'd need to keep setting the velocity with the scheduler if you want it to keep moving
No, what I want is that it does not change the speed when it is moving.
- wrong channel, #paper-dev
- Entities lose their velocity over time because gravity
I didn't realize the channel, my fault.
Do you know how to avoid detecting gravity?
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
okay
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 ) );
}
}
}```
you're assuming that the player has a current server
they just donnected, they don't
Is there any way for me to change the username of a joining player?
Iirc ProxiedPlayer is read only.
Found the way to modify the pendingConnection by loading bungeecord instead of bungeecord api
pretty sure you can just modify it in the query event
What are waterfall commands, all?
same as the bungeecord ones, wrong channel too I'd guess
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);
}
}```
cfg is null, did you create an instance of your mnYAML class?
No problem
whats the best way to get a player's prefix, should i just use the LP API or is there a way without dependencies?
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
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
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
gotcha
is using player.chat("/command") the best way to make the player run a command
from the proxy to the server, only way bar a plugin
Is there a event for if moving a player to another server failed?
or any kinda of way i could catch that
there miiight be a callback?
ah you can set a fallback for if server movement failed?
*callback
i will check it out
ServerConnectRequest.builder()
i see. Thank you ❤️
Is there a way to not send the error message?
this message may be a bit irritating for users
no
ok thanks. I will just add to it that the user can ignore it
colored brackets, how
rainbow brackets plugin
There is an easier way using events, then you just cancel the event.
This should show you a way to do it (if you would like to look at an example): https://github.com/CraftMinecraft/MoveMeNow/blob/master/src/main/java/net/craftminecraft/bungee/movemenow/PlayerListener.java
I will take a look later. Thanks.
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.
@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?
line 28 has something null on it
what is line 28
Is something not loaded when the player is post logged in?
if(player.getServer().getInfo().equals(this.plugin.getProxy().getServerInfo("limbo"))) {```
Sorry. I forgot
getServer or getInfo is null
PostLoginEvent is called before the player is actually connected to any server
so probably getServer is null
ServerConnectEvent is called when the proxy is trying to decide which server to connect to
you can use ServerConnectEvent#setTarget
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.
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
ok will try
is there a way to use the plugin messaging channel to make the proxy run a command?
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
@ 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
I just use apatch like I said
i don't know this :/
it's a magical script bundled in the paper repo
ho
i searched in the scripts directory, but i'm based on Travertine and i don't have this one. Will look at it.
it's in the paper repo
I just keep a copy of it it my PATH, needs wiggle to be installed though
Hello, i made a Travertine fork, but how can i update the upstream (Travertine) correctly=
Make a pull request.
A great example how to not update your fork is doing that ^
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 🤷♂️
Did I misunderstand the question?
they're asking how they can update their own fork
Don't you want to pull request? Or have I been doing it wrong?
That's not the general procedure how to update any fork of anything.
That's the the procedure if you want to contribute.
No.
Yes
they want to pull commits from travertine into their own fork
I don't open paper prs to paper if I want to fetch the latest commits.
Yeah lol
e.g. any merge conflicts and you're SOL
Guess that's what you do if you don't know git 
Wrong... god damn it NMF...
I don't/can't spell.
I went to delete my own message, and then he edited and it borked the placement of my cursor
That's the thing... I don't know git.
Luckily documentation exists 👏
Everything I've learned about it was by myself or from articles online.
And the articles online are just confusing.
Those are confusing.
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
I don't know what "rebase" is.
I prefer rebasing if I don't need/want everything
I've heard tons of documents try to explain it... but, either I'm dumb, or they are not explaining well.
Or I just drop the commits afterwards
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
Even GitHub itself shows you one way to update it properly
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?
you could do it with a plugin, just, you'd be diving deep into internals to the degree that forking would probably be easier
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.
#631 I think boils down to; don’t have your servers do stupid sh*t?
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
I can’t do irony in the morning

But yes. Clients shouldn’t be allowed to do that kind of nonsense
looks like server variable means that true is client <--> bungee and false is server <--> bungee
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...
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.
idk...
did you run the script?
ok..
I'm desperately waiting for the day downloading normal repositories will be discouraged
..
Is there a dedicated class to recognize Travertine?
I assume io.github.waterfallmc.travertine.protocol.MultiVersionPacketV17 would perhaps work
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){}
}
}```
Hello! Is it planned to add Adventure to Waterfall natively?
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
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.
I'm sorta like, ill, and so going crazy over PRs is not something I do unless they're critical
okay, thank you.
Yeah, I was thinking in that, but I don't know what to put into the callback space so I can have a response
the callback has your response
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
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 == .....) }
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){}
}
}```
stuff in the callback happens in the future
so when I try to change a boolean to true, it just wont change
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
I didn't thought about that, thanks now it works perfectly
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.
see the bungeecord documentation, if you're using IJ, there is a plugin which can cleanly set all of this up for you automagically
❤️
Works fine!
https://www.spigotmc.org/wiki/create-your-first-bungeecord-plugin-proxy-spigotmc/
May it should added in github to the README
plans are to redo the docs ourselves, just, erm, keyboard looks like a cozy pillow
debated on that one but seems kinda meh
Server crashes while spamming a command that access a database using c3p0 connection pool. Anyway know a way on how to fix this?
if using async stuff, increase the connections or use a bounded thread pool
How would I do this?
don't ping
connections are not thread safe
forgot to disable it
Wich one do you use?
But, i mean, use a thread pool which has a max thread count and use that for mysql stuff
hikari
I am going to try hikari
So the proxy stops responding like normally.
Here is the code:
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
How do I do all of that in the practical way and not in theory?
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
And what if I want to have multiple databases?
oh, then, you'll have to use a pool per database i guess
Does this cost a lot of resources?
each pool has to have its own set of connections
connections are not an infinite thing
there is a whole number of reasons why this isnt a good "fix" and I will indeed list those:
- You shouldn't throw exceptions there. Cached exceptions would be preferrable- If you are going there might as well do it right
- If youre checking the capacity then its already too late to do something about that, the memory has been allocated already
- 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
Yea, that's just literally... defo not suitable for paper
The last one is the correct way to go about it, but it breaks nearly all plugins that interact with channels in bungeecord

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...
Its gonna help at least and its a clean solution
if the buffer gets large enough and can't read a connection, it should stall out the conn I'd imagine
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
So yea, limiting that is the best way to fix it
Is it in MinecraftDecoder ?
if yes, well this is not going to work to prevent memory attack
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
That’s not always possible I’m afraid
I have 2 questions...
-
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.
-
(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.
- waterfall uses log4j, you'd basically just add an appender or whatever it's called to the root logger and read from there, iirc
- 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
How would I do that? I've never worked with Log4J.
I'd suggest seeing their documentation
ok
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.
?
I ain't done it before and I ain't reading the docs for you
I'm not asking you to.
Is there any way to find out if a player is new to the server?
Bungeecord and in addition Waterfall doesn't track that
You'll need a plugin if you want that
spigot or paper plugin?
technically speaking it does track it if you don't have force_default_server enabled
Hi! How do I check if CommandSender instanceof CONSOLE? ConsoleCommandSender, as like in Paper/BungeeCord , does not exist.
sender == Console, I'd imagine
java.io.Console? This is not possible:
oh, thank you!
oof, the javadocs search is broken
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...
might be worth to just setup a redirect in nginx from https://papermc.io/javadocs/waterfall/undefined/ to https://papermc.io/javadocs/waterfall/ ¯_(ツ)_/¯
was wondering, is it normal that HAProxyMessage is not released here ?
https://github.com/SpigotMC/BungeeCord/blob/830ee8f27d47400d17915bf546fc85540dbe5180/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java#L92
seemingly, no
My eyes 😩
what that's cool
Unsigned commits are a sin
i never set this up until now
Until it breaks, then it's a complete wtf
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.
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

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?
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.
No, this channel is also for devs, you likely want -help
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)
yeah
which waterfall do I want btw? is it waterfall proxy? (looking for the JAR that runs the proxy)
bootstrap was a seperate module iirc
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
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
@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
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
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?
Er, cancel it and then send it yourself, basically
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
can call that from any thread, basically
yeah BungeeCord isn’t single-threaded since it doesn’t need to be
well, neither does vanilla, but ya know... Mojang
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
lol
I mean, at least packet handling could’ve been async
Netty helps you out with that one
nah they put the packets into a queue that’s processed in the ticking
maybe not such a bad idea to queue them though
I assume that's done to preserve the order or something like that
probably
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
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
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
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
yes*? xD
vanilla: https://tenor.com/oZZh.gif
mojang made it async, just, async is a fun word
async but on the main thread 
seems legit
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
lmao
yes it is
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
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?
ye
any idea where abouts? or is that for me to determine?
make it patch 4
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
alright
git rebase -i upstream/upstream
move the patch up the list manually
(in the -Proxy folder)
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
the patch failed to apply
see the paper contrib guide, might be info there, beyond that, apatch/manually fix it
welcome to git
lol
ik how patches work, just confused on why tf that failed
it applied just fine before
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
looks like the patch equivalent of a merge conflict to me
so do I now need to go through every patch after it and make manual changes?
or make manual changes to my patch
If you make manual changes to your patch it usually also fails because the indexes and stuff aren't right anymore
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
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
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?
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.
alright
finally got fed up enough with Windows that I've finally forced myself to move back to my Arch install lol
Well shucks, the newest windows insider build has native x/g display server capabilities and I’ve found that running the Ubuntu version of IntelliJ through that on windows actually makes it usable
sounds interesting
I can't wait
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
Yeah, but since it is running inside a VM, it can be a bit of a performance hit when it starts up
And indexes
I noticed that as well, especially when opening up Paper
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
the script was made on windows since windows line endings are \r\n, right
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
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
sup
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.
What is message
show how you load your file
Btw, the loading of the file is fine.
What is your issue ? Error ?
try renaming the file on the disk?
I mean, do those strings exist in the file on the disk?
This SHOULD be Toggled GSPY <on / off>!
The way you mixed static fields with others is strange
You load a static config field from the constructor of your Config class
I've self taught all the stuff I know about java.
Yes.
oof. Didn't mean to ping... I forgot to turn off the ping.
I mean, the fact that it does something suggests that your issue is elsewhere, outdated version of the file?
Nope.
Can't really say, maybe try deleting it, beyond that, eerrr...
I mean, it's gotta be pulling that string from somewhere
This is why I feel like I'm going insane.
stop the server, delete the jar, do a clean build, restart the server
It's definitely something with gspyOn / gspyOff being "". Also, I have restarted the server, rebuilt the jar, clean built it, etc.
unzip the jar, use your debugger, etc
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.
Where do you new Config() ?
Doesn't help me
My main class. The one that is the main for the plugin
StreamLine.java to be exact.
Add debug messages on config loading, static fields definition, print value directly from config
let me try the last one.
The firsts ones was to see what order it executes
because the way you init your config is realy bad
What kind of debug messages?
anything
^
https://github.com/xNitrate/StreamLine/blob/365c2ecef24940aa6ba4430aa49dfce9c2a28915/src/main/java/net/plasmere/streamline/config/Config.java#L34
System.out.println("config load - start")
https://github.com/xNitrate/StreamLine/blob/365c2ecef24940aa6ba4430aa49dfce9c2a28915/src/main/java/net/plasmere/streamline/config/Config.java#L37
System.out.println("config load - end")
static {
System.out.println("MessageConfUtils class init - start")
}
static {
System.out.println("MessageConfUtils class init - end")
}
try this
and see what order these messages are printed
I gotta go now though... :/
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
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)
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
hey guys im having promlams with some mods support
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.
ah the beauty of type erasure
And how would I now get this fixed?
You'd need to cast individual elements
okay?
There is no fix
either you implictly retain the type information or you cast individual elements in the array instead, basically
Then how could I create a method that allows me to have a way of returning either SamplePlayer[] or PlayerInfo[] based on stuff provided?
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
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...
Still doesn't answer my question about how this would look like.
I never worked with that stuff before
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
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;
}
}
Yes
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
yup
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);
}
}
That code literally cannot work on the console
@echo vault yes java is fun
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
Doesn’t matter. Has to be this way
why?
minimal diff
^
ah right
Please actually read the contrib guides
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
See the paper one, that's the more over-arching guide here
ah right
upstream merge pls :p
I can PR it if you like, but should be fairly trivial / no conflicts
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
IntelliJ is weird sometimes, i often have to invalidate caches for indexing to work normally
yeah it does some whack sometimes lol
ah seems like someone beat me to it (thanks!)
i thought you forgot so i did it
thanks for merging & doing travertine too, cat <3
Does anyone know of any good tutorials (YouTube?) for making APIs for BungeeCord / Waterfall plugins?
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
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
Bungeecords reload system is the problem
who cares
It will not reconstruct packet mappings
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
Right, changing the bind address also does nothing
On the other hand, disable-unused-features default true?
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
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
For some packets anyway
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
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
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

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
Just funny side-note
It’s broken in 1.16.x
There are two invalid offsets with projectiles
FIVE
But that doesn’t seem to matter
I thought this was gonna be war
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
Cat? I don’t have time for war
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
This entire thing is stupid
it's such a cludge-fuck of a system
You’re telling me
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
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
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"
In his defense
The object that uses == to compare can be a primitive type too
But that he never even bothers to discern types….
if it's the one i'm thinking of, it can never be a primative in that block of code iirc
But, 🤷♂️
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
.
You know you don’t need to cast anything here? CommandSender is the providing class for sendMessage
Error not in this. If player executes command with args from client, the command doesn't event log in console
?! Console? You’re sending a chat message
I'm looking into moving a player to a different server and at the same time send some data to the server. Two questions:
- Is there a way to send a plugin message on the specified player's connection to the server?
player.sendDataseems to send to the client, whileplayer.getServer().sendDataseems to choose a random player's connection for sending the message? - Is the plugin message channel ready when
ServerConnectedEventfires?
just send the player's UUID on the channel
Yeah, that's the obvious workaround. Is there a reason why Bungee/Waterfall doesn't expose the player specific connection to the server, though?
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
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?
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
Great, thanks
(but I would assume that the event gets called after the connection is ready)
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
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
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?
whelp
the channel is for the use between the client and the server, the proxy just piggybacks on it
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?
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
Yeah, this is my point
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)
Thanks for the help
but yeah, I strongly suggest to always assume that a client could send plugin message data that reaches the backend server
Sure. In my case it is an effort/time/risk tradeoff. There won't be any trouble even if this is exploited
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
Nothing
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
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.
Bungeecord should have a getConsoleCommandSender method iirc
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));
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
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.
are you intercepting between client <-> proxy or proxy <-> server? The first will only work if the proxy is in offline mode
Explain to me why you want to alter the JoinGame packet?
I'm not trying to alter it, I'm trying to read data off it
which data?
.... how are you reading the packet?
@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();
}```
let me guess, this is read before the proxy reads it?
do me a favor and add int marker = buf.readerIndex(); before you read the entity ID and buf.readerIndex(marker); after the last line
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```
@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);
}
Did exactly that 🙂
same issue?
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```
erm, that screams that it's replacing the packet in the registry
Issue is that you're replacing a packet in the proxies packet registry
^
Which means that the proxy ain't gonna actually process this packet
Yes, I understand the issue. How can I work around it?
listen to the original packet instead?
Never worked with that library
what Five said, you'd ned to see if you can access the original packet class
well then you'll have to do it without a library






