#velocity-dev

164 messages · Page 6 of 1

oblique haven
#

I’m also not entirely certain that there isn’t protocol changes. I’ll go check the change log and see if there’s anything velocity interacts with which would be a concern. doesn’t look like anything velocity would mess with

fervent mantle
#

Hi, I've a problem with the API: when a message breaks, the color resets

oblique haven
fervent mantle
#

maybe it's because im using the § (so legacy colors)? The code is simple Component#text

oblique haven
#

That’s probably why you’re seeing the color messed up

fervent mantle
#

so i must use minimessage's colors?

oblique haven
#

You could even try using the LegacyComponentSerializer

#

That’d probably work better

fervent mantle
#

yeah, that's right

oblique haven
#

I highly discourage it

#

The legacy component serializer at least puts it into proper components from what I understand

fervent mantle
#

ik, i'll use the & with the legacycomponentserializer

oblique haven
#

👍

fervent mantle
#

LegacyComponentSerializer#legacyAmpersand.deserialize()
Is this the correct use for the & symbol right?

oblique haven
#

Seems right

maiden hawk
#

it looks like, color does not get transfered to a new line

#

tho you can do some workaround around the issue

#

or use minimessage

bold wharf
#

that's nothing to do with the API but down to how newlines work

#

do NOT mix legacy and modern text together

maiden hawk
#

fuck, sorry for the ping

bold wharf
#

parsing it properly is not mixing

maiden hawk
#

btw, can minimessage work together with legacy?

bold wharf
#

MM doesn't parse legacy

maiden hawk
#

well

#

fuck

fervent mantle
#

with the LegacyComponentSerializer seems working fine

maiden hawk
#

Does it?

#

So you can just mix those together?

bold wharf
#

components are compnents

#

the serialiser that you use to create those individual components is irrelevant

maiden hawk
#

Could I (in theory) make a serializer which would convert legacy to minimessage and then pass it to minimessage's one?

#

I would love to use the benefits of it, but I would also appreciate the legacy codes

bold wharf
#

I mean

#

it'sboth of those formats have serialisers

#

there is literally nothing stopping you deserialing and then serialising to the other

#

not to mention that MM has things like placeholders, etc

maiden hawk
#

fck another ping

#

I am trying, trust me

burnt dragon
#

i mean you could arguably just do a find and replace tbh

maiden hawk
#

However I see a single issue I don't

#

Gonna do that, I will report how it ends up

#

hex colors are gonna be a bit of a hassle tho

topaz cypress
#

For some reason GeyserMC players can see the server in their servers list, but once they join it kicks them, any ideas why?

#

Reason in console "CLOSED_BY_REMOTE_PEER"

maiden hawk
#

is there any exception visible in the console?

topaz cypress
#

"[geyser]: Bedrock user with ip: /(Blocking this IP out for reasons) has disconnected for reason CLOSED_BY_REMOTE_PEER" is all it says.

#

[floodgate]: Floodgate player who is logged in as Nathan4031 00000000-0000-0000-0009-01ffeed6a406 joined
27.02 19:16:37 [Server] INFO [floodgate]: Floodgate player logged in as Nathan4031 disconnected
27.02 19:16:37 [Server] INFO [geyser]: Nathan4031 has disconnected from the Java server because of Connection closed.
27.02 19:16:37 [Server] INFO [geyser]: Bedrock user with ip: /(Once more not showing the IP for reasons) has disconnected for reason CLOSED_BY_REMOTE_PEER

bold wharf
#

all that says is that the server closed the connection

#

or, maybe not, the wording of that stuff is weird

#

all i can say is that something closed the connection

topaz cypress
#

I have installed floodgate velocity + geyser and set it up the way it should be, but IDK what else could be the issue.

maiden hawk
topaz cypress
#

I just check and I am 100% sure that my geyser is fully setup, but it doesn't seem to work.

sacred musk
#

Is there any way to set ping response description field as raw string instead of TextComponent?

burnt dragon
#

you can use the gson component serialiser if you've only got raw components as strings to use

maiden hawk
sacred musk
#

Some external things like server lists pages didn't implemented handling server motd as TextComponents and I want to pass it like Bungeecord do, as raw string

#

But as I assume it isn't possible by Velocity api

long kelp
#

im getting this error when i try to load my plugin anyone know whats going on?

#

this is my main class

spice dagger
#

I got this error

#

Address already in use: bind

long kelp
#

do you have a duplicate instance of your server?

long kelp
#

hmm

#

have you ran your server before but closed the command prompt?

long kelp
#

try going into task manager and closing any existing java instances

#

closing a server by just exiting out of command prompt is a bit buggy

#

sometimes it doesnt register with the java runtime to close the program

#

so the instance stays open occupying the port

spice dagger
long kelp
#

alternatively sometimes you can actually connect to the instance

#

if you can do that then try running /end

long kelp
#

anyone know why its telling m that my class doesnt implement a registrable command subinterface

#

even though it does

spice dagger
long kelp
#

lel

#

its not me btw

#

its an image i took off of (french accent) le googel (french accent)

robust mural
long kelp
#

i replaced simplecommand with command because arguments were being odd

#

do i have to change the way im registering the command?

robust mural
long kelp
#

cause rn im registering it with commandManager.register("maintenance", new MaintenanceCommand());

#

hmm

long kelp
robust mural
#

You can implement RawCommand, SimpleCommand or BrigadierCommand

long kelp
#

i see

#

cause thats whats listed on the front of the velocity page

spice dagger
#

how do I add velocity to falixnodes??

long kelp
#

how do you make a velocity server on a panel?

#

@spice dagger isnt falix a free host?

#

you need atleast 3 servers to create a network. if you have 3 servers then its pretty straight forward. just follow the velocity installation guide

spice dagger
long kelp
#

its pretty much the same with every host

#

as long as you have access to the console

#

if you know how to do it on a localhost server

#

doing it on a server host is about the same

spice dagger
long kelp
#

then this is your issue

spice dagger
#

and it gives errors when default install

long kelp
#

if falix doesnt allow custom jars then installing a custom jar is out of the question

#

if the install provided by falix is broken

#

then thats another issue

#

try contacting falix support

long kelp
#

is it possible to write to a toml file?

oblique haven
long kelp
#

wait velocity writes to the toml file?

#

time to go through velocity source code to figure out how it does that

oblique haven
long kelp
#

except creating and reading from a file is different from writing to it

#

nvm

#

writing to a toml file is about the same as writing to any file using java

#

shoulda realized this :\

oblique haven
#

I think Velocity uses Configurate internally

craggy pecan
long kelp
#

Yeah I fixed the issue

craggy pecan
valid gazelle
#

Where's the new wiki?

long rock
inner surge
#

How can I remove the change screen when changing server

burnt dragon
#

you can't with velocity by default and really you shouldn't

inner surge
#

Why not with velocity

bold wharf
#

I mean

#

"why not" in general, the thing requires messing with a good chunk of the client state in order to work

#

i.e. it's gotta manually despawn entities and other stuff and many plugins pulling that mess have been buggy af

maiden hawk
inner surge
#

I believe so

#

It's also possible with velocity, but you gotta mess with some shit basically src

#

@maiden hawk

maiden hawk
#

I mean it would be sick

#

but I imagine it would be well, messy.

#

as cat said, you would need to clear the world manually

