#Networking Protocol
1 messages ยท Page 3 of 1
Or a VSCode derivative
So we need that support
Because it would alienate their ability to make PRs
what I was more pointing at was that, even for a nicety like an .editorconfig which is optional and only supplementary, the previous management would veto it altogether, even if a vast swath of contributors would benefit
@mental ingot screm for not having pulled latest when you began work on the networking refactor
which meant it lacked the commit which enabled branch suffixing
which meant I had a brief moment of panic when I saw #builds and thought it was building and publishing the feature branch
why you gotta do this to me
I can restart all over again
All of my patches are broken
And it broke basically all other patch
๐
I am going to make a new local
Cherry pick all shit
And then push
This is the primary reason why I do shit the way I do
Without PR
Without applying patches
So that i can do it all neatly when I am ready
At the end
And not halfway in the middle
@mental ingot how does the networking refactor handle https://github.com/neoforged/NeoForge/issues/92 ?
Nope it won't do anything for that
hmmm
Right now I need to find energy and time to fix my workspace
As I mentioned on the issue, this is not a problem with the old implementation on 1.20.2 and if the new implementation uses a somewhat similar point in the vanilla code to tap off the payloads, then it also won't be an issue going forward with the new implementation
It's specifically an issue in 1.20.1 and earlier because the tap-off happens on the netty thread there. In 1.20.2 this is not the case anymore though
ah
this really begs the question of whether we should open a 1.20.1 branch
we shouldโข๏ธ
yep because 20.1 is not really a neoforged version (just a frankenstein transitional version)
We should treat 20.1 with the standard lts policy we always have
yeh, no breaking changes. at all. additions if people port them.
mfw
I can delete messages apparently, pranked, sorry for ping
all good
i think they're legit, so i'm guessing somebody just stepped on their keyboard (cat moment?)
smh spam pinging, ban her
her?

