Git Product home page Git Product logo

Comments (33)

gekigek99 avatar gekigek99 commented on June 19, 2024 1

@gekigek99 do you have a source for the the server info packet or did you just try stuff out and can point me in the right direction for the server type?

no i just did raw research as they say and wrote in the wiki what I found.

to get the correct server version you need to:

  • set serveStatus to "online" and run the script in debug mode
  • launch manually the minecraft server
  • request server info with the client

the script will capture 2 parameters that you need to replace in the script to make it work again

(next week i am planning on writing an update to make the process automatic (i will use an external config file that will be automatically updated when a new version is available))

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

@gekigek99 do you have a source for the the server info packet or did you just try stuff out and can point me in the right direction for the server type?

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

Also, startup message is kind of broken in the unRAID docker log.
image

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

I am straight up unable to connect to the docker server after implementing the changes from master into the docker branch.
image
image
I am using 1.14.4, though something doesn't line up as Minecraft suggests the client to be out of date (yes, I changed the version number in the script):
image

@gekigek99 I guess that this is somehow correlated to the advertising of a vanilla server and it being a modded forge server, but do you have any other ideas what changes could have broken something for the docker environment?

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

I am using 1.14.4, though something doesn't line up as Minecraft suggests the client to be out of date (yes, I changed the version number in the script):

it is not enough to just change the "serverVersion" you also need to change the "serverProtocol" parameter

these 2 parameters can be obtained with the procedure described above

(this should make the ping/server version work again)

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

first try to see if the ping/server version works again with the procedure described above, then try to connect to the server (so we can see if these are related problems)


@gekigek99 I guess that this is somehow correlated to the advertising of a vanilla server and it being a modded forge server, but do you have any other ideas what changes could have broken something for the docker environment?

does it work with a non-modded server?

Right now i can't dedicate much time to the issue as i have exams but next week i should hopefully be able to dig into this

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

Also, startup message is kind of broken in the unRAID docker log.
image

i really don't know why it would do that ahaha... kind of strange but for now i guess it's not the main problem

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

image

does the server disconnects you when you ask for server info? or when you try to join?

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

does it work with a non-modded server?

This is the next step I have to test. I just thought that I might ask if you had any idea, before going on a journey to test a multitude of configurations^^

Right now i can't dedicate much time to the issue as i have exams but next week i should hopefully be able to dig into this

No worries. Focus on your exams, the old version is still up and running. I created a development tag on Dockerhub for testing new versions :)

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

image

does the server disconnects you when you ask for server info? or when you try to join?

When trying to join. Somewhere must be some miscommunication, as the old version correctly displays my username and starts up the server, while the new version goes into the routine for asking for the server info and not the join routine...

Maybe there is a problem within the docker environment. I will have to try running the script on my PC directly and then when that works transition into a Docker container again.

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

image

does the server disconnects you when you ask for server info? or when you try to join?

Maybe there is a problem within the docker environment. I will have to try running the script on my PC directly and then when that works transitioning into a Docker container again.

It's quite strange because the new version, apart from the ping/"outdated" warning (because at mojang they updated the serverProtocol to a value higher than 751), it works ok for me (with vanilla server and not in the docker env)

Try to find the "serverProtocol" you need with that procedure and so we can confirm at least that the "require server info" part of the script is working correctly

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

I am currently testing some different configurations and encountered a different bug in the main go script.
@gekigek99 should I open a new issue for this?
I am using 1.16.2 and with the current code and only changed debug to true.

image

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

@lubocode yes i'll open it

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

After testing a multitude of configurations and comparing the different version of the code I think there is no problem with the script itself. Maybe with the new server protocol does something different and that gets blocked by my PC.
I have tightened security with MS Defender so maybe that blocks part of the traffic, but to be sure I will need to retest on a different machine.
Running the master script in Windows and connecting through localhost works.

The script version from six months ago continues to work in the Docker with 1.14.4 and forge.
Testing that one with 1.16.2 and connecting with a different machine are the last two things I can currently test.

After that I will go deeper with capturing the server response, as you mentioned.

@gekigek99 do you have a source for the the server info packet or did you just try stuff out and can point me in the right direction for the server type?

no i just did raw research as they say and wrote in the wiki what I found.

to get the correct server version you need to:

  • set serveStatus to "online" and run the script in debug mode
  • launch manually the minecraft server
  • request server info with the client

the script will capture 2 parameters that you need to replace in the script to make it work again

(next week i am planning on writing an update to make the process automatic (i will use an external config file that will be automatically updated when a new version is available))

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

