#velocity-dev

164 messages · Page 11 of 1

earnest cedar
#

does in velocity something changed with favicon for 1.19 clients?

bronze yoke
#

not necessarily 1.19 specific, had it on older versions too

#

don’t know what causes it tho

agile ore
#

I'm trying to send a plugin message to a velocity proxy from papermc. This is how I do it:

target.sendPluginMessage(BukkitServerCore.instance, "megavex:autoban", byteArrayOf())

And this is how I am listening for it:

@Subscribe
fun onPluginMessage(event: PluginMessageEvent) {
  println("Plugin message received: $event")
}

However I don't seem to receive the message. What am I doing wrong?

#

I also registered the channel on papermc like this:

server.messenger.registerOutgoingPluginChannel(this, "megavex:autoban")
#

The listener is definitelly registered, I tested that.

languid rover
#

have you registered the channels?

agile ore
#

I only registered it on papermc

#

not on velocity

#

do I have to do that?

languid rover
#

on velocity you should also have something like this.server.getChannelRegistrar().register(ChannelIdentifier);

agile ore
#

yep, that worked

languid rover
#

nice

tawdry sky
#

Hey, how do you cancel an event?

#

with the player chat event

opaque escarp
red harbor
#

is there a services manager like Spigot where you can register your services?

craggy pecan
lethal garnet
#

is velocity polymer still roughly on track to release at 2023 Q1 or is it likely it’ll release later?

coarse topaz
#

Potentially later than that. Tux recently moved and switched jobs so he has been quite busy

wary tiger
#

Velocity polymer, I am sure, will require much more time to develop than between now and March 2023

lethal garnet
#

yeah I’m aware now given that tux has had more to work with since I last heard a rough eta

digital yacht
#

how do I use com.velocitypowered.api.proxy.messages?
(I can't find any guides on youtube)
I'm reading the docs and this is all I figure out
this.server.getChannelRegistrar().register(MinecraftChannelIdentifier.from("connect_requests"));
how do I tell it what to do when it recives a pluginMessage?

fossil sundial
digital yacht
#

TYSM

#

OH MY GOD I'M SO STUPID IT WAS AN EVENT LISTENER

#

I AM SO DUMB

#

I JUST NEEDED AN EVENT LISTENER

#

HOW AM I THIS DUMB

#

📉

ashen fiber
#

Lol

digital yacht
#

...

#

oof

opaque escarp
#

👀

grave sierra
fossil sundial
grave sierra
#

Thats from Velocity

#

No request is sent or detected on Spigot.

fossil sundial
grave sierra
fossil sundial
#

I mean where was the pack sent from originally

#

If it was the proxy then this is absolutely working as intended

grave sierra
#

Its proxy

fossil sundial
#

Yea then it’s working as intended

#

The proxy sending the request on previously was a bug

grave sierra
#

My problem is that it is not sending the status to the backendserver.

oblique haven
#

the proxy purposefully doesn't pass status back if the origin was the proxy since the backend isn't the one "handling" that pack - you're free to use plugin messaging to achieve this though with custom channels, shouldn't be too hard

grave sierra
#

I can do that before.

I check if the player has properly loaded the resource pack with the spigot ResourcePackStatus event from the lobby server.

It was working in January-February.

oblique haven
#

what you're seeing is intended - what was happening before was not intended if it was passing it back

#

I believe there was an issue with original origin or something which Five fixed in one of the prior patches which led to that PR

grave sierra
#

But after these dates, this is the only action taken on the issue.

oblique haven
#

this isn't an issue

#

it's intended behavior

grave sierra
#

I mean yes

#

Then what's causing it to work beforehand?

oblique haven
#

a bug

#

non-intended behavior

grave sierra
#

Could Spigot detect that the player's resource pack was loaded due to the bug?

oblique haven
#

you're saying spigot isn't sending the pack

#

the proxy is

grave sierra
#

I want to explain my problem from the beginning.

#

When I sent the resource pack over the proxy in January-February, I could detect the player's resource pack from the spigot servers on the backendserver with the "ResourcePackStatus event". But now I can't do that.

oblique haven
#

right

grave sierra
#

I've been looking for what caused this all along. I can't understand why.

I was not using the message channel before.

Just a resource pack plugin via Velocity and an event listener via spigot server. This much.

oblique haven
#

Right - that was unintended behavior and has since been fixed

grave sierra
oblique haven
#

just send a plugin message

#

having a random resource pack ack to the spigot server about status makes no sense outside of your particular scenario

#

if spigot didn't send a resource pack - it's not expecting a response, so it makes absolutely no sense to send it one

#

if you want to imitate one you're free to do so with plugin messaging - but that's imo probably the best way to handle it

grave sierra
#

Understood.

fiery bloom
#

Hello everyone, can anyone write me a line with the code for teleporting to the server at certain coordinates?

burnt dragon
#

no, this is for help with development not comissioning people to do work for you

valid gazelle
coarse topaz
#

Not without a plugin on the server itself, no

agile ore
#

Is there a way I can get a list of running backend servers? Basically I want to check if the player is allowed to join a specific backend server on a ServerPreConnectEven, if not send player to the first fallback server that they have access to.

coarse topaz
fossil sundial
south ermine
#

Is there a better documentation on velocity & its velocity-plugin.json ?

#

Because I am finding lots of conflicting information

#

I cannot get a velocity-plugin.json to generate

#
dependencies {
    annotationProcessor("com.velocitypowered:velocity-api:3.0.1")
    compileOnly("com.velocitypowered:velocity-api:3.0.1")
}
``` Should be this simple; why not?
coarse topaz
#

Do you have the @Plugin annotation in your main class

south ermine
#

I needed to use kapt as the annotation processor due to kotlin source file

coarse topaz
#

Ah yes, that'll do it

south ermine
#

Fun fact, for some reason plugin id cannot have uppercase

coarse topaz
#

That is correct

south ermine
#

Not in the annotation exception

#

Not in the docs

coarse topaz
#

However, I feel that shouldn't completely stop the plugin from starting imo

south ermine
#

It prevents it from compiling

coarse topaz
#

It would be much cleaner if we just threw an error and allowed the plugin to load

#

well, yes

#

But, I do not feel that it should

#

Ideally, we should just ignore the casing of the letters and automatically format the string

south ermine
#

Well, I guess my only recommendations are to add such things to the documentation (usage of kapt for kotlin sources, lowercase plugin id)

#

Thanks for the help though

valid gazelle
#

Would it be possible to make a compiler error/warning for that because that would make more sense

coarse topaz
#

Well, we can do two things simultaneously in theory

#

Auto lowercase plugin id's, and print a better message

#

Perhaps something like this

opaque escarp
# coarse topaz Auto lowercase plugin id's, and print a better message

Printing a message with the invalid id entered is a good idea, but converting the invalid id to lowercase may cause some unwanted problems. For example, if you want to depend on another plugin and it is opensource, you can look at the main class and copy the id to use it in the dependencies of the @Plugin annotation, but in case the id is invalid the plugin will not be able to depend correctly on the other plugin

coarse topaz
#

Perhaps we should apply the same logic to the dependency then

maiden hawk
analog dew
#

kapt being needed to run annotation processors on Kotlin code isn't specific to Velocity, that's just general Kotlin knowledge

#

I don't think it's particularly important for the Velocity docs to document how to use Kotlin

merry trellis
#

Are you we able to hide disconnect messages when we disconnect a player with event.setResult(ResultedEvent.ComponentResult.denied(message));?

As if they are formatted pretty they take up a bit of console space

south ermine
fossil sundial
fossil sundial
south ermine
burnt dragon
fossil sundial
copper crown
#

How would I go about sending kicked players to a predefined server? For example, if I join a server and get a forge mod rejection (or I get kicked for any other reason) I want the players to be sent to the lobby again

#

I know on bungee I somehow managed to not even connect to a server if the join event was cancelled so I would just remain on the lobby if I got kicked instantly

burnt dragon
#

you can listen to the kicked event and set a redirection iirc

copper crown
#

getServer should be the server you're kicked from then, right?

coarse topaz
merry trellis
median kraken
#

When I send a {message} from a proxy in minecraft chat, a message comes up: "<> {message}"
How to get rid of those <> ?

#

paper 1.19

#

on version 1.18.2 everything was fine

ashen fiber
#

It's bugged, devs will probably fix it soon™️.

south shadow
#

Hello, I have an issue with PlayerAvailableCommandsEvent event. I am trying to prevent tab-autocomplete ONLY for proxy commands, but this event includes both proxy and server commands. How can I distinguish these two type of commands?

burnt dragon
#

you can check if the command exists in the velocity command manager

#

it has a method to get a list of aliases

#

but also, consider not removing tab completion as it just hurts accessibility for no gain

south shadow
#

I am just trying to prevent players to see those commands

burnt dragon
#

use a permissions plugin

south shadow
#

I am developing a plugin, I already have spigot and waterfall compatibility, but I want velocity too

south shadow
burnt dragon
#

that doesn't have anything to do with not using a permissions plugin but whatevs

south shadow
#

even with a permission plugin, commands will appear in the tab completion

#

that's why there are hundreds of anti tab completion plugins on SpigotMC

#

I am new to velocity, I don't know much about it, maybe velocity already blocks all commands on tab completion

#

but that doesn't happen on bungeecord or waterfall.

bold wharf
#

Plugins which properly define their stuff will not show up in tab completion

#

Like, that 100% happens on waterfall

fossil sundial
fossil sundial
bold wharf
#

^ Plugins just suck at using it, but the feature is literally there and has existed for a looooong time

#

Also, i got chat registry passthrough working, all of my checks for equality came back true, and chat actually works again! now just for eveeeerything else, lol

ruby spear
bold wharf
#

Well, that's part 1, gotta work on all the business which will use that

#

i.e. registering custom types, etc

#

Think I'm going to wait on seeing what adventure does before I actually bother with the API side of stuff, idk what all they intend to cover, but, want to at least get the business logic needed in place for it

ruby spear
#

do chat events work any differently with the signed messages

#

I'm not sure what to change on my end to update to velocity 1.19

bold wharf
#

Well, the signed message will need to be passed around, part of what I'm waiting on adventure for

#

Honestly, I ain't done much with velocites API, or the codebase, so this is all pretty much a new territory for me, already had a few fights with checkstyle

ruby spear
#

what are other servers doing using velocity with 1.19? embracing the jank?

bold wharf
#

I mean, thus far it works fine, I don't think anything supports the signed message stuff though

ruby spear
#

is there a way to just disable signed messages

bold wharf
#

pretend that every message is sent by the server

ruby spear
#

welp

solid ivy
#

Technically you can create custom message type

#

That only displays players name

#

Then just use display name for message

#

Through it's harder on proxies

fossil sundial
solid ivy
#

It will

#

Since displayname is fully controlled by server

#

And client never signs it

#

Just content part of message

#

Which doesn't even need to be visible

fossil sundial
#

Turn off the chat decorator preview packets and see if it still works

#

I’m genuinely interested

#

Had no time to see

solid ivy
#

Tested when I modded it

#

I'm currently on my phone so ¯\_(ツ)_/¯

#

Someone would report that already if it was the case

median ridge
#

Hello, sorry for my english, how do I fix this? happens when I use \n

I'm also using LegacyComponentSerializer.legacySection().deserialize()

solid ivy
#

You can't

#

Vanilla limitation

#

You to split it by hand

burnt dragon
#

no you dont

#

you can use newlines in messages

median ridge
#

Okay, I'll see if I can make a parser, thanks.

solid ivy
#

I'm sure newlines were broken on chat

#

Or maybe that was only lore?

#

¯\_(ツ)_/¯

median ridge
#

It works in chat in 1.8, but not in 1.7.

burnt dragon
#

ok well it doesn't work on 1.7

obtuse locust
#

why I can not get resource from plugin folder on velocity? resourceAsStream is ok but result is empty

bold wharf
#

Because you're calling it on the classloader

#

the classloader is, well, looking at the jar file

#

if you want a file off the disk, create a reference for that

obtuse locust
bold wharf
#

then open it as a jar file

#

a folder is not a resource

obtuse locust
bold wharf
#

google

#

think you could do it from the code protection thing or something

obtuse locust
bold wharf
#

Yea, stuff like that is none reliable

#

guessing that your "working" test was ran from the IDE where the classloader is often pointing towards a folder

obtuse locust
#

maybe..

#

velcity has google libs

#
List<ClassPath.ClassInfo> classes = new ArrayList<>();

for (ClassPath.ClassInfo info : ClassPath.from(LiteProxyManager.class.getClassLoader()).getTopLevelClasses()) {
    if (info.getPackageName().startsWith("dev.rollczi")) {
        classes.add(info);
    }
}
#

works

#

or

Set<ClassPath.ClassInfo> classes = ClassPath.from(LiteProxyManager.class.getClassLoader()).getTopLevelClassesRecursive("dev.rollczi");
lethal garnet
#

could you theoretically use signed messages with a custom chat formatter?

#

or is that not possible

#

(im not exactly familiar with the new updates)

burnt dragon
#

yes, that's what chat types are for

inner surge
#

How can I usee bungee channels with velocity

opaque escarp
# inner surge How can I usee bungee channels with velocity
Gist

Velocity API 1.1.0 Plugin messaging channel example - MessageListener.java

gray hedge
#

Why does when kicking with disconnect() remove the spaces also it says internal issue occured?

#

Oh nvm

#

I'm stupid

#

Tired

#

Sowwy

maiden hawk
#

btw

#

what was velocity 2?

opaque escarp
#

Velocity 2 is now Velocity Polymer (4)

opaque escarp
opaque escarp
# opaque escarp Is the same in 3.x.x

To clarify... Velocity 3.0.0 (in its first release) and Velocity 1.1.x are the same, except that Velocity 3.0.0 removes text, updates guice and starts using Java 11

maiden hawk
#

now I am confused as fuck

#

why did velocity 3 come before 2, but after 1?

analog dew
#

The 1.x series couldn't continue without breaking changes, but 2.x was already assigned at the time

maiden hawk
#

IIRC, semantic versioning allows for breaking changes at the minor version, right?

analog dew
#

No

maiden hawk
#

Oh

#

Well

#

Makes sense

#

Shouldn't polymer be renamed to 4.x then?

rich hawk
#

it is 4

#

.x

lethal garnet
#

figured i'd ask this again as im considering making a PR:
Has anyone considered adding more command-line arguments to velocity? specifically --host, --online-mode, etc

pseudo cradle
#

what polymer

#

why is it named polymer

rich hawk
#

why not

valid gazelle
#

lithium polymer

gloomy junco
#

Hi all!
I need help getting a PluginMessage on the Paper Server.
So I send a PluginMessage to a chat event from my proxy using: sendExampleMessage(e.getPlayer(), "123");
The sendExampleMessage() method was taken from https://gist.github.com/Xernium/95c9262c5f70b8791557861bbc09be1b.
On the Paper server, the handler was taken from https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/

On my Paper server, I register a channel: this.getServer().getMessenger().registerIncomingPluginChannel(this, "mychannel:main", this);
And in the onPluginMessageReceived() method I check if it belongs to my channel.
But tests have shown that even the onPluginMessageReceived() method itself is not called, that is, I'm just trying to display in the logger that a message has arrived without any checks.
But nothing happens, I can't figure out why it doesn't work. From the server side, I can send a message and it will come to the proxy.

I can't figure out if I'm sending it somehow wrong or it's not accepted on the server.

I am using Velocity 3.1.2-153
and Paper 1.19-17

fossil sundial
# gloomy junco Hi all! I need help getting a PluginMessage on the Paper Server. So I send a Plu...

You’re thinking wrong. The destination you want to send it too from the proxy is not the player. You want to send it to the server; the channel message sink is the ServerConnection if you want to send it to the server

https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/proxy/Player.html#getCurrentServer()

hoary egret
#

How does one disable a velocity plugin or is it not possible?

bronze yoke
#

not at runtime

#

it's possible but unsupported

fossil sundial
#

Open an issue on GitHub or I’ll forget; that was originally intentional for 1.19+ but it must have gotten lost in the update madness

rich hawk
#

huh..?

bold wharf
#

inb4 via

rich hawk
#

oh they edited their message

lunar quail
#

Does velocity have some ticking internally or everything that happens is handled async upon events?

bold wharf
#

no

#

it's all event driven from the networking stuff

ashen fiber
#

Anyone have a simple example on how to use plugin messaging channels?

pale aspen
#

How can I make an API for a Velocity plugin that plugins on sub servers can use?

sour current
#

You'd need to use something like plugin messaging or redis so that the plugins can talk to eachother

pale aspen
#

Is there any resources I can read on plugin messaging?

#

I'm making a friends plugin in Velocity and I basically want to make an API that gets the friends of a specific person

sour current
#

See the message that 4drian3d replied to above yours, its the spigot page on the bungee channel which shows how to use it

pale aspen
knotty mica
#

Yes

sour current
#

That's possible I think, though it'd be better to use something like mysql

pale aspen
#

How would that make things easier?

sour current
#

If it's for an api for other plugins to use then probably not, nvm that

pale aspen
#

I still don't understand how I'm supposed to be sending a list of data from the Velocity plugin to the server

#

What I'm getting is that I have to register a channel using the Velocity plugin

proxy.getChannelRegistrar().register(someChannel);

Then send some data

sendExampleMessage(player.server, "something");

In my Paper plugin I would register a plugin channel and an event for it. But I don't see how I can make an API with this

#

I would have to listen and deserialize the data for every plugin

fossil sundial
#

You can’t share a classspace so this is more or less one of the only ways to move data

fossil sundial
#

If it were easier then Minecraft wouldn’t have the networking code it does currently

bold wharf
#

at the end of the day, they're two isolated program spaces

#

anything you do between the two is gonna involve some form of communication

pale aspen
#

That's all fine and good, but I am trying to make an API. It seems I can't

bold wharf
#

Well, you kinda can't

#

at least, any API you make is gonna rely on communicating over the network

#

Like, if you want reliable connections and stuff and to have an "API", you'd generally be better off writing some REST API and wrapping API around that

#

but, then ofc, everything is still network IO

magic forum
#

I'm making an API for Ambassdor

#

So people can create plugins that interact with the forge handshaking process

#

If they want

#

This will be the most used method I think

#

It does all the hard work for you

#

It uses my custom downloading mechanism to download the handshake packets from the forge server

#

And stores them in simple byte arrays that you can send to the client directly using Velocity API

#

I'm gonna create a way for plugins take over the handshaking process and just use Ambassador as library. If they doesn't, Ambassador is gonna default to it's own handshake handler

#

Basically, I'm doing a full rewrite right now

gloomy junco
#

Guys, I know that in order to successfully receive the PluginMessage you need at least 1 person on the server, but can I bypass this system to always receive the PluginMessage even if there are no players on the server?

bold wharf
#

No

#

the entire thing relies on hijacking a players connection to send it over

#

No player to hijack, no connection to send data over

#

best you can do is rely on some other solution, pubsub, sockets, etc

gloomy junco
#

I'm understood, thank you

lilac elbow
#

Is there an event that fires when a server connects to the proxy?

oblique haven
#

Players connect to the proxy and the proxy connects to the server on behalf of the player

lilac elbow
#

Would this work or does it need to be sent from a player

oblique haven
lilac elbow
#

Why can you even send it from the server then

oblique haven
lilac elbow
#

So that will work?

#

I just need to send an alert the the plugin running on the proxy then send info back

oblique haven
#

Yep

lilac elbow
#

What if there isn't? will it wait until a player is?

oblique haven
#

Could test it

nova sparrow
#

Plugin messaging requires a player to be online for it to work?

agile ore
nova sparrow
agile ore
nova sparrow
#

I suppose so

#

Better than relying on a player to be online

#

Can think of other solutions tbh

agile ore
#

What are you trying to achieve?

nova sparrow
#

Oh me, nothing

#

I've just never actually used plugin messaging so I was curious

lilac elbow
#

Can someone explain redis to me

#

I always thought it was just another version of mysql

#

Is it not?

valid gazelle
#

its more meant for temporary data

#

it's an in-memory data store

lilac elbow
#

I have a list of players, I need to have the list on proxy side and be able to access it from each server. Right now I was planning on everytime something gets added to the list, send a message to the server and replicate the list there, is there a better way?

valid gazelle
#

yeah redis sounds like the right tool for that

#

i dont really know the specifics that well so i cant give much more advice though

lilac elbow
#

Do you know if sending plugin messages is secure or can clients access it

valid gazelle
#

idk, might have to ask someone else

lilac elbow
#

Because i'm sending database information

valid gazelle
#

yeah i would say that probably makes more sense to go over redis because it's not player specific right

lilac elbow
#

Yeah but thats the other thing

#

Its a bungee network so there will be a lot of servers, and I dont want to have to manually enter the server connection string for each one, so i was going to have it on the main, when the server boots up send a connection ping to the proxy then the proxy responds with the database information and the plugin saves it

valid gazelle
#

is there a way you could pass the credentials as an environment variable, adn then read that variable in your plugin?

lilac elbow
#

Do rented dedicated servers usually allow you too do that?

lilac elbow
#

This look right? isnt sending message to bungee

#

For redis do you need to host a server? i'm looking at https://www.tutorialspoint.com/redis/redis_java.htm will Jedis jedis = new Jedis("localhost"); just run it on the server the bungee is on?

valid gazelle
#

i think you have to run redis separately

lilac elbow
#

Yea redis wont work for me because it needs to know when its being called

valid gazelle
#

wdym

nova sparrow
lilac elbow
#

That sounds stressful for the server

nova sparrow
#

do it on another thread every so often

#

its not a good idea but

#

are you just trying to communicate stuff between a front end and backend

lilac elbow
#

Every so often wouldnt work either that ruins the point of needing to know when its called

nova sparrow
#

I was thinking earlier could you use a http server?

lilac elbow
#

Like if I have a ban command on the server, do the command there, send the info to the proxy, then send the ban info to all servers

nova sparrow
#

on another thread possibly

lilac elbow
#

Which is what im trying to avoiid

#

And does http have an event system with packets?

nova sparrow
#

I mean you can post to a server

lilac elbow
#

Yea at that point I would just create a server from scratch

nova sparrow
#

lmao

#

i mean it is an option

lilac elbow
#

^ im being serious with that I think it would handle data better

nova sparrow
#

I mean thats a fairly big task

lilac elbow
#

I want to see if there is a way to do it directly with bungee and spigot first

nova sparrow
#

You could just fork velocity and add what you need into it

lilac elbow
#

I would also need to fork paper then

#

Which again would just be making a server

nova sparrow
#

Or make a plugin for front and back end

lilac elbow
#

Still would need a server to communicate with each other

nova sparrow
#

And in that plugin make an event fire when you receive a post

#

Yeah

lilac elbow
#

What would be the point for that

#

Thats just exactly what im trying to do already but just with extra plugins for no reason

nova sparrow
#

Then build it into one plugin 🤷‍♂️

#

Its an option

#

Might not be what you want but if redis doesnt work and you can think of anything else

lilac elbow
#

That wouldnt work...

#

You cant communicate directly between bungee and spigot

#

so it cant be one plugin

slate siren
#

well

#

you could have two packages that compile into one jar

#

and have it connect via databases to communicate information

slate siren
#

not even actual data just booleans etc

nova sparrow
#

sql messaging?

slate siren
#

yeah

nova sparrow
#

yeah thats good

slate siren
#

that’s what i was getting at

nova sparrow
#

used that before

lilac elbow
nova sparrow
#

but i think he'd run into the same problem

lilac elbow
#

Like a spigot and bungee version in 1 jar?

nova sparrow
#

yeah

lilac elbow
#

I know that, but what would that do

nova sparrow
#

Well it would mean you're only making one plugin technically

lilac elbow
#

The plugins would still need to communicate and they are in different directories on different servers

agile ore
#

¯_(ツ)_/¯

nova sparrow
#

^

agile ore
#

proxy communication

#

both works

lilac elbow
#

i already explained

#

I cant I need to know when it is beiing called

agile ore
#

Wdym

#

Explain what you want to do instead of the issue you're having

lilac elbow
#

If I do /ban Keylon I need to know when that command is called on the proxy for example

#

Not using Command events or anything because its not being called on the command

agile ore
lilac elbow
#

Read after

#

I just used a command as an example

agile ore
#

I still don't really understand

lilac elbow
#

I need a way to send any data, and know when that data is sent

fossil sundial
#

You need to register a command to process it-?

lilac elbow
#

no

#

Im trying to make almost an event system ig that runs across the proxy and server

agile ore
fossil sundial
#

^

lilac elbow
#

Alright, another thing is my proxy isn't receiving messages from my server

fossil sundial
#

You can’t wait for redis

#

?

lilac elbow
#

?

#

You can?

#

Like I said before Im not familiar with redis much

fossil sundial
#

Depends on what kind of event you want to gauge how feasible any of this is

#

You can’t get an awaiting event to work right over redis

#

But the same is true with plugin messaging

lilac elbow
#

server send class

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

Server main

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

Bungee lsitener

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

Do I need to register incoming channels in my bungee plugin? or only outgoing

fossil sundial
#

……. You’re in the wrong channel for bungeecord

lilac elbow
#

Im using velocity

#

ohhhh

#

I meant to be in waterfall

#

oops

fossil sundial
#

There’s no @tame spireentHandler on velocity

lilac elbow
#

I meant waterfall

#

my b

fossil sundial
#

Sorry to whoever I just pinged, discord mobile is problematic sometimes

nova sparrow
#

lmao

wet locust
#

Hello, I was wondering if it was possible to set to blank the default fallback server because I'm making a plugin that's manage all servers and add/remove them automatically

#

Or I just need to unregister the default fallback server ?

lost swan
#

Hey, how to change the log level of the integrated slf4j logger? I have not found a config option.

fossil sundial
lost swan
#

Thanks! 😇

pseudo cradle
#

If I send a resource pack through a backend plugin, will velocity receive the status packet back from the client

#

or what about vise versa

#

if I use velocity to send a player a resource pack, will the backend server receive the packet

fossil sundial
# pseudo cradle if I use velocity to send a player a resource pack, will the backend server rece...

Velocity fires events for all resource packs and resource pack status to the api.
The api also exposes where the pack originated from; and if the proxy interferes with the pack it also saves where it was from originally
But in essence:
If the backend sends a pack then the backend will always get a response
If the proxy sends a pack then the backend will never get a response because that would constitute an illegal protocol state

pseudo cradle
#

mk ty

valid gazelle
#

any chance someone could take a look at my pull request i made a while ago and review if possible? it's pretty small and i'm getting tired of rebasing it every so often, and also maintaining my own jar on my server
https://github.com/PaperMC/Velocity/pull/643

GitHub

If passthrough-default-server-ping is set to false, then Velocity will respond with its own MOTD and version for pings that go to a host not listed in forced-hosts. This means that you can make it ...

craggy pecan
#

This can be replicated with a plugin, so I doubt it will get accepted

nova sparrow
#

^

woven stag
#

Hello I wish to modify total player count but it does not work. This is my implementation

    @Subscribe
    public void onPing(ProxyPingEvent event){
        AtomicInteger count = new AtomicInteger();
        for (GameServer server1 : VelocityCore.getInstance().getServerManager().getServers().values()) {
            if (server1.getGameMode().equals(GameMode.SUPREME_PG)) {
                continue;
            }
            count.addAndGet(server1.getPlayerAmount());
        }
        VelocityCore.getInstance().getServer().getAllServers().forEach(server1 -> count.addAndGet(server1.getPlayersConnected().size()));
        event.getPing().asBuilder().onlinePlayers(count.get());
    }
#

please let me know if I am doing something wrong

burnt dragon
#

you're not setting the ping

#

you're getting the current ping and then modifying it, but you need to call event.setPing

woven stag
#

oh shoot, thanks!

valid gazelle
#

when its in velocity itself its just 3-4 lines of actual code/logic

craggy pecan
#

You have to understand that the feature is niche at most, given 1. most servers don't use forced hosts, and 2. even less use it in conjunction with exotic ping passthrough configurations

#

That 3 lines of code estimate doesn't take into account docs and further confusion when using forced hosts

valid gazelle
#

I thought it was like the default option, or at least a very popular one on bungeecord

#

and it shouldn't be confusing I don't think, just basically is like a toggle for a network wide motd I think, by default the behavior isnt changed in this pr

vestal prawn
#

how much time does it take so a PR is available on the website ?

agile ore
#

it won't show up until it's merged

vestal prawn
#

and how much time does it take to be merged ?

fossil sundial
vestal prawn
vestal prawn
#

✊😔

nova sparrow
#

Would it be possible to tell if an attempted connection is from an browser context, and if so redirect them. Haven’t looked at it much but was just thinking about it? could be useful

#

🤷‍♂️

idle geyser
idle geyser
#

this works, i use it

bold wharf
#

SRV records do have some caveats

#

I mean, web servers generally run on a different port, so often just host the web server on the same box, or, setup a web server which just redirects to the correct place

lucid halo
#

SRV sometimes can randomly fail for no reason, which is fun

#

tho, I've only seen that happen a couple times over the past few months, so

valid gazelle
#

huh i never had it happen myself

bold wharf
#

seems generally down to janky ISP hardware

lucid halo
#

it probably doesn't help that I use CenturyLink with no better option available

bold wharf
#

like, for some people they can just reboot their router and magically all works again

valid gazelle
#

weird, why would that happen with srv and not other dns lookups either

bold wharf
#

tbqh, SRV records are somewhat niche

lucid halo
#

probably bad caching cannot store SRV

#

and that may incur a longer round trip than A or AAAA

bold wharf
#

Like, idk anybody who really uses them all too much, and so chances are they're just not as well tested

tired quarry
bold wharf
#

This override here is dum

#

(at least imho)

#
  1. this is the cause of the <> in messages
#
  1. adventure defaults that to use the SYSTEM message type, which WOULD be the correct behavior for literally every single usage within the proxy itself, however, I am somewhat iffy on changing this from default
#

@fossil sundial if you happen to be around, thoughts?

fossil sundial
#

system chat packet can only provide one

bold wharf
#

Thing is that it defaults to chat

#

So, that override replaces the default message type that adventure would set

#

I wanna just yeet that override

#

(the one I linked, so that we go back to the default there)

fossil sundial
#

adventure cant account for this yet

untold grove
#

is there a command to send players to other servers?

burnt dragon
turbid jay
#

Hey all. I'm a bit confused while making my plugin. I have a Player object & a RegisteredServer object. How do I force the player to join the RegisteredServer?
I need to 'move' the player to another server from a lobby server.

burnt dragon
#

player.createConnectionRequest(sever).fireAndForget()

#

replace fireAndForget() with one of the other methods if you want actual error handling

turbid jay
#

Ah, perfect! Thanks 🙂

craggy oyster
#

I think

summer terrace
#

I seem to have an issue where Player#sendMessage seems to be printing out Action Bars rather than text chat

Using: Velocity 3.1.2-SNAPSHOT (git-0caff79b-b156)

this.server.getAllPlayers().stream().filter(player -> player.hasPermission("staffchat.use")).forEach(player -> player.sendMessage(
                MINI_MESSAGE.deserialize(chatMessage,
                        Placeholder.unparsed("server", serverName),
                        Placeholder.unparsed("player", displayName),
                        Placeholder.unparsed("message", message)
                )
        ));```
```java
player.sendMessage(MINI_MESSAGE.deserialize(toggleMessage, Placeholder.component("status", Component.text("disabled").color(NamedTextColor.RED))));
        ```

anyone know why this is caused, or if I did something wrong?
sour current
#

iirc that's a viaversion bug, update to their latest commit

summer terrace
restive pine
#

Hi guys!, is there any way to dynamically load a plugin on Velocity? I suppose there isn't any way but we don't lose anything by asking :)