bold wharf
#

I mean, if you can find a plugin to do it, you can do it on any platform

#

Just, like

#

people generally haven't bothered to recreate all the stupid ass plugins yet™

#

so, there is probs no plugin for it yet

maiden hawk
#

I mean

#

Is there really any practical reason to do this?

#

Players don't care about the screen when changing worlds

#

why would they now?

inner surge
#

there is

maiden hawk
#

and which?

inner surge
#

can't say

#

under nda

maiden hawk
#

fr?

#

I mean

inner surge
#

yep

#

job

maiden hawk
#

I can't think of a single reason

inner surge
#

there's

#

tahts why im bothering so much

#

it wil be hella work

maiden hawk
#

I don't believe that you need to really do this

#

maybe the xyproblem?

atomic leafBOT
torpid panther
#

has anyone else experienced this?

#

the build of velocity before that commit works just fine

#

seems like this was mentioned earlier here in this chat too, but that was ignored.

oblique haven
torpid panther
#

it may be that the packet isnt being forwarded back to the server

oblique haven
#

Maybe it’s due to the origin logic being messed with?

torpid panther
#

velocity just eats the packet

oblique haven
#

The only other thing that the PR touches other than S2C is the origin logic - so that’s the only place I’d think it could sit

#

Velocity has its own ResourcePackStatus event, can you check if that’s called and print out all the fields of the event

#

Might give us more info on what’s going on

torpid panther
#

i do not really know how to write plugins for velocity.

#

havent ever done it

oblique haven
#

I can probably take a look this weekend, feel free to just make an issue in the GitHub about it

torpid panther
#

will do

long kelp
#

anyone know what im doing wrong? i cant use @override and i cant find anything for tabcompletion on simplecommand

oblique haven
#

args are held in the invocation

long kelp
#

oh

#

thanks

oblique haven
heady swallow
#

is there a method that can be used to restart the proxy

craggy pecan
heady swallow
#

alright, ty

halcyon jackal
bold wharf
#

that more looks like you never shaded it

halcyon jackal
#

I did tho

#

Haven't pushed the change yet, but added this line to the pom.xml of the velocity module in hopes it would work....

<relocation>
    <pattern>net.kyori</pattern>
    <shadedPattern>com.andre601.oneversionremake.core.dependencies.adventure</shadedPattern>
</relocation>
bold wharf
#

that's just a relocation

#

you have adventure api marked as provided

burnt dragon
#

you also can't just shade+relocate your own adventure-api and use native methods for components

bold wharf
#

not to mention you'd need to use platform too ^^

burnt dragon
#

and sadly there isn't a velocity platform so :')

bold wharf
#

o o f

burnt dragon
#

submit a PR to update adventure?

bold wharf
#

was there any API breaks? thonk

burnt dragon
#

nope

#

one line pr tbh :')

bold wharf
#

if no ABI breaks then i don't see why not

halcyon jackal
#

From what I know did at most the minimessage module break in some way

burnt dragon
#

wasn't a breaking change as there was no release

halcyon jackal
#

Like MiniMessage.get() became MiniMessage.miniMessage()

halcyon jackal
burnt dragon
#

snapshot builds are allowed to break as much as they want, that's how semver works

halcyon jackal
#

There was...

burnt dragon
#

as soon as you make a release, then semver comes into play

bold wharf
#

There was no ABI breaks between the releases of adventure

#

ABI breaks in the snapshots in the meantime or other components are irrelevant

halcyon jackal
#

So what now? Simply PR to bump the version?

burnt dragon
#

yup

halcyon jackal
#

mkay... Will see if I can manage that xD

narrow gate
#

