Raised This Month: $ Target: $400
 0% 

[ANY] Server Chat Relay REDUX v0.8 (Updated 05/23/2016)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
kekcheese
Junior Member
Join Date: May 2016
Plugin ID:
5201
Plugin Version:
0.8
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Enables cross-server chatting
    Old 05-22-2016 , 03:58   [ANY] Server Chat Relay REDUX v0.8 (Updated 05/23/2016)
    Reply With Quote #1

    Full credit to FLOOR_MASTER for the original code found here: https://forums.alliedmods.net/showthread.php?t=73779

    I modified this for my own use and figured others may want the changes I made. I intend to maintain this for any issues that may arise and will continue to develop features as I have time. Feel free to ask any questions or make requests in this thread.

    Cvars
    • sm_scr_server (default "0")
      • When non-zero, this game server becomes the Server Chat Relay server
    • sm_scr_relaysay (default "1")
      • When non-zero, broadcast all say messages from this server (except those that begin with '!' and those listed in the sm_scr_blacklist_file file.)
    • sm_scr_ip (default "127.0.0.1")
      • IP of the Server Chat Relay server (ignored when sm_scr_server is 0)
    • sm_scr_port (default "51000")
      • Port of the Server Chat Relay server
    • sm_scr_tag (default "Server 1")
      • Tag to prefix messages broadcast from this server
    • sm_scr_clients_file (default "scr_clients.txt")
      • The text file containing a list of allowed client IPs
    • sm_scr_blacklist_file (default "scr_textblacklist.txt")
      • The text file containing a list of text that will not be broadcast
    • sm_scr_o_alias (default "sm_bc")
      • Alias for the !o command. Defaults to sm_bc, which means !bc is the chat command.
    • sm_scr_text_color (default "{default}")
      • Color the text of the message sent to all servers. Please do not use this for communication between games as it may corrupt the text.
    • sm_scr_user_color (default "{blue}")
      • Color the username of the message sent to all servers. Please do not use this for communication between games as it may corrupt the text.
    • sm_scr_tag_color (default "{green}")
      • Color the server tag of the message sent to all servers. Please do not use this for communication between games as it may corrupt the text.
    • sm_scr_spam_delay (default "1")
      • How many seconds to wait between users being able to send messages. E.x. sm_scr_spam_delay set to 2, if a user sends 2 messages within 2 seconds, only the first message will be relayed to all servers.

    Commands
    • !o [text]
      • Broadcast the specified text to all servers. This is useful if sm_scr_relaysay is 0. Available to all players.

    Installation Notes / Dependencies
    • This plugin depends on the Socket Extension being installed. Please install this first.
    • The initial load of the program may fail with a Socket Error 3. This is expected. Please modify the config files and load the relay server first, then dependent servers.
    • This has only been tested on CS:GO.
    • Online compile DOES NOT WORK due to socket requirement. Attached is a compiled 1.7.3 smx if you'd rather not self compile.

    Installation Steps
    1. Install the Socket Extension on all servers
    2. Copy scr.smx to the SourceMod plugins directory on each server. (e.x csgo\addons\sourcemod\plugins)
    3. Download the attached cfg and place in your the SourceMod cfg folder on each server OR let it auto create one on the first load. (located at e.x. csgo\cfg\sourcemod\plugin.scr.cfg)
    4. Modify the cfg file on the main server to have sm_scr_server set to 1.
    5. Modify the cfg files on the dependent servers to have sm_scr_ip and sm_scr_port to the proper values.
    6. Start the Relay server (whichever server has sm_scr_server set to 1).
    7. Start all dependent servers.

    scr_clients.txt and scr_textblacklist.txt
    Both files need to be placed in the root of your mod directory, or set the cvar to go through folders. (e.x. csgo\scr_clients.txt)

    For scr_clients.txt, if the file exists then no servers will be able to relay messages unless they are part of this file. Please put each new server on a new line, just listing the IP address it will be connecting from.

    For scr_textblacklist.txt, place any words that will trigger a line to not be sent to other servers. All commands that start with ! automatically do not get sent over, so things like "rtv" and "nominate" should be placed in this file so those do not get sent when used without an exclamation point.

    Version History / Changelog
    • 5/23/2016 - v0.8
      • Changed spam delay to a controllable CVar, default to 1 second. sm_scr_spam_delay. Requested by: Major Erection
    • 5/22/2016 - v0.7
      • Enabled color support using colors.inc dependency. CVARs added: sm_scr_user_color, sm_scr_tag_color, sm_scr_text_color. Requested by: Major Erection
    • 5/22/2016 - v0.6
      • Created the sm_scr_o_alias CVAR. Requested by: Major Erection
      • Rate limited cross server chat to 1 message per user per second. Requested by: Major Erection
      • Fixed blacklist being case sensitive, now RTV will be treated like rtv.
    • 5/22/2016 - v0.5
      • Changed from !bc to !o
      • Fixed blacklist not affecting the broadcast command.
    • 5/22/2016 - v0.4 (First revision by Cheese)
      • Added ability to blacklist text that you don't want broadcast
      • Resolved issue where blank lines in CSGO would be sent across the servers
    Attached Files
    File Type: sp Get Plugin or Get Source (scr.sp - 447 views - 14.8 KB)
    File Type: smx scr.smx (13.8 KB, 486 views)
    File Type: cfg plugin.scr.cfg (2.0 KB, 420 views)

    Last edited by kekcheese; 05-23-2016 at 13:17. Reason: v0.7
    kekcheese is offline
    Major Erection
    AlliedModders Donor
    Join Date: Dec 2015
    Location: Malaysia
    Old 05-22-2016 , 13:59   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #2

    Firstly I'd like to say good stuff you have here man. I'll try it out soon

    But I need to ask a few questions :

    sm_scr_relaysay 1 will make any normal message be sent to all servers right?

    also will !bc relay stuff listed in sm_scr_blacklist_file ?

    Thanks in advance man.
    __________________
    Major Gaming
    Major Erection is offline
    kekcheese
    Junior Member
    Join Date: May 2016
    Old 05-22-2016 , 14:21   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #3

    Quote:
    Originally Posted by Major Erection View Post
    sm_scr_relaysay 1 will make any normal message be sent to all servers right?
    Correct. Any server with sm_scr_relaysay enabled will send all chat messages to all other servers. Team chat messages are not sent no matter what.

    Quote:
    Originally Posted by Major Erection View Post
    also will !bc relay stuff listed in sm_scr_blacklist_file ?
    No, the blacklist file runs on the hijacked say command, so any text that triggers the blacklist will just skip over the text processing of this plugin.
    kekcheese is offline
    Major Erection
    AlliedModders Donor
    Join Date: Dec 2015
    Location: Malaysia
    Old 05-22-2016 , 14:35   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #4

    Installed it on 3 of my servers, they all loaded fine. The 2 servers connected to the correct ip and port. I changed the port because it said could not connect to 51000.

    Everything loaded fine, however none of the messages got sent over to other servers.

    I tried sm_scr_relaysay 1 and sm_scr_relaysay 0

    Both normal 'say' and !bc

    Checked the logs for any errors but there is none. Any idea how to solve this?

    Edit: The error log showed nothing but the normal one on my relay server shows [scr.smx] Rejected connection from 20x.58.xx.xxx:46998 and the other servers' logs showed Connected to Server Chat Relay server on ip:port
    __________________
    Major Gaming

    Last edited by Major Erection; 05-22-2016 at 14:40.
    Major Erection is offline
    kekcheese
    Junior Member
    Join Date: May 2016
    Old 05-22-2016 , 15:05   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #5

    Quote:
    Originally Posted by Major Erection View Post
    Installed it on 3 of my servers, they all loaded fine. The 2 servers connected to the correct ip and port. I changed the port because it said could not connect to 51000.

    Everything loaded fine, however none of the messages got sent over to other servers.

    I tried sm_scr_relaysay 1 and sm_scr_relaysay 0

    Both normal 'say' and !bc

    Checked the logs for any errors but there is none. Any idea how to solve this?

    Edit: The error log showed nothing but the normal one on my relay server shows [scr.smx] Rejected connection from 20x.58.xx.xxx:46998 and the other servers' logs showed Connected to Server Chat Relay server on ip:port
    Try creating the scr_clients.txt folder inside the root of your mod (e.x. csgo\scr_clients.txt) and add the IP address in there. Let me know if that works for you. Also, if the server is in hibernation status or no players are on, the connection may fail.

    Let me know if you need any direct help and I could do a screenshare session with you to fix this.
    kekcheese is offline
    Major Erection
    AlliedModders Donor
    Join Date: Dec 2015
    Location: Malaysia
    Old 05-22-2016 , 15:08   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #6

    Quote:
    Originally Posted by kekcheese View Post
    add the IP address in there.
    Add my IP or the server's IP?

    Quote:
    Originally Posted by kekcheese View Post
    Also, if the server is in hibernation status or no players are on, the connection may fail.
    sv_hibernate_when_empty 0 should solve this no?

    Quote:
    Originally Posted by kekcheese View Post
    Let me know if you need any direct help and I could do a screenshare session with you to fix this.
    Appreciate it but I think it's not needed yet
    __________________
    Major Gaming
    Major Erection is offline
    kekcheese
    Junior Member
    Join Date: May 2016
    Old 05-22-2016 , 15:20   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #7

    Quote:
    Originally Posted by Major Erection View Post
    Add my IP or the server's IP?
    You put scr_clients.txt in the csgo (or other mod folder) of the server which has sm_scr_server 1 set. Include the IP of all client servers, those that have sm_scr_server 0 set.
    Quote:
    sv_hibernate_when_empty 0 should solve this no?
    Yes
    kekcheese is offline
    Major Erection
    AlliedModders Donor
    Join Date: Dec 2015
    Location: Malaysia
    Old 05-22-2016 , 15:20   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #8

    Adding the IP's worked. But only with 'say'

    When I set sm_scr_relaysay 0 and use !bc, it states that sm_bc is an unknown command
    __________________
    Major Gaming
    Major Erection is offline
    kekcheese
    Junior Member
    Join Date: May 2016
    Old 05-22-2016 , 15:48   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #9

    Quote:
    Originally Posted by Major Erection View Post
    Adding the IP's worked. But only with 'say'

    When I set sm_scr_relaysay 0 and use !bc, it states that sm_bc is an unknown command
    I've changed it to !o <text> as !bc doesn't normally show up for my server. Tested it and its working, though it will show "Unknown command: sm_o" in console still.

    Attached to the main thread and below.
    Attached Files
    File Type: sp Get Plugin or Get Source (scr.sp - 197 views - 11.2 KB)
    File Type: smx scr.smx (9.7 KB, 325 views)
    kekcheese is offline
    Major Erection
    AlliedModders Donor
    Join Date: Dec 2015
    Location: Malaysia
    Old 05-22-2016 , 16:08   Re: [ANY] Server Chat Relay REDUX v0.4 (Updated 05/22/2016)
    Reply With Quote #10

    Quote:
    Originally Posted by kekcheese View Post
    I've changed it to !o <text> as !bc doesn't normally show up for my server. Tested it and its working, though it will show "Unknown command: sm_o" in console still.

    Attached to the main thread and below.
    Works perfectly man! Thanks so much for what you've done. I've been searching for a cross server chat plugin that works for the past 2 months.

    I have a couple feature suggestions though,

    1. Aliases for !o
    2. Color in the chat. Meaning we can choose color for the tag, color for the message and color for the name.
    3. A command like !oadmin or whatever to just notify admins.
    4. Cooldown for sending messages to prevent spam. (something like one message per second)
    __________________
    Major Gaming

    Last edited by Major Erection; 05-22-2016 at 16:09.
    Major Erection is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 12:29.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode