#Coding free multiplayer [Looking for help & testers] Zero port forwarding
1 messages ยท Page 2 of 1
Once I push
pushed
good night and a happy 13.01 for the people reading dis
@livid lake I summon you
To test dis
good timing xD
I'm ready
Either you test it manually somehow alone
Or find another person to annoy into helping us out
I'll be able to test it ๐ have a good night! I'll let you know how it works
Did it work?
More gui work got done
and this should tm work
@vapid plaza when can i annoy you to test this with me
does it work with DNS names as well as IP ?
as in does the GUI support the entry of a name ๐
i mean it should
or should it, dunno need to look
well, from my side
i support a full on dns name
i need to look into gole now
Why would someone point DNS to their IP if they can't do port forwarding?
that would be the next question i am asking myself
fair point, but you may still opt to use this mod still? ๐คทโโ๏ธ
i mean, it could work, would need to test it
but if i dont even know if it works with straight p2p with no dns shinanigans
i would test that later
i thought that was the base mod functionality the p2p element?
yeah the mod is in the proof-of-concept stage, its not very stable yet
ill let you know when my internet is back lmao, im on 4g rn
found my error
i was too dumb to properly encoded Base64
@gleaming beacon thanks to him i found that ou
newest push should have fixed that tm
:)
are you still looking for testers? @ me if you need help
@devout maple i need a thrid person rn, hop in vc
@craggy cloak could we talk about gui shinenigans?
honestly just ripping off e4mc's gui seems like the perfect way to handle it
IMB is great at gui design
We do not need to rip anyone of.
oh the clipboard feature works already
it does sometimes
sometimes it doesnt
currently depends on if your runtime is headless or not
but i am currently fixing that
fixed now
Hehe I found the fix
Yeah sure
interresting
Why am i still live
how tf does that happen
linux moment
thats the next question
And 8 year old HDD
I see hole punching goes great.
you mean gui development?
the hole punching works great, got 3 people to connect to me today
Ah
gimme 5 minutes, ima make some food. i will stay in this call tho
Now do 3 (4 including yourself) at once
well yes
we were 3 people on a server
at the same time
2 other dudes
and myself
Breaking limits here
?
my internet seems to be somewhat functional again
and the connection was stable and all
until someone decided to spawn 100 to the power of 4 ender dragons
lmao
at least i only threw some diamonds
i also made some progress on the native java front
Connection was stable
i made a functioning tcp tunnel on localhost
Fps were not
Well, wanna test it today if it works with me?
Or wanna first make it work with minecraft
its not something that needs to be tested over wan, i just needed to see if it correctly forwards data
the next step is seeing if minecraft can correctly connect over the tunnel
unless theres something you wanna test, theres no reason to
i need to make some more things work on localhost first
But first, gotta eat some quiche
Ah ok
@lofty timber I'll make a PR with the UI you saw, might take an hour or two
No problemo
Thank you really much๐
If I work fast, I could prob get this to be ready for release monday
Without a native java impl tho
speaking of
this is minecraft successfully running through a java tunnel
i dont think the error is a problem, it happens when the client disconnects
If you can just catch that
And print a connection closed
@vapid plaza you think you get this finished this weekend?
i need to catch it so i can close the socket correctly
If so I am gonna wait and not use gole
Ok, I'ma just use gole for the time beeing
Ok
Just ping me, if this is ready to be worked into a mod
I'ma quickly the rework the hood of the mod to incorporate it
holy shit
man is cooking fire
you are already out of my league 1000 times over lol
bro is cookin
did you make a separate gole tunnel for each, on a different port?
yeah they locally tunnel to 25565
i was experimenting with reusing the tunnel
but i think its gonna create problems when people join at different times
i can only send syn packets before starting to listen
well that means more tunnels, more open ports, more active sockets
i currently need 3 threads per open socket xd

