Skip to content

Add a way to prevent server-side prints from being redirected to players #3029

@SloPro

Description

@SloPro

What happened?

Hello,

this isn't technically a bug report, but I was told to post this here anyway by Heron.

I used to use Lua's io.write(message) to be able to guarantee certain server console output will never get redirected to a client, e.g. when executing a command. io.write would just print directly to stdout without triggering the redirect. This no longer works as of build 12092 (not exact number) as io.write doesn't exist anymore. It worked in 11516.

Since io.write doesn't exist anymore, and JavaScript's similar process.stdout.write is also apparently planned to be removed, I'd like to suggest a way to prevent these redirects from happening.

Thanks

Expected result

Prints to stdout

Reproduction steps

-- on the server:
RegisterCommand('test', function()
    print('this is a server-side print')
end)

Once a player executes the /test command from the code below, the output will be seen in the client's F8 console (and potentially stock chat). It's transmitted via a __cfx:internal:serverPrint S->C event. I think it would be good to have a way to print to the server's console in such cases without the player being able to read what it says.

Importancy

Unknown

Area(s)

FiveM, FXServer, ScRT: Lua

Specific version(s)

FXServer 12092

Additional information

No response

Metadata

Metadata

Labels

ScRT: LuaIssues/PRs related to the Lua scripting runtimebugtriageNeeds a preliminary assessment to determine the urgency and required action

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions