Azelphur / SourceIRC

An easy to use SourcePawn API to the IRC protocol.
6 stars 9 forks source link

Update sourceirc-relayall.sp #6

Closed JoinedSenses closed 7 years ago

JoinedSenses commented 7 years ago

Added cmd to toggle IRC, which can be useful when multiple servers are connected.

Azelphur commented 7 years ago

Hi!

Thanks for helping improve SourceIRC, this is certainly a good idea, however I have a couple of suggestions before we merge these changes

On line 177 through 180 and line 187 through 191, you are looping through all connected clients, and running PrintToChatAll for each connected client. PrintToChatAll prints to all players chat, so your code will send the message once for every connected client, eg if there are 10 players online and I type "hi" in IRC, all the players will receive me saying "hi", 10 times in a row. Obviously not what you intended, you'll want to switch to PrintToChat I imagine.

The only other thing I'd request, on my server we often use IRC for warning players if they are breaking the rules, etc. So I personally wouldn't want players to be able to disable seeing IRC messages. This could be solved by adding a cvar like sm_allow_irc_disable, which prevents the sm_irc command from being used.

Let me know if you have any questions or need any help, and thanks again for helping to improve SourceIRC :)