nova sparrow
#

velocity reload

#

if it even exists

bold wharf
#

No

nova sparrow
#

i mean a proxy starts up quick enough to just restart really

bold wharf
#

Like, I mean, theres always a way, but, ofc, 100% unsupported

#

Suggest looking into your IDEs hotswapping features, etc; but, as said, proxies load pretty darn quick so it's generally not a huge concern

median ridge
#

Is there any way to intercept messages received through the BungeeCord channel?
I tried using PluginMessageEvent but I can't get anything from the channel.

agile ore
#

how do i fix thisss

#

it worked like a hour ago

fossil sundial
# median ridge Is there any way to intercept messages received through the `BungeeCord` channel...

Why would you need to do that? If you make your own custom plugin you’re expected to use your own namespace:key identifier.
I digress, yes it is possible to do; If you disable the bungee messaging channel in the velocity config then the proxy itself won’t respond to it anymore and plugins can use it. If you need to use a subchannel of bungee you also need to implement the other functionality of the bungee channel to keep it working

fossil sundial
#

Either that or the mojang repo isn’t working once again

median ridge
agile ore
#

or maybe my build.gradle is broken or somethingh

#
repositories {
    maven {
        name = 'velocitypowered-repo'
        url = 'https://nexus.velocitypowered.com/repository/maven-public/'
    }
}

