Author Topic: Echo Admin Commands to Admins only  (Read 35796 times)

0 Members and 2 Guests are viewing this topic.

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #30 on: August 23, 2013, 04:44:30 AM »
I'm just looking at the code now. Surely the easiest way to do this would be to change:

Code: [Select]
ULib.ucl.registerAccess( hiddenechoAccess, ULib.ACCESS_SUPERADMIN, "Ability to see hidden echoes", "Other" )
to this:

Code: [Select]
ULib.ucl.registerAccess( hiddenechoAccess, ULib.ACCESS_HEADADMIN, "Ability to see hidden echoes", "Other" )
Would that have my desired effect?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Echo Admin Commands to Admins only
« Reply #31 on: August 23, 2013, 05:05:04 AM »
No. The easiest would be to give that access tag to the appropriate group using "ulx groupallow". Changing that code only effects clean installs.
Experiencing God's grace one day at a time.

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #32 on: August 23, 2013, 06:36:39 AM »
I'm very confused then.
The groups I want to be able to see echoes have ulx hiddenecho, I can see that in the groups.txt file.

So I can understand this, assuming group headadmin has hiddenecho allowed and echo is set to 0 and an admin (without hiddenecho) does "ulx kick RandomNameHereLol" who should see what if anything?

Sorry if I'm getting annoying, I just really wanna get this to work as we want it. I'm happy to edit Lua but reluctant to mess with ULX if it already does what we want - ULX is great as it is!

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Echo Admin Commands to Admins only
« Reply #33 on: August 23, 2013, 08:51:53 PM »
The access tag is "ulx seeanonymousechoes", and it only has any effect if the echo mode is set to 1.
Experiencing God's grace one day at a time.

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #34 on: August 27, 2013, 05:47:11 AM »
The access tag is "ulx seeanonymousechoes", and it only has any effect if the echo mode is set to 1.

Ok, but you haven't actually answered my question though...

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Echo Admin Commands to Admins only
« Reply #35 on: August 27, 2013, 06:54:35 PM »
If you're expecting me to make the modification for you, I'm not going to. I know it sounds harsh, but I could spend all day on these forums making modifications for specific requests. It's not that I don't want to help, it's that other things are more important.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Echo Admin Commands to Admins only
« Reply #36 on: August 27, 2013, 07:14:10 PM »
Echo mode in 0 would see nothing.
Echo mode in 1, those with seeanonymousecho would see "username kicked username2" while others would see An admin kicked username2.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #37 on: August 28, 2013, 08:10:49 AM »
If you're expecting me to make the modification for you, I'm not going to. I know it sounds harsh, but I could spend all day on these forums making modifications for specific requests. It's not that I don't want to help, it's that other things are more important.

I'm not expecting you to make the mod for me. I just wanted it to be made clear by the ULX developers themselves how a particular ULX function works.

Echo mode in 0 would see nothing.
Echo mode in 1, those with seeanonymousecho would see "username kicked username2" while others would see An admin kicked username2.

Thanks, I understand that part. In your above scenario, what would someone with hidden echo see with either of those echo options (0 and 1)?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Echo Admin Commands to Admins only
« Reply #38 on: August 28, 2013, 02:07:11 PM »
This is getting repetitive.
Megiddo and I have only answered your question 3 or 4 different ways now.
I'm not quite sure how to make you get it.
If you don't get it after this answer, I'm not answering any more, and you must figure it out by testing on your own.
As long as it's taken, most would have figured it out on thier own just by changing the settings in thier server.

ulx logEcho 1 ; Echo mode
; Echo modes:
; 0 - OFF No output to any players when an admin command is used
; 1 - ANONYMOUS Output to players without access to see who used the command (admins by default) similar to "(Someone) slapped Bob with 0 damage"
; 2 - FULL Output to players similar to "Foo slapped Bob with 0 damage"

Echo mode in 0 would see nothing.
EDITED to match our own code examples
Echo mode in 1, those with seeanonymousecho would see "Foo slapped Bob with 0 damage" (as though you were using echo mode 2), while others would see "(Someone) slapped Bob with 0 damage"
Echo 2, everyone sees who did it no matter the permission
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #39 on: August 28, 2013, 03:44:40 PM »
This is getting repetitive.
Megiddo and I have only answered your question 3 or 4 different ways now.
I'm not quite sure how to make you get it.
If you don't get it after this answer, I'm not answering any more, and you must figure it out by testing on your own.
As long as it's taken, most would have figured it out on thier own just by changing the settings in thier server.
Echo 2, everyone sees who did it no matter the permission

