mark2devel / mark2

Minecraft Multi Server Wrapper Written in Python with Twisted; Pull Requests HIGHLY Encouraged, Collaborators Needed Discord: https://discord.gg/zymJygHNpv
Other
208 stars 44 forks source link

False-positive crash restart #158

Closed Elgorond closed 2 years ago

Elgorond commented 3 years ago

My bungeecord is on a restart loop because mark2 can't ping the ip due to TCPShield plugin denying connections to it unless they first go through their proxy (i.e. the domains connected to them). Is there a way to disable the below feature?

2021-11-15 22:14:47 # server might have crashed: not accepting connections or wrong port is being pinged. -- restarting.
2021-11-15 22:14:47 # stopping bungee (caused by not accepting connections)
2021-11-15 22:14:47 | Closing listener [id: 0x8555ce38, L:/[0:0:0:0:0:0:0:0%0]:25565]
2021-11-15 22:14:47 | Closing listener [id: 0xa1bcdc0f, L:/[0:0:0:0:0:0:0:0%0]:25565]
2021-11-15 22:14:47 | Closing pending connections
2021-11-15 22:14:47 | Disconnecting 2 connections
Elgorond commented 3 years ago

I see that the server.properties is supposed to address this, but what if I don't have a workable ip I can put there?

Edit: So adding the following to mark2.properties seemed to fix my issues. plugin.monitor.ping-enabled=false plugin.monitor.enabled=false

But is there any reason why mark2 couldn't communicate with the bungee server even after I added 127.0.0.1/32 to TCPShield's ip-whitelist?

Column01 commented 3 years ago

I believe that TCPShield will not work with mark2. There is some code in TCPShield to drop ping attempts if they are from a legacy server list ping which mark2 uses for compatibility reasons. I will see if I can potentially implement a newer server list ping protocol, but no promises.

See the TCP shield code here

Column01 commented 3 years ago

In order to implement it, we'd need some way to determine if the server it's pinging is 1.6 or newer. In 1.7, the ping protocol was changed in a breaking way. TCPShield detects that change (well really bungeecord does) and then drops all "legacy" ping requests AKA mark2's ping request.

Ironically, I found code from one of the OG mark2 developers that he made to ping newer Minecraft servers lol

Will probably look into an elegant way of using it in mark2 to hopefully fix this issue

Column01 commented 2 years ago

I've started working on a new project for server wrapping in Python instead of doing this. Looking at the code, it would have been possible to implement it in the existing project, but difficult given certain limitations in regard to compatibility, going to close this as technically it's TCPShield breaking mojang convention by denying legacy pings (even though the new project will follow the new standard)

TomLewis commented 2 years ago

I fell into this problem today trying to setup TCPShield and mark2 just restarting the proxy over and over again.