Can I do PR to add Kotlin Symbol Processing (kotlin's analogue for annotation processing) to velocity api?

#

basic kotlin annotation processing executing 8 times slower than ksp

wicked stag
#

@bold wharf can we continue the discussion here about pr #657 i have a really bad connection now and it makes hard to use the github page (that was the reason for the duplicate message too)

bold wharf
#

no-ping

#

The vhost getHostString just returns the string that was passed into the unresolved socket thing

#

if extra crap is getting in there it's further up and should be in the more general cleaning logic, but I question how such mangled stuff got in there

wicked stag
#

when i used the official client it had the /<unresolved>:XXXXX part

bold wharf
#

and, how are you seeing that?

#

where from?

#

is the only place where that's added in

wicked stag
#

in the issue i posted a simple plugin that logged this info

bold wharf
#

and, velocity doesn't use toString

#

conn.getRemoteAddress().toString()

#

that's why you're seeing the /unresolved

wicked stag
#

but i made another version which looks like the velocity internal:

@Plugin(
        id = "handshakemonitor",
        name = "Handshakemonitor",
        version = "1.1-SNAPSHOT"
)
public class Handshakemonitor {

    @Inject
    private Logger logger;

    @Subscribe
    public void onHandShake(ConnectionHandshakeEvent e) {
        InboundConnection conn = e.getConnection();
        logger.info("{} -> {}", conn.getRemoteAddress(), conn.getVirtualHost().map(InetSocketAddress::getHostString).orElse("").toLowerCase(Locale.ROOT));
    }
}
#

and got the same result

bold wharf
#

what result?

wicked stag
#

domain/<unresolved>:XXXXX

bold wharf
#

I'd need to see it

#

cos, the only way that /unresolved gets in there is from a toString on the address object

#

so something somewhere else is screwing that one up

#

what you PR'd doesn't make sense given how getHostString works, if getHostString returns a thing with the unresolved in it, something is mangling it elsewhere

wicked stag
#

if you want i can send you the unmasked log in dm

bold wharf
#

I don't accept DMs

#

you'd need to send it to pencil but might need a paste.gg link or something, idr

wicked stag
#

then i'd prefer to not publicly expose my backend ip

#

but yeah the getHostString does return more than just the domain

#

and the fix just removes that data if it present

bold wharf
#

the fix if that's the issue is in the wrong place

#

But, I don't see how that could be the issue

wicked stag
#

but getHostString is a builtin java method, so i can't see another possible fix

bold wharf
#

getHostString is a builtin java method which returns the hostname set when createUnresolved is called

#

if that s returning a string with /<unresolved>, there is an issue higher up

#

No

wicked stag
#

when i used a cli chat client to test it (can't run mc on a rpi) i got the base64 data

maiden hawk
#

I can try to test it if you want

bold wharf
#

the thing only appends :port on the end of the hostname

maiden hawk
#

Couldn't that also cause the issue?

bold wharf
#

well, no

#

I mean

#

toString only appends :port on it

#

at least to me that sounds like something installed on the proxy is scuffing the hostname

maiden hawk
#

hmmm

wicked stag
#

you mean plugin installed?

maiden hawk
#

I can try to run a bare proxy without any plugin, except the hostname shower and then try to connect with notchian client?

bold wharf
#

well

#

plugin

#

the cli client

wicked stag
#

i tried it without plugins and it had the same issue

maiden hawk
#

even with notchian client?

bold wharf
#

Well, what's the contents of the handshake packet?

maiden hawk
#

is the cli chat client open source?

wicked stag
#

oh yep, forgot to send it

maiden hawk
#

According to wiki.vg the hostname sent should be:

Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a simple redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide example.org as server address in addition to connecting to it.
maiden hawk
#

oh wait

#

it is C#

#

Well that shouldn't be that off from Java right?

#

ok looking on the source, the cli chat client sends the server address obtained from this method:

        public string GetServerAddress(string serverAddress)
        {
            if (ForgeEnabled())
                return serverAddress + "\0" + forgeInfo.Version + "\0";
            return serverAddress;
        }
#

Maybe here is the issue?

#

while serverAddresss is the bare thing inputted by the user

#

Or at least I think

wicked stag
#

it's not about debugging the chat client as the issue started with the vanilla client

maiden hawk
#

wait

#

so the issue is also present with the vanilla client?

#

I thought you couldn't test it

wicked stag
#

i just used the chat client to continue working on the issue because the only available thing for me at the moment is a rpi4

maiden hawk
#

Shouldn't the rpi be able to run Minecraft?

wicked stag
#

in theory yes, in practice no

maiden hawk
#

you have the low memory version?

wicked stag
#

more like driver issues, video performance is also bad, like i can't watch a youtube video nor an mp4 file without tearing and low fps

#

but 4gb version

maiden hawk
#

understandable

#

Imma try it for you

wicked stag
#

ty

maiden hawk
#

However, I can only test this on localhost

wicked stag
#

well i think it should work the same or at least similarly

maiden hawk
#

gonna use build #115

#

done, booting up minecraft

#
/127.0.0.1:44204 -> localhost

This is what gets printed

#

Weird

#

I am using latest build, notchian minecraft 1.18

#

gonna try what happens with fabric

#

The same thing

#

Maybe there's an issue somewhere else in the chain?

wicked stag
#

it might only happen with domains or a specific java vendor?

#

idk if anything else could affect it

#

or maybe linux/windows

#

i run the server in quay.io/parkervcp/pterodactyl-images:debian_openjdk-15-hotspot

maiden hawk
#

@wicked stag Please take a look on my latest comment on the PR, what do you think of my theory?

wicked stag
#

i found that description too and i have no idea how can String form of the address look like domain///XXX.XXX.XXX.XXX:XXXXX///XXXXXXXXXX///long-base64-encoded-binary-data

#

where the part after the domain is the source ip port

#

and idk what is the number and base64 binary data

#

or another solution is to keep the server address field from the handshake packet as a string and use that for getting forced hosts

#

that way there couldn't be a single thing affecting the final string representation of the host

maiden hawk
#

good catch

#

I thought that velocity used the hostname in the packet first

bold wharf
#

it does use the hostame from the handshake packet

#

you can follow that logic around

maiden hawk
#

I am blind then

wicked stag
#

but it gets converted to InetSocketAddress at some point

maiden hawk
#

gimme a while

wicked stag
#

also is there any benefit of using InetSocketAddress instead of a string?

maiden hawk
#

sorry for the misunderstandement

#

this is really weird

#

can you try and deploy this on production noel?

#

So we can see where the issue is?

wicked stag
maiden hawk
#

Well I would want to see what InetSocketAddress#getHostString spits out in your case

#

because as I've said, it behaves normaly on local

wicked stag
#

give me a minute

#

or a few

#

brb in about 15min

wicked stag
#

@maiden hawk i modified the plugin to this:

@Subscribe
public void handler(PreLoginEvent e) {
    InboundConnection conn = e.getConnection();
    String vhost = conn.getVirtualHost().map(InetSocketAddress::getHostString).orElse("").toLowerCase(Locale.ROOT);
    if (vhost.contains("mct")) {
        e.setResult(PreLoginEvent.PreLoginComponentResult.denied(Component.text(vhost)));
    }
}

the server is available at test-a.mct.noelnemeth.com and test-b.mct.noelnemeth.com

maiden hawk
#

should I join?

wicked stag
#

it will respond you with the host string

maiden hawk
#

I see

#

just please, don't share my IP

#

oh shiiit

wicked stag
#

don't worry i didn't plan it 😄

maiden hawk
#

test-a

#

I will write a response to the PR stating our findings, ok?

wicked stag
#

ok

maiden hawk
#

which build of velocity do you use?

wicked stag
#

latest dev/3.0.0 which has my fix

maiden hawk
#

ok

#

btw, can you please try to parse that base64 string? My client didn't log it and I am too lazy to write it by hand

#

I just want to make sure that my ip isn't there

wicked stag
#

i can dm it to you

#

but it's binary data

maiden hawk
#

pheeew

#

well guess I will have to risk it

#

nowadays, anyone has your ip anyway.

wicked stag
#

actually i need to remove test-b i ran out of available domains on tcpshield 😄

#

i leave test-a up for a while

#

until i need one more domain

wicked stag
#

yeah i'm on free plan, since i just occasionally host servers for friends

maiden hawk
#

do you need tcp shield then?

wicked stag
#

chinese script kiddos will find the backend ip and bruteforce or dos everything

maiden hawk
#

really?

#

I've never met with that

wicked stag
#

that's why i started using tcpshield and cloudflare

maiden hawk
#

I use cloudlfare all the time

#

but it sucks they only proxy HTTP and WS

wicked stag
#

until i found tcpshield i proxied mc over websockets XD

maiden hawk
#

I will pretend I didn't see that

wicked stag
#

it worked surprisingly well

#

like 40ms ping

maiden hawk
#

GJ I guess

wicked stag
#

anyways i'm happy with my fix so i'll leave it for the velocity team to decide how they want to fix it in the official version

maiden hawk
bold wharf
#

wait

#

you've been using TCPShield all this time?

maiden hawk
#

wait

#

that could explain

wicked stag
#

yep

maiden hawk
#

everything

wicked stag
#

why?

maiden hawk
#

I didn't realize :D

bold wharf
#

...........

#

so

maiden hawk
#

they could do some whacky stuff

bold wharf
#

I mean, based upon the fact that they have a plugin to literally cleanup the handshake packet...

bold wharf
#

TCPShield literally has a plugin

maiden hawk
#

To his defend, many (mostly professional networks) use it, so I think something like official support would be appreciated by many

bold wharf
#

That fix is bad anyways, as I keep saying

wicked stag
maiden hawk
#

wait

#

really?

#

Hmmm

bold wharf
#

Yes

maiden hawk
#

so tcp shield isn't the cause?

bold wharf
#

The literal statement here is that the things returning mangled data

maiden hawk
#

yes

bold wharf
#

which, cleaning that out in a very specific case is not the proper solution

#

you'd need to clear the entire thing

half locust
maiden hawk
#

but noel says that tcp shield wasn't enabled at the moment of testing

bold wharf
#

and, idk if we should be maintaining crud to deal with oddball platforms

maiden hawk
bold wharf
half locust
#

eh it works (somehow), but the fact that it does is frankly shocking.

bold wharf
#

that's LITERALLY their format.

maiden hawk
#

now I am confused

wicked stag
#

oh

maiden hawk
#

Well

#

that's a mystery solved

wicked stag
#

so the cleanup doesn't happen before the decision made about the server?

maiden hawk
#

wait

#

Now I am 2 times confused

wicked stag
maiden hawk
wicked stag
#

the plugin removes that information late or it doesn't even remove it idk

bold wharf
#

You need their plugin to clean up that stuff

maiden hawk
#

the plugin should remove it before the server choose stuff happens

#

do you have it installed noel?

half locust
# maiden hawk Is it that bad?
  • Every interaction opens a new SQL connection
  • Classes nested in if statements (didn't even know that was posible)
  • massive "util" class that does everything from SQL connections to formatting
maiden hawk
#

I am going to remove that thing ASAP from my server

wicked stag
maiden hawk
maiden hawk
#

Well that's mystery solved

half locust
#

iirc yes 🙂

maiden hawk
#

I refuse to believe it

#

I hope it is at least async, right?

#

well, the good thing is, I use sqlite for coreprotect

half locust
#

given my server never lagged to death, yes

#

same

maiden hawk
#

ikr cringe

half locust
maiden hawk
#

wtf

#

you might consider doing a purge

#

storing a 100GB CP DB on your Desktop seems like a horrible idea tbh

wicked stag
#

@maiden hawk could you try now that i have re-enabled tcpshield plugin?

maiden hawk
#

okay

half locust
maiden hawk
#

ok lol

#

why don't you do a purge?

half locust
#

anyways should move this to #general if you want to continue before cat or someone yells at us

maiden hawk
#

true

wicked stag
wicked stag
#

yep, please

#

oh, nvm

maiden hawk
#

?

wicked stag
#

it should work since it's running the modified velocity version

maiden hawk
#

yupp

wicked stag
#

the base setup was tcpshield plugin with official velocity, which didn't work

#

but the plugin rewrites the packet so it should work

maiden hawk
wicked stag
#

maybe the server decision is made before the rewrite?

maiden hawk
#

Looking at the source, the event in which their plugin operates

#

should be fired before server choosing begins

#

Maybe it is a nonblocking event? Therefore the proxy doesn't wait for its execution and just continues doing its job, possibly being faster than tcpshield?

heady swallow
#

am I able to send a player to a specific world inside a specific server, or am I just able to send the player to the server and the server handles what world

bold wharf
#

no, but, yes

#

the proxy can't control where people are in a server, etc

#

but, nothing stopping you sending a message to the server of which you have some plugin on the server to send people there or whatever

heady swallow
#

could you guide me in the right direction of sending a message from what you described?

light kettle
#

gives me this error

oblique haven
light kettle
#

yes but it never gave problems

oblique haven
#

try removing plugins 1 by 1 until it stops, it looks like it's being caused by a plugin

#

I'd start with any stats plugins and stuff like that

bold wharf
#

best guess is make sure that you used the correct jar

#

though, I mean

oblique haven
bold wharf
#

if it loaded that far one would assume it's gotta be

#

Yea, probably

oblique haven
#

I smell that bstats changed and a plugin didn't upload

#

but we'll see

oblique haven
#

@bold wharf added a quick hotfix to another spotty location in the resource pack send, it was queuing the initial resource pack rather than the intended one received from the event, which could also cause this issue, just a heads up that it's another piece post your review

maiden hawk
#

oh no

#

you pinged cat

#

you are going to be sent to hell

oblique haven
oblique haven
steady trellis
maiden hawk
#

This is kinda awkward but can someone please take look at #637?
I kinda need it fixed, so I don't need to use my fork.

gleaming ore
#

How difficult would it be to make an API for sending spawn and destroy packets, is there anything in velocity that allows you to do this? Trying to implement a server side player culling system.

agile ore
#

well, this is my code right now:
@Subscribe public void onLogin(final PostLoginEvent e) { ProxiedPlayer p = e.getPlayer(); String hostName = p.getPendingConnection().getVirtualHost().getHostString();
can someone help me with this?
How can I let the player issue a command with velocity?

oblique haven
gleaming ore
#

Ah, I figured. Is there any place I should put that functionality in when I fork it? Didn't know if there was a packet manager class. Sorry if my question is ignorant, not familiar with the codebase.

oblique haven
#

I’d recommend looking at how the other packets are drawn up, but it’s called something Registry

gleaming ore
#

Never mind, I found it in Velocity/proxy/src/test/java/com/velocitypowered/proxy/protocol/PacketRegistryTest.java Is this what you were referring to?

oblique haven
gleaming ore
#

Perfect, thanks a ton!

#

Im assuming theres no docs for this?

maiden hawk
maiden hawk
#

Most things are in JD

#

but that's really only the api

bold wharf
#

get the command manager, map, or whatever it was called and use the execute method

#

(See the javadocs)

gleaming ore
# maiden hawk Are you sure that doing this is a good idea?

Ehhh, not sure, I told myself I would give it a day and see where I get. I really have no other good solution. Working to achieve 10k players in a world with minestom, which is the easy part but making client performance workable is the hard part, hence the dynamic culling

maiden hawk
#

why can't you do this directly from minestom?

#

btw, can minestom really handle that much?

#

Considering that even Velocity pbly cannot

gleaming ore
#

The performance overhead would be nuts probably with 10k players

bold wharf
#

minestorm basically does nothin on its own

maiden hawk
#

Ikr?

gleaming ore
#

Yeah it can

maiden hawk
#

That seems sussy

#

iirc, noone even managed to get 10k players with one velocity proxy

gleaming ore
#

Going to use multiple proxies, Ive been talking with the contributors over on their discord

gleaming ore
maiden hawk
#

visible_confusion it just seems weird that minestom could handle more players than velocity

gleaming ore
#

bandwidth should be fun 🙃

maiden hawk
#

I realize that minestom is really only a skeleton

gleaming ore
#

Yep, theres nothing to it

maiden hawk
#

But I would dare to say that it still processes way more data than proxy

bold wharf
#

proxies basically get weird, like, it's still gotta mutate stuff, it's still gotta copy data around, etc

gleaming ore
bold wharf
#

am sure that one could get velocity to handle that many players

gleaming ore
#

with one instance?

bold wharf
#

Just, you'd need to throw a ton of resources at it and that point you'd be better off just load balancing

gleaming ore
#

Yeah, makes sense

bold wharf
#

or, wait, would netty cope with that

maiden hawk
bold wharf
#

Like, I don't recall how efficent the selectors are

maiden hawk
#

they used 48c xeon

gleaming ore
#

You could probably do 10k on a mulan epyc then

maiden hawk
#

I believe so

#

But I think you would hit architectural limits

#

The thing is, noone has ever tried it

#

so we really don't know

#

but what are you trying to achive with having 10k players on a single server?

#

Btw, bandwidth will also be pain in the ass

gleaming ore
#

No idea on the specifics yet, it would be a one off event though. Some kind of gamemode like hide and seek etc.

#

Yeah ive already done the numbers on bandwidth, 10gbps minimum

gleaming ore
#

Gbps, I dont think any hosting providers offer that much haha

#

AWS maybe? I though they only do 50gbps

maiden hawk
#

I've found out, that you should count about 1Mbps for one connected player

#

so this makes sense

gleaming ore
#

This whole thing is a sorta long term project with a team im working with. Im just trying to figure out now where to steer things based of theoretical limits

maiden hawk
#

are you really sure you can obtain that much players?

maiden hawk
gleaming ore
#

Im not sure that its even possible to get 10k players in a server

maiden hawk
#

honestly

#

even 1k players on a single server seems like an incredibly dumb idea

#

there will just be huge chaos

gleaming ore
maiden hawk
#

And waste thousands of dollars

gleaming ore
#

It really depends on your game mode

#

?

#

Thousands off of what?

maiden hawk
#

dollars?

#

I mean

gleaming ore
#

Yeah how?

maiden hawk
#

don't tell me that infrastructure to handle this is going to be cheap

#

10k players is way more than it may seem

gleaming ore
#

Minestom is much better than you would think

#

Someone got 10k players running on a M1 macbook air lol

maiden hawk
#

Idk, but I am having my doubts on that

gleaming ore
#

Its wonderful when you dont have to use mojang code

#

Join their discord and ask around, theres a video of 7.5k bots running fine on a laptop

maiden hawk
#

Even handling that huge amount of network IO is going to be really expensive

burnt dragon
#

it's not really about mojang code - it's more about the fact that minestom doesn't do anything

maiden hawk
#

yup

gleaming ore
#

Well thats the whole point

maiden hawk
#

it's like body without brain

burnt dragon
#

sure there are some improvements/optimisations - but i doubt you'd get much better performance than a vanilla server if you re-implemented all the features

maiden hawk
#

^

gleaming ore
#

Obviously, Minestom isnt that at all, the point is to use it as a game engine of sorts

#

10k players in a survival world would be a nightmare

maiden hawk
#

the moment you start implementing features, the player count you can handle is going to drop drastically

burnt dragon
#

yeah ofc, i was just correcting what you were saying about mojang code :p

maiden hawk
#

While minecraft server code isn't the best (mostly because of the old codebase), it is still optimized pretty fine (especially with things like Paper)

gleaming ore
#

Gotcha gotcha, sorry was meaning that its nice when you dont have their code in the way, not that it was written poorly

burnt dragon
#

right yeah

gleaming ore
maiden hawk
#

tbh

#

it will be a miracle if you will be able to handle 1k players

#

tho I still don't understand how you want to obtain those in the first place

gleaming ore
#

Thats not really the point, the point is to develop efficient systems and server architectures that could handle those players

maiden hawk
#

oh ok

#

well glhf

agile ore
#

Hi, I am trying to create a universal plugin compatible with spigot, bungee and velocity, but I get the following error:

[23:10:12 ERROR]: Unable to load plugin plugins\XSBuildTest.jar
com.velocitypowered.api.plugin.InvalidPluginException: The plugin file XSBuildTest.jar appears to be a Bukkit or BungeeCord plugin. Velocity does not support Bukkit or BungeeCord plugins.
        at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.getSerializedPluginInfo(JavaPluginLoader.java:151) ~[velocity-3.1.1-98.jar:3.1.1]
        at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadCandidate(JavaPluginLoader.java:61) ~[velocity-3.1.1-98.jar:3.1.1]
        at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:92) ~[velocity-3.1.1-98.jar:3.1.1]
        at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity-3.1.1-98.jar:3.1.1]
        at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity-3.1.1-98.jar:3.1.1]
        at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity-3.1.1-98.jar:3.1.1]
