#Coding free multiplayer [Looking for help & testers] Zero port forwarding

1 messages ยท Page 2 of 1

lofty timber
#

gtg offline for today tho

#

Once I push

#

pushed

#

good night and a happy 13.01 for the people reading dis

#

@livid lake I summon you

#

To test dis

livid lake
#

good timing xD

livid lake
lofty timber
#

Well my power went out

#

So you gotta test it somehow without me

livid lake
#

alright sure

lofty timber
#

Either you test it manually somehow alone

#

Or find another person to annoy into helping us out

livid lake
#

I'll be able to test it ๐Ÿ™‚ have a good night! I'll let you know how it works

lofty timber
#

More gui work got done

#

and this should tm work

#

@vapid plaza when can i annoy you to test this with me

peak cosmos
#

does it work with DNS names as well as IP ?

#

as in does the GUI support the entry of a name ๐Ÿ˜›

lofty timber
#

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

patent elbow
#

Why would someone point DNS to their IP if they can't do port forwarding?

lofty timber
#

that would be the next question i am asking myselfconcern

peak cosmos
#

fair point, but you may still opt to use this mod still? ๐Ÿคทโ€โ™‚๏ธ

lofty timber
#

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

peak cosmos
#

i thought that was the base mod functionality the p2p element?

lofty timber
#

yes

#

but its kinda wonky atm

vapid plaza
#

yeah the mod is in the proof-of-concept stage, its not very stable yet

vapid plaza
lofty timber
#

so far

#

two different people

#

two times the connection did not work

lofty timber
#

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

gleaming beacon
#

:)

lofty timber
#

Can I annoy you to test it one last time?

#

p2p achieved

devout maple
#

are you still looking for testers? @ me if you need help

gleaming beacon
#

HEHEEH

#

I killed his computer

#

:)

lofty timber
#

@devout maple i need a thrid person rn, hop in vc

lofty timber
#

hehehe

#

it works

gleaming beacon
lofty timber
#

@craggy cloak could we talk about gui shinenigans?

devout maple
#

honestly just ripping off e4mc's gui seems like the perfect way to handle it

lofty timber
#

I do not wanna rip of anyone

#

The GUI ATM is functional

#

But not pretty

gleaming beacon
#

We do not need to rip anyone of.

devout maple
#

oh the clipboard feature works already

lofty timber
#

it does sometimes

#

sometimes it doesnt

#

currently depends on if your runtime is headless or not

#

but i am currently fixing that

#

fixed now

gleaming beacon
#

Hehe I found the fix

lofty timber
#

I will be there in 5 minutes

#

Gotta fix my chair before that

#

It broke in half

craggy cloak
#

lol kk

#

I'll wait in VC

craggy cloak
#

@lofty timber PC Crashed

#

๐Ÿ˜ญ

lofty timber
#

interresting

craggy cloak
#

Why am i still live

lofty timber
#

how tf does that happen

craggy cloak
#

linux moment

lofty timber
craggy cloak
#

And 8 year old HDD

patent elbow
lofty timber
#

you mean gui development?

#

the hole punching works great, got 3 people to connect to me today

patent elbow
lofty timber
#

gimme 5 minutes, ima make some food. i will stay in this call tho

fleet falcon
lofty timber
#

well yes

#

we were 3 people on a server

#

at the same time

#

2 other dudes

#

and myself

fleet falcon
#

Breaking limits here

lofty timber
vapid plaza
#

my internet seems to be somewhat functional again

lofty timber
#

and the connection was stable and all

#

until someone decided to spawn 100 to the power of 4 ender dragons

vapid plaza
#

lmao

#

at least i only threw some diamonds

#

i also made some progress on the native java front

lofty timber
vapid plaza
#

i made a functioning tcp tunnel on localhost

lofty timber
#

Fps were not

lofty timber
#

Or wanna first make it work with minecraft

vapid plaza
#

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