No matter what version is set in the script, the connection still works and also with modded servers.
I do however get the same error as above.
image

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

Also, testing with WSL (2) is not good, as there seem to be some other problems occuring. Maybe due to the special environment mix.

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

After testing just with my machine I can say that the advertised server version and protocol do not have an impact on being able to connect to the server if the server version is different or the server is modded.
Since that has also been implemented with the config.json I will rename this issue.

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

Running the master script in Windows and connecting through localhost works.

I unfortunately can only test it in this way for now...
I'll see what I can do (I'm not an expert for docker)

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

something i can tell you for sure is that in the last 2 images serverVersion and serverProtocol are written in the wrong way:
they should be ... serverVersion: 1.14.4 serverProtocol: 498 without any characters (go-version 3.4)

(remember always to check the config.json for errors like 751}} or "1.14.4")

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

something i can tell you for sure is that in the last 2 images serverVersion and serverProtocol are written in the wrong way:
they should be ... serverVersion: 1.14.4 serverProtocol: 498 without any characters (go-version 3.4)

(remember always to check the config.json for errors like 751}} or "1.14.4")

Config looks good. The numbers are written in the same way as in the original.

    "ServerVersion": "1.14.4",
    "ServerProtocol": "498"

(I'm not an expert for docker)

No problem. Me neither, so I just work with what I know^^
I will try to get another machine or OS installation tomorrow, because I'm away for a few days after that, but since the old Docker version still works, I may postpone it to the end of next week.

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

ok no problem!

could issue 31 and 34 be related in some way (like the same problem from different point of view)?

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

Can we just make the point of the situation again? ;)
What is the problem? when does it happen?
how can I reproduce it? (what script, what docker, how to install the docker, what steps do i need to take to make it happen...)

Just so that in the next days i'll have a base from where i can help a little more ;)

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

could issue 31 and 34 be related in some way (like the same problem from different point of view)?

I don't know. For now it seems like this issue indicates a problem before starting the server while issue 34 indicates a problem after starting the server and either detecting the version or a player leaving the server.

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

Can we just make the point of the situation again? ;)
What is the problem? when does it happen?
how can I reproduce it? (what script, what docker, how to install the docker, what steps do i need to take to make it happen...)

Just so that in the next days I'll have a base from where I can help a little more ;)

Sure, I will create a summary tomorrow afternoon, when its not 5 minutes to midnight and I can concentrate a bit better^^

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

I don't know. For now it seems like this issue indicates a problem before starting the server while issue 34 indicates a problem after starting the server and either detecting the version or a player leaving the server.

okok but then how can you reach the problem after starting the server if the problem before starting the server prevents you from connecting at all?

Sure, I will create a summary tomorrow afternoon, when its not 5 minutes to midnight and I can concentrate a bit better^^

ok thanks take your time

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

okok but then how can you reach the problem after starting the server if the problem before starting the server prevents you from connecting at all?

Well, that is because issue #34 seems Windows (10?) specific, while this issue #31 is happening with the Docker image I tried building from merge #29 .
On Windows, I can join the server without problems, while with the Docker there is not even a connection recognized by the script that triggers the server start. From a quick test from a different PC yesterday, it seems at least partially to be a problem with my PC, as the server started, though after the startup countdown trying to join the server timed out. I will have to add more logging, as log.Fatal(err) worked in some instances, but not others, so that I didn't get enough info yesterday.

As for what you might be able to test... Maybe take the script from the docker branch and run it on a native Linux distro like Ubuntu. If that works, try installing the development docker with docker pull lubocode/minecraftserver-hibernate:development and following the README from the dockerhub page.
While you won't be able to update that, you can also just build the docker yourself with the Dockerfile from the docker branch and test out code with that. Keep in mind, that you will have to copy the MC server.jar into the volume specified by yourself upon installing the Docker container.

If there are no problems for you, don't sweat it. I will come back to it next week and do some more testing after implementing more logging. You can then just focus on what you would like to do with the master script, or if there is nothing and you feel bored, maybe add some code comments, so that it will be easier to understand for newcomers^^
A wiki is nice and all, but adding comments where code is not directly understandable or where variables only make sense with background knowledge is worth a lot for seamless group work on shared code.

When I come back next week, we can also have a skype/discord/whatever session and talk to further our understanding of these problems without making more of a mess through communicating with issue comments 😅
I have your mail address, so I will just contact you when I am back, such that we can share contact info for the desired voice service.

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

