itzg / rcon-cli

A little RCON cli based on james4k's RCON library for golang
Apache License 2.0
180 stars 17 forks source link

handling multipacket responses #9

Open cpw opened 4 years ago

cpw commented 4 years ago

Hi, So I think I've fixed RCON in forge for proper multipacket responses that don't overflow..

Sadly, your cli doesn't properly handle them. https://wiki.vg/RCON#Fragmentation discusses how you might go about it...

I'd suggest the third trick, with an invalid packet that you discard afterwards.

https://github.com/MinecraftForge/MinecraftForge/commit/5f292895cb89d42b9a5d12922c80541874e0bf39

itzg commented 4 years ago

Hmm, this app currently depends on (is at the mercy of) https://github.com/james4k/rcon, which apparently hasn't been updated since 2012 😟

I should probably either fork that library or just consume the packet processing into this repo...

itzg commented 4 years ago

...yeah, I'm just going to re-implement the rcon packet handling since it's a pretty easy protocol. With that I'll go with the 2nd bullet, 3rd trick, as you suggested.

cpw commented 4 years ago

Thanks! look forward to it :+1:

cpw commented 4 years ago

But yeah, apart from the weirdness when you have multiple packets, latest forge works great with this. It'd be super seriously nice if colour formatting became terminal colour formatting, but that's a big stretch probably :D

itzg commented 4 years ago

Agreed. It's doable, as researched in https://github.com/itzg/rcon-cli/issues/4, just need to get around to it.

itzg commented 4 years ago

What's an example of a command that'll typically get a fragmented response? help command?

cpw commented 4 years ago

yeah. help works, if you have a couple of mods with commands installed. or install a big fat modpack and run forge mods

itzg commented 4 years ago

I have my changes finished locally but still haven't found a modpack that ends up producing fragmented responses. What was a specific mod or pack you know induces fragmentation?

cpw commented 4 years ago

the towncraft pack (https://www.curseforge.com/minecraft/modpacks/towncraft) using forge 34.1.23 should do it if you do "forge mods"

itzg commented 4 years ago

Since you mentioned that specific version, I ran Forge 1.16.3-34.1.23; however, several of the mods require older versions:

mc_1  | -- MOD universalmodcore --
mc_1  | Details:
mc_1  |         Mod File: ImmersiveRailroading-1.7.3_1.12.2.jar
mc_1  |         Failure message: Mod universalmodcore requires minecraft 1.14.4
mc_1  |                 Currently, minecraft is 1.16.3
mc_1  |         Mod Version: 1.0
mc_1  |         Mod Issue URL: http://my.issue.tracker/
mc_1  |         Exception message: MISSING EXCEPTION MESSAGE
mc_1  |
mc_1  | -- MOD reap --
mc_1  | Details:
mc_1  |         Mod File: reap-1.5.3.jar
mc_1  |         Failure message: Mod reap requires minecraft 1.14.4
mc_1  |                 Currently, minecraft is 1.16.3
mc_1  |         Mod Version: 1.10.1
mc_1  |         Mod Issue URL: https://www.curseforge.com/minecraft/mc-mods/reap-mod/issues
mc_1  |         Exception message: MISSING EXCEPTION MESSAGE

...and more

Is there a 1.12.2 build of Forge backpatched with https://github.com/MinecraftForge/MinecraftForge/commit/5f292895cb89d42b9a5d12922c80541874e0bf39 ?

cpw commented 4 years ago

Is there a 1.12.2 build of Forge backpatched with MinecraftForge/MinecraftForge@5f29289 ?

No, we don't support 1.12.2 anymore...

It looks like the pack you were referring is a 1.14 pack, not a 1.16 pack. The link above has a 1.16 version - I was using it to test this very forge fix ;)

itzg commented 4 years ago

I had used your link :), but I now see they only provide a 1.12 server pack. That's what I must have downloaded out of habit. I'll piece together a scenario using their 1.16 file. Thanks.

cpw commented 4 years ago

With 1.16, many "client" packs will "just work" as server packs, the many structural changes I pushed towards mods means that it's harder (not impossible, sadly) to make a mod that won't at least "load and do nothing" on the server side.