Ulysses

General => Developers Corner => Topic started by: iViscosity on December 16, 2016, 06:31:30 PM

Title: Log ONLY to Console
Post by: iViscosity on December 16, 2016, 06:31:30 PM
Was wondering if there was a way to log something with ULX (or just in general) that will ONLY echo to the console. I'm writing a script that, for security reasons, should not be echoed to anyone except the parties involved. Would something like 'MsgN()' be useful, or is there a more convenient and safer way of doing this?


EDIT: Right now I'm using fancyLog( { calling_ply } and fancyLog( { target_ply } (different messages to each) so that it sends ONLY to them, is there a safer way of letting them know this?


EDIT2: Would ServerLog (https://wiki.garrysmod.com/page/Global/ServerLog) work?
Title: Re: Log ONLY to Console
Post by: MrPresident on December 18, 2016, 11:19:22 PM
ServerLog would only log to the Dedicated Console and none of the connected clients.
Title: Re: Log ONLY to Console
Post by: iViscosity on December 19, 2016, 07:34:18 AM
Yeah I guess it was kind of confusing what I was asking there. Pretty much, ServerLog is what I need to log to only the server, is there any safe way to notify players in the game about something that is sent ONLY to them and no one else? I'm thinking of using HUD_PRINTCONSOLE (with PrintMessage(), I think that's the one), but I need to know if there is any way that can be intercepted.
Title: Re: Log ONLY to Console
Post by: Bytewave on December 19, 2016, 09:17:31 AM
I'm thinking of using HUD_PRINTCONSOLE (with PrintMessage(), I think that's the one), but I need to know if there is any way that can be intercepted.
Unless someone has network access, I doubt this data would be interceptable.
Title: Re: Log ONLY to Console
Post by: MrPresident on December 19, 2016, 12:26:01 PM
Yeah, the server chooses who to send messages to, so if you only send a message to 1 client.. no other client can intercept it.

If you're worried about the server seeing messages sent between 2 clients... well... that's just how it goes..
Title: Re: Log ONLY to Console
Post by: iViscosity on December 19, 2016, 12:29:12 PM
Yeah, the server chooses who to send messages to, so if you only send a message to 1 client.. no other client can intercept it.

If you're worried about the server seeing messages sent between 2 clients... well... that's just how it goes..
I'm worried about other clients seeing the message, not the server seeing the message. I think I've got what I need, though.

Sent using Tapatalk. Owner of iViscosity Gaming.

Title: Re: Log ONLY to Console
Post by: MrPresident on December 19, 2016, 12:50:52 PM
Yes, that's just not possible the way source (or really any server - client) handles sending messages from the server to the intended recipients.