dependencies {
    implementation project(':jedis:jedis-datasource-api')

    compileOnly 'com.velocitypowered:velocity-api:3.1.0'
    annotationProcessor 'com.velocitypowered:velocity-api:3.1.0'
}
fossil sundial
#

Do you have the papermc maven repo?

agile ore
#

i only have velocitypowered

agile ore
#

you could also make your own channel for load balancing

fossil sundial
fossil sundial
agile ore
#

still doesn't work

craggy pecan
nova sparrow
#

maven >

magic forum
#

raven

agile ore
#

nvm guys, setting up dependencyResolutionManagement is very hard

left wing
#

Hello,
I'm sending plugin messages with spigot, but when i register a listener on velocity with PluginMessageEvent the event gets never called

agile ore
#

this.server.getChannelRegistrar().register(new LegacyChannelIdentifier("your plugin channel or something"));

#

on velocity

#

this.server is proxyserver

left wing
#

ooh yeah

#

i'm a retard

#

🤦‍♂️

#

totally forgot about that

agile ore
#

there's also MinecraftChannelIdentifier for 1.13+

old plover
#

Hello, I didn't find code for teleport source and player to server

left wing
#

Yeah i know that i have them assigned as variable just never used the variable😆

old plover
#

I am making a plugin for screenshare