lofty timber
#

Well, I am there in 5 minutes

#

If your up for it

vapid plaza
#

unless theres something you wanna test, theres no reason to

#

i need to make some more things work on localhost first

lofty timber
#

But first, gotta eat some quiche

craggy cloak
#

@lofty timber I'll make a PR with the UI you saw, might take an hour or two

lofty timber
#

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

vapid plaza
#

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

lofty timber
#

If you can just catch that

#

And print a connection closed

#

@vapid plaza you think you get this finished this weekend?

vapid plaza
#

i need to catch it so i can close the socket correctly

lofty timber
#

If so I am gonna wait and not use gole

vapid plaza
#

maybe, maybe not

#

hard to say

lofty timber
#

Ok, I'ma just use gole for the time beeing

vapid plaza
#

ill soon be at the point of testing as a minecraft mod tho

#

probably this evening

lofty timber
#

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

craggy cloak
#

@lofty timber

#

Will find HD images later

lofty timber
#

holy shit

#

man is cooking fire

#

you are already out of my league 1000 times over lol

craggy cloak
#

fixed alignment

lofty timber
#

bro is cookin

vapid plaza
#

@lofty timber you got it working with >2 people right

#

how did that work

vapid plaza
#

did you make a separate gole tunnel for each, on a different port?

lofty timber
#

yes

#

seperate tunnel, which all still link to port 25565 on my pc

vapid plaza
#

yeah they locally tunnel to 25565

lofty timber
#

i just create a new tunnel for every user

#

thats the "magic"

vapid plaza
#

i was experimenting with reusing the tunnel

#

but i think its gonna create problems when people join at different times

lofty timber
#

yes

#

best is just, one user, one tunnel

#

i thonk

vapid plaza
#

i can only send syn packets before starting to listen

vapid plaza
#

i currently need 3 threads per open socket xd

lofty timber
lofty timber
#

or well is it

#

i did never check what happens

vapid plaza
#

if there was a way to send a packet from a serversocket, this would be 100x easier

lofty timber
#

when i punch a hole to a user

vapid plaza
#

but nooo java says you cant do that

lofty timber
#

and then just make a seconduser do the same

#

i never checked if that goes horribly wrong

#

but it prob will

vapid plaza
#

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

lofty timber
#

Don't think it's possible

#

Or particularly wise

vapid plaza
#

it would be a lot less open ports that might not close correctly

lofty timber
#

Also corrct

#

Ah I dunno

#

What's better between the two

vapid plaza
#

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

lofty timber
#

I think at that point

#

When opening 10 tunnels

vapid plaza
#

any lower and the ping will suffer

lofty timber
#

One should maybe think of getting a server

vapid plaza
lofty timber
#

Yes

proper sleet
#

virtual threads ๐Ÿคค

lofty timber
#

We sadly ain't got no java 21

proper sleet
#

do the minor inconvenience of "java": ">=21"

lofty timber
craggy cloak
#

Hopefuly 1.20.5 will be java 21

#

Virtual Threads are indeed poggers

vapid plaza
#

X to doubt

lofty timber
#

If so, virtual threads๐Ÿ˜‹

craggy cloak
#

I mean, it probably will be

#

its the new LTS

lofty timber
#

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

vapid plaza
#

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

proper sleet
#

gradle wrapper directory

#

but thats intentional usually

vapid plaza
#

it means i cant update past fabric loom 1.2 apparently

lofty timber
#

Huh

craggy cloak
#

Change this

vapid plaza
#

yeah i found it

craggy cloak
#

8.5+ is needed for Loom 1.4+

vapid plaza
#

got 8.5 now

#

i think next time id rather copy the fabric example mod instead of generating with mcdev

craggy cloak
#

yeah

vapid plaza
#

everything is outdated

craggy cloak
#

mcdev sucks

#

I like Fabric CLI to generate

vapid plaza
#

