#waterfall-dev
1 messages · Page 6 of 1
Also had to use a BukkitRunnable for teleporting so it delays and tries a few times to make sure player is in the world
Did you fix it?
If not, i believe you have to send the data to the server, not the player
Because you're doing player.sendData
any suggestions to injecting code here via a plugin?
Having to block packets from reaching other handlers
that's an xy problem if i've ever seen one
I'm planning to add an event around there
"how do i mixin bungee"
Potentially
any solutions for current versions?
Not really
maybe get the Channel after server started and inject into pipeline afterwards
general requirement is that i need to do it before player connection starts, so that's my issue.
handshake is basically the only reliable place you're going to be able to do that properly
plugins load waaaay too late for bytecode transformation to be realistic there
having to do a system to filter packets
since people get layer 7 attacked with bad requests and bots and whatnot
By doing it as soon as possible, i can withstand a larger throughput.
also PlayerHandshakeEvent can't be cancelled
You can close the connection there
https://sfy.cx/ss/u/7775.png
If i close the connection, wouldn't it keep running the code in the switch?
yeah, that's the thing
God, I fucking hate lombok
hopefully Thread.currentThread().interrupt(); wouldn't screw it up
@coral lichen you can save old SERVER_CHILD ChannelInitializer, replace with yours one, do some stuff then call initChannel from saved ChannelInitializer
yeah, good idea
does anyone here happen to know how to send an empty packet?
so that it triggers bungee's empty packet exception
writeVarInt(0, buf) ?
write an empty buffer
yet when i send that then bungee says length is over 0
probably doing something wrong in client
Make sure you have compression enabled
Then send a compressed packet with zero payload