okok i understand better, for now i think i'll focus on solving issue #34 and adding comments to go version (and i think that will keep me busy enough ahah)

add some code comments, so that it will be easier to understand for newcomers^^
A wiki is nice and all, but adding comments where code is not directly understandable or where variables only make sense with background knowledge is worth a lot for seamless group work on shared code.

yep you are right i opened issue #36 for that (the wiki is more like for me to remember things though ahah)

When I come back next week, we can also have a skype/discord/whatever session and talk to further our understanding of these problems without making more of a mess through communicating with issue comments

yes i think it's a more appropriate way of doing things ahah

I have your mail address, so I will just contact you when I am back, such that we can share contact info for the desired voice service.

great!

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

so... i've looked fastly at possible differences and i don't see where the problem might be...

now i'll refer to this image:
image

you try to join and it says you that you requested server info then it closes connection

this is what happens on the script:

Screenshot_2020-10-13 gekigek99 minecraft-server-hibernation

(the green is what it's doing the red it's what it should do)

we need to understand why buffer[dataLen-1] == 0/1 and not 2 in docker so i would try adding an fmt.println(buffer[:dataLen]) just after dataLen, err := clientSocket.Read(buffer)

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

Trying to join (server still down, connection fails):

2020/10/14 15:36:48 *** from 172.17.224.1:25555 to 127.0.0.1:25565
[27 0 242 3 20 49 55 50 46 49 55 46 50 51 52 46 50 52 56 0 70 77 76 50 0 99 211 2 11 0 9 76 117 107 97 115 117 107 52 108]
2020/10/14 15:36:48 closing connection for: 172.17.224.1

Requesting server info:

2020/10/14 15:37:39 *** from 172.17.224.1:25555 to 127.0.0.1:25565
[27 0 242 3 20 49 55 50 46 49 55 46 50 51 52 46 50 52 56 0 70 77 76 50 0 99 211 1 1 0]
2020/10/14 15:37:39 *** player unknown requested server info from 172.17.224.1:25555 to 127.0.0.1:25565
2020/10/14 15:37:39 closing connection for: 172.17.224.1

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

Spamming the server with requests and cancelling them leads to a server startup eventually.
The start and stop currently only works with sudo (and the script returns exit status 1 for the startup function) , so the server instance I connected to was probably the one I started manually earlier.
Connecting to the started server does in fact work.

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

Trying to join (server still down, connection fails):

2020/10/14 15:36:48 *** from 172.17.224.1:25555 to 127.0.0.1:25565
[27 0 242 3 20 49 55 50 46 49 55 46 50 51 52 46 50 52 56 0 70 77 76 50 0 99 211 2 11 0 9 76 117 107 97 115 117 107 52 108]
2020/10/14 15:36:48 closing connection for: 172.17.224.1

this is the problem i explained to you yesterday where golang tends to put packets together (only sometimes... and this explains why eventually the server starts)...
on python it should be like this:

[27 0 242 3 20 49 55 50 46 49 55 46 50 51 52 46 50 52 56 0 70 77 76 50 0 99 211 *2*]  
[11 0 9 76 117 107 97 115 117 107 52 108]

(the highlighted 2 is the one that should trigger the start command)

(the second packet is containing the player name after the [9] (it's interesting to notice how the player name is sent with the format that is described in the wiki -> [11 0 9] where 9 is the lenght of the player name))

from minecraft-server-hibernation.

lubocode avatar lubocode commented on June 19, 2024

It now works. See commit 314fcc7 for the fix for connection establishment.
Now the server doesn't start up correctly, but I will open another issue for that. This ones has been abused enough already xD

from minecraft-server-hibernation.

gekigek99 avatar gekigek99 commented on June 19, 2024

@lubocode as a side note:
in the commit on Apr 7, 2020 (2708b6c) the go version still had a (really bad...) function called FindPattern() used in this way:

locationpattern, foundpattern := FindPattern(buffer[:datalenght], []byte{2, 11, 0, 9}) //for me is 2,11,0,9 don't know if it's a general rule
if buffer[datalenght-1] == 2 || foundpattern {
    // player is trying to connect
}

i removed it after discovering how the header magic works (11 0 9) because i understood it worked only for playerName length of 9...

this is why for you the old version was working and the newer ones did not: you were lucky enough that your playerName is the same length as mine and therefore 11 0 9 where the correct numbers to make everything work for your specific case, but would not have been functional for others.

now the FindPattern idea has been re-implemented in commit 831332b

from minecraft-server-hibernation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.