neat, i didnt even know theres a cli

#

im too new to modding idk half the available tools xd

lofty timber
#

Java

#

(Optional)

vapid plaza
#

yeah i dont know it that well either

#

but like

#

its java

#

its not hard

lofty timber
#

Mixinsohno

vapid plaza
#

ive only ever needed @Inject so far lmao

#

i only made 1 basic mod tho

#

prolly gonna need more for this one

lofty timber
#

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

vapid plaza
#

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

lofty timber
#

yes

#

what mixins should have been

#

(joke)

#

i am really excited for what imb11 is wizarding together

#

ui development is wizardry

sonic crane
#

whats the realistic maximum of connections?

vapid plaza
#

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

craggy cloak
#

@lofty timber (Ignore the gray box, this is where world information will go.)

#

Oops

#

forgot to upload

#

1

#

sec

lofty timber
#

he forgor

craggy cloak
lofty timber
#

ok cool, but am i too blind to see where you input the ip of the client?

craggy cloak
#

i havent done it yet

#

its just structuring

lofty timber
#

ah ok

craggy cloak
#

But i was thinking

#

might be worth changing "P2P" mentions to "Local"

lofty timber
craggy cloak
#

Eg: Create Local Server

lofty timber
#

ye

craggy cloak
#

Since that's technically what you're doing if you dont tick P2P checkbox

lofty timber
#

ye makes more sense

#

you are doing incredible work rn ;D

vapid plaza
#

id call it "host world" or something

craggy cloak
#

Yeah

vapid plaza
#

since people outside local network will join

craggy cloak
#

Will rename "Open to LAN" to "Host World"

vapid plaza
#

wheres the button gonna be on the host side to add a new client?

craggy cloak
#

When the server is active, the button will rename to "Manage Server"

#

and then the management screen will open

vapid plaza
#

replacing the "player management" or whatever its called right?

lofty timber
#

player reporting

craggy cloak
#

Vanilla doesn't have a player management GUI

#

It has /ban and /kick

#

thats really it

vapid plaza
craggy cloak
vapid plaza
#

then where is the manage server button gonna go, cause player reporting replaces open to lan once lan is opened

craggy cloak
#

Oh

#

then yea

#

Since you can open player reporting using keybind

lofty timber
#

yeet the child

vapid plaza
#

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

lofty timber
#

if ya need someone to test with

#

ping me

vapid plaza
#

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

lofty timber
#

just hardcode that shit for the moment beeing

#

hardcode all values

#

and see if i can join

#

thats the easiest test one can do

vapid plaza
#

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

lofty timber
#

you can just, yoink mine

vapid plaza
#

im gonna create a temporary branch

#

so i can rebase once the better ui is there

lofty timber
#

ye

#

lemme add you to the repo

#

whats ya name on github?

vapid plaza
#

four-griffins

lofty timber
#

invite sent

craggy cloak
#

Send me an invite too whilst you're at it @lofty timber

#

IMB11

#

ill push UI stuff to a branch

lofty timber
#

done my lord

vapid plaza
#

where do i see invites xd

lofty timber
#

email

vapid plaza
#

yeah nvm just received it

#

thank ๐Ÿ‘

lofty timber
#

np

#

this is a group effort, not a kroks doing everything

vapid plaza
#

yeah i like where its going tbh

#

several people hopping in to help

lofty timber
#

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

vapid plaza
#

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

lofty timber
#

i just most of the time start goofy aaaah projects

#

that even i dont know the reason to use

craggy cloak
#

ik

#

ill accept later

vapid plaza
#

question, what is midnightconfig

#

i havent used it before

craggy cloak
#

trash

#

its going away after i finish the UI

lofty timber
#

what shall i use then?

#

generally curious

vapid plaza
#

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

lofty timber
#

those are all things

#

i postpone for now

#

until the ui is here

vapid plaza
#

yeah after the ui is in place we can always clean up a bunch of stuff

