Pryaxis / TSAPI

🛠🌳 The TShock Scaffold API enables developers to build plugins that hook directly into the Terraria game engine.
http://tshock.co/
GNU General Public License v3.0
109 stars 66 forks source link

Switch IsInputRedirected to a CLI flag #195

Closed SignatureBeef closed 3 years ago

SignatureBeef commented 3 years ago

Alternate to #185 as i don't believe we should be using Console.IsInputRedirected in this situation. Instead disable it explicitly, rather than automatically and undoing it (making it more confusing).

Tested using gist: https://gist.github.com/DeathCradle/570f9be7b4a498cacc0ec2bef35c535b Drop in this TerrariaServer.exe, commands continue to work, unless -disable-commands is supplied.

Root source before file shuffle: https://github.com/Pryaxis/TSAPI/blob/ec4e59ea0c5fd5e21fbb4742c844863016a901a7/Terraria/Main.cs#L10020

SignatureBeef commented 3 years ago

Note gist/test case has been updated with a few revisions since, and recently for windows/osx - terraria uses specific console encoding depending on the platform. I know @hakusaro and myself primarily test on osx, so now others 'should' be able to test as well.

hakusaro commented 3 years ago

My build is available here: https://argo.sfo2.digitaloceanspaces.com/atoms/TerrariaServer.exe

hakusaro commented 3 years ago

@bartico6 tested on windows and it works there too.