agile ore
old plover
#

no

agile ore
#

or just send them into another server

old plover
#

source and player called in command

half python
#

Is there a way to set a players displayName like it was possible in BungeeCord?

agile ore
# old plover

player.get().createConnectionRequest(proxy.getServer("some_server").orElseThrow()).fireAndForget()

old plover
#

thank you

#

I'm new with this api

#

sorry for this questions

#

I'm learning

agile ore
#

if you want a response to check if player has really connected to a server then you can use connect instead of fireAndForget

old plover
#

perfect

#

I want send executor of command in this server

#

and arg[0] (player_name)

#

But I don't find this method for send executor

#

how find player name executor of command?

#

I have find them

#

I am stupid sorry lol

halcyon jackal
#

Would like some feedback on whether this maven configuration would work or not:
https://github.com/Andre601/AdvancedServerList/commit/67aab526253f82da8afaa0479589de185da07512

My goal is to have stuff such as configurate and Adventure shaded into the core, so that I can then relocate them if needed for the other modules.

Like:

  • On BungeeCord, shade and relocate both into the resource
  • On Velocity, only shade and relocate Configurate (Can't even remember if that is needed...)

If there are any other recommendations to make the jar files both less bloated and functional with BungeeCord and Velocity lmk (Also, to be clear: The jars will be separate from each other. There won't be a universal jar for both proxy types)

old plover
#

How find player nickname executor

#

on invocation.source

burnt dragon
#

if they're separate jars then you can do what you want, keep as much stuff in a commons module as you can and yay

halcyon jackal
#

My question was if what I'm doing her works or if there is better options

#

I weirdly enough had the same error duing the mvn clean install command, but that was fixed when I excluded SF and RSA files

#

So, not entirely sure what I should do here... Include the same excludes in the velocity module?

#

Welp. That seems to have worked.

halcyon jackal
#

Is there a way to get the name of the player in the ProxyPingEvent?

#

Or alternatively the UUID.

vestal prawn
#

in the proxy ping you have only the ip of the player

halcyon jackal
#

rip

halcyon jackal
#

Is there an equivalent setup in Velocity for BungeeCords onDisable method?

#

I assume the ProxyShutdownEvent would be the right choice?

bronze yoke
#

yes

old plover
#

Hello, How check if command has been executed by player or Console?

vestal prawn
#

if not then it's the console

spiral portal
#

If it isn't a player then it could also be a command block. The ConsoleCommandSender represents the console

agile ore
#

How can I create a configuration (toml) in Velocity? Do I need to hook other things or is there a direct method to do that?

vestal prawn
cloud iron
#

How can I use commands for velocity plugins network-wide?

tardy totem
#

how do i change a players message with the chat event

fossil sundial
fossil sundial
spiral portal
vestal prawn
agile ore
#

How can I debug incoming plugin messages like BungeeCord Connect?

#

Are there any flags for enabling that

fossil sundial
#

No.

fossil sundial
#

But no other than that

agile ore
fossil sundial
#

Option 2 is to disable the bungee messaging channel in the config

#

That’ll allow a plugin to register and listen to it

fickle grail
fossil sundial
#

But it also breaks the functionality of the channel

fossil sundial
fossil sundial
fickle grail
#

yep, but debugger only works when you want to run proxy in idea 😄

fossil sundial
#

No; javas very capable of remote debugging using the builtin remote debug system

fickle grail
#

hmm, ok fair point

bold wharf
#

remote debugging is ❤️

#

But, yea, theres not much real thing for debugging that as the format is set in stone, you can't really screw it up on the proxy side

fickle grail
#

btw, is there any way to "wait for the next packet"? f.e

server.sendPluginMessage(channel, data); 
server.getConnection().ReadNextPacket()?

I want to force the server to respond with PluginMessage in the next packet, I know I can subscribe PluginMessageEvent and add some timeout like 1sec for a response, but maybe there is any more elegant way?

fossil sundial
lunar quail
#

what is the common/best way to broadcast events accoss minecraft server network?

#

the network is running with multiple proxies, so broadcasting with plugin channels (they exist only if there is a player) is not the solution I need

fickle grail
lunar quail
fickle grail
fickle grail
fossil sundial
#

And not the server

#

Am I understanding correctly?

fickle grail
#

yes, like that:

  @Subscribe
  public void onLoginEvent(PostLoginEvent e) {
    byte[] data = getData(e.getPlayer());
    e.getPlayer().sendPluginMessage(channel, data);
  }
#

i looked at source code, and PostLoginEvent is fired in "game state" after login is finished, so it should be fine to send pluginMessage in this event

fossil sundial
#

Open an issue on GitHub. Yea that’s a bug. I think you’re the first person I’ve seen that needs this functionality

bold wharf
#

I don't see where such a check exists?

fickle grail
#
  @Override
  public boolean handle(PluginMessage packet) {
    VelocityServerConnection serverConn = player.getConnectionInFlight();
    if (serverConn != null) {
      if (player.getPhase().handle(player, packet, serverConn)) {
        return true;
      }

      if (PluginMessageUtil.isRegister(packet)) {
        player.getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));
      } else if (PluginMessageUtil.isUnregister(packet)) {
        player.getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
      } else if (BungeeCordMessageResponder.isBungeeCordMessage(packet)) {
        return true;
      }
      System.out.println(String.format("Packet: %s",packet.getChannel()));
      serverConn.ensureConnected().write(packet.retain());
    }
    return true;
  }

