gophertunnel is composed of several packages that may be of use for creating Minecraft related tools

Overview

gophertunnel

Swiss army knife for Minecraft (Bedrock Edition) software written in Go

PkgGoDev

telescope gopher

Overview

gophertunnel is composed of several packages that may be of use for creating Minecraft related tools. A brief overview of all packages may be found here.

Examples

Examples on how to dial a connection or start a server can be found in the minecraft package. Additionally, a MITM proxy is implemented in the main.go file.

Versions

Gophertunnel supports only one version at a time. Generally, a new minor version is tagged when gophertunnel supports a new Minecraft version that was not previously supported. A list of the recommended gophertunnel versions for past Minecraft versions is listed below.

Version Tag
1.16.100 Latest
1.16.20 v1.8.2
1.16.0 v1.7.11
1.14.60 v1.6.5
1.14.0 v1.3.20
1.13.0 v1.3.5
1.12.0 v1.2.11

Sponsors

Become Patron

Gophertunnel is sponsored by all my gopher sponsors. A special thanks goes to the Very Important Gophers below.

Contact

Chat on Discord

Comments
  • The example proxy doesn't work on some servers

    The example proxy doesn't work on some servers

    I tried compiling the example proxy in main.go and it works great on all the servers i've tried except on mco.cubecraft.net:19132 for some strange reason. Also most of the server will disconnect you for login timeout if it doesn't login fast enough but I easily fixed that by moving raknet.Dial after the authchain

    I don't have the error it gives when connecting to cubecraft right now, i will post it later. You can try for yourself anyway.

    bug 
    opened by gioiann 18
  • nbt: unknown tag '110' at offset 1149 during op 'Match'

    nbt: unknown tag '110' at offset 1149 during op 'Match'

    Thanks for the libraries! I'm using the nbt package for a java edition proxy to decode the dimension nbt in the JoinGame packet, but there is an error when trying to use a Minecraft server version 1.16+.

    Here the error details (the 1.16.1 server sends the player the packet and the proxy can't read the nbt part of it):

    error decoding packet (type: *packet.JoinGame, id: 25, protocol: 1.16.1(736), direction: ClientBound): nbt: unknown tag '110' at offset 1149 during op 'Match'"
    

    code ref: https://github.com/minekube/gate/blob/690e29d172f0deebaec48fbc3dcb49983ed36667/pkg/proto/packet/joingame.go#L148

    This is the complete data field (containing the nbt somewhere in the middle) of the JoinGame packet (hex encoded, use a converter like https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ if that may help):

    0000 001f 0100 0313 6d69 6e65 6372 6166
    743a 6f76 6572 776f 726c 6414 6d69 6e65
    6372 6166 743a 7468 655f 6e65 7468 6572
    116d 696e 6563 7261 6674 3a74 6865 5f65
    6e64 0a00 0009 0009 6469 6d65 6e73 696f
    6e0a 0000 0004 0800 046e 616d 6500 136d
    696e 6563 7261 6674 3a6f 7665 7277 6f72
    6c64 0100 0962 6564 5f77 6f72 6b73 0101
    0006 7368 7275 6e6b 0001 000b 7069 676c
    696e 5f73 6166 6500 0100 0b68 6173 5f63
    6569 6c69 6e67 0001 000c 6861 735f 736b
    796c 6967 6874 0108 000a 696e 6669 6e69
    6275 726e 001e 6d69 6e65 6372 6166 743a
    696e 6669 6e69 6275 726e 5f6f 7665 7277
    6f72 6c64 0100 0975 6c74 7261 7761 726d
    0005 000d 616d 6269 656e 745f 6c69 6768
    7400 0000 0003 000e 6c6f 6769 6361 6c5f
    6865 6967 6874 0000 0100 0100 0968 6173
    5f72 6169 6473 0101 0007 6e61 7475 7261
    6c01 0100 1472 6573 7061 776e 5f61 6e63
    686f 725f 776f 726b 7300 0008 0004 6e61
    6d65 0019 6d69 6e65 6372 6166 743a 6f76
    6572 776f 726c 645f 6361 7665 7301 0009
    6265 645f 776f 726b 7301 0100 0673 6872
    756e 6b00 0100 0b70 6967 6c69 6e5f 7361
    6665 0001 000b 6861 735f 6365 696c 696e
    6701 0100 0c68 6173 5f73 6b79 6c69 6768
    7401 0800 0a69 6e66 696e 6962 7572 6e00
    1e6d 696e 6563 7261 6674 3a69 6e66 696e
    6962 7572 6e5f 6f76 6572 776f 726c 6401
    0009 756c 7472 6177 6172 6d00 0500 0d61
    6d62 6965 6e74 5f6c 6967 6874 0000 0000
    0300 0e6c 6f67 6963 616c 5f68 6569 6768
    7400 0001 0001 0009 6861 735f 7261 6964
    7301 0100 076e 6174 7572 616c 0101 0014
    7265 7370 6177 6e5f 616e 6368 6f72 5f77
    6f72 6b73 0000 0800 0a69 6e66 696e 6962
    7572 6e00 1b6d 696e 6563 7261 6674 3a69
    6e66 696e 6962 7572 6e5f 6e65 7468 6572
    0100 0975 6c74 7261 7761 726d 0103 000e
    6c6f 6769 6361 6c5f 6865 6967 6874 0000
    0080 0100 076e 6174 7572 616c 0008 0004
    6e61 6d65 0014 6d69 6e65 6372 6166 743a
    7468 655f 6e65 7468 6572 0100 0962 6564
    5f77 6f72 6b73 0004 000a 6669 7865 645f
    7469 6d65 0000 0000 0000 4650 0100 0673
    6872 756e 6b01 0100 0b70 6967 6c69 6e5f
    7361 6665 0101 000c 6861 735f 736b 796c
    6967 6874 0001 000b 6861 735f 6365 696c
    696e 6701 0500 0d61 6d62 6965 6e74 5f6c
    6967 6874 3dcc cccd 0100 0968 6173 5f72
    6169 6473 0001 0014 7265 7370 6177 6e5f
    616e 6368 6f72 5f77 6f72 6b73 0100 0800
    0a69 6e66 696e 6962 7572 6e00 186d 696e
    6563 7261 6674 3a69 6e66 696e 6962 7572
    6e5f 656e 6401 0009 756c 7472 6177 6172
    6d00 0300 0e6c 6f67 6963 616c 5f68 6569
    6768 7400 0001 0001 0007 6e61 7475 7261
    6c00 0800 046e 616d 6500 116d 696e 6563
    7261 6674 3a74 6865 5f65 6e64 0100 0962
    6564 5f77 6f72 6b73 0004 000a 6669 7865
    645f 7469 6d65 0000 0000 0000 1770 0100
    0673 6872 756e 6b00 0100 0b70 6967 6c69
    6e5f 7361 6665 0001 000c 6861 735f 736b
    796c 6967 6874 0001 000b 6861 735f 6365
    696c 696e 6700 0500 0d61 6d62 6965 6e74
    5f6c 6967 6874 0000 0000 0100 0968 6173
    5f72 6169 6473 0101 0014 7265 7370 6177
    6e5f 616e 6368 6f72 5f77 6f72 6b73 0000
    0013 6d69 6e65 6372 6166 743a 6f76 6572
    776f 726c 6413 6d69 6e65 6372 6166 743a
    6f76 6572 776f 726c 64e2 d3a6 044a 3443
    d714 0a00 0100 00
    

    ASCII encoding of the above hex, if that even helps:

    minecraft:overworldminecraft:the_netherminecraft:the_end
    		dimension
    nameminecraft:overworld	bed_worksshrunkpiglin_safehas_ceilinghas_skylight
    infiniburnminecraft:infiniburn_overworld	ultrawarm
    ambient_lightlogical_height	has_raidsnaturalrespawn_anchor_worksnameminecraft:overworld_caves	bed_worksshrunkpiglin_safehas_ceilinghas_skylight
    infiniburnminecraft:infiniburn_overworld	ultrawarm
    ambient_lightlogical_height	has_raidsnaturalrespawn_anchor_works
    infiniburnminecraft:infiniburn_nether	ultrawarmlogical_height€naturalnameminecraft:the_nether	bed_works
    fixed_timeFPshrunkpiglin_safehas_skylighthas_ceiling
    ambient_light=ÌÌÍ	has_raid
    
    opened by robinbraemer 11
  • Xbox live login fails

    Xbox live login fails

    panic: error obtaining Live token: error decoding flowtoken XML container: EOF

    This error started happening really often, then it went away and now it seems like it happens everytime.

    I tried with different accounts and also different IPs in case Microsoft blocked my IP because of suspicious login attempts. I also tried creating a new account using a new residential IP and then use the same IP to login with gophertunnel API, it's not working, same error but I'm able to login using minecraft

    bug 
    opened by gioiann 11
  • Cannot connect to Realms

    Cannot connect to Realms

    When connecting to a realm (using IP:Port as Remote Address), the proxy crashes when you try to join. (Address is fine, it works in the normal Bedrock Client)

    panic: runtime error: makeslic e: len out of range
    
    goroutine 81 [running]:
    github.com/sandertv/go-raknet/internal/message.(*OpenConnectionRequest1).Write(0xc00086fe84, 0xc0002f5f50)
            C:/Users/RootRobo/go/pkg/mod/github.com/sandertv/[email protected]/internal/message/open_connection_request_1.go:20 +0x209
    github.com/sandertv/go-raknet.(*connState).sendOpenConnectionRequest1(0xc0000acd50, 0xc00086000c, 0x4, 0x0)
            C:/Users/RootRobo/go/pkg/mod/github.com/sandertv/[email protected]/dial.go:439 +0x75
    github.com/sandertv/go-raknet.(*connState).discoverMTUSize.func2(0xc00027c720, 0xc0000acd50, 0xc0002f6db8, 0xc0002025a0, 0xc00021e3c0, 0xc00027c6c0, 0x917320, 0xc000380120)
            C:/Users/RootRobo/go/pkg/mod/github.com/sandertv/[email protected]/dial.go:369 +0x1b5
    created by github.com/sandertv/go-raknet.(*connState).discoverMTUSize
            C:/Users/RootRobo/go/pkg/mod/github.com/sandertv/[email protected]/dial.go:361 +0x1f6
    exit status 2
    
    bug 
    opened by RoootTheFoxold 10
  • Invalid argument supplied for foreach when joining server

    Invalid argument supplied for foreach when joining server

    [22:59:25] [Server thread/CRITICAL]: ErrorException: "Invalid argument supplied for foreach()" (EXCEPTION) in "src/pocketmine/Player" at line 1923 [22:59:25] [Server thread/DEBUG]: #0 src/pocketmine/Player(1923): pocketmine\utils\Utils::errorExceptionHandler(integer 2, string[39] Invalid argument supplied for foreach(), string[67] phar:///home/container/PocketMine-MP.phar/src/pocketmine/Player.php, integer 1923, array[2]) [22:59:25] [Server thread/DEBUG]: #1 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(119): pocketmine\Player->handleLogin(object pocketmine\network\mcpe\protocol\LoginPacket) [22:59:25] [Server thread/DEBUG]: #2 src/pocketmine/network/mcpe/protocol/LoginPacket(142): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleLogin(object pocketmine\network\mcpe\protocol\LoginPacket) [22:59:25] [Server thread/DEBUG]: #3 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(111): pocketmine\network\mcpe\protocol\LoginPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter) [22:59:25] [Server thread/DEBUG]: #4 src/pocketmine/network/mcpe/protocol/BatchPacket(123): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\LoginPacket) [22:59:25] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(111): pocketmine\network\mcpe\protocol\BatchPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter) [22:59:25] [Server thread/DEBUG]: #6 src/pocketmine/Player(3158): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket) [22:59:25] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/RakLibInterface(169): pocketmine\Player->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket) [22:59:25] [Server thread/DEBUG]: #8 vendor/pocketmine/raklib/src/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string[20] XXX.XX.XXX.XXX XXXXX, object raklib\protocol\EncapsulatedPacket, integer 0) [22:59:25] [Server thread/DEBUG]: #9 src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket() [22:59:25] [Server thread/DEBUG]: #10 src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process() [22:59:25] [Server thread/DEBUG]: #11 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}() [22:59:25] [Server thread/DEBUG]: #12 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications() [22:59:25] [Server thread/DEBUG]: #13 src/pocketmine/Server(2346): pocketmine\snooze\SleeperHandler->sleepUntil(double 1581461965.8149) [22:59:25] [Server thread/DEBUG]: #14 src/pocketmine/Server(2203): pocketmine\Server->tickProcessor() [22:59:25] [Server thread/DEBUG]: #15 src/pocketmine/Server(1785): pocketmine\Server->start() [22:59:25] [Server thread/DEBUG]: #16 src/pocketmine/PocketMine(272): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/) [22:59:25] [Server thread/DEBUG]: #17 src/pocketmine/PocketMine(295): pocketmine\server() [22:59:25] [Server thread/DEBUG]: #18 (1): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

    bug 
    opened by JustTalDevelops 10
  • Please require just the minimal interfaces: io.Reader, io.Writer, io.ByteReader, ...

    Please require just the minimal interfaces: io.Reader, io.Writer, io.ByteReader, ...

    Hey, I'm working on the Bedrock part of Gate proxy and would find myself to copy-paste-modify many functions from your library because many read/write helpers like https://github.com/Sandertv/gophertunnel/blob/10479899eb371fa2f7181377363e69192076c080/minecraft/protocol/varint.go#L52 require a full blown *bytes.Buffer.

    Could you please downgrade all such cases to the minimal interface required?

    For example as done in util/reader.go & util/writer.go: https://github.com/minekube/gate/tree/af6f2f5ecd4e3f1cdc03e8f3861049d553d1c2f7/pkg/proto/util

    enhancement 
    opened by robinbraemer 8
  • Xbox client spawning issues

    Xbox client spawning issues

    The following error occurs when using the Minecraft Xbox One edition. I can't reproduce it as I don't have an Xbox One but all you need to do is join gophertunnel and that will happen.

    panic: start game spawning timeout
    

    I guess the client doesn't like the StartGame packet gophertunnel creates.

    The Xbox client is able to join other external servers just fine (only tested on PocketMine servers)

    bug 
    opened by gioiann 8
  • Issue connecting to Dragonfly servers

    Issue connecting to Dragonfly servers

    When connecting to a Dragonfly server your CPU usage will jump to 100% and your whole PC starts lagging! There will also be no chunks loaded, you're just sitting in space.

    image

    bug 
    opened by Prim69 7
  • Can't connect to localhost game

    Can't connect to localhost game

    I can't connect to my localhost world using Dial("raknet", "localhost:19132") function. It says

    panic: ping raknet: context deadline exceeded
    

    What I've tried already (and it didn't work):

    • 127.0.0.1, [::1]
    • setting udp and tcp instead of raknet (udp makes it wait until context deadline exceeded, tcp connection was just refused)
    • using DialTimeout(...) set to several minutes

    I didn't change anything in the firewall settings, I have Windows 10 and LAN Multiplayer option is turned on in my world. Everything works fine when I join some internet server. Am I missing something?

    help wanted 
    opened by sermah 7
  • Invalid packet checksum

    Invalid packet checksum

    I've been getting this error really often, expecially on mineplex. When this happens a temporary "fix" is restarting the proxy but eventually it will happen again.

    error reading from client connection: error reading batch: invalid packet checksum: d6f4aaa48ed69500 should be 228fc984d0749b49
    

    This error message can be either from listener.go or dial.go since it's the same for both. I found out it's from there

    So either the server is not encrypting properly (and i don't think so since it works without proxy) or the proxy is doing something wrong.

    bug 
    opened by gioiann 7
  • Issue connecting

    Issue connecting

    I get the following error when connecting to a 1.16.210 server with the 1.11.0 tag:

    InvalidArgumentException: "Data should be exactly 115920 bytes, got 9 bytes" (EXCEPTION) in "pmsrc/src/pocketmine/network/mcpe/protocol/types/SkinImage" at line 42 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #0 pmsrc/src/pocketmine/Player(1975): pocketmine\network\mcpe\protocol\types\SkinImage->__construct(integer 69, integer 420, string[9] .....rq.^) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #1 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(117): pocketmine\Player->handleLogin(object pocketmine\network\mcpe\protocol\LoginPacket) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #2 pmsrc/src/pocketmine/network/mcpe/protocol/LoginPacket(145): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleLogin(object pocketmine\network\mcpe\protocol\LoginPacket) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(109): pocketmine\network\mcpe\protocol\LoginPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/network/mcpe/protocol/BatchPacket(130): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\LoginPacket) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(109): pocketmine\network\mcpe\protocol\BatchPacket->handle(object pocketmine\network\mcpe\PlayerNetworkSessionAdapter) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/Player(3318): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(169): pocketmine\Player->handleDataPacket(object pocketmine\network\mcpe\protocol\BatchPacket) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #8 pmsrc/vendor/pocketmine/raklib/src/server/ServerHandler(95): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string[18]my ip50831, object raklib\protocol\EncapsulatedPacket, integer 0) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #10 pmsrc/src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #11 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(113): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe{closure}() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #12 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(75): pocketmine\snooze\SleeperHandler->processNotifications() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #13 pmsrc/src/pocketmine/Server(2155): pocketmine\snooze\SleeperHandler->sleepUntil(double 1616991725.4625) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #14 pmsrc/src/pocketmine/Server(1992): pocketmine\Server->tickProcessor() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #15 pmsrc/src/pocketmine/Server(1586): pocketmine\Server->start() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #16 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[21] /home/div/pocketmine/, string[29] /home/div/pocketmine/plugins/) 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #17 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server() 2021-03-29 [04:22:05] [Server thread/CRITICAL]: #18 pmsrc(11): require(string[76] phar:///home/div/pocketmine/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

    opened by Prim69 6
  • Temp resource pack path is invalid on android

    Temp resource pack path is invalid on android

    https://github.com/Sandertv/gophertunnel/blob/b1dfb04b1de2878d8bb20252b49ed4e3efe176a0/minecraft/resource/pack.go#L62

    On android the path this ends up using is "/data/local/tmp" which is inaccessible unless the user has a rooted device

    I'm currently using os.UserConfigDir() to get around this locally

    opened by Prim69 0
  • Failing to connect after successful authentication

    Failing to connect after successful authentication

    getting this error

    Failed to connect%!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)panic: runtime error: invalid memory address or nil pointer dereference
            panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x72249a]
    
    goroutine 1 [running]:
    github.com/sandertv/gophertunnel/minecraft.(*Conn).Close(0xc000020280?)
            /home/cody/go/pkg/mod/github.com/sandertv/[email protected]/minecraft/conn.go:440 +0x1a
    panic({0x76fee0, 0xaac660})
            /snap/go/9952/src/runtime/panic.go:838 +0x207
    go.uber.org/atomic.(*Bool).Load(...)
            /home/cody/go/pkg/mod/go.uber.org/[email protected]/bool.go:49
    github.com/sandertv/gophertunnel/minecraft.(*Conn).DoSpawnContext(0x882990?, {0x8829c8?, 0xc0002ae660?})
            /home/cody/go/pkg/mod/github.com/sandertv/[email protected]/minecraft/conn.go:274 +0x28
    github.com/sandertv/gophertunnel/minecraft.(*Conn).DoSpawn(0x87c240?)
            /home/cody/go/pkg/mod/github.com/sandertv/[email protected]/minecraft/conn.go:254 +0x6b
    main.seeIfAnyoneIsHome()
            /home/cody/GolandProjects/livegoverflow/main.go:33 +0x173
    main.main()
            /home/cody/GolandProjects/livegoverflow/main.go:65 +0x17
    

    I've tried on a locally and externally hosted server with no luck, any ideas what I might be doing wrong?

    bug 
    opened by codymikol 0
  • Capitalized UUID in resource pack causes panic

    Capitalized UUID in resource pack causes panic

    Source used: minecraft/example_dial_test.go

    As described above, Capitalized UUID in resource pack causes gophertunnel to panic.

    Error:

    2022/08/07 23:52:05 error: texture pack {uuid=3BBD640E-B454-4358-BB57-33C49C0DFCF5, version=0.0.1} not downloaded
    panic: dial minecraft 127.0.0.1:62488->127.0.0.1:19132: use of closed network connection
    
    goroutine 1 [running]:
    main.ExampleDial()
            D:/D-Backups/Go/Gophertunnel/main.go:29 +0x7da
    main.main()
            D:/D-Backups/Go/Gophertunnel/main.go:108 +0x17
    exit status 2
    
    

    Tested with PM4 and confirmed by just changing the case of the resource pack UUID. (not entire UUID) manifest.zip (Capitalized UUID)

    manifest.zip (Non-Capitalized UUID)

    Raw Manifest JSON:

    {
    	"format_version": 1,
    	"header": {
    		"description": "test",
    		"name": "Neutronia",
    		"uuid": "3BBD640E-B454-4358-BB57-33C49C0DFCF5",
    		"version": [0, 0, 1],
    		"min_engine_version": [1, 2, 6]
    	},
    	"modules": [
    		{
    			"description": "teststsk",
    			"type": "resources",
    			"uuid": "1EC46F41-7514-4611-A6B1-6AFBE21B6EE0",
    			"version": [0, 0, 1]
    		}
    	]
    }
    
    
    {
    	"format_version": 1,
    	"header": {
    		"description": "test",
    		"name": "Neutronia",
    		"uuid": "3bbd640e-b454-4358-bb57-33c49c0dfcf5",
    		"version": [0, 0, 1],
    		"min_engine_version": [1, 2, 6]
    	},
    	"modules": [
    		{
    			"description": "teststsk",
    			"type": "resources",
    			"uuid": "1ec46f41-7514-4611-a6b1-6afbe21b6ee0",
    			"version": [0, 0, 1]
    		}
    	]
    }
    
    bug 
    opened by alvin0319 3
  • Cant connect to play.inpvp.net (mineville) or mco.mineplex.com (mineplex)

    Cant connect to play.inpvp.net (mineville) or mco.mineplex.com (mineplex)

    play.inpvp.net connects forever mco.mineplex.com has an error

    mineplex error:

    2022/02/12 18:16:55 error: parse server token: illegal base64 data at input byte 246
    panic: dial minecraft 192.168.1.13:58559->108.178.12.67:19132: use of closed network connection
    
    goroutine 1 [running]:
    main.main()
            C:/Users/Silica/Desktop/minecraft/gophertunnel/main.go:111 +0xcda
    
    package main
    
    import (
    	"bufio"
    	"context"
    	"encoding/json"
    	"flag"
    	"fmt"
    	"io"
    	"os"
    	"os/signal"
    	"strings"
    	"syscall"
    
    	"github.com/sandertv/gophertunnel/minecraft"
    	"github.com/sandertv/gophertunnel/minecraft/auth"
    	"github.com/sandertv/gophertunnel/minecraft/resource"
    	"golang.org/x/oauth2"
    )
    
    const TOKEN_FILE = "token.json"
    const KEYS_FILE = "keys.db"
    
    func get_token() oauth2.Token {
    	var token oauth2.Token
    	var err error
    
    	if _, err = os.Stat(TOKEN_FILE); err == nil {
    		f, err := os.Open(TOKEN_FILE)
    		if err != nil {
    			panic(err)
    		}
    		defer f.Close()
    		if err := json.NewDecoder(f).Decode(&token); err != nil {
    			panic(err)
    		}
    	} else {
    		_token, err := auth.RequestLiveToken()
    		if err != nil {
    			panic(err)
    		}
    		token = *_token
    
    		buf, err := json.Marshal(token)
    		if err != nil {
    			panic(err)
    		}
    		os.WriteFile(TOKEN_FILE, buf, 0666)
    	}
    	return token
    }
    
    func dump_keys(keys map[string]string) {
    	f, err := os.OpenFile(KEYS_FILE, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
    	if err != nil {
    		panic(err)
    	}
    	defer f.Close()
    	for uuid, key := range keys {
    		f.WriteString(uuid + "=" + key + "\n")
    	}
    }
    
    func download_pack(pack *resource.Pack) ([]byte, error) {
    	buf := make([]byte, pack.Len())
    	off := 0
    	for {
    		n, err := pack.ReadAt(buf[off:], int64(off))
    		if err != nil {
    			if err == io.EOF {
    				break
    			}
    			return nil, err
    		}
    		off += n
    	}
    	return buf, nil
    }
    
    func main() {
    	// get target server ip
    	var target string
    	flag.StringVar(&target, "target", "", "[serverip:port]")
    	flag.Parse()
    	if target == "" {
    		fmt.Printf("Enter Server: ")
    		reader := bufio.NewReader(os.Stdin)
    		target, _ = reader.ReadString('\n')
    		target = strings.Replace(target, "\n", "", -1)
    		target = strings.Replace(target, "\r", "", -1)
    	}
    	if len(strings.Split(target, ":")) == 1 { // add default port if not set
    		target += ":19132"
    	}
    
    	sigs := make(chan os.Signal, 1)
    	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
    
    	ctx, cancel := context.WithCancel(context.Background())
    
    	// authenticate
    	token := get_token()
    	src := auth.RefreshTokenSource(&token)
    
    	// connect
    	fmt.Printf("Connecting to %s\n", target)
    	serverConn, err := minecraft.Dialer{
    		TokenSource: src,
    	}.DialContext(ctx, "raknet", target)
    	if err != nil {
    		panic(err)
    	}
    	go func() {
    		<-sigs
    		serverConn.Close()
    		cancel()
    	}()
    
    	defer serverConn.Close()
    	if err := serverConn.DoSpawnContext(ctx); err != nil {
    		panic(err)
    	}
    
    	println("Connected")
    	println("ripping Resource Packs")
    
    	// dump keys, download and decrypt the packs
    	keys := make(map[string]string)
    	for _, pack := range serverConn.ResourcePacks() {
    		keys[pack.UUID()] = pack.ContentKey()
    		fmt.Printf("ResourcePack(Id: %s Key: %s | Name: %s Version: %s)\n", pack.UUID(), keys[pack.UUID()], pack.Name(), pack.Version())
    
    		fmt.Printf("Downloading...\n")
    		pack_data, err := download_pack(pack)
    		if err != nil {
    			panic(err)
    		}
    		os.WriteFile(pack.Name()+".ENCRYPTED.zip", pack_data, 0666)
    
    		fmt.Printf("Decrypting...\n")
    		if err := decrypt_pack(pack_data, pack.Name()+".mcpack", keys[pack.UUID()]); err != nil {
    			panic(err)
    		}
    	}
    
    	if len(keys) > 0 {
    		fmt.Printf("Writing keys to %s\n", KEYS_FILE)
    		dump_keys(keys)
    	} else {
    		fmt.Printf("No Resourcepack sent\n")
    	}
    	fmt.Printf("Done!\n")
    }
    
    enhancement 
    opened by KuromeSan 3
Releases(v1.15.1)
Owner
Sandertv
Go and PHP programmer
Sandertv
Tools - This subrepository holds the source for various packages and tools that support

Go Tools This subrepository holds the source for various packages and tools that

Rohan 0 Jan 12, 2022
Avalanche : a network composed of multiple blockchains

Timestamp Virtual Machine Avalanche is a network composed of multiple blockchains. Each blockchain is an instance of a Virtual Machine (VM), much like

null 1 Dec 15, 2021
Avalanche: a network composed of multiple blockchains

Subnet EVM Avalanche is a network composed of multiple blockchains. Each blockchain is an instance of a Virtual Machine (VM), much like an object in a

Ava Labs 147 Sep 30, 2022
Openldap (LDAP) binding for Golang (go) ; no more support ; you may have a look at https://github.com/go-ldap/ldap

OpenLDAP this is Openldap binding in GO language. I don't work any more with golang, so, please fork this project. Installation : Installation is easy

Marc Quinton 45 Mar 4, 2021
Scans a file or folder recursively for jar files that may be vulnerable to Log4Shell

Velocity A Minecraft server proxy with unparalleled server support, scalability, and flexibility. Velocity is licensed under the GPLv3 license. Goals

PaperMC 1.1k Sep 27, 2022
🛡 Several domain lists compiled into a database file used by V2Ray.

Domain list database This project is pulled from v2fly/domain-list-community, with only its data changed to use several blocklists. Purpose of this pr

Lightingale Community Open Source Software 1 May 22, 2022
Anaximander is an ISP probing tool implementing several reduction techniques to cut down the number of probes launched in order to map an Autonomous System

Anaximander is an ISP probing tool implementing several reduction techniques to cut down the number of probes launched in order to map an Autonomous System, while still keeping high discovery levels.

null 2 Jun 21, 2022
gNXI Tools - gRPC Network Management/Operations Interface Tools

gNxI Tools gNMI - gRPC Network Management Interface gNOI - gRPC Network Operations Interface A collection of tools for Network Management that use the

Google 222 Sep 27, 2022
A Go package for creating contributor list by release, Help full for those organization that use one repository for platform release

This is a Go package which create contributors list by release by scanning across all repository that exist in organisation, Only helpful for those or

Yuvraj 0 Dec 26, 2021
An easy-to-use platform for creating microservices without complex infrastructure solutions.

RPCPlatform An easy-to-use platform for creating microservices without complex infrastructure solutions. Only etcd required. Out of the box you get a

Oleg Trifonov 0 Jan 4, 2022
Use Consul to do service discovery, use gRPC +kafka to do message produce and consume. Use redis to store result.

目录 gRPC/consul/kafka简介 gRPC+kafka的Demo gRPC+kafka整体示意图 限流器 基于redis计数器生成唯一ID kafka生产消费 kafka生产消费示意图 本文kafka生产消费过程 基于pprof的性能分析Demo 使用pprof统计CPU/HEAP数据的

null 43 Jul 9, 2022
Get related domains / subdomains by looking at Google Analytics IDs

AnalyticsRelationships This script try to get related domains / subdomains by looking at Google Analytics IDs from a URL. First search for ID of Googl

Josué Encinar 133 Sep 24, 2022
🎉 An awesome version control tool for protoc and its related plugins.

❤️ PowerProto is actively maintained! Any questions in use can be directly raised issue, I will respond to you as fast as possible. If you think the p

storyicon 157 Sep 16, 2022
🌍 Package tcplisten provides a customizable TCP net.Listener with various performance-related options

Package tcplisten provides customizable TCP net.Listener with various performance-related options: SO_REUSEPORT. This option allows linear scaling ser

Spiral Scout 1 Sep 7, 2022
Grpc bridge to various mediabank related systems

Mediabank bridge This internal tool enables authenticated gRPC based endpoint for securely communicating with systems like: Telestream Vantage Workflo

BCC Code 0 Jan 7, 2022
Dofind - Dofind is fast domain related finder made with golang

Dofind is fast domain related finder made with golang. ██████╗░░█████╗░███████╗

Muhamad Burhanudin 4 Feb 16, 2022
A vote botting wrapper for GoLang designed for Minecraft: Pocket Servers.

libvote A vote botting wrapper for GoLang designed for Minecraft: Pocket Servers by Jviguy and JustTal. Disclaimer Usage of libvote requires your own

Tal 2 Apr 17, 2022
Simple Minecraft Bedrock reverse proxy

BedProx [WIP] Simple Minecraft Bedrock reverse proxy Features Reverse Proxy HAProxy Protocol Support (NOT TESTED) Webhooks REST API How to use/deploy

Hendrik Schlehlein 7 Sep 7, 2022
A library designed for hosting Minecraft: Java Edition listeners.

expresso A library designed for hosting Minecraft: Java Edition listeners. Features Hosting listeners. All handshake, status, and login state packets.

Tal 3 Jul 29, 2022