Modifying chat with sayfilter but SayCommand doesnt "register"

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Jan 23, 2017 12:07 am

Are you sure?

I reproduced it by joining the empty server:

Console => "spectate" => "say hi" =>

Code: Select all

] say hi
*ZUSCHAUER* frag :  hi


=> sp plugin load deadchat => "say hi" =>

Code: Select all

] say hi
*ZUSCHAUER* frag :  hi
*ZUSCHAUER* frag :  hi


I disabled sourcemod for that test, so it must be pretty much that plugin.
Windows10/CSS

More testing with bots:

added 10 bots to both teams:

Writing "say_team hi" prints only once, but console spams:

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\deadchat\deadchat_css.py", line 36, in pre_saytext2_filter
    recipient_filter.update(PlayerIter('ct'))

AttributeError: '_RecipientFilter' object has no attribute 'update'
User avatar
L'In20Cible
Project Leader
Posts: 914
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby L'In20Cible » Mon Jan 23, 2017 12:24 am

decompile wrote:Are you sure?

I reproduced it by joining the empty server:

Console => "spectate" => "say hi" =>

Code: Select all

] say hi
*ZUSCHAUER* frag :  hi


=> sp plugin load deadchat => "say hi" =>

Code: Select all

] say hi
*ZUSCHAUER* frag :  hi
*ZUSCHAUER* frag :  hi


I disabled sourcemod for that test, so it must be pretty much that plugin.
Windows10/CSS

Followed those steps, I'm not getting it twice:

Code: Select all

] kill
L'In20Cible suicided.
Scoring will not start until both teams have players
Achievements disabled: cheats turned on in this app session.
] say hi
*DEAD* L'In20Cible :  hi
rcon plugin load deadchat
[SP] Loading plugin 'deadchat'...
Searching for a cached signature...
Found a cached signature!
[SP] Successfully loaded plugin 'deadchat'.
] say hi
*DEAD* L'In20Cible :  hi


decompile wrote:More testing with bots:

added 10 bots to both teams:

Writing "say_team hi" prints only once, but console spams:

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\plugins\deadchat\deadchat_css.py", line 36, in pre_saytext2_filter
    recipient_filter.update(PlayerIter('ct'))

AttributeError: '_RecipientFilter' object has no attribute 'update'
Yes, this is what I explained in my previous post.
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Jan 23, 2017 1:03 am

I tried it:

Code: Select all

] kill
frag suicided.
] say hi
*TOT* frag :  hi
] rcon sp plugin load deadchat
[SP] Loading plugin 'deadchat'...
[SP] Successfully loaded plugin 'deadchat'.
] say hi
*TOT* frag :  hi
*TOT* frag :  hi


Windows 10 / Dedicated Windows CSS Server / No Plugins loaded except source-python itself.
User avatar
L'In20Cible
Project Leader
Posts: 914
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby L'In20Cible » Mon Jan 23, 2017 1:08 am

decompile wrote:No Plugins loaded except source-python itself.

Any SP plugins that use SayFilter/SayCommand by any chance?
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Jan 23, 2017 1:13 am

Nope, nothing except that one plugin.

It works fine with say_team, only when being dead in a team does print multiple times.

Noticed that in the console it also says prints one "*DEAD* frag: whaddup" instead of two ingame.

Maybe it has something to do with the PlayerIter, where it prints again tomyself due writing the message, and once being in the PlayerIter.
User avatar
satoon101
Project Leader
Posts: 2292
Joined: Sat Jul 07, 2012 1:59 am

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby satoon101 » Mon Jan 23, 2017 1:21 am

Do you have SourceMod or EventScripts installed? I know this issue used to appear sometimes when both of those were installed together. Maybe we have that same issue with one or both of them.
Image
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Jan 23, 2017 1:23 am

I have Sourcemod/Metamod installed, but I havent used or more disabled them when I tested them. (Removing the .vdf so they doesnt load)
User avatar
L'In20Cible
Project Leader
Posts: 914
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby L'In20Cible » Mon Jan 23, 2017 1:31 am

satoon101 wrote:Do you have SourceMod or EventScripts installed? I know this issue used to appear sometimes when both of those were installed together. Maybe we have that same issue with one or both of them.

This issue was caused by EventScript's SayFilter that was forcing the client to re-execute the say/say_team command when the given text was modified. I don't think this is an issue we have, since we modify the CCommand directly and pass it on to the original callback. However, I'm really unable to reproduce this issue on my end so there is definitely something conflicting. It cannot be the filter adding the same player twice, since we exit the call if the index is already in the container. I'm out of idea. What is the output you get with the command sp info? Also, if you add some print() to the hook, does it gets printed twice? If so, that means there is definitely something resending the command.
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Jan 23, 2017 2:09 am

Yes, it does print twice.

Syntax: Select all

@PreHook(saytext2_filter)
def pre_saytext2_filter(args):
print("\n_hook_")
...


Code: Select all

[SP] Loading plugin 'deadchat'...
[SP] Successfully loaded plugin 'deadchat'.
rcon from "xxxxxxxx": command "sp plugin load deadchat"

_hook_
_hook_*DEAD* frag: hi
sp info

Date          : 2017-01-23 02:07:01.663556
OS            : Windows-10-10.0.14393
Game          : css
SP version    : 539
Server plugins:
   00: Source.Python, (C) 2012-2016, Source.Python Team.
SP plugins:
   00: deadchat
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Sat Jan 28, 2017 1:10 pm

Mentioning again:

I have sourcemod, metamod, tickrate enabler and sourcemod installed, but not activated.
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Wed Feb 08, 2017 2:25 am

Another thing I noticed is, that im getting:

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/plugins/chatranks/chatRanks.py", line 123, in pre_message_end
    on_user_message_created(message_index, BitBufferRead(buffer), buffer)
  File "../addons/source-python/plugins/chatranks/chatRanks.py", line 145, in on_user_message_created
    name = buffer_read.read_string()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 30: unexpected end of data


Username: ┼ N‡GH†MΔƦΣ CRΣ3PƦ ⺠: !s
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Sat Feb 11, 2017 5:30 pm

Next to that issue I figured it out why it sends twice (duplicate chat message):

Its cause of SourceTV:

tv_enable 1
tv_autorecord 1
tv_name "Source-TV [Auto-Recording]"
tv_delay 90
tv_password ""
tv_maxclients 10
tv_maxrate 3500
tv_snapshotrate 24
tv_allow_camera_man 0

in autoexec.cfg
decompile
Senior Member
Posts: 267
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby decompile » Mon Feb 20, 2017 3:59 pm

Regarding to that Issue:

https://github.com/Source-Python-Dev-Te ... -280918095

How can I do that, with the fixed version for sourcemod? I dont have receipents to use..
User avatar
Ayuto
Project Leader
Posts: 1543
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Modifying chat with sayfilter but SayCommand doesnt "register"

Postby Ayuto » Mon Feb 20, 2017 6:44 pm

viewtopic.php?p=7944#p7944

I have changed RecipientFilter to BaseRecipientFilter. That will probably fix the issue with SM.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest