SmartlyDressedGames / Legally-Distinct-Missile

Fork of Rocket for Unturned maintained by the game developers.
MIT License
77 stars 29 forks source link

IO buffer bug #21

Closed rube200 closed 4 years ago

rube200 commented 4 years ago

Bug found with rocket console Video This bug happen in a fresh server with just rocketmod Unturned server command: start /SEPARATE Unturned.exe -nographics -batchmode -silent-crashes +secureserver/Test_Rm4

SDGNelson commented 4 years ago

I double-checked with and without Rocket and it worked properly for me.

Are you using the SDG-maintained version/a fork of it? If not, it will become mandatory in the next update. Can you share why not?

The console functions block the calling thread which is why the game's built-in console runs them from a separate thread.

rube200 commented 4 years ago

I was using a fresh version of server. (i reinstalled both client/server files two days before this report)

Bat script


@echo off
cd "C:\Program Files (x86)\Steam\steamapps\common\Unturned_Server"
move /Y Modules\Rocket5 Rocket5 >nul 2>&1 -- ignore it (old stuff, these folders don't even exist)
move /Y Rocket4 Modules\Rocket4 >nul 2>&1 -- ignore it (old stuff, these folders don't even exist)
echo -SkipAssets
start /SEPARATE Unturned.exe -nographics -batchmode -silent-crashes +secureserver/Test_Rm4```
SDGNelson commented 4 years ago

Are you using the SDG-maintained version of Rocket though? Either from the Extras directory, this repository, or a fork of this repository.

rube200 commented 4 years ago

Copy-paste from extras folder

SDGNelson commented 4 years ago

Does it happen if you run the ExampleServer.bat script?

Also based on "with just rocketmod" I assume you have no plugins for this test, but just in case, do you have any plugins?

rube200 commented 4 years ago

I had tested it with my plugin ORP on the server but I knew it wouldn't affect it. Now I ran the script you said (I had to move the server to C: because of the path) and now with 0 changes (plugins / config ...) the bug continues to happen, but a funny thing happened when I put a id/name that is invalid it returns the correct message from the server, so it's probably related to Rocket.Core.Logger.Log

This error also appeared btw: An error occured while executing v [12323]: System.NullReferenceException: Object reference not set to an instance of an object at Rocket.Unturned.Commands.CommandV.Execute (Rocket.API.IRocketPlayer caller, System.String[] command) [0x000f9] in <59f13c7b8fd2452db84433be578fe6c9>:0 at Rocket.Core.Commands.RocketCommandManager+RegisteredRocketCommand.Execute (Rocket.API.IRocketPlayer caller, System.String[] command) [0x00000] in <466fa14d466749559a64a11ae8acbc60>:0 at Rocket.Core.Commands.RocketCommandManager.Execute (Rocket.API.IRocketPlayer player, System.String command) [0x001b2] in <466fa14d466749559a64a11ae8acbc60>:0 [World] Spirits [ⓇⓊⒷⒺ②🄋🄋]: "/v 12323" (not output in chat for it, and /i 12323 returns the correct msg)

SDGNelson commented 4 years ago

Why did you have to move it to the C drive? Nothing in the game or those scripts should rely on a specific drive letter. For my tests it was on the D drive.

Is it possible that your ORP plugin uses the Console class somewhere? e.g. Console.WriteLine

I think you may be right that something in Rocket.Core uses the Console class, will check into that.

XanderCodes commented 4 years ago

I may have completely misread the thread, but looking at the video, I believe this is caused by Windows' terminal, mainly the QuickEdit function... see this and this from StackOverflow.

All you have to do to fix it is right-click on the console's title bar, click Properties, then disable "QuickEdit Mode"

I should add I have experienced this issue for many years, on multiple different game servers, I don't know if it's something that can actually be fixed from within Unturned or LDM...

SDGNelson commented 4 years ago

I think the reason I didn't run into the same freeze was that I used the built-in vehicle/give commands rather than the Rocket alternatives. Checking the Rocket.Core code a couple days ago it does directly use the Console functions, so in the next update it will be routed through Unturned instead.

SDGNelson commented 4 years ago

This should be fixed in the next update. Thanks for the report @rube200! All usage of System.Console has been replaced with SDG.Unturned.CommandWindow.