[23:10:12 INFO]: Loaded 0 plugins```
Is there any way to solve it?
oblique haven
#

and is there a velocity-plugin.json file inside of the jar

agile ore
rich hawk
#

No

halcyon jackal
#

Where would I actually find out the latest version of the velocity API to use?

opaque escarp
#

Is there an approximate release date for Velocity 3.1.2*(Includes Minecraft 1.18.2 support, brings MiniMessage and Adventure-API 4.10.0 and a new event, which I would think is enough for a release)*? I already have 5 plugins that depend on Velocity's latest "SNAPSHOT" 😅

halcyon jackal
#

What new event?

violet meteor
#

Hi, anyone have an idea how to change the brand text in the client debug menu? Is there any java method for this?

I want to change "Paper (Velocity)" to something else.

craggy pecan
#

You will need to modify Velocity's source and compile it yourself. This has been discussed in the past, we don't understand why anyone would want to do that

burnt dragon
#

there is no way

#

velocity and paper and others don't provide api for removing attribution

violet meteor
burnt dragon
#

is that api

#

and is that velocity or paper

bold wharf
#

Its a plugin message

#

like, you basically just need to send the correct plugin message to the client

#

We're not gonna walk you through removing attribution, however

hollow sleet
#

hello, what is the difference for a command between Suggest and SuggestAsync pls?

ashen fiber
#

The one with async in the name does it asynchronously.

warm haven
#

Is 3.1.0-SNAPSHOT the latest stable version of Velocity?

burnt dragon
#

no

#

things that end in SNAPSHOT are not stable

warm haven
#

Make sense, but not stable but latest release that include MiniMessage 4.10.0

burnt dragon
#

3.1.2-SNAPSHOT

warm haven
#

Thank you!

slate hamlet
ashen fiber
#

I guess we have been lied to for years

#

Paper has never been stable.

ebon siren
#

rule #0 of foss programming: nothing is ever stable

fast cradle
#

Hi! Anyone know how to check if a player session is premium?

oblique haven
fast cradle
bold wharf
#

I mean

#

depends on the proxies config

#

then theres the UUID version

#

if you mean, you wanna make a plugin to do the hybrid auth mode thing, see the mc api docs

tired quarry
#

hybrid auth mode is spooky

maiden hawk
#

It is doable

#

but it has some issues

#

Main issue being, hitting Mojang API ratelimit

autumn kernel
#

Are all Adventure methods implemented in Velocity?

#

Stuff like playSound

sour current
#

Most are, except book/sound methods

autumn kernel
#

Oh well, that sucks

mighty herald
#

Anyone has an idea on how to code a sorted tablist for velocity?

maiden hawk
# autumn kernel Oh well, that sucks

The issue with sound is, that Velocity would need to track player's position, which would be pretty resource demanding. You can solve this by having a plugin on the server, and sending the sounds via plugin message channel.

craggy pecan
#

Then send them directly from the backend server, don't overengineer it

burnt dragon
#

you'd need to store a sound registry on velocity

autumn kernel
#

Why? You could just give the resource name of the sound

#

Or what do you mean?

bold wharf
#

not for everything

#

if you just wanna use the custom sound packet, yea, sure

#

but, that packet doesn't support all the expected features

autumn kernel
#

But thats still better than nothing, right?

bold wharf
#

We generally try to err away from half assed features

autumn kernel
#

Can't you also play a sound only for a player at the players position nowadays?

bold wharf
#

Yea, sure

#

but that'sliterally half assed and doesn't support everything

#

and, once again, we don't really wanna maintain half assed code

#

and, well, actually

#

that;s part of the issue

#

We don't know where the player is

autumn kernel
#

Isn't there a packet you can send to the player that spawns the sound where he is, without giving a position argument?

burnt dragon
#

yup

#

but again, that is not a named sound effect packet

maiden hawk
fiery sentinel
#

Hello!
I am trying at the moment to implement Velocity to my multi platform plugin.
This is my first time working with Velocity...

I read that @Plugin(id = "DiscordNotify", name = "DiscordNotify", version = "3.0.0", authors = {"TrueMB"}) Annotation should create a velocity-plugin.json. This doesnt seem to work, since I couldnt find it in the compiled jar.
I am using maven.

<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                      <encoding>UTF-8</encoding>

                    <annotationProcessorPaths>
                        <annotationProcessorPath>
                            <groupId>com.velocitypowered</groupId>
                            <artifactId>velocity-api</artifactId>
                            <version>3.0.1</version>
                        </annotationProcessorPath>
                    </annotationProcessorPaths>

                </configuration>
                
            </plugin>

PS. Sorry for the repost, just saw that i was in the wrong channel

bold wharf
#

I've literally never seen somebody specify the AP manually

#

that almost sounds wrong

fiery sentinel
#

tried it without as well 😄 Just wanted to make sure I am not making the mistake like ppl on gradle xD

maiden hawk
bold wharf
#

the compiler should already look at the classpath for annotation processors

maiden hawk
#

Send the entire pom.xml please

bold wharf
#

don't even need to with gradle last I knew

maiden hawk
#

Well it didn't work without it for me eShrug

bold wharf
#

kotlin?

#

oh, odd, apparently you do

#

at least for gradle

#

I thought the compiler dealt with that

maiden hawk
fiery sentinel
bold wharf
#

I meant project, god knows

maiden hawk
#

Java

#

You sue 3.0.0-SNAPSHOT in your dependencies

#

the current is 3.1.0

bold wharf
#

I mean

#

I just cloned your repo and it literally doesn't build

maiden hawk
bold wharf
#

so, I have doubts that you're actually building with maven

fiery sentinel
bold wharf
#

oh, something is mangling jars

#

probs a shit repo, god knows

maiden hawk
#

Maven moment PepeLaugh

#

make sure to relocate your stuff correctly pal

fiery sentinel
#

There was indeed a problem, since I moved the package name ^^
But this shouldnt have to do with the json?

tired quarry
tired quarry
uneven plover
#

what's the event when poison damages an entity?

burnt dragon
#

there is no such event for this on velocity

modest grove
#

Whats the equivalent of ByteArrayOutputStream b = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(b); try { out.writeUTF("Connect"); out.writeUTF(SERVERNAME); } for a velocity instance?

bold wharf
#

same

#

velocity implements the bungee messaging channel

modest grove
#

oh

#

well cool

#

thanks

rich hawk
#

Why not

fiery sentinel
#

Here I am again .-.
Now I got a problem with a SimpleCommand.
For some reason the command, which needs arguments, doesnt work ingame. It doesnt event trigger.
Only if I am running the command through the console....

VelocityCommandExecutor_Staff staffCommand = new VelocityCommandExecutor_Staff(this.instance);
CommandMeta staffMeta = commandManager.metaBuilder("staff").aliases("s").build();
            
commandManager.register(staffMeta, staffCommand);

If I am using only the command ingame without arguments, then it just gets ignored....

burnt dragon
#

that commend doesn't have any arguments?

fiery sentinel
# oblique haven Is there a permission for it

omg this was really the Issue....
Now I got some more questions.
My problem was, that I wasn't using Luckperms. Is there a way to do permissions management like in Bungeecord with the config?
And I guess /server worked, since it is using the bukkit Luckperms and PluginMessengerChannel?
Is it also possible to change the error message? Or can I only prevent that by returning true and do the check on myself?

craggy pecan
#

Velocity doesn't include a permission manager, no

#

No, /server works because it's allowed by default

#

The "Incorrect argument ..." message is hardcoded in Brigadier, a Mojang library (it might be translatable by the client, not sure)

fiery sentinel
#

Thanks for your answers!

median vessel
#

does velocity have a built in plugin config system like paper?

rich hawk
#

Configurate

gleaming plank
#

how can I communicate Velocity and Paper servers?

#

so, I want to send packet from Velocity to Paper server, and receive response from Paper server then

bronze yoke
#

that depends, if there's a player online you can use plugin messages, but if there are no players you should use something else like redis, rabbitmq, etc

gleaming plank
#

okay, I'll use plugin messages, because communication will be only when player online. I need to listen to PluginMessageEvent in Velocity, right?

bronze yoke
#

yes and you must register the channels you want to use

#

both ends iirc

gleaming plank
#

but how?

#

I know how to do it on Paper side, but don't know how to do it on Velocity

#

found ProxyServer.getChannelRegistrar().register()

#

thank you

gleaming plank
#

How can I send packet from Velocity to my Paper server?

#

I tried event.getTarget().sendPluginMessage(Constants.MINIGAME_CHANNEL_IDENTIFIER, "test".getBytes(StandardCharsets.UTF_8)); in PluginMessageEvent, but it doesn't work

bronze yoke
#

did you register the incoming channel on the paper server as well?

#

also I'm pretty sure that method sends the plugin message to the client

gleaming plank
#

nvm I fixed it

teal adder
#

Do I need to implement something for listening class?

rocky frost
#

Hello 👋!
What's the difference between ServerConnectedEvent and ServerPostConnectEvent?

burnt dragon
#

the javadocs explain the difference pretty clearly

rocky frost
#

Ok

buoyant dust
#

Hello, I'm quite new using the velocity api, and I have ran in to this error. I'm not sure what is velocity-plugin.json, as in the wiki page it doesn't appear. I have put the @Plugin annotation in my main class.

thick bramble
#

Are you using Gradle?

#

If so make sure you've set velocity as an annotation processor

buoyant dust
#

no, Im using maven

#

i have set it to

bronze yoke
#

pretty sure someone had the same issue a few days ago

#

had something to do with relocating

#

plus you don't have to manually add the annotation processor with maven

fast cradle
#

How to log debug if this level is disabled in logger?
/how to enable this level

bronze yoke
buoyant dust
buoyant dust
buoyant dust
#

@bronze yoke sorry for the ping, I have read the conversation and I didn't realise how he solved that issue.

half locust
#

Paper is a server software, Velocity is a proxy (like Bungeecord)

bold wharf
#

remove the AP paths I guess

#

like, processors should generally be picked up automatically

#

unless they forked with that...

sick ether
#

hi, can someone help me with my first plugin? xD

#

i dont know how to invoke this

      this.server.getCommandManager().unregister("livetest");
      this.server.getCommandManager().register("livetest", new vLiveCommand());
lofty bramble
buoyant dust
#

I have another plugin build with gradle which works perfectly

#

Ups, sorry for ping

#

I think i will switch to gradle

burnt solar
#

how can i add multiple ServerPing.samplePlayers in ProxyPingEvent when only method that exist is
'''
public Builder samplePlayers(SamplePlayer... players) {
this.samplePlayers.addAll(Arrays.asList(players));
return this;
}
'''

bold wharf
#

it's a vararg

#

i.e. it takes as many arguments as you want

#

or an array

burnt solar
#

okay thanks

merry trellis
#

Using CommandExecuteEvent. Is there a way of knowing if the command ran on the proxy or was passed through to the servers?

merry trellis
#

Basically, I want to be able to log what Velocity commands people are using but I can't seem to figure out a way to filter my velocity and server commands.

steady trellis
#

if sender instance of ProxiedCommandSender or ConsoleCommandSender, i forget

merry trellis
#

No because it will be a player regardless

#
Player runs /gamemode ----> Proxy ----> Server ->>>> Command Runs!
Players run /velocity ----> Proxy ->>>>> Command runs!
#

I wan't to check if the command runs on Velocity or gets passed through

steady trellis
steady trellis
maiden hawk
#

So, when I tried to connect to my (online mode) proxy, with an offline mode client, I got disconnected with a custom response. Does that mean, that you can now specify the message to send to people with offline clients? afaik this was only a client side thing

bold wharf
#

the kick comes from the server as it tries to validate the session

maiden hawk
#

The proxy is on localhost btw

bold wharf
#

I mean

#

you're literally seeing a kick from the server

maiden hawk
#

yes

#

That's what I am confused about :D

bold wharf
#

I do not recall there being anything on the client which dc's itself in such cases

#

the client doesn't have the auth token, etc, it relies on mojang sitting in the middle, and, given that every kick I've ever seen for invalid sessions comes from the server, 🤷‍♂️

maiden hawk
#

well

#

That's great :D

#

I thought you would always receive the "Invalid Session" message

maiden hawk
#

This is on fastlogin's wiki

We could check if that username is associated to a paid account but if we request a online mode login from a cracked player (who uses a username from a paid account), the player will disconnect with the reason "bad login" or "Invalid session". There is no way to change that message on the server side (without client modifications), because it's a connection between the Client and the session-server.

Now I am even more confused

maiden hawk
#

ok

#

this was caused by tlauncher modifying the client in a way, which allows the encryption process to continue, even if the client knows its data is invalid. Therefore the server kicks you.

#

This is what I receive when connecting with a notchian client

bold wharf
#

oh, well

#

guess I've seen both varients of the boot

#

🤷‍♂️

maiden hawk
#

It is pretty weird

#

But it also is pretty sussy, that tlauncher modifies the client

#

But I am not really surprised, most of these "cracked" launchers are very questionable

spiral thunder
#

Is there a public maven repository that contains the velocity-proxy jar?

steady trellis
spiral thunder
#

I need MinecraftPacket

steady trellis
spiral thunder
#

I want to intercept a packet

#

I need PluginMessage#handle(MinecraftSessionHandler handler) as well

#

So I want the proxy

naive patrol
#

is there a native way to get all permissions a player has

ashen pawn
naive patrol
#

thanks tux

#

i respect the simplicity of the former

oblique haven
naive patrol
#

returning a possible null Boolean isn't really desirable

#

and having information about whether or not its actually set can be important

#

e.g. maybe you don't want to change the value if its already set

#

sure you could have another method but tristate makes it cleaner

oblique haven
#

Hm makes sense

steady trellis
merry trellis
#

Can anyone help me detect where a command runs on Velocity or get passed through to a server?

Player runs /gamemode ----> Proxy ----> Server ->>>> Command Runs!
Players run /velocity ----> Proxy ->>>>> Command runs!
fervent mantle
#

Hello, I've a problem with the API.
I tried to register a player to the mysql database, but the code does not seem to run and the debug message "test" doesn't appear. The import of Subscribe is the velocity one and I already registered the events class in the main.
That's my code: https://pastebin.com/tzcfpzRa, ping me if you know how to fix the issue.

oblique haven
#

99% sure it’s annotated with the incorrect annotation

#

I’m gonna PR in an error message for this, it’s happening quite a bit

fervent mantle
#

It's not the Google eventbus, it's the velocity one. I said that in the message

oblique haven
fervent mantle
#

thats the line to register the events in the proxy initialize event:
proxyServer.getEventManager().register(this, new BaseListeners(this));

oblique haven
#

very weird, I'm unsure

vivid creek
#

hi, i wanna do database queires in login event is this correct way to do that? @Subscribe public EventTask onLogin(final LoginEvent event) { return EventTask.async(() -> { // code }); }

gray hedge
#

There's no way to get all effective permissions from a player in velocity?

rich hawk
#

no

#

that’s up to your perm plugin afaik

gray hedge
#

Oh that sucks

#

Cause like how do you check player's highest permission based of like weight

#

Guessing random numbers

#

That sounds like very inefficient

half locust
#

Use something designed for that purpose i.e. luckperm's Meta system

craggy pecan
# merry trellis Can anyone help me detect where a command runs on Velocity or get passed through...
GitHub

The modern, next-generation Minecraft server proxy. - Velocity/BrigadierCommandTests.java at 94e8b0df43fa7d59372d62bef1dcff5baa7315fc · PaperMC/Velocity

amber ridge
#

How do i fix ```
[13:58:12 ERROR]: Can't create plugin siecmcproxypoints
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. [Guice/ErrorInjectingMethod]: NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
    at SiecMCProxyPoints.initializePlugin(SiecMCProxyPoints.java:30)
    at VelocityPluginModule.configure(VelocityPluginModule.java:48)
    at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at pl.siecmc.siecmcproxypoints.SiecMCProxyPoints$$FastClassByGuice$$5539533.apply(<generated>) ~[?:?]
    at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:50) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:87) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:146) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:124) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[velocity.jar:3.1.2-SNAPSHOT (git-596d4758-bunknown)]```?
#

Main file:

@Inject
    public void initializePlugin(ProxyServer server, Logger logger, @DataDirectory final Path folder) {

        this.logger = logger;
        this.server = server;

        logger.info("========================");
        logger.info("=> Plugin loading...");
        logger.info("========================");

        this.config = ConfigManager.loadConfig(folder);

        Toml dbConfig = config.getTable("Database");

        this.dbManager = new Database();

        dbManager.initializeDatabase(dbConfig);

        if (!dbManager.getConnection().isRunning() || dbManager.getConnection().isClosed()) {
            logger.info("========================");
            logger.info("=> Loading failed! Database not connected.");
            logger.info("========================");
        } else {
            logger.info("========================");
            logger.info("=> Loaded successfully!");
            logger.info("========================");
        }

        return;

    }
#

Database.java:

@Inject
    public HikariDataSource initializeDatabase(Toml dbConfig) {

        logger.info("========================");
        logger.info("=> Loading database!");
        logger.info("========================");

        config.setJdbcUrl( dbConfig.getString("jdbcUrl") );
        config.setUsername( dbConfig.getString("user") );
        config.setPassword( dbConfig.getString("password") );
        config.addDataSourceProperty( "cachePrepStmts" , "true" );
        config.addDataSourceProperty( "prepStmtCacheSize" , "250" );
        config.addDataSourceProperty( "prepStmtCacheSqlLimit" , "2048" );
        ds = new HikariDataSource(config);

        logger.info("========================");
        logger.info("=> Database loaded!");
        logger.info("========================");

        return ds;
    }```