inside InitialConnectSessionHandler

fossil sundial
#

mcconn.ensureConnected()

#

Is in the abstract super class

fickle grail
#

hmm?

bold wharf
#

I mean, I see that there exists logic for the connection to the server

#

but not for the player itself

fickle grail
#

So I looked inside AuthSessionHandler, in line 141 you change state to Play, fire LoginEvent
then switch Handler to InitialConnectSessionHandler and fire PostLoginEvent, so all logic is handled by InitialConnectSessionHandler, am I correct? I started using velocity yesterday so i could make some mistakes.

#

And of course, if sending pluginMessage will be allowed in InitialConnectSessionHandler, some logic needs to be copied from ClientPlaySessionHandler (like firing PluginMessageEvent) 😄

fossil sundial
#

Again I see how this issue could arise. Open an issue on GitHub and we will look into it soon.
Besides that- which versions are you coding this for? On 1.13 and newer there’s a better solution

fickle grail
#

1.8 as a base, but with ViaVersion

fossil sundial
#

So you want to interact with a client mod?

fickle grail
#

yep, i need to send as soon as possible some data with PluginMessage and wait for response

fossil sundial
#

just before you get your hopes up

#

even if we fix it

#

some versions will not be able to respond correctly before the client is first initialized

#

(aka has joined the first server successfully)

fickle grail
#

yea, i know but this mod only works on 1.8, so i know it will work, beside that i already "hardcoded" fix and tested it

lunar quail
fickle grail
#

but I wanted to confirm if it is a bug or just my mistake, I will make an issue on GitHub right now

lunar quail
fossil sundial
fickle grail
lunar quail
bold wharf
#

I mean, it's a hack

lunar quail
bold wharf
#

You basically just create a table which stores rows and poll the db for entries since the last record you read

fossil sundial
#

I would argue that MySQL can be really fast, but you have to use it correctly for that actually to apply

paper cosmos
#

what would be the correct way to use it?

fossil sundial
#

transactions and pre-compiled sequences

#

correct use of indexes and relations

#

correct constraints and data sizes

#

list goes on

fickle grail
#

Ofc MySQL can be fast with correct indexes, caching etc but Redis is still faster 😄

bold wharf
#

yea, but redis persistence is a joke

fickle grail
#

That's why I am using it for cache and for generated data, at any time I can FLUSH ALL all data from Redis, and it will be back in like 5min without any problems 😄

vestal prawn
#

redis is not for persistence anyway

#

it's for temporary data / cache / messaging if you want

oblique haven
#

@fossil sundial is the modern forwarding secret able to be provided by the system (sys prop/env var)? We have an issue where our secrets are defined at a system level so pushing it into a file during runtime makes no sense - it would be nice if we could securely push it into the environment under a hidden environment property, mainly for security

#

Putting it in the file space opens up a potential security issue for our users and I want to make sure we’re not falling into that. For now our unstable latest uses a legacy configuration to surpass this.

#

Haven’t had time to sift through that piece but thought you might know

bold wharf
#

VELOCITY_FORWARDING_SECRET

fossil sundial
bold wharf
#

-D is evil for that

#

but, yea, can do either

fossil sundial
#

the OOM killer just came for my IDE

bold wharf
#

kek

#

git fukt

fossil sundial
#

32gb full

bold wharf
#

2G heap, using almost 4G, which is really just the norm, but it does seem to go up slowly over a while, so, maybe

balmy turtle
#

how does velocity know what permissions a player has?

bold wharf
#

It doesn't

#

that's why you install a perm plugin on the proxy itself

balmy turtle
#

that makes more sense. whats the industry standard? just ignore velocity permissions?

bold wharf
#

luckperms

agile ore
#

I think i messed up the kick event