Channel ch = ((IClientConnectionMixin) client.getNetworkHandler().getConnection()).getChannel();
ChannelHandlerContext ctx;
if (ch.pipeline().get("compress") != null) {
ctx = ch.pipeline().context("compress");
} else {
ctx = ch.pipeline().firstContext();
}
PacketByteBuf buf = new PacketByteBuf(PooledByteBufAllocator.DEFAULT.buffer());
buf.writeVarInt(0);
ctx.writeAndFlush(buf);
i'm doing this
(in a fabric mod)
not sure how correct this is
eh most of it is written by assuming things, but not reading tbh
is 0 empty tho?
wdym
If you want to get this error https://github.com/SpigotMC/BungeeCord/blob/master/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java#L35 i think easy way is write 0 in VarInt encoder (if it works as i think)
varint encoder, you mean that varint length prefix prepender?
i disabled compression for now, packet lenght = 1
🙃
length*
yea i mean writing (varint) 0 costs 1 byte right...?
yeah
which is 0x00
should be caught here
and length should be == 0
ghh must've something to do with my lack of netty skills
definitely doing something wrong and/or not understanding how pipeline works clearly
okay got it
When doing ProxiedPlayer.connect() to a full server, is PlayerLoginEvent fired on the Sub server? I'd like to kick an AFK player when a user is attempting to join a full server
It's hard to test on your own
Could it be that waterfall preloads all classes of a plugin?
Or in other words, how can I use my own class loader?
It doesn't preload them, you shoooould be able to use your own classloader without any issues beyond classloaders being classloaders
Weird. I’m explicitly loading my class with a custom class loader. And it still claims to have the bungee class loader
(A class separate from the plugin class)
@shut glacier how are you loading the class?
Class.fromName(name, true, myClassLoader) @bleak current
I think you should use this: https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)
I think
I can try
dear lord
bungee's codebase contains too many shady arbitrary delays
e.g "wait 250ms before we kick the player"
yeah, fine - kicking the player at wrong time might crash it, but using a Thread.sleep(500) instead of proper state check smells really bad
or for example "wait 500ms after disconnecting all players" instead of checking whether all players are actually disconnected...
Hello.
Is there any easier way then this to decide if a server is online or not?
getProxy().getServers().get(serverName).ping(new Callback<ServerPing>() {
@Override
public void done(ServerPing result, Throwable error) {
if (error != null) {
// Means that server is not responding : OFFLINE
// Store this, by example, in a Hashmap<Server,Boolean> serverStatus, false is OFFLINE and true ONLINE
return;
}
}
});
yes, wrap it into CompletableFuture
I would like to get it from a PaperMC plugin. Is there any way to check if a Waterfall connected server is online or not from my PaperMC plugin?
that's bit more complicated and involves either fucking with plugin channels a lot (slower, not very flexible and probably more unreliable because of programming errors)
or building a central server status daemon which checks whether servers are up (periodically/whatever mechanisms you can imagine) and provides that info via e.g simple http rest api
use your imagination
Great
Once I get my classloader to load my class I get a lovely java.lang.ClassCastException when trying to cast it to its bas class (which is loaded by the plugin classloader)
move all the logic away into separate class
That would force me to call all methods by string names
and make plugin only bootstrap jars/classloader
sec
L90
classloader hackery is a total time sink sadly
Yeah
All because Java doesn't have decent built in ways to inject libraries during runtime
Or enforce separation where necessary
if i register a command on waterfall is it executable on every backend by default or not?
It's a proxy, it proxies the commands and intercepts them
In other words, it has no control over your backend
How do I get the max players my proxy can hold?
ProxyServer.getInstance().getConfig().getPlayerLimit() is depricated and cant see anything else
That's it, deprecation is basically just stupid there
That's a shame. Really dislike using deprecated functions.
Basically, the configuration class itself is deprecated because 'we might change the config'
Blame upstream, it's just typical blergh
What do you think the likely hood of .getConfig() being yanked is?
None
Guava has the nice @UnstableApi annotation. I like that better.
We already have a patch to fix up the javadocs from upstream, does IJ provide any hinting around that annotation?
I'm going to crash, but I have nothing against changing that stupid deprecated annotation to something more suitable, bonus points if the IDE offers some form of hint around it
Yes, IJ does hint it
@trail plume yeah, actually, the Guava annotation is @Beta, which is about the same thing
so with Inventory instance, how does one go about checking if the inventory in InventoryClickEvent is the same inventory as the Inventory previously created?
i used to use .getName() but that has been removed
and Inventory does not appear to have the suggested getTitle()
Does Waterfall/Travertine discard or stop plugin messages with unregistered channels?
probably
actually, I just checked - upstream bungee doesn't do it, and I don't think WF does it either
it doesn't yep
i haven't seen any downsides in that yet
besides bungee being not correct
How do I get the player from the Prelogin event?
@EventHandler
public void onConnect(PreLoginEvent event) {
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(event.getConnection().getUniqueId());
This isn't working
you can't
player object does not exist at that point
what do you need player for there?
The best you can do is store the latest know ip and compare that
I need to check their permissions to see if they have a certain rank
and this is for an anti vpn plugin, want to check if they're a new player based on their group/rank and check their IP if it's a proxy,
ended up hooking into LuckPermsAPI and getting the user from there, that might work better, will try
that's a way, yes
Is possible listen the packet on BungeeCord/WaterFall?
you have to inject your own packet handler into netty pipeline then
any way to handle a player being kicked by "Server Full" and redirect them back to the lobby
I though ServerKickEvent but not so sure now
How can I serialize Enums?
Is there a way of getting the server the player will be connected to upon join?
Hopefully using PostLoginEvent
event.getPlayer().getReconnectServer() is null even though server is not default.
event.getPlayer().getServer() is also null
Basically, no
That event is fired too early, before they've actually been connected or started initiating a connection to the server
I did look at ServerConnectEvent as it seems to have a "JOIN_PROXY" reason. However, I can't seem to get that to fire at all.
I have a server queue system and if they queue exists, connect people to the lobby instead of the last server they are on
@stark bone try ServerConnectEvent
you can use
if (event.getReason().equals(ServerConnectEvent.Reason.JOIN_PROXY)) {
event.setTarget(getProxy().getServerInfo("hubserver"));
}
Oh just saw you can't get it to fire
make sure you're putting an EventHandler annotation
@civic valve jeez, note to self, put @EventHandler over events....
[21:48:51 INFO]: Event fired?
[21:48:51 INFO]: james090500 is trying to join creative
lmao
ye
Anyway to listen for Payload packet on Waterfall?
payload packet?
plugin message?
you don't have to register them in bungee iirc
because bungee's channel registration is absolutely broken, half-assedly done and what so ever
so all plugin messages can be accessed via PluginMessageEvent
i think last time i touched it then it was like this
I see, thanks
Any ProxiedPlayer is an instance of UserConnection?
This error is thrown when i send the ForgeConstants.FML_START_CLIENT_HANDSHAKE PluginMessage
It kind of get completed
But still kicks me
Seems like ForgeServerHandler is null
is forge support enabled in config?
There is any artifact like bungeecord-proxy for waterfall/travertine?
Yes, same name format, they're just also not deployed
how can i delete the players scoreboard? I get sometimes an error bc a team already exists
You basically need to avoid having multiple servers using the same team names, it's basically a flaw in how bungees connection process works, best fix I've got is basically pending those packets for later in the connection phase, just not gotten to it
Some levelof "good luck"
😐
proxy logs are basically 100% irrelevant
figured
you can allow waterfall to send the empty packet to the client
client simply ignores it
maybe waterfall does too if configured, can't remember exactly
oh wait... it's not configurable now :D
is there a latest jar link? that doesnt specify a version number? like this but without the /109? https://papermc.io/api/v1/travertine/1.14/109/download
nevermind lol
What is the Repo vor Waterfall?
same repo as paper
what is waterfall?
ok
What’s the main new features of Waterfall comparing to Bungee?
So i'm looking into automatically building my fork of waterfall with jenkins, what do you guys do to actually run the build? Like how does it know what maven tool to use if you execute the build script or will it always default to the maven installed on the system?
looks like it uses whatever binary your environment variable points mvn to
Ya, after tinkering with it I managed to get it working with a very messy looking pipeline.
Yes, same repo as paper
Ok, so I think I have a weird one for you
I'm working on a universal plugin (running on all major platforms) and to keep logging consitent I've opted for SLF4J
Now After some trial and error I managed to get a system working where if SLF4J is not present on the platform I load and inject it into the classpath before my plugin loads
So for example on Waterfall I use the built in version on Bungeecord I load and inject it myself
Now that works as should and is not the problem
The problem is that the logging looks awful on Bungeecord
That's how it looks on BungeeCord:
And this is how it should look and does look on Waterfall:
Does anyone have an idea on how I can get it to look at least similar?
Waterfall uses an updated version of the logger dependencies in bungee
and has explicit support for slf4j
I know
so the reason it doesnt look worth a damn in bungee is that, and the solution would be to go hope you can convince them it matters
I mean they use Java's logging system as far as I know
Now the thing I don't quite understand is why after adding slf4j-jdk14 the log is so weird
And how I can configure it to essentially just log to java.util.logging directly without stupid format code
If all it did was to match the log level, take over the logger name and the just print the message literally, it would be done
I could fix it by using a custom logging adapter
That sounds like a somewhat possible idea
how do i get rid of these warnings?
Either properly check that your values are null; add @NotNull annotations if appropriate; or disable the inspection in your IJ Settings.
If you have a command called test
And you give it aliases like t, testsmth
command.getName() will return test
But label can be t, testsmth or test
It's what players put after the /
this channel is for waterfall dev
examples of using a custom log4j filter inside a bungee pl?
Hello ! Do you know how can i can filter my console log by words ? 🙂
Invoking my magic looking glass... looks like the plugin isn't following all the semantics of BungeeCord AsyncEvent handling correctly.
The fix is to remove that particular plugin and file a bug report against it, or find a different plugin.
nice advertising
Wut
The plugin is free and not obsucted if you want to decompile it.
might as well open source it?? xd
https://file.properties/paste/avociyojec.js <- Log4JFilter class
https://file.properties/paste/nuweyogemu.java <- LogFilterModule class
Also in my main class I have this: java ((Logger) LogManager.getRootLogger()).addFilter(new Log4JFilter(moduleManager));
(onEnable)
so what is the issue in the end
There are empty messages rather then them just being cancelled.
I want to remove them, filter them out, not just replace them with nothing.
?
take a look at console spam fix?
I want to implement a console filter in my plugin, not use external. Also isn't consolespamfix a paper plugin?
There is a bungee version of it...
Didn't know that, didn't really searched for it. I tried to add the functionality to my plugin. Still looking for that.
I will check the github repo of csf. Thanks.
It's for bungee, not waterfall. 🙂
To my understanding, should work the exactsame
If I'm not wrong, waterfall uses log4j, not regular log. CSFB doesn't have the log4j support.
Have you tested it?
It works but it doesn't filter. I'm using a custom waterfall fork (from a dev that added some antibot functions, premium) so it may not work because of that.
I'll ask him for it too.
Strange.
I'll try with a regular waterfall build.
Enabled Waterfall version git:Waterfall-Bootstrap:1.14-SNAPSHOT:cccb337:296
¯_(ツ)_/¯
Nope.
Not even CSFB handles the UpstreamBridge one properly
For reference my plugin filters them out properly but sends spams messages.
Oh it seems that I've fixed it.
private Filter.Result checkMessage(String message) {
for (String string : moduleManager.getLogFilterModule().getFilter()) {
if (message.contains(string)) {
return Result.DENY;
} else if (message.isEmpty()) {
return Result.DENY;
}
}
return Filter.Result.NEUTRAL;
}
I used a for loop and checked if the message is empty.
works as intented
Thanks cat!
What causes texturepacks to load twice when using bungeecord/warterfall?
Like when changing between two servers with different texturepacks for example
You'd need to send an empty texture pack to load a new one
No I mean I understand you'd need to do that, but it's like it does it no matter what even if it already had an empty texture pack it loads the same new texture pack twice
I can make a video to show you if it's helpful to understand what I am asking
I mean, it'd only load it twice if it was told to load it twice
it only happens when using bungee/waterfall
like when I coded it into a spigot plugin to load the pack it did it once when running spigot alone, but through bungeecord it loaded it twice even when just loading the empty pack on the servers without packs
You don't still have the plugin on the servers, do you?
yes but I removed the texturepack loading from my plugin and tried using a bungeecord plugin
it has the same behavior, it loads twice still
What is the maven dependency for net.md_5.bungee.command.ConsoleCommandSender ?
waterfall-api
...bungee.api.command.ConsoleCommandSender ?
never mind, it's an impl
it's in waterfall-proxy artifact
but it's not deployed
if you want to check if sender is console, use if (!(sender instanceof ProxiedPlayer) && sender.getName().equals("CONSOLE"))
ProxyServer.getInstance().getConsole()
Returns console command sender
Now you can just do ==
ah yes, that's a way too
Does the delete scoreboard team packet helps with the issue of players being kicked due duplicated team name?
is there a module to add a /join command to join servers insted of /server? if so could you direct me to it
Hello, is there any way to get the ProxiedPlayer instance from a ServerConnection?
(DiscordBot) https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/UserConnection.java -- BungeeCord/UserConnection.java at master · SpigotMC ...: "BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft..."
or not
iterate over players, check if player's server connection is the said connection
don't know better solution from top of the head right now
to scream at people using outdated versions of java
Just bump it to 1.7 or something
Yeah we took that java 6 warning out of paperclip for that reason
Most people kinda jumped off that ship when Mojang made them
Not sure where the proxies are, might be feasible to consider the same but eh ¯_(ツ)_/¯
@night grotto @trail plume @lofty ridge i have a Problem a Bad guy crashes bungee Servers easyly by using a indexoutofbounds exception at net.md5.bungee.protocol.Minecraftdecoder at a Check in readablebytes are 0 tomorrow i Could Senf you a log today im net longer at pc and ihrer Servers like hypixel was crashed by him too please create a fix and publish it Soon bye Max
yikes
that's nice
Literally already an issue on the tracker for that too
did you kick him or did he just leave
I kicked

i implemented automatic upstream commit merging into my concourse pipeline for a while ago...
let's see if it actually works
||here's the link for the curious: https://ci.mikroskeem.eu/teams/mikroskeemsrealm/pipelines/mikrocord/jobs/try-upstream-merge/builds/2||
lel it did naht
any website u know i can learn these stuff
.rekt
☑ Tyrannosaurus Rekt
Dude, pick a channel and stick to it
ye mb
so ye that did not kick in
wait
it's my script after all

but that means i'll mod the shit out of it
Tryna blame me u fuq
cat bad
oh wait i thought i was at paper channels mb lmao
concourse, urgh
Now I got a new toy on the list to play with
I do wanna get to grips with pipelines on jenkins too as they look interesting; I just dun has the brain
concourse is a bit bitch to set up btw
so just warning
also if you happen to use ZFS then...
tho wut

set -e is missing from the main script
nvm
ah build script needs it too...

better
otherwise if it succeeded, it should've pushed a change with rebuilt patches & updated submodule 😄
-> #paper-help
looks at the channel name
why bother reading
new upstream commit
me being patient for automatic merge to succeed
failed
aight, looking what's up:
doing same thing locally
it works
wut in tarnation

.rekt
☑ md_rekt
well that rekt was rather convenient
.rekt
☑ Better Dead Than REKT

Hehe, BungeeCord development is ramping up a bit again
yep
Revert "#2714: Remove unnecessary throws in ServerConnector"
This reverts commit 74a6aa3.
Completely breaks Bungee
ripperino
where is bungee's changelogs/commits?
ah ty
Glad to see md_5 testing pull requests
does anyone knows a good way to sync data through all the servers on the proxy?
Because plugin messages are sent through a users connection
The proxy doesn't maintain its own connection to the server for sending messages, that wouldn't be supported by the mc protocol
If you rely on those messages, better off using a read message broker vs the hackjob that is plugin messaging
*real
well I better start learning sockets
better off looking into a message broker vs sockets, especially if you want your plugin to be used in scalable environments
https://pastebin.com/XdwJhW5M I've tried deleting my scoreboard files, any help?
? I'm pretty sure it's on by default and I never disable player collision?
Do you use protocol hacks like ProtocolSupport or ViaVersion
nope
Idk, those are the most usual culprits, either way it is just a warning with no actual ill side-effects
whenever it shows in waterfall everyone gets kicked
What plugins do you run on the bungee/servers
Something has to be causing that.
The logs you provided don't have the actual scoreboard name for anyone to point out a plugin
yeah
because there isn't
in the console it's just Team and a space
that's my plugin list
any help?
I'm going to guess its a factions scoreboard, but I havent ran factions for years so idk.
factions
Hello.
I have an ArrayList in my Waterfall plugin and I would like to add items to this list from the web with POST request.
Example: "www.myserverip/plugin?name=asd" will add "asd" into the ArrayList.
Is this solvable?
Note: The "www.myserverip/plugin?name=asd" link will be not public only allowed for 1 remote IP.
Is this a good solution or I need to use a database and PHP etc.?
wut
so you want to pull up a webserver on waterfall and get said POST requests?
... why shouldn't that be solvable?
everything can be solvable if you can write code :o
ancestor simulation incoming

Didn't notice it added the iml file, and I coulda worn I removed the DS_Store file 
In dedication to the fact that I fucking hate myself, have fun: https://keybase.pub/electronicboy/builds/travertine/Travertine-e115.jar
Unsupported, doesn't support entity metadata remapping either as I'm too lazy/dead and it's going to be removed when bungee updates anyways
hating yourself isn't healthy cat
you should find something better to unleash your hate on, like people asking "paper 1.15 when"
I'll help cat release his internal anger: "paper 1.15 when"
an fix'd a derp as I forgot to mess with the respawn packet
How much Traveltine 1.15 can broke?
hmmm whats entity metadata remapping then
entity metadata remapping is basically rewriting the entity metadata so that entity IDs for players are written properly as bungee doesn't send the client its new entity ID when it jumps servers
Waterfall has an optional mode, which is enforced for the 1.15 protocol, which will send the client its correct entity ID, but basically is "less transparent" to the client
oh is that why players would still be flying with elytra if they were when switching servers
or whats the side effects
The mech without the rewriting would actually sort that one out by default afaik
(to reset the entity ID, we basically have to tell the client to do a bit more of a through state cleanup)
Only real side-effect is that plugins aren't always happy with the mechanism, pretty sure one of the tab list plugins gets a bit upset with some ordering with it
cat, tried out that travertine build with 1.15 support. i can connect to my hub server just fine, but whenever i switch servers it kicks me for this? or would this be viaversion territory?
You'd need to work out where that's being thrown from, it's basically upset that a packet is shorter than it's expecting
that one just states that the connection was closed improprely by something else
@lilac crystal fix ForceResourcePacks please
https://pastebin.com/raw/3tEZZZkc
tried it on a blank 1.8 server with viaversion (yes ik 1.8, but its the only server i have atm that i could wipe, rest have stuff on it i need), this is saying the same thing and doesnt really help right? https://pastebin.com/U0a15ywL
No, broken pipe is a broken pipe
All that means is that something rekt the connection
ugh
does cross server switching work for you on 1.15? if you dont have a test environment or if you're not up for it, nvm.
Yup
[19:44:56 INFO]: [electronicboy|/192.168.194.1:59681] <-> ServerConnector [valaria] has connected
[21:17:56 INFO]: [electronicboy|/192.168.194.1:59681] <-> ServerConnector [lobby] has connected
[21:17:59 INFO]: [/192.168.194.1:59681|electronicboy] <-> DownstreamBridge <-> [valaria] has disconnected
on the backend server, yes
hmm
im using the plugin on the server
clean 1.14 server, only plugin is viaversion, same kick/error. ima try switching to 1.15 server with no viaversion
Exception Connecting:QuietException: Unexpected packet received during server login process!
If that's a vanilla server, disable ip forwarding
I have it working on my server 
viaversion on bungee does the same thing
Do you use BungeeCord? Ensure you have updated it first, you can use the plugin on all your backend servers OR BungeeCord. Compatibility is the best when on your backend servers.
seems backward to me
ye haha
yea i put it on spigot servers
U can put via on either
so why is it backward
they are saying it's better to put it on the spigot server
and you said you put it on the spigot server
but you also say it seems backward
????
it seems backward to have viaversion on bungee when bungee natively supports various versions
via on bungee makes sense only when uh
you want snapshot versions...?
or whatever
heyyyy cat, ./waterfall up 😃

If he's pushed 1.15 for bungee, that shoooould mean that he's planning to drop spigot tonight soon
31 mins ago according to jenkins
time to turn on builddata notis
can we download 1.15 ?
no
theres only bungee i think
"reeee paper succccc no 1.15"
dont be like that lol
inb4 "guys spigot 1.15 out why no paper 1.15 jus d0 ./paper up??!"
paper up from console says unknown command thanks
mfw
im running a windows server if that helps, my options are heap entity reload version debug chunkinfo
... -> #paper-help
They're referring to the paper scripts used by devs; Basically, just wait, spigot hasn't released 1.15 yet
ah ok thanks, Spigot has released 1.15 I will wait. thanks all
So when's md5 removing 1.8 support :^)
@trail plume I get this with travertine off build server https://gyazo.com/9494420f7104371dc2419b92d7488118
set ur fukin game version
?
Worked here fine
I have game_version: ''
is it supposed to be something else
weird i guess i downloaded the wrong version
maybe i pressed the back button on my mouse and latest was still old link thats only explanation I have 😓 sorry
would be neat if you could make that always show, and change the color of it
There are plugins for that
Pretty sure they can do the color too; Making it show is a case of lying about the protocol version, however
o interestin
i updated from that jar (https://discordapp.com/channels/289587909051416579/555462232209621003/654024941284491293) and im no longer getting kicked when switching servers, really weird.
what is travertine
what are you even saying lol. cat made a travertine jar with 1.15 support before bungee released theirs. all he mentioned was that entity metadata remapping wasnt supported. he never said it was broken, and it definitely wasnt old when he released it. i thought hey why not, someone might as well try it out. so I threw it on and tested it out while i waited for bungee to release. i could connect but i couldnt switch servers without getting kicked with the error i posted about above.
all im doing is posting a followup to my issue.
Hello, how can I cancel ProxyPingEvent? event.setResponse(null); works but always drop a nullpoint exception.
you can't set it to null
How can I cancel it? So player see "Can't reach server".
.g bungeecord proxypingevent
(DiscordBot) https://github.com/SpigotMC/BungeeCord/blob/master/api/src/main/java/net/md_5/bungee/api/event/ProxyPingEvent.java -- BungeeCord/ProxyPingEvent.java at master · SpigotMC ...: "BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft..."
.g bungeecord initialhandler
(DiscordBot) https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java -- BungeeCord/InitialHandler.java at master ·...: "BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft..."
use reflection to get ch field from PendingConnection instance
then call getHandle() and you have an access to netty Channel
further steps should be obvious
ooor you could use PendingConnection#disconnect()
Hello, i want to maintaining the proxy for a long, so i am trying to plugin segmentation, is it good? it could be ~20 plugins
yes
i just going to split the features from plugins
sorry for being dumb at english, didint learn as well
is it cause performance problem? and it affects a lot?
Can someone tell me how to detect if a player holding a carrot?
- Wrong channel
it's kinda shitty belief that n amount of plugins causes performance issue
rather, multiple plugins doing slow things causes performance problems
in fact, one plugin doing slow things also causes performance problems
Back again, can someone help with this Maven compile error? https://i.imgur.com/p6ngKGc.png
Okay thank you, I'm looking through Maven's settings in IntelliJ, I've set "maven.compiler.source = 8". Though, I feel this is wrong as it's still failing.
Though, with a completely different error this time.
(DiscordBot) https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html -- Apache Maven Compiler Plugin – Setting the -source and...: "Apr 28, 2019 ... Setting the -source and -target of the Java Compiler. Sometimes when you may need to compile a certain project to a different..."
Okay, thanks again. 🙂 I'll take a look.
That worked. Damn that was simple. Thank you.
what's the question
are you asking for waterfall's maven location
uh
wrong channel
paper-dev?
also i just don't get what i am meant to put in there
what group id
what group
my plugin
you just gave a screenshot of a random dialog box
yeah
unclear what you are trying to do
i'm making a new project
groupid for your plugin is whatever you make it
you should probably google up a guide on using maven
does it just mean like an identifier?
and not use the waterfall channel
I think that a option to disable the exceptions should be added to the config, i just disabled exceptions and a little more stuff and all crashes because of invalid packet spam has gotten fixed.
Took me 5 minutes to fix a really common exploit that is being really abused this days.
Submit a PR...
Cleaning up the exception handling in waterfall is on my todo list, just 1.15 and my health in general is somewhat limiting
I'm lost in how do I build waterfall? I get this error:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module /root/waterfallsource/Waterfall-master/Waterfall-Proxy of /root/waterfallsource/Waterfall-master/pom.xml does not exist @
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project io.github.waterfallmc:waterfall-super:dev-SNAPSHOT (/root/waterfallsource/Waterfall-master/pom.xml) has 1 error
[ERROR] Child module /root/waterfallsource/Waterfall-master/Waterfall-Proxy of /root/waterfallsource/Waterfall-master/pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
but I can't find waterfall-proxy for download anywhere
use the scripts
which?
Well, *the script
I'm confused, on the github page all it says is:
How To (Compiling From Source)
To compile Waterfall, you need JDK8, git, bash, maven, and an internet connection.
Clone this repo, run ./waterfall b from bash, get jar from Waterfall-Proxy/bootstrap/target/
never mentions use of any scripts, so I really have no idea
What do you think "waterfall" is?
proxy server?
smh
That waterfall file is literally a script
ohh
The instructions right there literally tell you exactly what to do
I still get the same error
would need to see the full log
[ERROR] Child module /root/waterfallsource/Waterfall-master/Waterfall-Proxy of /root/waterfallsource/Waterfall-master/pom.xml does not exist @
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
linux
sorry I'm new to building stuff, so I'm not sure what exactly "full log" is xD
I'm ill and really do not have the mental capacity to deal with this right now
But like
Wtf do you think the word "full" means
well good luck, I will find other way maybe
this is full log I hope, but me going off so may only reply tomorrow
https://pastebin.com/raw/s3LHQMUJ
root@limework:~/waterfallsource/Waterfall-master# sh waterfall b -e
fatal: Not a git repository (or any of the parent directories): .git
Literally the first step
clone this repo
speaks about negative iq
still calls paper as paperspigot
... can you atleast try? :D
either way
http perhaps?
i've used redis/rabbitmq
depending on a thing
if i need rpc-like comms then grpc or http (json rest api) does the trick
@trail plume Okay, thanks for considering it. I wanted to add a config value but its the first time i fork travertine and i dont really know how to do it.
plus the handshake event is being called even if the protocol is not 1 or 2 and there where some more stuff running that souldnt be running if the packet is invalid.
@bleak current It is a exploit actually, as you're exploiting a vulnerability to generate unwanted consequences. (in this case generating exceptions like hell by spamming invalid packets)
ping some more staff while you're at it
unwanted consequences such as?
verbose logging?
have you tried reporting to openssh devs that you're getting bombarded by spambots, who generate 3-4 log lines per session, that it's an exploit? :p
several terabytes of logged stacktraces later
I always thought that cloning this repo means downloading it manually from github (recommendation: include that you need to use "git" command to clone it instead of manual download)
maybe let's create a youtube tutorial how to build waterfall
and link it into the readme
🙄
eh wouldn't use it, video tutorials are extremely boring xD
so it's easier to learn the difference between (git) cloning and downloading
it literally uses the word "clone", not "download and extract the zip file" or anything like that
Hello. Do you know something about "ping attacks" when bots not connect to the server only ping them? It works like when I refresh the server list? How can I protect against it? I have to cancel the ProxyPingEvent (disconnect the pending connection or set different result)? Or use the server firewall is better?
your potential aid is to set up a firewall rule to rate limit the connections
I wrote some code that grabs the servers from a database table and uses
getProxy().getConfig().addServer(serverInfo); thru the result set. it works all fine and dandy, but when bungee starts up, it cant find the servers set in priorities and errors since the server retrieval query takes place in the bungee plugin. also errors with forced_hosts too. any idea on how to approach fixing that?
onLoad(), exactly what im looking for. thanks!
Hello, how can i change server name for waterfall?
(screenshot was from paper without waterfall because didnt have time)
use a plugin
yes this is development channel and i looked out javadocs and i dont know what to do because bad at english
i mean im creating waterfall plugin
(DiscordBot) https://www.spigotmc.org/resources/f3name-edit-your-server-brand-in-debug-screen.58997/ -- F3Name - edit your server brand in debug screen | SpigotMC...: "With this plugin, you can easily edit server brand from the default ("Spigot", or very long Bungee version) to whatever you want. Show your ..."
there you go
https://github.com/prettydude/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bungee/F3NameBungee.java#L296
thanks figured out
Is there anyway to 'dev' live? Like can I hold a server open and run methods to see what the server returns?
Idk if I'm wording the question correctly.
I find it's quite slow writing something (that doesn't work, because I'm very new to Java programming), compiling it, uploading it and restarting the server. There must be a faster way, right?
You can setup a remote debug session to your server and then insert breakpoints in the code and the server will then just halt, so you can do your debugging.
Okay, thank you. I'll take a look into how to do this.
There's any build compatible with 1.15.1?
No
What do you mean by "git not to break"?
You want to still be able to do "git pull"?
What's the safe way of adding a server to the Waterfall Proxy with a plugin?
collection returned by getServers is mutable
Thanks. Is this already in maven? I don't find the method in my IDE.
are you using waterfall or bungee in your maven
waterfall
do you also have bungee in there too
No. My proxy only uses waterfall and my plugin only has the waterfallmc dependency.
I am using this in maven:
<dependency>
<groupId>io.github.waterfallmc</groupId>
<artifactId>waterfall-api</artifactId>
<version>1.15-20191221.065800-7</version>
<scope>provided</scope>
</dependency>
p sure its just waterfall and ur version number should be 1.15
waterfall-api is correct, but yea, should be 1.15 too
I pulled this weired version out of nexus. 1.15-SNAPSHOT also doesn't work 😦
mvn dependency:tree
What method are you looking for exactly?
ProxyServer#addServer()
That would be why
lol
ProxyServer.getInstance().getConfig().addServer()
Okay wow. It's officially too late for me...
I have already been decompiling my waterfall version to search for errors...
Thanks for the help.
Hey, anyone knows that? I'm using travertine: https://pastebin.com/9b69QxkH it just crashed or something like that
DoS?
Hey, im trying to compile waterfall (travertine) but when importing objects from api in a protocol class it gives a error. (I dont really know how to explain correctly, but heres a pic of what i mean) https://i.imgur.com/NXCKtOJ.png
I hope someone close to the source knows how to fix this. Thanks.
Oh okay, i wanted to use ProxyServer.getInstance() to access some stuff there. You know if theres another way to do so?
No, you need to devise another way to pass the stuff you want over
Okay, thanks :)
you can do quite hackish thing with suppliers
e.g if you want a boolean flag from config or something
then you can abuse a static field where you'll set a booleansupplier instance
lombok makes it tad prettier as well lol
im in MinecraftDecoder class trying to make some edits, I want to grab the config with BungeeCord.getInstance().getConfig()
however it wont let me autoimport BungeeCord, i added
import net.md_5.bungee.BungeeCord; to the top but when i go to build it, it cant find that either. how do i grab the config from net.md_5.bungee.protocol.MinecraftDecoder?
That module doesn't import the API
ah, so its not possible to grab the config from there?
no
well fuck, so much for this pr lol
what pr
Permissions...
Oh, doesn't have a perm, lol
Completions Control This plugin serves as a demonstration for the ProxyDefineCommandsEvent added in Waterfall (and Travertine), allowing for plugins and server owners to control the commands sent to the client Downloads Downloads are currently available on github: https://gi...
..
My comment was more, "if they don't have perms to use the command, they won't see it"
Then I noted that that command doesn't have a perm node, and linked a pretty plugin for you...
It's a waterfall plugin...
it is, everything is stuck behind your imagination
How should I go about sending a resource pack over waterfall (programmatically)? I can't find an event that is called once the player is loaded into the server (similar to Spigot's PlayerJoinEvent). Sending the resource pack when the player connects or starts to connect is just not the best of ideas I'd imagine. I could hypothetically do it through Spigot, but that would make the player have to update their resource pack every time they join a new server. I want to send the pack once they join the bungee, and not have to download it again until they join again.
I could also hypothetically send a plugin message from the bungee to the server they are connecting to at the first join and then have the server send it.
Tag me if you have a response.
phoenix has a plugin which does just that
You basically need to register the thing yourself, but, pretty sure that the client is smart and won't reapply the pack, assuming that you set up the right info for it
Is there source code available?
I’m looking to use only like ProtocolLib and ViaVersion as my non-swedzian plugins
It honestly seems like easy enough of a system to implement, just send a packet from bungee to the player when they join
Use the plugin messaging channel then
Like what I said?
I’m going to try this later https://www.spigotmc.org/wiki/send-title-to-player-packets/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Just send the resource pack packet instead.
There is literally already API to do everything you're talking about
There is an API to send messages between the proxy and the server
Is there some sort of bungee event that is called when fully join?
I don’t want to do it between server and proxy, would prefer to do it all on the proxy side
not sure if i'm going crazy here.... I'm getting a lovely error:
[21:12:18 ERROR]: [Ping Handler] -> creative - exception processing exception
java.lang.NullPointerException: null
at net.capecraft.bungee.commands.AfkCommand$1.done(AfkCommand.java:50) ~[?:?]
at net.capecraft.bungee.commands.AfkCommand$1.done(AfkCommand.java:1) ~[?:?]
at net.md_5.bungee.connection.PingHandler.exception(PingHandler.java:51) ~[server.jar:git:Waterfall-Bootstrap:1.15-SNAPSHOT:4ecb3f3:309]
at net.md_5.bungee.netty.HandlerBoss.exceptionCaught(HandlerBoss.java:167) ~[server.jar:git:Waterfall-Bootstrap:1.15-SNAPSHOT:4ecb3f3:309]
When doing
player.getServer().getInfo().ping(new Callback<ServerPing>() {
@Override
public void done(ServerPing result, Throwable error) {
//Checks if server is full else do AFK check
if(result.getPlayers().getOnline() == result.getPlayers().getMax()) {
The null point is on the "if" statement. Not sure why it's null though
Now this was working. The only change is I have moved server hosts and update to 1.15.1 from 1.14.4
My original though is the waterfall can't contact the server, but I can connect just fine
something you're calling on is null
result or getPlayers
Oh, result is gonna be null
Check for the throwable first
The throwable shows me the same error
Oh the result is not null
the get Players is null
The throwable will be null of it was successful
[21:16:48 INFO]: ServerPing(version=ServerPing.Protocol(name=Paper 1.15.1, protocol=575), players=ServerPing.Players(max=4, online=2, sample=[ServerPing.PlayerInfo(name=james090500, uniqueId=ba4161c0-3a42-496c-8ae0-7d13372f3371), ServerPing.PlayerInfo(name=mov51, uniqueId=bf8b08a5-714c-4667-8f49-efce56cb7dc5)]), description=A Minecraft Server, modinfo=ServerPing.ModInfo(type=FML, modList=[]))
[21:16:48 INFO]: ServerPing.Players(max=4, online=2, sample=[ServerPing.PlayerInfo(name=james090500, uniqueId=ba4161c0-3a42-496c-8ae0-7d13372f3371), ServerPing.PlayerInfo(name=mov51, uniqueId=bf8b08a5-714c-4667-8f49-efce56cb7dc5)])
[21:16:48 INFO]: null
System.out.println(result);
System.out.println(result.getPlayers());
oops
updated the messy response
So result is not null but result.getPlayers is null
You have players in that output though?
It may be running twice, for some reason.
let me double check this
Ok...
So,
So the calback runs twice
but the main method runs once
and then the result is null on the second run
[21:22:14 INFO]: Main Method Running!
[21:22:14 INFO]: Call back Running!
[21:22:14 INFO]: ServerPing resultxxxxx (removed to avoid spam)
[21:22:14 INFO]: Call back Running!
[21:22:14 INFO]: null
Why it is running twice is a mystery to me
Ok, I got it, so some how, its caused by LuckPerms. Actually printing the error System.out.println(error); rather than doing a printStacktrace shows me this. ```[21:32:51 INFO]: java.lang.NoClassDefFoundError: Could not initialize class net.capecraft.bungee.helpers.LuckPermsHelper
Due to upgrading 5.0 and needing to update the API calls
How did one even o.O
I mean, it's strange that the callback ran twice after the error and that one worked and the other errored
very confusing
What my guess is is that that plugin is hookinh in somewhere and just being 10/10 janky somehow
Thank you for your help anyway. The joys of plugin development
because people got used to using ipwl and have probably never even heard of bungeeguard 🙂
If you know how to correctly setup your proxy server
You don’t need either
Firewalls, IP tables, and NYS
hello
i see you added ConnectionInitEvent to waterfall, i would suggest an improvement
when you use Waterfall behind HAProxy, the event become quite useless as the ip the event see is the ip of the HAProxy server
i case of HAProxy, i think this Event should also be triggered after the HAProxy sent his packet with the real player IP
to differenciate these two differents event trigger, a boolean could be added into the event to tell if the event comes "before HAProxy" or "After HAProxy"
Thank you all for your work on this fork 🙂
That would be a different event given that it occurs later on in the process, after the actual init
you're right
i think a warning should also be added into the ConnectionInitEvent javadoc to tell that if a loadbalancer is configured, the IP in the event is from the loadbalancer
I mean the event doesn't seem to make any guarantee that this is the actual player client connection
why ?
probably because it's called before it is even checked if whatever is connecting is a notchian client
The event only garauntees that it's a connection being initiated
basically: if you need player information use one of the player events
yes, that's why i suggested an improvement or a new event for the proxy-protocol case
Getting the IP from haproxy would be later in the connection phase, meaning that it couldn't be covered under the existing event
Create an issue on the tracker
I'll have to have a look when my head isn't killing me or something
how does waterfall even add support for hyproxy?
*haproxy
or is that something bungee supports by default?
it already has
bungee supports it
ah, I see
it just transmits haproxy's protocol information
Bungee supports it, it basically adds a decoder that understands packets from haproxy and just faux's the IP there
so wait, can people just fake their ip that way? lol
it has to be enabled in the config
If you've got haproxy enabled, yes
ye
hm, the decoder is from netty directly
i will submit a ticket on the tracker. With a plugin that throttle connections, this kind of modification could help with the "error flood hack".
if you properly configure your iptables between your waterfall and your haproxy, there's no reason a player could fake his IP.
just like the IPTables beween your waterfall and your mc servers
I just thought it might be enabled by default
(DiscordBot) https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt -- PROXY protocol: "2017/03/10 Willy Tarreau HAProxy Technologies The PROXY protocol Versions 1 & 2 Abstract The PROXY protocol provides a convenient way to safely ..."
hoping with fingers crossed that this is an issue you are working on and im not uniquely affected
yes
awesome, is there any suggestions that you reccommend to mitigate in the meantime?
(sorry didnt mean to delete previous comment was clicking copy)
That fix stops the crashing from that specific issue
Just, you'll wanna have something like fail2ban to deal with the actual connections themselves
i have limited connections in my iptables to no more than 3 per ip, so that is mitigating it somewhat. but still pushing cpus to high levels
Latest build virtually mitigated the impact. thansk guys
with your last update to travertine it breaks @lilac crystal ForceResourcePack plugin, idk if he needs to update or there is something wrong with travertine, but players just kicked: https://hastebin.com/oqohabimev.rb
@trail plume (sry if i shouldnt tag)
the latest two updates are upstream patches
specifically the ones that speeds up common exceptions, which seems to be related to this
or you could file a proper issue instead of pingimg everyone
The paste doesn't even work...
hastebin 🚮
also trash tbh
eh atleast it works, saves pastes for quite some time, doesn't go down often
Normally hastebins fine idk why it deleted so fast
in my experience it's "normally" 🚮
^
I dont even recommend it anymore, sometimes files last a few days, other times a week or two, but nothings ever still there when I want to look at it later
paste.gg and gist, hell even pastebin
it's supposed to delete files after 30 days
regardless of what it's supposed to do, that's clearly not the case in reality
as was just demonstrated
and given that we've had these experiences many times previously, this also isn't new
so as suggested, just refrain from using it
update to 120, everyone gets kicked with that, downgrade to 118 its all fine
i can submit a issue on github but i dont have any more info
o.O
I use this but idk if it needs to be updated or travertines fault https://www.spigotmc.org/resources/force-resourcepacks.10499/
Basically, that doesn't make sense to me
Coz, in the case that that would throw, there are no readable bytes left
Meaning that the next method after that would throw
// Waterfall start
if (input.readableBytes() == 0) {
throw new BadPacketException("No more bytes reading varint");
}
// Waterfall end
in = input.readByte();
well i definitely dunno
yeah I'm seeing that too on the latest Waterfall build, gonna have to look at what changed there
Hello ! Do you know how can i modify the list of commands sent to players when they log in? On paper we can use the PlayerSendCommandEvent but on Watefall i don't found anything
ref the javadocs, there was a define commands event
Oh yes thanks !
How to programm with paper? Is it like bukkit? "extends JavaPlugin" doesn't work for me
oh my fault
@finite rock yes fully compatible.
how do i make where i can have a queue system like 2b2t
How should I go about getting the default server priority? Not based on the player, since I do modify their reconnect server (not sure if that messes with stuff).
I would also prefer not having to go through the ProxyConfig to get it 😛
No
Quite a shame
The config is the "live" object
👍
Is there a reason there's no getServerPriority or something in the ReconnectHandler?
It just stores the data for the individual players I see, but the thing is, it has to get the default option somewhere, right?
Yea, it gets the default from the listenerinfo config
Oh, actually, false
It doesn't get the default, it just returns null if there is no specific server it should send them to
Ok. So if I use ProxiedPlayer#setReconnectServer(String) and supply null as the argument, it would reset them to the default server?
Yes
data.put( key( player ), ( player.getReconnectServer() != null ) ? player.getReconnectServer().getName() : player.getServer().getInfo().getName() );
It's scary how gross bukkit is
I mean, bungee
Ok cool. Is it possible to supply null over a plugin message as a UTF and the bungee still reads that input as null?
Yeah both 😛
Actually, wait, setting that to null won't do anything for you
thet check is literally a not null
jesus my brain is zapped
That's just a gross way to override the server that's saved by the reconnecthandler
well never mind the get default server method in the player's listener is depreciated
Basically, if you wanna override that behavior, replace the reconnect handler yourself
sender.getPendingConnection().getListener().getServerPriority()
Uhm
Ya?
I don't know if this is overridden by the setReconnectServer method
being that setting the reconnect server puts that new server at the top of that priority list
It doesn't
so that getServerPriority() method should always work from the default in the config then?
On connection, the proxy checks if the reconnection handler has a server that they should connect to
(given i dont modify it)
Otherwise, it goes to the logic of using the priorities
and yea, that list is literally backed from the config
I see
so... if I'm gathering this all correctly...
sender.setReconnectServer(getInstance().getProxy().getServerInfo(sender.getPendingConnection().getListener().getServerPriority().get(0)));
should set the reconnect server of the player to the default server in the list? or should i just set their reconnect server in this case to null so it defaults to the priority list instead
setting it to the 0th server would break the priorities iirc
Right
What about null though? That should make it use the priorities instead, right?
No
Because you can't set that to null, basically
null means "don't override the server that we save"
So... then I can't reset someone's reconnect server after setting it?
The only way to get true defined behavior from the reconnection stuff is to define your own
Hm
That handler is basically one of the many major fuckups and "special" designs of bungee
Yaaaaahhhh
Is there a default ReconnectHandler I can extend so that I don't have to do all the close() and save() stuff?
like just super it
found this
but I can't seem to import it... ?
Because it's in a module, not in the API
I see.
so why do they use raw types and not even suppress the warnings?
.<
looking at the source code for ProxiedPlayer, it looks like ProxiedPlayer#getReconnectServer() does return null if it is defaulting to the priority list instead.
that leads me to believe setReconnectServer(ServerInfo) can accept a null argument...
That literally just sets a field on ProxiedPlayer
if that field is null, the handler just saves their current server
side question (but related), if force_default_server in the config is true, does that mean the reconnect server field will not do anything?
correct