Line ```this.dbManager = new Database();``` cause this error
sour current
#

you need to shade in hikaricp

amber ridge
#

what do u mean?

#

U mean this?

            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>LATEST</version>
            <scope>compile</scope>
        </dependency>```
craggy pecan
#

Can we see your full pom.xml file? (use a paste site)

amber ridge
sick ether
#

Can someone help? i dont know how to repair hover text and add open url on click event

burnt dragon
#

it's just .hoverEvent(component) if you're wanting to do a show text hover event

#

open URL on click event is .clickEvent(ClickEvent.openUrl("etc"))

craggy pecan
rocky frost
#

Hi! What are the steps for setting up messaging with paper plugins? Here is what I've done:
Velocity: server.getChannelRegistrar().register(MinecraftChannelIdentifier.create("imdabigboss", "main"));

public void onPluginMessage(PluginMessageEvent event) {

Paper:
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "imdabigboss:main");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "imdabigboss:main", this);

public void onPluginMessageReceived(String channel, Player player, byte[] bytes) {

But for some reason, no messages are coming through. Have I missed something?

steady trellis
#

so no plugin messages will come through

#

make sure u also registered ur listeners

rocky frost
rocky frost
#

Spigot: player.sendPluginMessage(instance, "imdabigboss:main", b.toByteArray());
Velocity: player.sendPluginMessage(CHANNEL_ID, b.toByteArray()); (public static final ChannelIdentifier CHANNEL_ID = MinecraftChannelIdentifier.create("imdabigboss", "main");)

steady trellis
#

its either Subscribe or SubscribeEvent, i forget

merry trellis
rocky frost
craggy pecan
serene shuttle
#

Hi! How is it possible to load a plugin after server startup? PluginManager#addToClasspath is only for dependencies, right?

craggy pecan
#

It's not possible

serene shuttle
#

Yikes.. okay, I will initiate a server restart then. Thank you

craggy pecan
#

Loading and unloading plugins at runtime can have undesirable side effects

serene shuttle
#

yeah, thought so, I was just curious because there's a method in waterfall, but since I'm new to velocity.. monkaThinkGlasses

sick ether
#

Hi, why .clickEvent(ClickEvent.openUrl("www.serwer.pl/discord")) dont work?
My code:

        source.sendMessage(Component.text()
                .content("Jesli tak to serdecznie zapraszamy do nas! ").color(NamedTextColor.GOLD).build()
                .append(Component.text().content("[Klik]").color(NamedTextColor.RED)
                        .decoration(TextDecoration.BOLD, true)
                        .hoverEvent(Component.text("Kliknij aby dolaczyc na discorda", NamedTextColor.GREEN))
                        .clickEvent(ClickEvent.openUrl("www.serwer.pl/discord"))
                        .build()));
#

hover text work but ClickEvent no

waxen sierra
#

Hello, is it possible to somehow disable the automatic language adaption of velocity to a specific client and set one default language that is used for everyone? I currently have the following idea, but it doesn't seem to be working:

    @Subscribe
    public void onServerConnected(ServerConnectedEvent e) {
        e.getPlayer().setEffectiveLocale(Locale.ENGLISH);
    }
sick ether
bold wharf
#

server connected event is probably too early for that

#

like, the client sends the locale info pretty late in the process, idk if there is an event specificlaly for when velocity reads the clients settings

waxen sierra
#

How does velocity determine which language should be used for which client? Event with changed Minecraft in-game language the messages are still not in English. Also I tried adding a delay of 5 seconds before setting the client locale, but still I wasn't successful.
@sick ether Where are the language files located? Isn't the translation coming from adventure?

waxen sierra
#

In which path?

sick ether
#

com velocity

#

@waxen sierra com velocitypowered proxy l10n

waxen sierra
#

Okay, found it! Thanks a lot!

sick ether
#

you're welcome

#

why .clickEvent(ClickEvent.openUrl("www.serwer.pl/discord")) dont work?
My code:

        source.sendMessage(Component.text()
                .content("Jesli tak to serdecznie zapraszamy do nas! ").color(NamedTextColor.GOLD).build()
                .append(Component.text().content("[Klik]").color(NamedTextColor.RED)
                        .decoration(TextDecoration.BOLD, true)
                        .hoverEvent(Component.text("Kliknij aby dolaczyc na discorda", NamedTextColor.GREEN))
                        .clickEvent(ClickEvent.openUrl("www.serwer.pl/discord"))
                        .build()));
#

hover text work but ClickEvent no

bold wharf
#

tried adding the schema?

#

i.e. https:// ?

sick ether
#

no, i will try
thanks

#

thank you! this work

burnt dragon
viral blade
#

what's my best bet for transmitting data between velocity & paper?

#

is it the same as bungee?

bold wharf
#

"best bet" is basically open ended

#

plugin messages still work within their typical limitations, ofc

#

best overall solution especially if you want something scalable is more on the lines of pubsub type stuff, etc

viral blade
#

unfortunately this specific project isn't on a scale where that is practical, so ig I'll just go with plugin messaging

uneven lynx
#

Hi, i'm trying to get the servers list on a velocity proxy, i don't know how to

#

can someone help me?

robust mural
#

ProxyServer#getAllServers

uneven lynx
#

i'm creating a bukkit plugin

simple epoch
uneven lynx
#

because i didn't want to import apis or do complicated stuff in order to do that

#

as now, i just removed that method, but if you could send me a wiki or a documentary, it would be helpful

fervent mantle
#

What event should I use for that?

uneven lynx
#

what are you trying to do

#

check whenever a player joins the server?

#

or when it logs in via some authentication plugin

fervent mantle
uneven lynx
fervent mantle
#

lol? There isn't any playerjoinevent in the velocity api

uneven lynx
#

oh sorry, i don't quite use the velocity api

uneven lynx
fervent mantle
uneven lynx
#

there is no trace of server.getEventManager().register(plugin, listener); in the code you sent

#

so, i'll ask you again, have you registered the event?

fervent mantle
#

in my main class: proxyServer.getEventManager().register(this, new BaseListeners(this));

uneven lynx
#

you don't need to use this as argument

viral blade
#

Anyone know why this command is never registered?

    @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
        CommandManager commandManager = proxyServer.getCommandManager();
        CommandMeta meta = commandManager.metaBuilder("runtrial")
                .build();
        commandManager.register(meta, new RunTrialCommand());
    }
fervent mantle
viral blade
uneven lynx
fervent mantle
#

..

uneven lynx
#

and also, the velocity docs doesn't say to do so

fervent mantle
#

Oh, wait, now I understand what do you mean.
The this in the new instance of BaseListeners is an argument of the constructor

viral blade
uneven lynx
viral blade
#

oh ofc

uneven lynx
#

that was what zMario was saying

#

i also think (and i can be mistaken) that if you do so, there is a chance that the event won't work

viral blade
#

that won't break things

#

that's how dependency injection works

#

so you can get access to the main plugin

uneven lynx
#

ok, thanks

fervent mantle
uneven lynx
viral blade
#

what?

#

DI is passing an instance of your main class

#

do you mean using static abuse?

uneven lynx
#

you can declare a method to get this

viral blade
#

huh?

uneven lynx
viral blade
#

the this as an argument goes to the method as an instance of your main class

uneven lynx
#

i mean

viral blade
#

and that class's this is different

#

do you mean using static abuse?

uneven lynx
#

wdym with static abuse?

viral blade
#

you're abusing the functionalities of static methods
the issue with this is that it makes unit testing and such much more complex

#

it's not necicarily bad per-se

uneven lynx
#

that's the only static method in my whole project

#

lmao

viral blade
#

so?

#

that's still abusing static

#

it's fine and all

#

but there's no reason not to do DI if you can

#

atleast imho

uneven lynx
#

i think that you're stretching a bit the concept of "abuse"

viral blade
#

It's commonly referred to as static abuse

#

I'm not the first one to call it that

uneven lynx
#

using a static variable is considered abuse

#

?

#

if so, that's the stupidest thing i heard in a while

viral blade
#

not a static variable

#

a static instance

#

static itself is just fine

#

I use static methods all the time for utils

#

but using it to carry an instance is referred to as static abuse

uneven lynx
#

and why is so terrible if i may ask?

viral blade
#

read the stack overflow post I sent

#

evil is a strong word

#

but that's why it's referred to as static abuse

uneven lynx
#

you're stating that i'm abusing static so you should telling me

viral blade
#

read the post!
There's no reason for me to write why when 31 people replied to that post

uneven lynx
#

you started this discussion so you're the one that should argument

viral blade
#

"argument"?
wdym