Well you clearly don't understand what I am asking so there is no point carrying on.
Considering the ULX developers can't/won't tell me what the difference is between hiddenecho and seeanonymousechoes - that's a simple enough request that neither of you have managed to answer.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Echo Admin Commands to Admins only
« Reply #40 on: August 29, 2013, 04:29:25 AM »
Communication takes two parties. One to speak and one to listen. ;)

We have explained the differences patiently, even though it would have been far easier for everyone involved for you to just read the instructions and try it out yourself.
Experiencing God's grace one day at a time.

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #41 on: August 30, 2013, 06:40:45 AM »
I've talked to Megiddo about this, and he seems fine with it, so we will be adding this feature (time permitted). I need to get an issue created on our issues page as well, but.. for now just know that it's on our radar!

The eventual echo modes will end up something like this:
Code: [Select]
; Echo modes:
; 0 - OFF No output to any players when an admin command is used
[color=red]; 1 - ADMINS Output to admins only.[/color]
; 2 - ANONYMOUS Output to players without access to see who used the command (admins by default) similar to "(Someone) slapped Bob with 0 damage"
; 3 - FULL Output to players similar to "Foo slapped Bob with 0 damage"

Stickly and mikey clearly understand what I am trying to achieve. JamminR and Megiddo, I think it's probably best you don't answer anymore questions regarding the ULX Lua as you don't seem to have a clue how any of it works. Did you just copy and paste another admin tool, change a few bits and then release it as ULX?

If you don't know what the difference between hiddenecho and seeanonymousechoes is then just say, would have been far easier from the start for both parties instead of pretending to know what you're talking about -  wasting my time and your own.

I suspect I'll be banned for this post so I guess I'll have to find another crappy helpful forum to ask my questions on.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Echo Admin Commands to Admins only
« Reply #42 on: August 30, 2013, 08:56:26 AM »
JamminR and Megiddo, I think it's probably best you don't answer anymore questions regarding the ULX Lua as you don't seem to have a clue how any of it works.

Well that has to be the funniest thing I've read all week!

Did you just copy and paste another admin tool, change a few bits and then release it as ULX?

K, never mind, you just beat your own record there. (I'd advise looking up our history-- we've been around since before admin mods were a thing)


okiedoke, you got confused when you started talking about "ulx hiddenecho". Megiddo clarified in his next post that...
The access tag is "ulx seeanonymousechoes", and it only has any effect if the echo mode is set to 1.
...because "ulx hiddenecho" has no affect on any of the echo modes. You never specifically asked us what "ulx hiddenecho" did, you just stated that you would like to use it to do what you wanted to:

The groups I want to be able to see echoes have ulx hiddenecho, I can see that in the groups.txt file.

At least, you didn't mention it up until the point where you were saying we can't/won't tell you the difference.

Now, here is some hopefully useful overall explanations to make sure we're clear:
As you're probably aware, there are only the three echo modes right now:
0 - No output to anyone
1 - Output to everyone, but groups that don't have access to "ulx seeanonymousechos" see "(Anonymous) slapped Foo!"
2 - Output to everyone, and see the full output "(Stickly Man) Slapped Foo!"

We have an issue on our bugtracker to add the feature discussed in this thread- but we can only get to it when we have the available time, meaning you will need to do some of your own edits to the code (more on that in a bit).

There are some commands, such as ulx spectate and rcon that are set to be hidden since we would never want all players to be able to see those. For these commands, only groups that have access to "ulx hiddenecho" will receive the echos that an admin has spectated someone, used an rcon command, etc. So hiddenecho works on a per-command basis, and has nothing to do with the other echos.

Code: [Select]
local seeanonymousechoAccess = "ulx seeanonymousechoes"
ULib.ucl.registerAccess( seeanonymousechoAccess, ULib.ACCESS_ADMIN, "Ability to see who uses a command even with ulx logEcho set to 1", "Other" )

Now the ability to change ULib.ACCESS_ADMIN to a custom usergroup and being able to change it to work when echo is set to 0 would be PERFECT.

This is an FYI, but "ULib.ACCESS_ADMIN" is just a variable that contains the admin group name as a string ("admin"). So, you could replace it with "admin" or "superadmin" or whatever you want, but all that would do is change which group gets it by default when the server starts-- which is why we recommended using "ulx groupallow" to assign the tag to groups like you would any other access tag/command.

Now, possibly the easiest and hackyish way to get what you want without putting much thought into it is to go through our codebase and find every function call to fancyLogAdmin, and set the second parameter to true. (You can use the ulx rcon command echo as an example for what it should look like). Unless I'm mistaken, all echos should then be treated as hidden, and only the groups who have access to "ulx hiddenechos" will be able to see them at all.