#
[22:24:25 ERROR]:       at lucid.hasx.BreezyFiok.lambda$onProxyInitialization$1(BreezyFiok.java:91)
[22:24:25 ERROR]:       at com.velocitypowered.api.event.EventHandler.executeAsync(EventHandler.java:23)
[22:24:25 ERROR]:       at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598)
[22:24:25 ERROR]:       at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479)
[22:24:25 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[22:24:25 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[22:24:25 ERROR]:       at java.base/java.lang.Thread.run(Thread.java:833)```
burnt dragon
#

that is not the full stack trace

vestal prawn
#

💀

oblique haven
chilly raven
#

Hello friends I wonder if there is a configuration read object(Like SnakeYaml) in Velocity API
Are there any documentation about it? I researched but couldnt find anything

oblique haven
#

If you like snake you can shade it into your project just fine

nova sparrow
#

snake 🙏

chilly raven
#

Ok thanks ☺️

wanton tangle
#

So I am working on a velocity plugin.
Which of the events (LoginEvent, PreLoginEvent, PostLoginEvent) should I use?
Currently I am using LoginEvent when the server is in online mode and PreLoginEvent if it is in offline mode.
Problem wih PreLoginEvent is that it just provides the username and not the Player object.

fossil sundial
wanton tangle
#

Ah I see player extends it

#

ok ez

cloud iron
#

Heyo! I'm working on a velocity plugin that has commands that can be used across the server network (i.e. /send)
The command registers fine on the proxy, but not on any of the other servers, how can I have it register on the servs?

bold wharf
#

make a server plugin

#

stuff on the proxy runs on the proxy

#

the proxy will intercept that command when you have the correct perms, etc, iirc

#

otherwise it just passes through silently, but, if you want the commands to exist on the server for plugins to abuse, etc, you'd need a server plugin

cloud iron
#

I see, thanks! So what would the server plugin contain? I'm guessing it's not simply including the command in the plugin.yml

bold wharf
#

well, you'd need to have some way to communicate with the proxy

wanton tangle
#

bruh

bold wharf
#

plugin messages for stuff like that is generally perfect, either using the built in bungeecord channel, or, a custom channel if you want your own logic

cloud iron
wanton tangle
#

so the invocation.source() will never be player??

bold wharf
#

it should be the player if the player execues it

wanton tangle
#

but you said its only proxy commands

bold wharf
#

or at least something associated with the player, iirc, see the JDs to see what that method returns and what extends that return type

#

the command exists on the proxy.

#

the proxy intercepts those commands

#

if the player runs a proxy command, it will run on the proxy

wanton tangle
#

ok I see so i gotta do some additonal mc server side stuff to register the proxy commands there too?

bold wharf
#

no

#

once again, the proxy interecepts all the commands

#

if the command is registered on the proxy, and the player runs a command that they have perms for, the proxy will intercept it and handle it, running the command

#

For their specific case, stuff like /send, sometimes you want such a command to exist on the proxy so that signs or command blocks, etc, can run such commands

#

if you want something on the server itself to run a command, the command needs to actually exist on the server

#

but, that doesn't show relevent to your case

wanton tangle
cloud iron
bold wharf
#

on the proxy

cloud iron
#

Thought so, thank you!

slow thistle
#

I'm reading the velocity api docs and it says to reply to a message I have to do:

source.sendMessage(TextComponent.of("Hello World!").color(TextColor.AQUA));

However when I try to do TextComponent.of, IntelliJ tells me that such a method doesn't exist, anyone know why?

I'm using API version 3.1.2

bold wharf
craggy pecan
wanton tangle
#

Is there a way to get the players ip address from the player object?

rich hawk
#

yes

#

getRemoteAddress

wanton tangle
rich hawk
#

on player…?

#

inbound connection actually but player implements that

wanton tangle
#

i seee

#

im dumb

#

thanks!

obtuse locust
#

I can't see velocity plugins messages on client 1.19

lethal garnet
#

because you're not meant to?

#

what are you trying to do?

sacred ice
#

Is there a method to automatically center the motd lines?

burnt dragon
#

no

sacred ice
#

Ah centerText. Thanks

slow thistle
#
    @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
        logger.info("Initialized");
        try {
            jda = JDABuilder.createDefault("placeholder")
                    .addEventListeners(new MessageReceived())
                    .build();
            logger.info("Successfully logged into client");
        } catch (LoginException e) {
            e.printStackTrace();
        }
        server.getEventManager().register(this, new PlayerChat());
        logger.info("AxoVelocity ready");
    }

None of my code within my ProxyInitializeEvent seems to be running and there's no errors, anyone know why?

#

I can provide the full main file if needed

fossil sundial
cloud iron
#

How can I properly send players between servers?

player.createConnectionRequest(server); doesn't seem to work

bronze yoke
#

gotta add .fireAndForget() to the end

#

or connect() if you want to handle errors yourself

cloud iron
#

Ohh that would make sense, thank you!

slow thistle
oblique bay
slow thistle
craggy pecan
agile ore
#

Does "CommandSource" has an alternative method for its name who executed this command?

#

source#getName does not exist and I want to safe the name of the player / console. I could make an instance check if it's a player and then get his name and if it's not a player, then write as console, but isn't there a better/clean way?

burnt dragon
#

source.get(Identity.NAME) would work

fossil sundial
burnt dragon
#

not guaranteed to return something though

fossil sundial
#

The reason we don’t have this in the api is that plugins check for name.equals(“Console”) more often than you’d think

#

There is a player named console

#

For that reason alone this is a hard no from us

agile ore
#

Thank you for your answer

queen path
#

Hello there, so currently im getting this error, it seems like something is broken with minimessages?

#

This is where the error appears to come from? (Line: 39)

narrow pagoda
#

Update Velocity CatYes

queen path
narrow pagoda
#

on the server lol

queen path
#

Lol

#

Updated my project to 3.1.1 but the same error:

wanton tangle
#

is it possible to block commands for players on a specific server only?

#

oh found the PermissionsSetupEvent. that should do it

fossil sundial
#

The old velocity website is a bit problematic nowadays; we can’t exactly change it atm

queen path
fossil sundial
queen path
fossil sundial
queen path
#

ah okay!

wanton tangle
#

Why is the event.getSubject() of PermissionsSetupEvent of type VelocityConsole and not always Player?

#

ok guess I'll have to add an exception for that

fossil sundial
hollow sleet
#

Hello, how to switch player's server from a spigot server please?

bold wharf
#

use the bungee messaging channel

hollow sleet
bold wharf
#

yes

#

velocity implements that channel itself

hollow sleet
#

so it's working like this?

bold wharf
#

No

#
  1. wrong channel name, there is an example pinned somewhere or something
#
  1. you still have to actually follow the bungeecord channel spec, just sending a server name is gonna do nothing
hollow sleet
#

okay thanks, but where can I find the channel name

bold wharf
#

it was like bungeecord:main or something for 1.13+

hollow sleet
#

okay thanks

slow thistle
#

Is it possible to do something like in the spigot api where you can do ChatColor.translateAlternateColorCodes()

bold wharf
#

adventure was built this half of the decade

#

use the legacy component serialiser

slow thistle
#

Could you give me a link to where I can learn more about it?

atomic leafBOT
slow thistle
#

Thanks

fluid oxide
#

Idk where to write this exactly but a Velocity Version of a Waterfall / BC plugin needs to be completely rewrote?

bold wharf
#

depends on how the plugin was designed, but, generally, yes

magic forum
#

@fossil sundial I got server switching to work

#

It is possible to to avoid using a reset packet

fossil sundial
#

Now we only need a platform to put it on

magic forum
#

Yeah, but there is a but

#

the forge servers must be identical if you are gonna switch from one forge server to another

#

So it will still work for load balancing

#

I hope I didn't disappoint you

magic forum
vestal prawn
#

?

restive idol
#

hi, is possible to run a server from velocity? i use Runtime.getRuntime.exec pointing to the right directory but seems that it won't run anything

restive idol
#

thanks for helping

normal blade
burnt dragon
#

why on earth are you implementing proxy server

normal blade
#

uh i assume that's bad

burnt dragon
#

yes

normal blade
#

sorry, i'm new to velocity's api and just java in general 🥲

wanton tangle
#

what does this means: Playername has disconnected: multiplayer.disconnect.missing_public_key and how to fix?

normal blade
#

That isn't related to Velocity plugin development.

wanton tangle
#

mhmm Im getting this because of my plugin though

normal blade
#

Did you disable force-key-authentication?

wanton tangle
normal blade
#

Then restart

wanton tangle
normal blade
wanton tangle
normal blade
#

Here's the current config

wanton tangle
#

looks like the issue is related to 1.19.
I'll try your fix thanks

valid gazelle
#

What's the proxyServer variable there intended to contain

normal blade
green niche
#

is it possible to use kotlin for plugins? Cuz i cant get .json file generated in jar

valid gazelle
rich hawk
#

use kapt

normal blade
green niche
rich hawk
#

the annotation processor

bronze yoke
#

com.velocitypowered:velocity-api:3.1.2-SNAPSHOT

green niche
#

well IDs must start alphabetically, have alphanumeric characters, and can contain dashes or underscores.

bronze yoke
#

what does your @Plugin look like

#

because your plugin id must be lowercase

green niche
#

oh

#

rly?

bronze yoke
#

yes

#

the name doesn’t have to be

#

just the id

green niche
#

will try thx

#

@bronze yoke @rich hawk thank you very much!

wanton tangle
#

Do I have to close previous connection after forwarding/redirecting the player to another server in ServerPreConnectEvent with event.setResult(ServerPreConnectEvent.ServerResult.allowed(newServer));

#

Im not even sure if forwarding like that works?

#

But since this is on the server pre connect event, there shouldnt be a connection yet...

wanton tangle
#

Players get disconnected when doing it this way though... it says read timeout.

#

possible bug?

#

🐛

cloud iron
#

Heyo! Is it possible to get a connected server's logger through Velocity?

fossil sundial
fossil sundial
# wanton tangle Players get disconnected when doing it this way though... it says read timeout.

I think you’re confused as to what you’re doing here. Velocity will itself handle all of that. The connection to a possible old/previous Server gets automatically aborted on the https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/event/player/ServerConnectedEvent.html

fossil sundial
#

This may clear that up a bit:

#

To set the first server velocity attempts to connect you to use the PlayerChooseInitialServerEvent

#

If a player gets kicked or disconnected from a server you can listen to the player kicked event

#

And only if the player uses the command /server or the bungee channel is used by the server of another plugin is trying to connect the player somewhere else
Then is the only time ServerPreConnect is fired without your plugin having made the decision

fossil sundial
wanton tangle
fossil sundial
wanton tangle
fossil sundial
#

if there is none then you made the client wait for too long

wanton tangle
fossil sundial
#

I assume this only happens on first connection?

#

Cause this code doesn’t cause it for me

wanton tangle
#

its the first join on the proxy yes

fossil sundial
#

there’s a hard 10s limit to join first. This is a known problem which is why I suggested you use the PlayerChooseInitialServerEvent

#

we cant fix that

wanton tangle
fossil sundial
#

Its a client limitation. From the first packet the client sends to the client joining must not exceed 10s or the client will abort the connection

wanton tangle
fossil sundial
#

I don’t know what to tell you. But I myself can’t reproduce your problem

#

and the client hitting the limit is the only reason you’d get a timeout here

#

How long are you holding the event for?

wanton tangle
wanton tangle
wanton tangle
scarlet lake
#

currently velocity only validates that chat messages are sent in order but ignores command packet timestamps, is that intended? the vanilla server checks both

fossil sundial
fossil sundial
# wanton tangle which version of velocity were u using?

1.19 servers, 1.19 client, velocity 3.1.2-SNAPSHOT, latest build

package me.fivepb.testplugin;

import com.google.inject.Inject;
import com.velocitypowered.api.event.player.PlayerChooseInitialServerEvent;
import com.velocitypowered.api.event.player.ServerPreConnectEvent;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import org.slf4j.Logger;

@Plugin(
        id = "testplugin",
        name = "Testplugin",
        version = "1.0-SNAPSHOT"
)
public class Testplugin {

    @Inject
    private Logger logger;

    @Inject
    private ProxyServer server;

    @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
    }

    @Subscribe
    public void onPreConnect(ServerPreConnectEvent e){
        e.setResult(ServerPreConnectEvent.ServerResult.allowed(server.getServer("survival").orElseThrow()));
    }

    @Subscribe
    public void chooseInitial(PlayerChooseInitialServerEvent e) {
        e.setInitialServer(server.getServer("lobby").orElseThrow());
    }
}

cannot reproduce.

#

the choose initial is just there so you see that the original server is not the same server

#

you can remove that, no change

wanton tangle
#

try running it with these:

player-info-forwarding-mode = "modern"
force-key-authentication = false
forwarding-secret-file = "secret.txt" 
#

When trying it with player-info-forwarding-mode = "none" (default) I get directly kicked with Unknown login plugin response packet! message.

fossil sundial
wanton tangle
fossil sundial
#

It is something with the server you’re being sent to if nothing else

#

Try another server

wanton tangle
#

The only thing I can think of is another event of my plugin interfering somehow...

fossil sundial
#

I can’t reproduce your issue.
Also your use is unsupported (piracy).
If you find a way to reproduce it with a supported setup and it is indeed caused by velocity then please open a new issue on GitHub

wanton tangle
fossil sundial
#

Those run in sequence
PreLogin > PermissionSetup > ServerPreConnect > ServerConnected

#

I left out the events that are fired between them

wanton tangle
#

Another event is interfering

#

Now going to add one event after another and find out which one

#

brb

#

found the culprit... @fossil sundial I thought u could do long running stuff on the ServerConnectedEvent

#

guess i gotta use the postserverconnectedevent

#

nevermind. the stuff I was doing in that event has to be done in async

#

thx for the help

restive idol
#

how can i get the server name from an argument?

#

optional reports that is empty while it isn't

cobalt dove
#

how to get backend server online? only ServerPing?

final lynx
#

anyone know how I can disconnect a player with a displayed component without printing it out on the console? Or print out the console with a shorter version instead of the component shown to the player

burnt dragon
#

just log something to the console before you disconnect them?

final lynx
#

i mean it still shows "ABC disconnected: (long reason)"

burnt dragon
#

well yeah but that solves your issue of "unreadable thing being printed to console"

magic forum
#

When that's done, V0.2 is released

#

This is very inefficient way, It donwloads the handshake AGAIN just to check if it's still the same as before (because the server admin could have restarted the server to updated a mod in the meantime and the handshake would then be different)

#

This can happen, so I want to use checksum to make sure the server hasn't changed, and not have to download the entire handshake every time someone wants to switch servers

#

Also right now it just prints "Resync" needed in the console. This is a placeholder for what I'm gonna do I V0.3, which is this "kick to reset"-packet

#

Because ping forwarding is not high priority right now

#

So

#

that's the plan

agile ore
#

Does anyone know what might be causing this?

#

Disconnect packet works normally

#

But there's a tineout on clientside

wanton tangle
#

Does stuff executed by the proxy.getScheduler() get executed in async?

fossil sundial
tired quarry
#

literally such a dumb regression that they literally know about

magic forum
#

I'm trying to make the workaround as invisible as possible

bold wharf
#

Reset packet induces a unstandard state transition that forge agreed they didn't wanna deal with years ago, especially as it woulda caused issues across the board with nothing expecting that and proxies being shaky as all shit back then

magic forum
#

I have looked at how forge works and have adapted my plugin after that to make forge as stable as possible

#

My plugin keeps track on forge snapshots config files and modlists and maneges them so the client always is synced

buoyant dust
#

Does velocity support plugin message like bungeecord to move players between servers?

bronze yoke
#

yes, it supports the bungeecord channel

buoyant dust
fossil sundial
#

@brisk steeple heads up
The 1.19.1 update will add modern forwarding v3 to Velocity

v2 has the Revision 1 player key type
v3 has the Revision 2 player key type

  • the uuid it is signed against (if present)

If you ask for v3 you may get a v2 response.
The revision 1 key from 1.19(.0) is unusable on 1.19.1 so you must ignore it on that server version

This scenario may happen if you have ViaVersion somewhere in the pipeline but is technically still valid

Thanks for fabricproxy-lite!

#

Ping me if you have questions about it

brisk steeple
#

ok

agile ore
agile ore
#

anyone

#

;-;

bold wharf
#

the client has an idle handler on the network connection

#

you have 30 seconds to start sending packets to the client from when the thing connects before it DC's

agile ore
#

well the backend server sends packets but it doesn't seem like velocity forwarded them

#
net.minecraft.network.handshake.client.C00Handshake@7bde6b57
net.minecraft.network.login.client.C00PacketLoginStart@2cfe1362
net.minecraft.network.login.server.S03PacketEnableCompression@2634d717
net.minecraft.network.login.server.S02PacketLoginSuccess@1b637b4f
#

im only receinvg these packets on my client

#

and backend logs say that the client has connected

bold wharf
#

yea, those packets are only handled between the proxy and the server

#

you can't send login start to a client which is already joined, etc, and so velocity manages that mess

#

you basically need to get the client into the play state within a reasonable amount of time

agile ore
#

Does Velocity has it's own config management? Or should I just use Gson?

fossil sundial