thats the harsh reality of hole punching
or well is it
i did never check what happens
if there was a way to send a packet from a serversocket, this would be 100x easier
when i punch a hole to a user
but nooo java says you cant do that
and then just make a seconduser do the same
i never checked if that goes horribly wrong
but it prob will
opening a separate tunnel also makes the core punching logic more complicated since it dynamically takes a different port each time
hardcoded ports would have been nice
it would be a lot less open ports that might not close correctly
once the java implementation is finished ima need to see the performance impact of opening 10+ tunnels
i might be able to drop the amount of used threads, but its probably gonna stay at least 1 per player + 1 master thread
any lower and the ping will suffer
One should maybe think of getting a server
Which is understandable
but it would be neat if they dont have to tho
Yes
virtual threads ๐คค
We sadly ain't got no java 21
do the minor inconvenience of "java": ">=21"

X to doubt
If so, virtual threads๐
And why shouldn't they update
More features mojank can use
Especially virtual threads and pattern matching
I think pattern matching is java 21?
Or was it string templates
btw how do i update my gradle to a newer version
the project seems to use an older version than what i have installed system wide
it means i cant update past fabric loom 1.2 apparently
Huh
Edit gradle wrapper.properties
Change this
yeah i found it
8.5+ is needed for Loom 1.4+
got 8.5 now
i think next time id rather copy the fabric example mod instead of generating with mcdev
yeah
everything is outdated
neat, i didnt even know theres a cli
im too new to modding idk half the available tools xd
Mixins
ive only ever needed @Inject so far lmao
i only made 1 basic mod tho
prolly gonna need more for this one
They are not that hard once you understand all the black magic
But when looking at complicated ones, my brain just shuts off
Insert Windows XP shutdown sound
so far i find mixins very intuitive
and from what ive heard of mixinextras (which i also have not seen up close at all) its even more convenient
yes
what mixins should have been
(joke)
i am really excited for what imb11 is wizarding together
ui development is wizardry
whats the realistic maximum of connections?
whatever your network speed and cpu can support
cpu overhead will be very small tho
theoretical limit is ~65000 since you will run out of ports
but like
xd
65000 player minecraft server when
@lofty timber (Ignore the gray box, this is where world information will go.)
Oops
forgot to upload
1
sec
he forgor
ok cool, but am i too blind to see where you input the ip of the client?
ah ok
i havent done that in a long while
Eg: Create Local Server
ye
Since that's technically what you're doing if you dont tick P2P checkbox
id call it "host world" or something
Yeah
since people outside local network will join
Will rename "Open to LAN" to "Host World"
wheres the button gonna be on the host side to add a new client?
When the server is active, the button will rename to "Manage Server"
and then the management screen will open
replacing the "player management" or whatever its called right?
player reporting
Vanilla doesn't have a player management GUI
It has /ban and /kick
thats really it
yeah thats what i meant
No, that'll likely stay
then where is the manage server button gonna go, cause player reporting replaces open to lan once lan is opened
yeet the child
you know what it doesnt matter that much (to me), i just need to mock roughly the same places so i can test the java tunnel implementation
at this point i need some UI to attach to
and im thinking what the best way would be to do it
maybe i should just create a branch in the repo
just hardcode that shit for the moment beeing
hardcode all values
and see if i can join
thats the easiest test one can do
thing is i dont wanna do ui mixin, i just wanna write i/o code xd
but i need buttons for the testers to press
you can just, yoink mine
four-griffins
invite sent
Send me an invite too whilst you're at it @lofty timber
IMB11
ill push UI stuff to a branch
done my lord
where do i see invites xd
and the thing i want is that this works
not that i get gazillions of downloads or fame
i just want this to work and help people connect
yeah i want it to work, cause i would feel proud of my contribution
im the kind of person to start 99999 side projects and not finish any of them, so making a thing that not only works but is also useful will be very nice
i just most of the time start goofy aaaah projects
that even i dont know the reason to use
pending
alright im using static constants for my stuff then xd
im also gonna eventually replace the code where we force the lan port to be 25565, i wont need it to work and also it would break when that port is in use
low chance but if its not necessary, might aswell drop it
yeah after the ui is in place we can always clean up a bunch of stuff
yeah my plan which i had a bit of code for already, was to let the game pick the vanilla way and then see what it picked
To be honest
There isn't really anything that can be configured
Other than the puncher path
yes
gole
that config gile
i was gonna ask, do we really need an external config lib
is only for that the input gets persisted
but that can be left out
not that neccesary
Im currently using YACL for its image stuff
in the UI
so it might as well be used for it's intended purpose
okay fair
did you make a branch yet?
yeah but i didnt commit/push anything to it yet
ah ok
go into a world
hit p2p button
input everything
once holes are punched
proceed button
click start lan world
done
alr
technically it works, just looks shitty
gotta go, will try some more stuff tonight
ye have fun at whatever you do
thanks sir
found this weird bug
with Texture Not Found texture haha
no clue what i did lol
Bro this is awesome. So many people working together to make something awesome.
we got 3 people that voluntiered to help
1 person that had the initial idea
imb11 making the ui
myself making the backend
and last, but certainly not least four griffings currently writing a pure java implementation to be used
shoutout to those 3 people testing
other question since im not at my pc/dont have people to test
if you wanna let multiple people in, do you repeatedly press the p2p button and do the setup, and then start lan world?
actually can you start the world first and then start adding people
should work right
cause im thinking, if we first create tunnels but only connect to the world after all tunnels are set up, the first player might start running into tcp timeout problems
repeted p2p pressing
and only start once
ye ofc
Happy to assist with any testing if anything required rn
timeout time maybe?
yea
connection try rate too
in java implementation, the limiting factor is gonna be tcp handshake timeout
60s on unix, 72s on windows
@lofty timber Will add the list of IPs in a sec
shiiiii
Pushed UI if you want to have a quick look
not fully done though
I have my exams next week too, so I probably wont be able to work on it until next weekend sorry
The IP address list - it might be worth making this a global list of IP addresses through a config screen such as YACL
I assume its okay if an IP address is invalid
and it'll just skip
I might quickly just rename "Public" to "Protected"
since technically it's not fully public
ok i am prob to dumb for that
Luckily i wrote a bit of the YACL wiki
a bit: all
what is the point of the ip list?
Is it not to specify which IP addresses to tunnel/punch into?
it is
Then yeah, just make it global
ima try my best
These should really be temporary variables
instead of global
(except file path for gole)
(which can be removed when the java impl is done)
if the ui is almost done, aka has enough of the buttons
i could start the java impl from there instead of old ui
ive done basically nothing so far, feeling kinda unproductive this evening
if you want
The Join screen doesn't exist yet though
(but that's literally just two text boxes
Connection ID and Port)
(so you could do that if you wanted)
Essentially: make two TextFieldWidgets that have width 200 and center them in the middle of the screen
yeah and i dont even need a field for the port, the java code picks one
oh neat
You could probably utilize quickplay to join as well?
Instead of redirecting to the server list page
You'd need to access widen the entire quickplay class for that
is quickplay what is used when direct connecting from the multiplayer menu?
It's a new feature that was added in 1.20.4
that allows you to instantly join a world/server using launch arguments
So minecraft.jar --quickplayServerIp=play.hypixel.net
would throw you straight into hypixel
instead of the title screen
but the methods are easy to use that you could run the quickplay manager from anywhere
which is gonna be done at runtime some way or another
Quickplay only needs an IP and port
It can join from anywhere
(as long as you're not in a world, it works)
yeah but hole punching needs more than that
did it even do that?
ye
that would work on gole impl
Quickplay.joinServer("127.0.0.1:randomGoofyAaahPort")
ah
in iava impl, server needs to open a new socket, client needs to open socket, and they need to send the socket information to each other
using the base64 code
I see
can you not put some extra info into the base64?
I absolutely suck at networking haha
this is beyond me 
maybe it can be done on the second run, but every time you connect as a client youre gonna get a new port from the server to punch to, so you need to request it every time
i dont think its feasible to have quickplay
it might be possible to add p2p worlds to the multiplayer screen tho so you can connect fairly quickly
I think we're on the wrong line
Im talking about hacking the quickplay manager
to join the server via our UI
instead of the server list
not via launch arguments
that'd be too complicated
ah okay that makes more sense xd
maybe? id have to check out the new ui
is it on github?
Yeah
ui branch
No join screen yet
but create screen exists
essentially just need to add the joining world functionality
then you do your networking shenanigans
and show a success/fail screen
if fail, ask if the user wants to retry, leave the world, or stay in the world without retrying
yeah alright
man this looks so good
can we make the default port 25565?
hmm actually ig that will depend on if 25565 is free or not
default port 25565 and increment it by 1 if it's taken/refused?
ports are detirmed from the id aren't they?
yeah actually
the connection ID should be the full socket
right now they are yeah, they wont be anymore in the java impl
Hm okay
Maybe the normal proxy port?
That way we don't collide with normal minecraft servers.
wdym normal proxy port?
25577, port from bungeecord and velocity.
But honestly no
Just make 25565 default and make user able to configure it.
yeah
in the end, if the user picked port is taken were gonna override it all the same
so might as well pick the common port as default
I would just fail if the port is taken and tell them to change their port to a free one.
thats also an option
I wouldn't silent fail as just picking another port might cause other applications to fail.
although i want the experience to be quick for people who dont care about the port
25565 as default
they just press continue until they can play the game
dw i feel the same thing after looking at the new ui lmao
also i dont think were gonna need to mess with quickplay to join from our custom ui
the way the multiplayer screen joins seems fairly straightforward to yoink
ima just, try my best later
to make the ip list not look shit
honestly i feel like maybe i should wait until everything is done before ripping out the gole stuff
this is above my minecraft modding skill level and im gonna need a lot of time to understand everything thats going on lol
They're the same thing ๐
Quickplay actually just ripped out the join button functionality
into a method call
I'ma poke around at the IP list if that's no problem for you IMB11
Is there anything premade to that extend
I would recommend doing a manual YACL screen instead of annotations
Or do I need to rip my Brain out when working at thus
Let me find a good simple example
Oh
SnowUnderTrees has a "Biome ID" list
which is a List of strings

Time to f around and find iut
See the https://yacl.moddedmc.wiki/ guide for setup
I abstracted my setup stuff into a library mod
for extra curseforge points/profit
for reusability
obviously
wouldnt i need to design a add button?
to add to that list?
ah ok, cool
time to, get to coding
and reading a lot of docs
ok this code crashes for some reason
cool
i didnt change anything
did you reload gradle?
yes
huh
restart game?
restart intellij i suppose
MinecraftClient.method_1551() is getInstance()
because the game restarts itself forcefully
restarting intellij did absolutely nothing
i just nuked my chaches
they are sometimes borked
yea
just had to nuke my caches
for some reason
Note:
- We need to add a warning that sharing will leak your ip
@lofty timber Does a CF+MR page exist? Might be worth reserving a slug
p2p isn't taken
Is P2P4All the name?
so be quick
Might be worth just naming the mod P2P
i have it
you got a logo?
oo neat
modrinth pending
curseforge you are added
technically i havent contributed any code yet
doesnt matter, you did your part
true but i will do a more meaningful part in the future xd
ye
bruh
eg:
your weight / total weight = your percentage cut
You get more CF points if you are heavier? eats more
damn me and my lightspeed metabolism are gonna get nothing
its ok, as you get older it will fail you ๐
yeah same
my digestive system failing might be a good thing
maybe food stops falling straight through
ectomorphs
@lofty timber Only on modrinth ^^
101 %
i hope you dont think i tried to rip you off
O.O
(yes im lightmode user, piss off)
no lol
just joking
haha
Wait if you add like 1000 people
my eyes
just set all to 100%, infinite money glitch
nothing done there yet
just, grabbed the page
AAAAAA
modmenu config be like
i thought we wanted to have that on the join screen page
but here is fine ig
and i am also gonna ditch all this Base64 stuff
not wรถrth it
nice
You can
just make a button
i am just dumb aperantly
and use generateScreen
right
doesnt have to be locked to modmenu
i am dumb
i am to dumb to save the config ;V
P2PYACLConfig.get().golePath = extractedFileFolder.getAbsolutePath() + "/gole-darwin-amd64.exe";
P2PYACLConfig.save();
for some reason doesnt work
What's your code?
figured it out
probably
i am launching rn
jesus christ
i will figure this out alone
this cant be this hard smh
If you send me your code I can help
i may or may not have it now
gimme a sec
figures it out ;D
now i just need to ig, it seems start a gazillion GoleStarters
for every target IP i have saved
".exe" hardcoded?
nono
that is just a part of the logic
and also wronk
lol
good for pointing that out
@craggy cloak config button added, last thing left is querry all the target ips and try to connect to em
only problem is
every connection has a 2:30min timeout blocking the main thread lol
i could just design it non blocking tho
wait so the server is gonna try to reestablish a tunnel to all previously connected players?
on startup i mean
Just multithread it
using executors
yes
You might as well make a progress tracker too
So i can make a "loading" screen in the future
progress tracker?
what do you mean
which connections succeeded and which did not?
yeah
no, just buttons
buttons?
but i mean, when clicking join p2p player
you need to provide the ip to join
and the port
no, nothing there
@craggy cloak i need some way, to tell the user which port is for which client
because no two clients can have the same port
Just automate it?
+1 to the port number for each client
and if the port is taken
add again
or i add another list
where for the first entry of the ip list
the first entry of that list corressponds for that port

im actually making some progress
decided to go back to branching old ui and simply throwing out anything i dont understand, since i suck at reading other peoples code
my code is also horrible
my main problem is that my brain isnt braining anymore but i refuse to stop until i have a testable demo
xd
so im just staring at my screen xd
I have just tested and two of my tested NATs try to use external port same as internal one.
from what i read online, most routers do that yeah
because mine does the same
probably except ports like 80, 443, 8080 etc
im always gonna do tunneling with ports above 40000 just to be safe
no its actually a good thing
it only works when external and internal ports are the same
ye thats why i was curious if theres a problem
I think it is even better to just let the OS decide the port.
we might, but we need to check and override in some rare cases
@craggy cloak i created a Hashmap for you, where every connection starter is mapped to a boolean which decides if hole punching was successful or not
you can throw that into a log window
I feel like we could solve a massive pain point by just automating it entirely
Does the user need any say in port numbers?
The only concern that they should have is IP addresses
with us, he only has partial control
he says where it shall start
so he can like exclude a port he absolutely does not want used
It would be more sensible to have a "port range" configuration option
yeah and that
ig, i would leave it be as it currently is
also are you fine with just the boolean telling you if it finished or not
or do you want some more logging from the connector threads?
yeah my goal is to automate it as much as possible
i dont think letting the user pick a port makes a meaningful difference
but we need to e.g. keep port 25565 free to make joining easier, and we need to not override the lan port picked by integrated server
@lofty timber A hashmap of IP to an enum stating the progress would be helpful
Eg:
Pending,
Punching,
Failed,
Success
although nvm keeping 25565 free is only relevant in my current shitty demo lmao
will do
That's a different protocol, so you can use 25565 just fine.
minecraft uses tcp, no? the punching and tunnel also use tcp
MC definitely uses TCP.
but with the better ui, joining on port 25565 isnt important as it will happen programmatically anyway
Hole punching very likely uses UDP.
Anyways
we have working stuff, lets not re-re-rewrite it haha
it is done my lord
public final Map<String, ConnectionProgress> ipToStateMap = new HashMap<>();
what a beautiful concoction
i try to make all my connections
dump all in there
and then you need to open another window and make that beautiful
i leave that up to you
neat
i am currently now designing the join screen
that shouldnt be too hard
famous last words
for some reason
text field preview does not render
coolio
@craggy cloak i have once again proven that i can absolutely not design ui
clientside also now has login functionality
absolutely needs beautification
but also has connection stages built in
The join screen doesn't need to have fancy top buttons
Just make it all vertical
One sec
This shouldn't be hard
Just set the x to (screen width /2) - 100 for the text fields
make sure the text fields have a width of 200
ima do that tomorrow, 1 hour the next day is getting a tad late
guess what
first successfull connection with the new gui
nice
too myself but it counts
anyone online to help me test something
i wrote some horrendous code and i hope my tired ass didnt make a mistake with the ports, but i think it should now connect using minecraft ingame UI
my tired ass is beating minecraft code to death
yeah im stopping after this as well, whether it works or not
problem for future me
@proper sleet are you ready?
assets downloading ;-;
wack, you blocked him
i can see your messages
oh yay
@vapid plaza i casually changed 19 files
*23
gui now works
join gui needs a bit of tinkering
but otherwise, great success
And no log window yet
the native impl first test on the other hand was a failure 
did something wrong with the base64 decode
might be a linux <-> windows thing
What I did wrong
I encoded it wrong
You can't really encode the target ip directly
idk what the problem was, on my end the decoding went fine and i can see in the logs its the correct ip and port
something with a newline apparently
nah dude i gotta go to bed, im falling of my chair
ill look at it tomorrow first thing
Same same
I then gotta beauty up the join screen
And either wait for imb
Or throw together a log screen myself
Where I have no clue how
i use linux unless you already knew that
Hey that goofy error with the HTML in it? I just got it in a completely non-network-related mod. Apparently it's the auth servers being wack or smth.
ah so it probably wasnt that, im on linux too
Managed to read the title as โCoding-free multiplayerโ
They went down the other day
lol i wish
We Just receive random gibberish
When we try to auth Sometimes
When the auth servers die itโs very annoying
Aaand?
It lets you play on servers like Hypixel with an offline account though
So thatโs kind of fun
I use a premium account but itโs interesting
gimme a moment ive been awake for 15 minutes xd
Havenโt tested logging in on other accounts
That would be interesting to test
Thatโs a security problem though if you can
Ive been awake for two
So that means if the auth is down anyone can do anything on your account
Good thing that Iโm not a well known person in the Minecraft community
Only in very few places
What lets you play without a premium account?
If the auth servers are down you could technically log onto servers that require premium accounts
Iโm not 100% sure about it
I remember once I logged onto Hypixel when the auth was down
Everyone had Steve skins
It was wacky
That does not mean it was cracked accounts
Hopefully Iโm not correct
I donโt think I am
no you just get kicked
also what the hell is this forum post
2k messages
thas what happens when the request thread turns into a development chat lol
we might need to change the title of the post, its worded kinda weirdly
@livid lake Mind changing it to "LAN through NAT Punching"
P2P mod: LAN-to-LAN through NAT hole punching
@lofty timber im checking out the UI, the config screen seems to work as expected so far
join screen still needs something to explain what goes in the text fields
does anyone have 5 minutes to do more tests
Yea
Was too sleep drunken Yesterday
fair
@lofty timber can i annoy you to come test with me
if not, im gonna be back in about an hour to do more modding
Gonna be that
Am at my grandparents
@vapid plaza @lofty timber Does the client need the mod installed to join the LAN server?
I presume not
We don't touch Vanilla outside of the connection, we only establish the hole punching.
If your on the local Network No
Only for holepunching
But isn't hole punching one way?
We do it two way I think?
That sort of defeats the point of competing with e2mc then haha
Because both neeed to ping a specific port
e2mc had the benefit of supporting vanilla clients
Well TCP Tunneling cant do that
UDP?
You need both Parties to Ping each other
Well both cant donit
Party A and B need to Ping each other
e2mc has a proxy, we dont