The better way to fix it would be to edit the fancyLogAdmin funciton itself to ignore the check to see if the command is hidden or not:
Code: [Select]
if hide_echo then
     <code>
end
Just remove the if statement and leave the code, and it should treat all echos as hidden. However, this area of code is Megiddo's, and I know very little about it besides the quick glance I've just done, so I can't guarantee 100% that these methods will work or be without side effects (as in, hiding much more output than I intended).


And lastly, never ever assume someone else is at fault when you're not getting the information you want. Take a step back, calm down, have patience, and clarify in more detail what you are asking. Others may have misread what you've stated previously, and clarifying will give them another chance to read it properly- nobody is immune to communication problems. You didn't deserve a post like this, so be thankful I'm in a good mood today. :P
« Last Edit: August 30, 2013, 08:58:02 AM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline okiedoke

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #43 on: August 30, 2013, 09:36:11 AM »
Well that has to be the funniest thing I've read all week!

K, never mind, you just beat your own record there. (I'd advise looking up our history-- we've been around since before admin mods were a thing)


okiedoke, you got confused when you started talking about "ulx hiddenecho". Megiddo clarified in his next post that......because "ulx hiddenecho" has no affect on any of the echo modes. You never specifically asked us what "ulx hiddenecho" did, you just stated that you would like to use it to do what you wanted to:

At least, you didn't mention it up until the point where you were saying we can't/won't tell you the difference.

Now, here is some hopefully useful overall explanations to make sure we're clear:
As you're probably aware, there are only the three echo modes right now:
0 - No output to anyone
1 - Output to everyone, but groups that don't have access to "ulx seeanonymousechos" see "(Anonymous) slapped Foo!"
2 - Output to everyone, and see the full output "(Stickly Man) Slapped Foo!"

We have an issue on our bugtracker to add the feature discussed in this thread- but we can only get to it when we have the available time, meaning you will need to do some of your own edits to the code (more on that in a bit).

There are some commands, such as ulx spectate and rcon that are set to be hidden since we would never want all players to be able to see those. For these commands, only groups that have access to "ulx hiddenecho" will receive the echos that an admin has spectated someone, used an rcon command, etc. So hiddenecho works on a per-command basis, and has nothing to do with the other echos.

This is an FYI, but "ULib.ACCESS_ADMIN" is just a variable that contains the admin group name as a string ("admin"). So, you could replace it with "admin" or "superadmin" or whatever you want, but all that would do is change which group gets it by default when the server starts-- which is why we recommended using "ulx groupallow" to assign the tag to groups like you would any other access tag/command.

Now, possibly the easiest and hackyish way to get what you want without putting much thought into it is to go through our codebase and find every function call to fancyLogAdmin, and set the second parameter to true. (You can use the ulx rcon command echo as an example for what it should look like). Unless I'm mistaken, all echos should then be treated as hidden, and only the groups who have access to "ulx hiddenechos" will be able to see them at all.

The better way to fix it would be to edit the fancyLogAdmin funciton itself to ignore the check to see if the command is hidden or not:
Code: [Select]
if hide_echo then
     <code>
end
Just remove the if statement and leave the code, and it should treat all echos as hidden. However, this area of code is Megiddo's, and I know very little about it besides the quick glance I've just done, so I can't guarantee 100% that these methods will work or be without side effects (as in, hiding much more output than I intended).


And lastly, never ever assume someone else is at fault when you're not getting the information you want. Take a step back, calm down, have patience, and clarify in more detail what you are asking. Others may have misread what you've stated previously, and clarifying will give them another chance to read it properly- nobody is immune to communication problems. You didn't deserve a post like this, so be thankful I'm in a good mood today. :P

Thank you for the very in depth summary of everything I need to know.
Perhaps I should have been more clear when I first asked the questions but assumed by giving an example of what I wanted, someone in the know would then be able to help me.

I apologise for being so rude. I also apologise for removing 1 Karma from each Megiddo and JamminR.

Offline Topher III

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Echo Admin Commands to Admins only
« Reply #44 on: January 02, 2019, 01:45:43 AM »
I've talked to Megiddo about this, and he seems fine with it, so we will be adding this feature (time permitted). I need to get an issue created on our issues page as well, but.. for now just know that it's on our radar!

The eventual echo modes will end up something like this:
Code: [Select]
; Echo modes:
; 0 - OFF No output to any players when an admin command is used
; 1 - ADMINS Output to admins only.
; 2 - ANONYMOUS Output to players without access to see who used the command (admins by default) similar to "(Someone) slapped Bob with 0 damage"
; 3 - FULL Output to players similar to "Foo slapped Bob with 0 damage"

Its been 6 years, this still hasn't been implemented even though it would benefit many Garry's Mod communities.