SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

2 issues with linux servers #944

Closed jatapa closed 4 years ago

jatapa commented 4 years ago

Now I am not sure if this happens to everybody both linux and windows but after the latest update my servers have had these 2 problems.

  1. Running commands from console does not work.

  2. The servers will freeze right after they are up or after some time and after that nobody can connect to them.

Also tried without plugins and atleast the first issue still happens

SDGNelson commented 4 years ago

Been looking into it this afternoon, also ran into a case where the console became unresponsive. I'll also add "export TERM=xterm" to the ServerHelper.sh script. Interestingly with the logfile redirect and default console enabled it somewhat works e.g. you get the red ? for bad commands, but does not play nicely with the file output.

I don't believe any changes that would affect running multiple instances or modify the previous console behavior (with -NoDefaultConsole anyway) were made, so I'm going to read back through all the commits from this update.

jatapa commented 4 years ago

@Mithallas he does it by having every server in it's own folder like you have to install unturned for every server you have if you do it that way

SDGNelson commented 4 years ago

The only related change was that previously Console.WriteLine was always called during CommandWindow.log, and somewhat related is that the log files now share read/write access - but there is a log file for each server instance. I presume the when running multiple server instances you're using multiple server IDs e.g. +SecureServer/A and +SecureServer/B (otherwise they will clobber each other).

Other than that there were not any changes to running multiple instances or console IO when compared to the previous linux version. (Obviously a lot of the consle IO code was rewritten, but with -NoDefaultConsole the linux behavior is identical aside from the Console.WriteLine difference.)

aman7 commented 4 years ago

I presume the when running multiple server instances you're using multiple server IDs e.g. +SecureServer/A and +SecureServer/B (otherwise they will clobber each other).

i have made scripts like this for all my servers, but the time i start 2nd instance, 1st instance crashes and i get these errors. https://pastebin.com/EDGDJ9Tb

SDGNelson commented 4 years ago

Thanks for sharing that log: searching "_L_unlock_13 null exception" comes up with several other unity games which all ran into similar crashes on linux, but the native library varies e.g. physx, std containers, steamworks, etc. Their posts all seem to be edited to "it just started working" after validate game or installing misc stuff. Maybe try updating your system packages e.g. equivalent of "yum update" / "apt-get update"?

KyeNormanGill commented 4 years ago

I'm still not able to get input to work, through ubuntu console. I ran export TERM=xterm then ./ServerHelper.sh -logfile 2>&1 -NoDefaultConsole +secureserver/Rocket. Which started the server up fine. But i still can't run any commands.

Trojaner commented 4 years ago

Same here, I do not get input as well.

@SDGNelson I had this SteamAPI_ISteamNetworking_IsP2PPacketAvailable issue before this patch too. It's not related to the last update.

SDGNelson commented 4 years ago

Right now I'm waiting for a linux-only update to finish building that restores the old Console.WriteLine behavior in-case that fixes it, as in windows testing somehow flushing console output is required to get new input lines.

One thing I realized however is where does the linux input get sent to command input in the first place? Since the vanilla game is not listening for standard input except in the newer console implementation does that mean rocket is sending input?

Trojaner commented 4 years ago

https://github.com/RocketMod/Rocket.Unturned/blob/legacy/Rocket.Unturned/U.cs#L236 This is the only way how RocketMod handles input. The RocketLauncher doesn't do any magic, I believe it only redirects stdin like if we started the Unturned executable directly. Input also used to work if we do not use RocketLauncher or -logfile at all as it seems.

For Linux flushing console would be great too as piping with tee and grep cause issues at the moment because of that (at least it seems like that).

Edit: I have inspected the RM4 code a bit more and it indeed does Console.ReadLine() periodically on a different thread: https://github.com/RocketMod/Rocket.Unturned/blob/legacy/Rocket.Unturned/UnturnedConsole.cs#L64

SDGNelson commented 4 years ago

That doesn't explain how input is getting to onCommandWindowInputted from onInputCommitted however. 😕 I wonder if something custom somewhere is referring to CommandWindow.input which was left behind accidentally, so I've marked those obsolete but they will be created now and onInputText is bound again.

SDGNelson commented 4 years ago

Yeah your edit there explains it! 😄 Below that line it checks CommandWindow.input and invokes CommandWindow.input.onInputText externally with standard input. In this coming patch that should work fine again since CommandWindow.input is getting created again.

SDGNelson commented 4 years ago

I won't do it yet in the interest of keeping it a small stable update, but for the next update I will integrate that old threaded console stuff officially. #957 Update should be out within the next 45 min, and only requires a linux dedicated server update (no client changes, hash changes or version changes).

Ascivv1 commented 4 years ago

How do we upgrade the dedi server specifically?

Trojaner commented 4 years ago
login anonymous
app_update 1110390
Ascivv1 commented 4 years ago

Is the update out yet?

KyeNormanGill commented 4 years ago

Thankyou @SDGNelson you legend

SDGNelson commented 4 years ago

Was away, but yep the update's been out. One other note is that you do not need to specify "-NoDefaultConsole" anymore, as the Linux default console in the current version is empty aside from matching the old Console.WriteLine behavior.

Mithallas commented 4 years ago

do we still need to start servers with serverhelper or are we able to go back to using the rocket start.sh?

Trojaner commented 4 years ago

RocketLauncher should work fine again but if you want a future proof solution you should use the ServerHelper

Mithallas notifications@github.com schrieb am So., 28. Juli 2019, 05:56:

do we still need to start servers with serverhelper or should we be able to go back to using the rocket start.sh?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SmartlyDressedGames/Unturned-3.x-Community/issues/944?email_source=notifications&email_token=AANZWFB5P5YSGR4OJFHPRWTQBUDFXA5CNFSM4IHGM332YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26WJSI#issuecomment-515728585, or mute the thread https://github.com/notifications/unsubscribe-auth/AANZWFCHJVM64PKOKOYBTRDQBUDFXANCNFSM4IHGM33Q .

Ascivv1 commented 4 years ago

Rocket start script just freezes when I try to start the server. ServerHelper.sh works fine though

Mithallas commented 4 years ago

rocket start script works for me

SDGNelson commented 4 years ago

In the .1 patch TERM=xterm is in the ServerHelper.so script, and if a server startup command is not specified the dedicated server will warn and explain the different options.

With vanilla you can also specify -ThreadedConsole on linux, but output redirect or other trickery is required for now.

aman7 commented 4 years ago

same is happening with me.