oh wait
what did I miss?
Yes, i pinged, sorry
Was it me? I got kicked ๐ฆ
Yeah
I figured as much ๐คฃ
Nah, you're fine
Curle was trying to get in contact and apologies, she went to timeout and instead banned 
Ah I see! I wasn't on the server anymore so you couldn't DM me ๐
what's the status here?
Working on restoring my branch
After the fuck up that was the attempt to rebase across the change of the patch format
hello there
how are we doing? ๐
you'll probably need to rewrite each patch manually
(at least that's what I did to update the cap rework)
you know, towards the end of the cap rework I just wanted it done
so I know the feeling
if you need help don't hesitate to ask
Now that I am in better health work on porting this has started up again
Should be done by the end of the week
orion if you have your patches ported and/or need a second pair of eyes just ping me
I think I got everything updated to 1.20.4 and am now generating patches
Cross your fingers
Pushing updated state
@errant summit and @buoyant pagoda Pushed my work to 1.20.4
Some stuff is still not implemented yet
Like the status packet exchange
But all of the normal networking and configuration phase logic is now
cool
there are some compile errors and you need to run the update licenses task
https://github.com/neoforged/NeoForge/actions/runs/7196077011/job/19600089898?pr=277
Yes
schurli see the PR description
This thing is far from done
It is up for people to review the mechanics
Not for people to complain about licenses, formatting, or compileability
it's easier to review mechanics if the code compiles (and most importantly, runs)
for licenses and formatting it takes 1 min to run the relevant gradle task ;P
I mean compiling would be nice at least, you know so we can test / write tests
Which is not happening anytime soon
As I said when I opened the draft PR
this is a fucking draft
Don't expect anything more from it
You all got the draft PR under those conditions
It simply is not ready to compile
But you guys wanted to see what I did
So that is what you get
Thats fine, we can see the concepts and the direction your going in. Review can happen when your ready, but early feedback on a critial system like this is important. Saves you some time going down holes
Exactly
It is there to see the concepts, the direction, and understand my thinking
Not for reviews
speaking of which, can you open a new PR?
I mean I for my part already know the concepts as I was there when we made them
since you pushed to a new branch
Why does it matter?
No it is the same old branch......
oh, right
No clue
Up next for me is the status packet
Since 99% of all of the logic there are associated with the errors
if it does not build what does it do?
setup and clean
No.....
so it just checks the patches
apparently
build does a publish
But I don't mind it there at the moment
well we need to disable versioned settings in that case ^^
it does
But you can make a commit to that branch
And then have TC load it for that build only
it seems to load from 1.20.x only from my experience
Cleanup work to do once it is implemented and works:
- run formater
- remove import changes from patches
- update licenses
orion just a heads up so we don't work on the same thing,
I nuked PlayMessages and fixed EntityType to use the new payload, and now I'm looking at implementing the TierSortingRegistry sync in the configuration phase
you're working on the branch right?
yes the question is if I should commit directly to it or if I should PR into it
@mental ingot ^
hmm @mental ingot what do you think about a generic configuration task finish packet that just sends the id of the type to the server and finishes the task in the handler (reduces the need to have a packet for each task to finish it)
I thought of that, and rejected it
The idea is that Vanilla sends dedicated packets to the server to do that
And that is a much better design
Commit directly
also the TierSortingRegistry has a allowsVanilla in its compat check how would we implement that in the new system
Ehm check the vanilla packet splitter
It has logic for that as well
During the config phase you can ask it what kind of connection it is
I think
Hold on
public static RemoteCompatibility getRemoteCompatibility(Connection manager) {
return NetworkRegistry.getInstance().isVanillaConnection(manager) ? RemoteCompatibility.ABSENT : RemoteCompatibility.PRESENT;
}
You can pass the connection you are on to the NetworkRegistry
And it will determine if it is a vanilla connection or not
Question now is
Can you get that efficiently in the configuration phase event
The answer is no
Let me make a patch for you ๐
@errant summit I pushed an update now ๐
There is a boolean isVanillaConnection now on the listener in the event
That should allow you to trivially check during the configuration phase setup whether or not you want to add your task
Or if your task needs to run in compat mode
@errant summit You around for a call?
yea
Sitting in dev-voice
Okey after fighting java generics again
We patched BundlePacket to support common super packets, like custom payload
And we now support bundle packets during configuration tasks
cool
is there an risk of blowing the packet size? or a requirement for the packets to arrive at the same time?
It is more of a grouping anc conceptual idea
For registry and configs
You want the individual payload packets (aka one for each config/registry) to be sandwiched between a start and end packet
So you get a single bundle with: start -> payload ---- payload -> end
And then the client can neatly answer: yes processed
That is why we put them in a bundle
you need the client to reply that the config task is finished?
Not a requirement
But it is a nice thing to do
Especially for critical components
Like the configs and the registry
But in essence you can just pepper the client from the server with all packets, and give a damn about it
hmmm cause packets are already ordered with TCP so I wonder why we need them to arrive at the same time ๐ค
Is it a TCP or UDP connection
The default port is pretty high.....
For a TCP
But it should indeed be a TCP
In reality it does not really matter
The problem is Netty
Even in ordered TCP connections
Processing and reading of the packets can still happen in parallel
ah yes
you're saying that parsing the config from the bytebuf might require the registry to be already synced?
@fair sandal Do you have a minute in voice
I am stuck with the server-status packet
For the server list screen
And it is not looking good for that scenario
not possible sorry, I'm in at the "office"
Okey
Well then I am going to need to remove the whole "server status" ping login check
can't you keep the current hack?
I can have a call tonight
It is determined in the config phase
we can discuss it at 8 (probably a bit earlier works too) if you have time
Yeah
And I just realised that I have to rip the bundle shit from the config phase
Because of the vanilla lcient
It needs a custom packet
and that is a big nono on the vanilla client
@opal ferry After talking it through internally, we figured out that we can do the "minecraft:register" loop again during status pinging to show the user an indication of compatibility.
Would fabric be also interested in that processes?
We have documented it currently here: https://hackmd.io/U_i1gWO8TT-scIDEuT7JMw?view#Server-status-pinging
Also @fair sandal Your input here would be valueable
hmmm if we have that info during the status do we still need it for configuration? or are these two things completely dissociated?
it does raise the question of "status networking" ๐
Sadly dissociated
Because the client can be bounced from one server to the next
Where one server supports the channels
And the next does not
ah yeah right that was the whole point
We dont touch the status packet atm
I dont see why minecraft:register has anything to do with that?
The idea is that the player has an indication of if he can connect to the server
Forge right now shows like a green check mark / red cross
asking thins because the message list is kinda useless if you don't actually allow sending messages? idk
To indicate that the server connection is good / bad
As with today, it would be mostly used for the tooltip
To indicate connectability
or yellowish V for compatible vanilla
Right ๐
Id have to look at it in detail, but isnt it basically just a json blob in a single server -> client packet?
Yes and no, yes in practice that is what we do today, but that has some major drawbacks. For one due to the packet size, we have to do some really ugly encoding hacks to pass the compatibility information along, (vanilla puts the favi icon in it)
The other reason is that we have no real way of knowing if we are talking to a vanilla client / modded server
So the way me and schurli designed it right now
Is to only include a boolean in the status json
That indicates if the server can "speak" modded protocols
And then upgrade the connection
So that a normal negotiation can happen
That sounds quite complex tbh, the current single packet with a json is trivial. There are plenty of 3rd party tools/websites that people use to get the details on the server, this is going to be a pain for them. I would expect anything more to happen at the start of configuration.
what info are we using this for atm?
Some poeple have 10s or even 100s of servers saved, having a complex back and forward chat with the server could end up taking quite a while.
in principle it all happens in parallel
In practice the delay is minimal, the simple answer is, that without the clients channel information, there is way to know if it is compatible or not
The "minecraft:register"-loop is in the end negotiated on the server
And as such it is pretty difficult to handle this properly on the client side alone
Especially in such a congested packet as the serverstatus
Is it really the end of the world if the user tries to connect and then gets a nice error screen? Maybe I dont think the problem is big enough.
For me no
I would rip this in a heart beat
Just wanted to preserve functionality
That is all
what problem are we trying to solve here, again?
To be fair, the current approach probably isn't much less annoying for them since it uses a custom compression scheme to reduce the size of that JSON blob with all the mod and channel data
Document the compression scheme? I think it should very much stay one way. I would be worried about possible security issues as well, as this wouldn't have a high barrier to entry.
The status indicator on the server list. Forge negotiates this early on. With the new configuration protocol now being way later, that information is lost and the screen is missing the ability to show, yes you can connect, or no you can't
I wouldnt want this to be a trivial way to DOS a server
I'd honestly just rip out the compat check anyways.
that is still very much on the table
That status indicator is something:
- many mods don't work with
- it isn't that informative as it doesn't tell you why you can't join
- doesn't actually save much time - you'll not be adding servers you don't expect to be able to join anyways
"negotiates"? I understood it to be that the server sends along the information to the client (a one-way message, through the ping reply packet), and the client determines if it's compatible using the information given
I asked what the status packet contains but you didn't reply ๐
Either way its not something Fabric is going to use, we currently don't check that mods are compatible at login. (Registry sync does have some stuff though). let alone put something in the server list.
Ehm mod and channel information basically
What the server has
I guess the question I have is: when does the indicator actually save the user time or alleviate confusion?
the compatibility indicator is something that's been contentious for a long time 
If the answer is "almost never", which is my understanding of it, I'd rip it. If that's not the case, let's list out those scenarios so that we have a good idea of the most important use cases for it
And then design the implementation with that in mind
Either way, having an idea for what the goal actually is is important
because
- mods usually don't respect it enough to make it useful
- users don't heed it because it's usually wrong (because of point 1)
- pack makers have no control over it (without a mod intervening) outside of yelling at mods to fix it (point 1)
Beyond that, users don't generally add servers they don't think they should be able to join
and that the compatibility indicator has always had the caveat of "this is only an approximation -- you may not be able to join even if this is green"
Well with the new system it becomes more usefull
Because it indicates the channel compatibility
By letting them try to join and getting a better error message, it alleviates confusion
I don't think that's the main question. Like, step back a bit to the user's perspective: in what scenarios does the user:
- want to know whether or not they are able to join a server before they click on it
- if they can't, not want the in-depth message they'd get by actually trying to join that details why
as an aside, I do think that we shouldn't put too much effort into this compatibilty indicator, in the sense of it not blocking the major facet of the networking rework that is the breaking changes to the API due to underlying rewrites
@winged rain weren't you the original author of the server status check? or am I misremembering someone else? how much value do you think it adds compared to letting the player just try to connect to the server?
just a thought (I've not read the PR yet): how is it that the proposed spec says that the custom payload packet is used in reply during the status protocol, even though the status protocol only has two sets of packets (status request/response, and ping/pong)?
a comment on the PR itself at this stage: why in god's good gravy does IPacketFlowExtension exist?
if the answer to that is for use as method reference, I raise Predicate.isEqual(PacketFlow.CLIENTBOUND)
Just had a look at the how this works, its not as one way as I thought it was. https://wiki.vg/Server_List_Ping Its still dont think its worth the time/complexity. There also dosn't seem to be a custom payload packet.
yeah, I don't think this proposal flies, in the face of (a) the added complexity to the conventially simple status protocol (which most if not all versions of MC recognize) and (b) the expansion of an existing vanilla packet (the custom payload packet) outside of its normal protocol use
also why was config stuff moved around in this PR 
Link?
the Range class was moved
Isn't it a different range?
I thought I did not port that over
No I originaly moved that damn thing out for reuse in a different place
But I thought I moved it back
it's the exact same class
also i see a writeset / readset extension method was added
readCollection / writeCollection do the exact same thing
Can we stop reviewing the draft?!?
Yes I added that before I realised those existed
I mean might as well clean them up at any time
Actually the reason why I said I would not accept reviews, is because that puts social pressure on me to get it to be clean
When I don't even have it working
As covers said before
This is a draft to see the progress and the direction and to provide input on the core changes
To to go hunting for format, unrelated changes etc
I think it's fair game to point out these issues already since we're gonna be merging the PR eventually anyway
And that might confuse people looking through the PR
Yeah but I don't want the feedback now
If you have the feedback, nice keep it to your self, put it in a gist
And when it turns from a draft to a pr
You can add it all at once
But not now
Piecemeal by piecemeal
That was the condition for me opening the draft
I don't know, I don't really understand that reasoning... might as well leave it where someone can see it. Maybe on the PR?
Instead of you having to burrow through the branch
Just so it's written down somewhere and kept track of
My point is the whole world seeing it
Yeah you can do that in a notebook / gist / somewhere were it does not put social pressure on me to work on this every free hour that I have
I already feel bad enough for sitting on the couch during my evenings
And not working on this all the time
And when I opened the Draft you guys agreed to that
If you can't hold yourselves to that
Then I will close the draft and reopen it only when I am done
I'd rather have you not feel bad and let us place feedback on the PR whenever we notice something. There's no pressure to fix that stuff immediately, it's just nice for other reviewers so that we don't all repeat the same thing
To get that straight, you really don't need to feel bad about the PR taking time
That is simply not how it works man
It is in this particular case an either or
XOR
Everyone agrees that the PR will be merged eventually. Each comment is just a little TODO note before that can happen
at this point, I'm not even sure what's asking for feedback
The core
The general idea
If the API can be improved
If I overlooked some usecase
That is what I want to know
one problem I forsee is that the only true way to figure out needed improvements to the API would be to try it out locally
which isn't currently possible since, as you've said, the PR is not in a working state
Exactly!
It shows a concept
Of what is possible
At least in its current state
And how that concept is used in Forge itself
And what I want to know, from the core team, and everybody that is interested, is if that core concept and its examplary usage in forge, is good
at this point, does the networking PR compile and run the game?
No, the major breaking poiunt there is the status packet
If we can solve that
There are some small compile errors remaining
But that is the big major one
in what way does the status packet impede the progress of compiling and running the game?
It is kind of ugly wired in every where in the login process
Because the channel setup changed
That information is simply not there anymore
did you ever get to the packettype kind of stuff we discussed a while back?
well the idea was to not need the builder lambda
we are down to 32 compile errors and most of them are related to the login phase or the status packet
Yet several people including me, think it is easier for newcomers to understand
The packettype thing is not as easy to understand since it requires multple system to work together
Including multiple events
Which need to be wired up for registration
can the compile errors on the status packet be alleviated by nooping it for now (with liberal TODOs to mark it for later)?
Maybe
have you tried?
Yes
i'd like to see the networking rework be compiling and running the game, even if the extraneous parts like the compatibility indicator are currently nooped out (for re-adding later)
I think we can have it compiling this week if shartte and Technici4n stop distracting him with #neogradle-dev stuff
lol
I mean if we yeet it for now
in that sense, we'd see if there's any lingering bugs (non-compiler errors) with the implementation that need ironing out, which may cause the API to change
Then it can have it compiling later today
(note that .client and .server won't be on the same line easily once spotless is applied)
please do so
Why does spotless care here?
yeet it in the PR (with TODOs as appropriate), mark it in the PR description, and move on to making it compile and run
maybe if you place both .client and .server on a new line each it's fine
continuation indent is always 8
once we have it compiling and running, people can then locally test the PR to see if the APIs are satisfactory
the set of parameters that we pass to the API looks good. maybe we can do something about the nesting
If there is something that can be nuked, do so for now we can add it back later, I want this in before I go on vacation on the 26th
it's worth yeeting it for now I think
was waiting for daemon's reply but idk when he will see it so let's go ahead with the removal for now
question: why is the status packet not feasible now?
as in, what changed in the networking rework to make sending data via the status packet not feasible?
The moment that channel negotiation happens is much later
And the other way around
We previously did the negotiation on the client
another thing is that the point of the networking rework is to re-evaluate our hooks
And basically immediatly during connection open, aka status/login
I'd see it as a large audit of the networking setup as well, on top of the changes
(cause we need to audit it anyway to be able to change stuff correctly)
But now the logic is completely in the configuration phase
To allow for a forge client to be disconnected from a server
And reconnected to a different one
All old hooks should be gone
๐
Like this is nearly completely all implemented in the configuration phase now
what prevents the server from serializing the information used in the channel negotiation in the JSON payload of the status packet, and the client from then using that information + its own information to make the best-effort guess of whether the connection will succeed on that negotiation
With some minor touches to how packet protocols can be build
The json payload size limit
outside of that?
Not really anything
(since we do have the truncated flag for that -- we assume that if the truncation happens, the information is incomplete and likely to fail)
That is why I suggested to use a round trip packet to pick it up later
That hole system is a hack at best
And I personally find the additional round trip a way better solution then the encoding shit
The overhead is minimal
yea encoding json as a byte array and shoving that back into the json is ugly af
It is not just ugly but error prone
the additional roundtrip packet is conceptually cleaner, but the current code is more acceptable in practice
Why?
External webpages that monitor those servers will have a heard time processing this
for one, we aren't expanding a vanilla packet to outside of its normal uses
for another, we aren't requiring external webpages to literally implement the protocol we're making to communicate with servers on a round-trip basis (instead of implementing an encoding scheme in a packet they already know how to handle)
I would like to argue that servers which already implement the forge negotiation stuff, already do custom work, so the roundtrip is not really taht much different
Yes but we are for sure in a modded-modded connection
So I see no real reason why the scope of a vanilla packet matters there
I say, there is a difference between decoding data in a JSON payload from a packet you already know, versus having to implement handling for round-trip packets
and you say "servers", but you mentioned (and I followed up on) "external webpages" -- which is it?
it's the idea of going past the bounds of the vanilla network protocol, which we've always tried to work within the bounds of
such as our use of the custom payload packets (iirc during login and play) for sending data between server and client (without defining our own custom packets)
In general yeah I accept that, especially since we want to stay compatible with vanilla clients / servers on the other end
But here it does not matter
My question about the utility of the server indicator at all still remains
So yeah I'd definitely say yeet it for now if it simplifies stuff
Can always add it back later if it's something folks decide to keep around
@errant summit Can you pull from remote
And push your changes
I just removed the whole bundle shit again
And I started removing the SSP
don't forget to note that in the PR desc (perhaps as a checkbox), so we don't forget to decide on it later
pushed, down to 26 compile errors
Fixing those now ๐
Down to 4 errors
Purely related to channel mismatch screen data
So that should be doable
Well we are in main menu...
Lets see if I can get into a world
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: minecraft:network to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: minecraft:brand to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry_sync_start to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry to a client which can not accept it. Not sending packet.
[20:01:28] [Netty Server IO #1/WARN] [ne.ne.ne.ne.re.NetworkRegistry/]: Somebody tried to send: neoforge:frozen_registry_sync_completed to a client which can not accept it. Not sending packet.
Well that failed XD
Lol
At least config locating works
But the netowrk negotiation failed to store the results
And the system considers the connection to be vanilla
Skipping that packet XD
Ok so not too far off ^^
Well yeah
Oef the client is not answering with its known channels
Well that is interesting
The netreg did not initialize:
I am willing to bet you the bus is not registered to yet with the EBS instances
So this has to be a mod bus event too
Yep yep
EBS is not wired up to the forge bus yet
Lets see if a mod bus event works
Yep that works
Lets see if I can get channels
Did you post to the forge bus?
I bet it was just shutdown and dropped the event
Even though it was an EBS
I made it a mod bus event
Fixed a payload id
And there we go
Now we have packets
There we go ๐
Nice
It at least shows the correct error message
how's it going?
We are in world
Without errors
And without warnings that packets are unregistered
Lets see if we can connect to a server
Well that is a clear no
if you push I could also investigate the issue
I am not really at home
Was doing this on the laptop
And that is now in the bag already
I will push tomorrow morning
The default networking is working
But something somewhere in the negotiation is failing
While it is working for in memory connections
Which is weird
\o/ i knew it was a good idea to push for compile and run 
That is a sad state
Not sure what is sending state here
And there we go
Vanilla client connected to Forge server
now try with test server and neo client (should not work)
mod missmatch test server has the testmods present the neo client not
Ah test server
Yeah have not gotten that far
Currently still doing the vanilla dance
@errant summit We have a problem on the modded client -> Vanilla server connection
SOmehow the brand payload is not arriving at the client
Causing us to not detect the connection as vanilla
Which does not load the default configs
Causing an immediate crash
Because the configs have not been loaded yet
I think it's time to add runs to projects/base to debug the vanilla server
I am not sure
I thought it would appear first
Because it is in the code first
But it is just being skipped
And there we go
Added a fallback layer to detect the vanilla connection when features are send (one packet later)
@velvet whale Within the test framework you have a SimpleChannel implementation
From the code that seems unused
Can I rip that for now
And you add it back later?
Never mind
I figured it out ๐
Reimplemented this myself
All good ๐
BTW If somebody is wondering, how do I send a packet?:
This is it:
Ignore the sendPacketIfOn wrapper
That is part of the test framework
But to send stuff you just grab a packet distributor
And hit send
@errant summit Did you do the OpenContainer and SpawnEntity stuff?
I can't find the entity type stuff
I only see you deleting the PlayMessage stuf
well if it were still used you wouldn't be able to compile
at least the packet for entity type alredy had a replacement
I fixed the actual writing of the new spawn entity payload and registered it, for open container I think we need a slight redesign
Yeah
ok I re-introduced the open container stuff
now we only need to wire up the entity one
@velvet whale can you grab the branch and fix the test framework
there are some SimpleChannel usages so if he has he has only done it locally
not sure if i can find the time to do it, hopefully orion will be able to push it at some point tonight
my state is pushed
that sounds more like shit than git
It was intended to be a mixture
orion clearly meant hours because seconds and minutes are over
years?
weeks and months come before that but it could also be centuries
and that is just pulling, not even pushing
I fell a sleep
It will happen tomorrow morning
I have the code
Just need to pull it
@errant summit Did I miss something but why did you leave this method empty?
does serverplayer not override it?
ServerPlayer does override it
Not that I can see
Forgot to gen patches?
It overrides the normal openMenu
But not the one with the additional payload buffer
I now added it myself
So it is not a biggy
Just fell over it
While going over my PR
Making it ready for review
I can't tell you why
you must have forgotten to setup
But I don't have that patch
Nope
I just ran it
See I am on the latest version of the branch
And I don't have that patch
you dropped the commit
git reflog time
So just that?
export as .patch?
If it is just that change
Then I don't care
I implemented it now myself ๐
So it should just work
Well it does work
Because the test mods work
๐
But I stabbed myself in the foot there
Sorry schurli for the work that I wasted ๐
you undid it manually in 02519e8cbd74a2224c86d638b0cd7b04e542cffa
git has a --force-with-lease
Commit message?
which prevents a force-push if the remote has new commits
Fix imports in patches
avoids overwriting someone else's work by mistake
currently porting MI from fabric to SimpleChannel lol
will the IDs be used anywhere besides the registration?
@here: We are now ready for review: https://github.com/neoforged/NeoForge/pull/277
Mamma Mia.
Here we go again ๐
I fully support you getting this done :p
No i mean that was a reference to Mamma Mia ๐
The musical ๐
And Abba
I thought you would appreciate that XD
Fuck I missed one
I did a pass over it to remove those
But lovely missed it
@gaunt lark as usual make a list ๐
I don't think that was who you meant to ping there x3
@gaunt lark shite you are right
https://github.com/neoforged/NeoForge/blob/bf89bc2c1847beaa4df2c35549879cc6175ee2f9/patches/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java.patch#L13-L14 A few places where there seems to be this kinda whitespace change, can't remember how important that is
IMHO Not really
But that is not up to me
I mean if the patch is just whitespace
Then yeah
Like the one you linked before
But in this case, IMHO it really does not matter
Same with me, the only reason I raised it was because I didn't know how much that will effect porting
The white space?
Nothing
FUZZY Will simply ignore it
What I not have done yet is the AT stuff
I currently use the patches to make fields and shit public that I need
The ATs will be last thing after reviews, and feedback rounds
<@&797656813583466526> It might be prudent for you guys to start looking here as well, so we can provide adequate documentation when this goes live. Please start by checking out the above mentioned PR, and its description. And ask questions.
https://github.com/neoforged/NeoForge/blob/bf89bc2c1847beaa4df2c35549879cc6175ee2f9/patches/net/minecraft/server/MinecraftServer.java.patch#L128 Left over todo? Is it worth marking that with Neo or removing it
https://github.com/neoforged/NeoForge/pull/277/files#diff-6c6e6f18f4aa2f4332d0d1e8fa59c284837db6623f3b1f0ec9eb48dd4cd368e4R187 reaon
Which line the TODO?
Whoops missed adding the L128 on it
It needs to be a //Neo TODO
It is not a //Neo: comment style thing
It is a real todo
That eventually might need to be addressed
Think that was it from just a quick scan through, nothing jumps out to me, I'll try to find the time to sit down and dig into it more
On a side note is there any way for us to have automated test for this?
Not really.....
What would you want to test here?
This is more of a convention thing
I am willing to put in the work to add the tests
But I am personally pretty unsure as to what
Well idk but like... Registering and sending a packet... All clients get the packet that need to etc etc.
More like a quick way when porting to see if it broke fully or not
Also does this contain the limited compatibility stuff with fabric? Cause in that case it would be interesting to test those cases as well
That already happens in many manual tests we have, automating that is pretty difficult. @velvet whale Any ideas here?
Yes it is implemented, but again tested via several tests all over the place
Will do so this evening.
Ish? you can attempt to send the packet to a mock player and then check if the dummy netty channel contains the correct packet object
but that's as much as you can automate reasonably
Do you have an example?
fence gate test in block tests plays an open sound to the player when right clicked and then checks if the sound packet was "received" (more like sent tbf)
Okey
I will need to figure out how that is done
And how I could check for network initialization code
But I might look at it
No promise though
TIL that github markdown can do this
It is new
Maty said that Documentation should be left to parchment in vanilla classes.......
I don't quite understand that logic
We do this in different places
it's existed for quite a while as a public beta, and only recently became generally available (as in "this won't change without a good reason and advance warning, etc.")
Allthough I would agree that once we use that would be a valid argument
But we are not yet
So how do we want to deal with this
you should only add documentation if it's neoforge-specific, IMO
Yeah I add neoforge specific overrides
And I explain why, while also documenting the vanilla code
Because I noticed during porting, that knowing why something was overridden, or added, so I added the same kind of documentation to vanilla
I'd remove the vanilla doc as it will be duplicate once we introduce parchment support (which looks like it will happen soon)
doc for neoforge overrides is good though
๐ I will review this tomorrow when im more awake. :D
My point is: parchment documentation might not be there when porting, in particularly when you are looking at the patches
documentation in neo specific overrides and hunks seems fine imo
Yeah
but I also added some documentation to the vanilla method that I override
the @deprecated is enough IMO
Usually we do @Deprecated // Neo: Use xyzblah becuase asdf
also Orion you need to remove trailing whitespace ๐
normally intellij does it automatically when saving files so I suppose that you have that disabled
Where?=
Sure, but again it does not matter in reality
Yeah
it's just nice for consistency... if you press ctrl+s in intellij it should remove all trailing whitespace automatically
But i though we were matching vanilla output in patches, which does not have trailing whitespace
I tried that
No dice
Its in your formatter then
I don't have a formatter enabled in this repo
Probably in your default formatting rules
That does not work though....
We are allowed to keep trailing spaces in none patched files
does spotless not remove them?
No
ah, mc sources
Because you are in patched space
well they shouldn't have trailing spaces to begin with
Which is the whole problem here
Yet it does
I would propose to not care for the trailing whitespace
The patcher should not care
And in reality they are not in the way during reviewing in my opinion
it's a pain because someone modifying the file again will change the patch
I don't think its wise to just disregard formatting rules because you dont feel like its relevent
this happens more often than not in NG commits as well where you reintroduce a bunch of whitespaces
I will address it
๐
just something I noticed, then the next contributor just undoes all of that
weird that the option in IDEA doesn't work?
Again, I personally don't care about whitespace shit, and I don't care if the next one undoes it.
Because during reviewing I just simply ignore them
I look at the actual changed code
well it adds useless lines to the diff, and can cause merge conflicts etc
you may not personally care, but apparently we do
Agreed, so I will be addressing it
try pressing ctrl+s
Once we figure out what is going on
Just did, no dice
for me if I add whitespace and then press ctrl+s it gets removed
as an interesting note, iirc git diff shows trailing whitespace in bright red
it does yeah
or, I suppose it's vim rather than git
maybe try applying it to all lines instead of only modified lines
Spotless does not even have a "whitespace trail" check...
Oh yes it does
Hold on
Testing
wdym it's vim 
i don't recall having to :q! my way out of a git diff screen 
for Vim, I just memorized :q! and :wq 
i'm not likely to go use it for anything more than "it's the default tool for something" (or "it's literally my only option")

Okey made at least a minimal formatter for the patched code to remove the trailing whitespace
Lets see if this does not fuck everything up
I literally installed nano locally so I can use it in the (rare) case I need to edit something from the command-line
perhaps one day I'll learn to use vim 
@buoyant pagoda and @fair sandal We have a lot of trailing whitespace stuff in the code:
For example here
Is this vanilla?
Yeah
VF bug then

interesting
I added a trivial check in the spotless formatter
Which finds 165 files that have this behaviour
Over half of them
And a lot of them are not patched
Like that
Which is why IDEA is being fucky on my end
any commonalities between those files?
I have formatting copy enabled
Okay, well just make sure its not inside your patches, we can get a VF bug fix later
any chance you can send over a patch file for the changes needed to implement Spotless for the MC source? so we can replicate it locally, and potentially narrow down commonalities between source files with the bug ourselves
(i've sent a message in the VF discord to probe about this)
Subject: [PATCH] Clean up some patches and remove unused code.
---
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision bf89bc2c1847beaa4df2c35549879cc6175ee2f9)
+++ b/build.gradle (date 1702991092487)
@@ -64,6 +64,7 @@
endWithNewline()
indentWithSpaces()
+ trimTrailingWhitespace()
removeUnusedImports()
toggleOffOn()
eclipse().configFile file('codeformat/formatter-config.xml')
@@ -89,4 +90,11 @@
}
bumpThisNumberIfACustomStepChanges(1)
}
+ format 'patched', {
+ target project(':neoforge').fileTree('src/main/java', {
+ include "**/*.java"
+ })
+
+ trimTrailingWhitespace()
+ }
}
@buoyant pagoda That should do it
then run the spotlessPatchedCheck task
Is it still possible for the sender to check if a channel/mod exists on the receiving side so it can decide not to send a packet?
Technically but it is not exposed
that's never stopped me before 
good enough
In practice, the channeling system takes care of not sending payloads that are not known to the oposite side
ahh
So you really don't need to worry about that anymore ๐
IIRC, mods did use that functionality
okay that's an improvement then
JourneyMap I believe -- iirc Mysticdrew made a PR about that sometime in the past
Yeah but it should not matter anymore
You can just tell it to send the packet
It will immediatly noop
Because the channel has not been agreed upon
yeah previously I'd have to check isRemotePresent or the receiver would logspam
Yeah
Won't happen anymore
It won't even write the payload
At worst you now build the payload object
So there is some memory overhead
And there is technically a way to figure this out from the Connection object
As the PR specifies
It is all stored on the connection now with attributes
Its not entirely about that. Some mods may wish to do different things on each side based if their companion exists.
So if you have a connection, you can use the internal API and Attributes to get the connection state
I am considering firing an event
That indicates what the results of the negotiation where
Just have not decided how
It makes sense to me
That would be sufficient
That it should be possible
yes
something like this will probably be needed for syncable chunk data attachments in case they are used with a vanilla client
IMO storing the negociation result in a place that is easily accessible is the nicest
Yeah, seems reasonable to me honestly, event may be slightly overkill, just being able to query doesChannelExistsOnOtherSide(RL) is good enough
Any custom data we send, should always be a seperate payload
Not part of the vanilla packet
Because it literally runs into the vanilla client problem
well that's why I want to know if the client is vanilla or not
there are cases where it's useful to know
Not really
another example I can give you is custom ingredients with a vanilla client
you don't know that
Unless you are creating specifically different behaviour if your partner is there
it's more about gracefully handling vanilla clients
(or clients that don't have the mod present)
for example with fabric's custom ingredients, if the client doesn't support the ingredient type then it gets dissolved and sent as a vanilla-style ingredient automatically
(since the server does all the matching it's fine anyway that the client doesn't get the full picture)
Forge does this on an ingredient level, not on a connection based level
Hmm, I think I kind of agree with Orion here, its not exactly useful to know if the client is vanilla. But I also don't see any reason to lock that down. It should be just extra data given on the event/whatever where the channel sumarry is given.
on fabric you can use an NBT ingredient with a vanilla client
But I simply don't agree that forge should expose systems that would make networking protocols different whether or not a vanilla client is connected
That should be the mods choice?
A mod can do that
just to clarify, "vanilla" here means "not understanding the NF handshake/negotiation protocol" right?
For all I care
the point is that vanilla can't handle modded protocols and it might be desirable to implement a fallback for vanilla clients
not actually determining if the other side is full vanilla, nothing bolted on (no mod frameworks of any kind which mess with the brand)
Simply said: The payload and packet have no idea who they are sending to.
And might even be used in a scenario where they are written to multiple IO buffers for different client types
that is the mod author's responsibility to handle
In other words, trying to squeze that idea into the payload/packet is going to get you into trouble from the get go
if someone wants to send a message to a specific ServerPlayer, they can check what that specific player supports
the info should be available from the ServerPlayer imo
not at the payload level
It is
Well you probably can get the raw underlying connection
And hack it to get the information out
Right now
It only exposes whether the configuration listener is vanilla
But not at runtime
At runtime
You have no idea what the other side is or is not
And I can see that as a problem
So I might actually add that functionality
So that you can query the network setup
a simple boolean ServerPlayer.canHandlePacket(RL) would be sufficient for most purposes I think
(and a similar thing on the client side to check if the server can handle a packet, although that is generally less useful)
Exists within the NetReg
Well it exists as packet
Exists as in the data is there, or exists as in its already accessible and we are wasting our time going over this again and again?
I should probably expose that for a specific payload
Exists as in, described in the PR as mentioned are exposed public internal APIs
And if people want to use that
I feel like ive asked the same question more than once and gotten a different response each time
Then then are free to do so
Okey
It does not exist directly exposed on the RL level
It exists on the Packet object level
But only in an API marked as Internal
Does that make sense?
"public internal APIs" is an oxymoron 
Nope
they are public, because they need to be for compilability reason
They are internal because we do not give any compatibility guarantee on them
their access level is public
but they are an internal API, not a public API
Yes, which is what we mean with a public internal API
It is not an oxymoron
Because public and internal have different scopes
Internal here meaning: Not intended for mod consumption
I am not sure how we officially handle: @APIStatus.Internal
["public internal API" is] an oxymoron when "public" is interpreted as "intended for consumption by 3rd parties"
which is how I interpret "public" when used with "API"
I thought we set it as, you can use it on your own, but we don't given API compatibility guarantees on this
my understanding of something being part of the internal API is only the "we don't give API compatibility guarantees on this" part
being public is usually a side-effect of needing to be visible for our internal use
What I am planning on doing is making a public endpoint for this on the listener
Kind of like the "isVanillaConnection" endpoint
That then calls the internal endpoint
what do we define as "vanilla" in this context, for the record?
I'd assume 'Not Neo'
which means that you are not supposed to use it
for me @ApiStatus.Internal means "we need this public for reasonsโข๏ธ but don't use it"
if we could, we'd make our internal methods only accessible to NeoForge 
but we can't (it ain't module time for us yet), so we get by with @ApiStatus.Internal 
looks at event constructors
For me it always ment: This is public for our use, however we can not prevent you from using it, so feel free. But don't expect us to care for your compatibility
๐คทโโ๏ธ that's never stopped modders before
Just exposing whether the connection is vanilla is not sufficient. If we take JEI as an example, they need to disable certain features such as crafting table auto-fill when the server doesn't have the mod even if it is a modded server
I know
I think for features it is perfectly fine to know
But people should refrain from doing that for networking
yes, basically the same thing
well JEI needs to disable its feature based on networking ๐
well to do this they need to query "can the server process this packet"
But modifying your own intenral network protocol, as in the structure of the bytecode that you send that is something I am highly suspicious of
As I said, I am going to expose it somehow
Right now it is only "exposed" on a Packet level
for synced chunk data attachments what I had in mind was:
- either bundle packet with chunk data + attachment data if the client supports it,
- else normal chunk data (as in vanilla)
Bundle all the way
Don't even try the second route
It is really not worth the headache
perhaps @mild spruce would be interested in this discussion (as he did a PR somewhat related to this in Forge)
yea a check like for loaded mods would also be my idea
What would even be the point of spamming a vanilla client with the attachment data? Depending on how you intend to append the data to the vanilla chunk packet, it would also cause the client to disconnect outright because the buffer isn't empty after reading.
Putting a separate packet into a bundle has the benefit that you can re-use the exact same packet for later re-syncs when the data changes without having to send the entire chunk data again
Yep, additionally, if you do it as a seperate bundle, you can just use a packet distributor
And send the custom bundle / payload in one go
Because the core mechanics mean that the NetworkRegistry will filter them out
Allthough I might need to make a followup PR
To deal with the Bundles better.....
Their support is still pretty crappy
where did I say I wanted to append data to the vanilla packet?
if vanilla can't handle data attachments they should not be sent at all
The second point sounded like you intended to append the data to the vanilla packet
wdym with data attachments
synced BE/chunk/entity data attachments
just send your own payload
you can't modify a vanilla packet at all because it checks the expected length
no modifying structure of vanilla packets 
we've had this already with the intent packet 
That's the intention behind the first point Tech made. We can use a bundle packet to combine the vanilla one and the custom one and the client will be none the wiser as bundle packets are handled transparently half way up the netty pipeline
exactly
bundle packets sound so neat