lofty timber
#

that was my plan

#

like let the user choose the port the internal server runs on

vapid plaza
#

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

craggy cloak
#

I'll add a config screen with this UI PR

lofty timber
#

understood

#

do what you must

#

i will, punch holes after that ;V

craggy cloak
#

To be honest

#

There isn't really anything that can be configured

#

Other than the puncher path

lofty timber
#

yes

craggy cloak
#

gole

lofty timber
#

that config gile

vapid plaza
#

i was gonna ask, do we really need an external config lib

lofty timber
#

is only for that the input gets persisted

#

but that can be left out

#

not that neccesary

craggy cloak
#

in the UI

#

so it might as well be used for it's intended purpose

lofty timber
#

ye

#

will do

vapid plaza
#

okay fair

lofty timber
vapid plaza
#

yeah but i didnt commit/push anything to it yet

lofty timber
#

ah ok

vapid plaza
#

im checking out the current state of the mod

#

how do i start a server?

lofty timber
#

go into a world

#

hit p2p button

#

input everything

#

once holes are punched

#

proceed button

#

click start lan world

#

done

vapid plaza
#

alr

lofty timber
#

technically it works, just looks shitty

vapid plaza
#

gotta go, will try some more stuff tonight

lofty timber
#

ye have fun at whatever you do

vapid plaza
#

thanks sir

craggy cloak
#

found this weird bug

#

with Texture Not Found texture haha

#

no clue what i did lol

lofty timber
#

Huh

#

thats one interresting texture not found

#

btw i really appreciate your work

swift lance
#

Bro this is awesome. So many people working together to make something awesome.

lofty timber
#

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

vapid plaza
#

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

lofty timber
#

and only start once

vapid plaza
#

ye ofc

peak cosmos
#

Happy to assist with any testing if anything required rn

lofty timber
#

rn no, once the gui recode is done, then yes

#

extensive testing

gleaming beacon
lofty timber
#

yea

gleaming beacon
#

connection try rate too

vapid plaza
#

in java implementation, the limiting factor is gonna be tcp handshake timeout

#

60s on unix, 72s on windows

craggy cloak
#

wip

lofty timber
#

bro is cookin hefty

#

nice work tho ;D

craggy cloak
#

@lofty timber Will add the list of IPs in a sec

lofty timber
#

shiiiii

craggy cloak
#

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

lofty timber
#

ok

#

well whats missing?

#

maybe i can add to it?

craggy cloak
#

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

lofty timber
craggy cloak
#

Luckily i wrote a bit of the YACL wiki

#

a bit: all

vapid plaza
#

what is the point of the ip list?

craggy cloak
#

Is it not to specify which IP addresses to tunnel/punch into?

lofty timber
#

it is

craggy cloak
#

Then yeah, just make it global

lofty timber
#

ima try my best

craggy cloak
#

These should really be temporary variables

#

instead of global

#

(except file path for gole)

#

(which can be removed when the java impl is done)

vapid plaza
#

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

craggy cloak
#

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

vapid plaza
#

yeah and i dont even need a field for the port, the java code picks one

craggy cloak
#

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

vapid plaza
#

is quickplay what is used when direct connecting from the multiplayer menu?

craggy cloak
#

It's a new feature that was added in 1.20.4

#

that allows you to instantly join a world/server using launch arguments

#

would throw you straight into hypixel

#

instead of the title screen

vapid plaza
#

i see

#

i dont think that will work, we need to both enter a key and generate one

craggy cloak
#

but the methods are easy to use that you could run the quickplay manager from anywhere

vapid plaza
#

which is gonna be done at runtime some way or another

craggy cloak
#

Quickplay only needs an IP and port

#

It can join from anywhere

#

(as long as you're not in a world, it works)

vapid plaza
#

yeah but hole punching needs more than that

craggy cloak
#

ah

#

How did the old impl work then with the Direct Connect thing?

vapid plaza
#

did it even do that?

lofty timber
#

ye

craggy cloak
#

It has an IP address?

#

and if you have a port, why cant quickplay work?

lofty timber
#

yes

#

127.0.0.1:randomGoofyAaaahPort

craggy cloak
#

yeah

#

that would work

vapid plaza
#

that would work on gole impl

craggy cloak
#

Quickplay.joinServer("127.0.0.1:randomGoofyAaahPort")

craggy cloak
vapid plaza
#

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

craggy cloak
#

I see

#

can you not put some extra info into the base64?

#

I absolutely suck at networking haha

#

this is beyond me tiny_potato

vapid plaza
#

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

craggy cloak
#

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

vapid plaza
#

ah okay that makes more sense xd

#

maybe? id have to check out the new ui

#

is it on github?

craggy cloak
#

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

vapid plaza
#

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

craggy cloak
#

default port 25565 and increment it by 1 if it's taken/refused?

gleaming beacon
#

ports are detirmed from the id aren't they?

craggy cloak
#

the connection ID should be the full socket

vapid plaza
#

right now they are yeah, they wont be anymore in the java impl

gleaming beacon
#

Hm okay

#

Maybe the normal proxy port?

#

That way we don't collide with normal minecraft servers.

vapid plaza
#

wdym normal proxy port?

gleaming beacon
#

But honestly no

#

Just make 25565 default and make user able to configure it.

vapid plaza
#

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

gleaming beacon
#

I would just fail if the port is taken and tell them to change their port to a free one.

vapid plaza
#

thats also an option

gleaming beacon
#

I wouldn't silent fail as just picking another port might cause other applications to fail.

vapid plaza
#

although i want the experience to be quick for people who dont care about the port

gleaming beacon
#

25565 as default

vapid plaza
#

they just press continue until they can play the game

gleaming beacon
#

25565 will just be the normal port

vapid plaza
#

maybe make it a config option

#

whether or not to auto-repick a port

lofty timber
#

i feel kinda useless rn

#

anything i can do lol?

vapid plaza
#

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

lofty timber
#

to make the ip list not look shit

vapid plaza
#

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

lofty timber
#

That's up to you

#

I'ma just, poke around at the GUI stuff this evening

craggy cloak
#

Quickplay actually just ripped out the join button functionality

#

into a method call

craggy cloak
#

QuickPlay.startMultiplayer(client, serverAddress)

lofty timber
#

I'ma poke around at the IP list if that's no problem for you IMB11

#

Is there anything premade to that extend

craggy cloak
#

I would recommend doing a manual YACL screen instead of annotations

lofty timber
#

Or do I need to rip my Brain out when working at thus

craggy cloak
#

Let me find a good simple example

#

Oh

#

SnowUnderTrees has a "Biome ID" list

#

which is a List of strings

lofty timber
lofty timber
#

Time to f around and find iut

craggy cloak
#

I abstracted my setup stuff into a library mod

#

for extra curseforge points/profit
for reusability

#

obviously

lofty timber
#

Ye

#

Every java class

#

Seperate mod

#

That's the spirit

lofty timber
#

to add to that list?

craggy cloak
#

no

#

This is what it looks like

lofty timber
#

ah ok, cool

craggy cloak
#

This is the entire list widget

lofty timber
#

time to, get to coding

#

and reading a lot of docs

#

ok this code crashes for some reason

#

cool

lofty timber
craggy cloak
#

no

#

your code haha

lofty timber
#

when pressing on p2p

#

well no

craggy cloak
#

oh

#

err

lofty timber
#

i didnt change anything

craggy cloak
#

did you reload gradle?

lofty timber
#

yes

craggy cloak
#

MinecraftClient.getInstance() not found concern

#

what the fuc

lofty timber
#

huh

craggy cloak
#

restart game?

lofty timber
#

restart intellij i suppose

craggy cloak
#

MinecraftClient.method_1551() is getInstance()

lofty timber
#

because the game restarts itself forcefully

craggy cloak
lofty timber
#

restarting intellij did absolutely nothing

craggy cloak
#

hm

#

what's the full log?

#

could just be a symptom

lofty timber
#

i just nuked my chaches

#

they are sometimes borked

#

yea

#

just had to nuke my caches

#

for some reason

gleaming beacon
#

Note:

  • We need to add a warning that sharing will leak your ip
craggy cloak
#

@lofty timber Does a CF+MR page exist? Might be worth reserving a slug

lofty timber
#

no

#

but ima make one

craggy cloak
#

p2p isn't taken

gleaming beacon
#

Is P2P4All the name?

craggy cloak
#

so be quick

gleaming beacon
#

Oh

#

p2p yee

craggy cloak
#

Might be worth just naming the mod P2P

gleaming beacon
#

Yes

#

Stealing the slug /j

lofty timber
#

aint got no logo ;D

#

modrinth is secured

#

curseforge tho, no logo

craggy cloak
lofty timber
craggy cloak
#

yeah

lofty timber
#

noice

#

real good

vapid plaza
#

oo neat

lofty timber
#

got both of em pages

#

all named P2P

craggy cloak
#

my CF is itsmineblock

#

modrinth is mineblock11

lofty timber
#

modrinth pending

craggy cloak
#

ah

#

how tf do i accept

#

if everyones notifications are broken on modrinth

vapid plaza
#

i dont even have a mr or cf yet

#

eh ill do that later

lofty timber
#

curseforge you are added

vapid plaza
#

technically i havent contributed any code yet

lofty timber
#

for the moment beeing 50 50

#

if grifffin comes

#

33 33 33

lofty timber
vapid plaza
#

true but i will do a more meaningful part in the future xd

lofty timber
#

ye

craggy cloak
#

just do 1 1 1

#

then it's equal

#

its based on weights

#

not percentages

lofty timber
#

bruh

craggy cloak
#

eg:

your weight / total weight = your percentage cut

lofty timber
#

Your reward split as the owner is 50%

Project Owner

#

curseforge moment

peak cosmos
vapid plaza
#

damn me and my lightspeed metabolism are gonna get nothing

peak cosmos
#

its ok, as you get older it will fail you ๐Ÿ˜›

lofty timber
#

i eat and stay thin as a twig

#

shits nasty

vapid plaza
#

yeah same

#

my digestive system failing might be a good thing

#

maybe food stops falling straight through

peak cosmos
#

ectomorphs

craggy cloak
lofty timber
#

ye

#

did that just now

craggy cloak
#

For curseforge put in the literal percentages haha

#

sus

lofty timber
#

huh

#

tf modrinth doing

#

lemme change that

lofty timber
#

changed

#

modrinth smoking crack, i see

gleaming beacon
lofty timber
#

i hope you dont think i tried to rip you off

gleaming beacon
#

O.O

craggy cloak
#

(yes im lightmode user, piss off)

craggy cloak
#

just joking

#

haha

gleaming beacon
#

Wait if you add like 1000 people

lofty timber
gleaming beacon
#

they can all have 1% share

#

O.O

craggy cloak
vapid plaza
#

just set all to 100%, infinite money glitch

lofty timber
#

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

craggy cloak
craggy cloak
#

just make a button

lofty timber
#

i am just dumb aperantly

craggy cloak
#

and use generateScreen

lofty timber
craggy cloak
#

doesnt have to be locked to modmenu

lofty timber
#

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

craggy cloak
#

What's your code?

lofty timber
#

figured it out

#

probably

#

i am launching rn

#

jesus christ

#

i will figure this out alone

#

this cant be this hard smh

craggy cloak
#

If you send me your code I can help

lofty timber
#

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

lofty timber
#

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

vapid plaza
#

wait so the server is gonna try to reestablish a tunnel to all previously connected players?

#

on startup i mean

craggy cloak
#

using executors

lofty timber
#

yes

craggy cloak
#

You might as well make a progress tracker too

#

So i can make a "loading" screen in the future

lofty timber
#

progress tracker?

#

what do you mean

#

which connections succeeded and which did not?

craggy cloak
#

yeah

lofty timber
#

ok

#

for the client join screen, did you have anything done already?

craggy cloak
#

no, just buttons

lofty timber
#

buttons?

craggy cloak
#

see the handleCreate method

#

thats all you should worry about

lofty timber
#

but i mean, when clicking join p2p player

#

you need to provide the ip to join

#

and the port

craggy cloak
#

no, nothing there

lofty timber
#

@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

craggy cloak
#

Just automate it?

#

+1 to the port number for each client

#

and if the port is taken

#

add again

lofty timber
#

or i add another list

#

where for the first entry of the ip list

#

the first entry of that list corressponds for that port

craggy cloak
#

No lol

#

thats silly

#

Just automate the port numbers for each client

lofty timber
vapid plaza
#

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

lofty timber
#

my code is also horrible

vapid plaza
#

my main problem is that my brain isnt braining anymore but i refuse to stop until i have a testable demo

lofty timber
#

xd

vapid plaza
#

so im just staring at my screen xd

patent elbow
#

I have just tested and two of my tested NATs try to use external port same as internal one.

lofty timber
#

that, shouldnt be a problem?

#

or does it crash ore some shit

vapid plaza
#

from what i read online, most routers do that yeah

lofty timber
#

because mine does the same

vapid plaza
#

probably except ports like 80, 443, 8080 etc

#

im always gonna do tunneling with ports above 40000 just to be safe

vapid plaza
#

it only works when external and internal ports are the same

lofty timber
#

ye thats why i was curious if theres a problem

patent elbow
lofty timber
#

we cant

#

we need to decide em ports

vapid plaza
#

we might, but we need to check and override in some rare cases

lofty timber
#

@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

craggy cloak
#

Does the user need any say in port numbers?

#

The only concern that they should have is IP addresses

lofty timber
#

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

craggy cloak
#

It would be more sensible to have a "port range" configuration option

lofty timber
#

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?

vapid plaza
#

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

craggy cloak
#

@lofty timber A hashmap of IP to an enum stating the progress would be helpful

#

Eg:

Pending,
Punching,
Failed,
Success

vapid plaza
#

although nvm keeping 25565 free is only relevant in my current shitty demo lmao

patent elbow
vapid plaza
#

minecraft uses tcp, no? the punching and tunnel also use tcp

patent elbow
#

MC definitely uses TCP.

craggy cloak
#

everything uses TCP haha

#

TCP/IP

vapid plaza
#

but with the better ui, joining on port 25565 isnt important as it will happen programmatically anyway

patent elbow
#

Hole punching very likely uses UDP.

gleaming beacon
#

The current implentation converts the stuff to udp afaik

#

And back to tcp

craggy cloak
#

Anyways

vapid plaza
#

yeah the current gole backend uses kcp over udp

#

i will be using tcp tho

craggy cloak
#

we have working stuff, lets not re-re-rewrite it haha

lofty timber
#

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

craggy cloak
#

neat

lofty timber
#

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

craggy cloak
#

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

lofty timber
#

ima do that tomorrow, 1 hour the next day is getting a tad late

#

guess what

#

first successfull connection with the new gui

craggy cloak
#

nice

lofty timber
#

too myself but it counts

craggy cloak
#

I'll work on this next weekend

#

Got exams

#

cya

lofty timber
#

ye

#

ima finish the login button tho

vapid plaza
#

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

proper sleet
#

Sure

#

@vapid plaza send over the jar, what mc version

vapid plaza
#

1.20.4, lemme build the jar real quick

#

lemme know when you boot it up

lofty timber
#

my tired ass is beating minecraft code to death

vapid plaza
#

yeah im stopping after this as well, whether it works or not

#

problem for future me

#

@proper sleet are you ready?

proper sleet
#

assets downloading ;-;

vapid plaza
#

ah lmao

#

classic

proper sleet
#

oh it finally launched. Now to wait a couple mins

#

pfft me forgetting fabric api

vapid plaza
#

oh

#

how do i see your dms

#

i accidentally clicked ignore lol

proper sleet
#

its accept the button ithink

#

Unblock me ;-;

lofty timber
proper sleet
#

tell him to click and unhide my messegaes

#

then unblock

vapid plaza
#

i can see your messages

proper sleet
#

oh yay

vapid plaza
#

and youre not in the blocked people list

#

idk what i did

lofty timber
#

@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

vapid plaza
#

the native impl first test on the other hand was a failure concernedtater

#

did something wrong with the base64 decode

#

might be a linux <-> windows thing

lofty timber
#

What I did wrong

#

I encoded it wrong

#

You can't really encode the target ip directly

vapid plaza
#

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

lofty timber
#

While your at it

#

You could also test the new gui version

vapid plaza
#

nah dude i gotta go to bed, im falling of my chair

#

ill look at it tomorrow first thing

lofty timber
#

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

proper sleet
swift lance
#

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.

lofty timber
#

Huh

#

So we did Not Break it

#

Yey

craggy cloak
#

Oh yeah

#

Mojangs auth servers have been patchy recently

vapid plaza
inland kindle
#

Managed to read the title as โ€œCoding-free multiplayerโ€

inland kindle
lofty timber
#

When we try to auth Sometimes

inland kindle
#

When the auth servers die itโ€™s very annoying

lofty timber
inland kindle
#

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

vapid plaza
inland kindle
#

That would be interesting to test

#

Thatโ€™s a security problem though if you can

lofty timber
inland kindle
vapid plaza
#

mojang moment

inland kindle
#

Good thing that Iโ€™m not a well known person in the Minecraft community

#

Only in very few places

gleaming beacon
inland kindle
#

Iโ€™m not 100% sure about it

gleaming beacon
#

No..

#

Unless the server did something wrong

inland kindle
#

I remember once I logged onto Hypixel when the auth was down

#

Everyone had Steve skins

#

It was wacky

gleaming beacon
#

That does not mean it was cracked accounts

inland kindle
#

I donโ€™t think I am

cunning tusk
#

also what the hell is this forum post

#

2k messages

lofty timber
#

I am probably a driving factor for this lol

vapid plaza
#

thas what happens when the request thread turns into a development chat lol

vapid plaza
#

we might need to change the title of the post, its worded kinda weirdly

craggy cloak
#

@livid lake Mind changing it to "LAN through NAT Punching"

vapid plaza
#

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

lofty timber
#

Was too sleep drunken Yesterday

vapid plaza
#

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

lofty timber
#

Am at my grandparents

craggy cloak
#

@vapid plaza @lofty timber Does the client need the mod installed to join the LAN server?

#

I presume not

gleaming beacon
#

:)

gleaming beacon
lofty timber
#

Only for holepunching

craggy cloak
#

But isn't hole punching one way?

gleaming beacon
#

We do it two way I think?

craggy cloak
#

You just expose a connection to their network

#

Why can't it be one way

lofty timber
#

To Punch a hole

#

You need the Mod on both sides

craggy cloak
#

That sort of defeats the point of competing with e2mc then haha

lofty timber
#

Because both neeed to ping a specific port

craggy cloak
#

e2mc had the benefit of supporting vanilla clients

lofty timber
#

Well TCP Tunneling cant do that

craggy cloak
#

UDP?

lofty timber
#

You need both Parties to Ping each other

#

Well both cant donit

#

Party A and B need to Ping each other

vapid plaza