ULX

Author Topic: Ignore PlayerSay  (Read 2763 times)

0 Members and 1 Guest are viewing this topic.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Ignore PlayerSay
« on: June 18, 2016, 11:15:02 PM »
How does ulx ignore the PlayerSay hook for commands? For example, why can people still type in admin chat while muted?

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Ignore PlayerSay
« Reply #1 on: June 19, 2016, 07:15:04 AM »
Either hook priority, or they're using the ulx * console commands as opposed to their chat counterparts.
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Ignore PlayerSay
« Reply #2 on: June 19, 2016, 08:49:31 AM »
Additionally, admin chat isn't standard chat. I'd have to dig into our code, but it's likely that once @ is used, it would never get to the playersay hook anyway.
Essentially, we never return chat text in the first place.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Ignore PlayerSay
« Reply #3 on: June 19, 2016, 09:31:41 AM »
What JamminR said, ulx asay uses no hooks, as a matter of fact, and sends a message to only those allowed to see it and the person who used it. Can't remember if they used fancyLog or fancyLogAdmin, though.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Re: Ignore PlayerSay
« Reply #4 on: June 19, 2016, 09:55:48 AM »
That makes sense. Do you know how ulx detects if you type something without using the PlayerSay hook?

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Ignore PlayerSay
« Reply #5 on: June 19, 2016, 09:56:51 AM »
It's all in the code. It doesn't detect hooks or skip them or anything, it simply doesn't use them.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Re: Ignore PlayerSay
« Reply #6 on: June 19, 2016, 10:12:37 AM »
How does ulx know to execute a command when someone types a command in chat without using hooks?

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Ignore PlayerSay
« Reply #7 on: June 19, 2016, 10:27:52 AM »
It's in the command. When you define a ulx.command at the bottom of the code, you can assign a command line which, when you use in the chat, it will execute that command.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Ignore PlayerSay
« Reply #8 on: June 19, 2016, 11:05:23 AM »
It's in the command. When you define a ulx.command at the bottom of the code, you can assign a command line which, when you use in the chat, it will execute that command.
You're misinterpreting things.
ulx.command registers a new command, telling UL(x|ib) that you want x to happen when y is said or z is run in the console. HOWEVER, this does not mean hooks aren't used internally. They are, in fact, used.
This hook is registered with HOOK_HIGH priority. The hook responsible for gimps and mutes is registered with HOOK_LOW priority. Therefore, the PlayerSay hook that checks for commands takes the highest precedence (if I understand ULib's improved hook system correctly).
bw81@ulysses-forums ~ % whoami
Homepage

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Ignore PlayerSay
« Reply #9 on: June 19, 2016, 11:07:03 AM »
Ah, what I was thinking was you don't need to specifically specify a hook when making the command.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Ignore PlayerSay
« Reply #10 on: June 19, 2016, 02:02:57 PM »
Yes, you understand it correctly Bytewave. We didn't want admins panicking if they muted/gimped themselves and then couldn't run the commands they were used to (from chat).
Experiencing God's grace one day at a time.