View Single Post
Nikkii
Member
Join Date: Feb 2012
Old 06-23-2013 , 23:18   Re: Simple Chat Processor (Redux)
Reply With Quote #136

Quote:
Originally Posted by bottiger View Post
I can confirm OnChatMessage being called multiple times per chat message.

I think it could be fixed by having a boolean array, 1 entry for each player. When a message is processed, if the array is true for the player that is chatting, then the event is not fired. Otherwise it is set to true. When OnGameFrame happens, reset the bit for that player to false.

I haven't tested if these extraneous repeats fire within the same frame but I think they are.
It's the way User Messages are done, read the post I linked above... Not sure if it can be prevented (Since the messages it's hooking multiple times do sometimes get ignored and they continue), I might look into it tomorrow using a command listener on say/say_team and only stopping multiple on Plugin_Changed, as it'll create a new message and that's the end of it >.>

Not sure exactly how the messages work, but considering it creates a new one if it changed it shouldn't be that bad.
__________________
Owner of ProbablyAServer, a server without game changing mods and donation benefits

RCON Helper | [TF2] LogUpload | CCC Donator Tags | PHP Steam API Wrapper
Nikkii is offline