Monthly Target: $400 Donations: $147
 36% 

Server Chat Relay v0.2 (2/18)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
FLOOR_MASTER
Senior Member
Join Date: Mar 2008
Plugin ID:
449
Plugin Version:
0.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    25 
    Plugin Description:
    Enable multi-server chat
    Old 07-06-2008 , 02:33   Server Chat Relay v0.2 (2/18)
    Reply With Quote #1

    Server Chat Relay (SCR) enables players on different servers to chat with each other.

    Configuration
    • sm_scr_server (default "0")
      • When non-zero, this game server becomes the Server Chat Relay server
    • 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_relaysay (default "0")
      • When non-zero, broadcast all say messages from this server (except those that begin with '!')
    • sm_scr_clients_file (default "scr_clients.txt")
      • Specifies the filename to open with a list of allowed SCR client IP addresses. For TF2, the default value resolves to the location "orangebox/tf/scr_clients.txt". The file should contain a list of allowed IP addresses (no ports), one per line. Whitespace is trimmed. If the file cannot be opened, any client is allowed.
    Commands
    • !bc [text]
      • Broadcast the specified text to all servers. This is useful if sm_scr_relaysay is 0. Available to all players.
    Example Setup
    Exactly one game server must be an SCR server. For example, let's say you run two TF2 Servers with IPs 1.1.1.1 and 2.2.2.2, and one DOD server with IP 3.3.3.3. I'll designate the first TF2 server as the SCR server with the following config:
    Code:
    sm_scr_server    "1"
    sm_scr_port      "51000"
    sm_scr_tag       "2f2f (TF2)"
    sm_scr_relaysay  "1"
    (relaysay is optional) All remaining servers must be SCR clients (sm_scr_server 0). For the 2nd TF2 server, I'll use the following config:
    Code:
    sm_scr_server    "0"
    sm_scr_ip        "1.1.1.1"
    sm_scr_port      "51000"
    sm_scr_tag       "2f2f2 (TF2)"
    sm_scr_relaysay  "1"
    And for the DOD server, I'll use the following config:
    Code:
    sm_scr_server    "0"
    sm_scr_ip        "1.1.1.1"
    sm_scr_port      "51000"
    sm_scr_tag       "2f2f3 (DOD)"
    sm_scr_relaysay  "1"
    Load the plugin on the SCR server first, then load the plugin on the SCR clients in any order. Pay attention to the console messages to make sure the SCR server starts correctly before starting the SCR clients. If you have trouble starting the SCR server, make sure you unload the plugin on all the SCR clients first.

    After setup, the inter-server chat looks like this (as seen on the DOD server):


    Installation
    1. Ensure that the sockets extension is installed on your servers.
    2. Copy scr.smx to your servers' SourceMod plugins directories (addons/sourcemod/plugins). Because the plugin relies on sockets, online compile will fail. I compiled scr.smx on sourcemod-1.2.0-hg2562, but I recommend that you compile the source on your own setup.
    Version History
    • 2008-07-05 - v0.1
      • Initial release
    • 2009-02-18 - v0.2
      • Added client whitelist
    I wrote this quickly without thorough testing, so please be aware of that. There are a lot of potential features to add to this, so feel free to request them here. I'm sorry to say due to time constraints I can't spend time helping novice users get things up and running.

    Note that if you receive socket errors (e.g. error 3 or error 5), you should unload the plugin on both the SCR server and clients, wait at least 30 seconds or so, then load the plugin on the server first, followed by the clients. This is a process I hope to automate soon.
    Attached Files
    File Type: sp Get Plugin or Get Source (scr.sp - 852 views - 9.8 KB)
    File Type: smx scr.smx (7.1 KB, 572 views)

    Last edited by FLOOR_MASTER; 02-18-2009 at 11:58.
    FLOOR_MASTER is offline
    FlyingMongoose
    Veteran Member
    Join Date: Mar 2004
    Old 07-06-2008 , 12:28   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #2

    That's awesome dude, 2 feature suggestions:

    Trigger based relay, IE: requiring a preceding 'command' for the relay to operate (perhaps an optional feature the preceding string could be a cvar if not set all are relayed)
    example:
    /scr this sends to other servers
    this does not

    if scr_start_command "/scr" or something along those lines.

    Other idea is to include a command as follows
    /admin

    This could also be used in conjunction with irc relay to send a message to only admins on all servers with the relay as well as send a message to IRC.
    __________________
    Please do NOT PM for support.

    Only ask for support in plugin threads.

    TunedChaos.com - Precision Tuned Game Servers
    FlyingMongoose is offline
    SixSicSix
    Senior Member
    Join Date: Jan 2008
    Old 07-06-2008 , 12:41   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #3

    Floor master, you finally made it! I remember making this plugin but it never wanted to work properly! Thanks much!
    SixSicSix is offline
    FLOOR_MASTER
    Senior Member
    Join Date: Mar 2008
    Old 07-07-2008 , 06:57   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #4

    Quote:
    Originally Posted by FLOOR_MASTER View Post
    ...I wrote this quickly without thorough testing, so please be aware of that...
    I've been running this system on three busy servers and it's worked flawlessly, albeit with a tendency to be a bit spammy. One thing I'm finding necessary is a connection timeout detection/retry feature, which I'll make a priority.
    FLOOR_MASTER is offline
    flubber
    Senior Member
    Join Date: Oct 2007
    Old 07-07-2008 , 12:27   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #5

    1 - How about a admin version? i mean i'm playing on server 1 cheater on server 2, people can alert me with for example : !bca cheater inside.

    2 - Does it work between different game server (tf2 & dod:s for instance)?
    flubber is offline
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 07-07-2008 , 15:43   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #6

    Quote:
    Originally Posted by flubber View Post
    1 - How about a admin version? i mean i'm playing on server 1 cheater on server 2, people can alert me with for example : !bca cheater inside.

    2 - Does it work between different game server (tf2 & dod:s for instance)?
    #1 Agree on that, need something just for admins, although I've just added an override so that admins with ADMIN_GENERIC (b) only have access to sm_bc


    #2 Yup, tested with CS:S (3 servers), DOD:S and 2x TF2

    Did I mention I love you FLOOR_MASTER ?

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 07-08-2008 , 04:51   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #7

    Small suggestion: Print the chat message back to the user including the entire server the original message was sent on.

    Not so small suggestion: Add the ability to run a server command across ALL servers (with ROOT access only)

    Matt
    __________________

    Last edited by MoggieX; 07-08-2008 at 05:03.
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    MoggieX
    Veteran Member
    Join Date: Aug 2007
    Location: n00bville
    Old 07-08-2008 , 05:32   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #8

    Actually, thinking aloud, why not pack the message with a identifier?

    Then when the message is received, it picks up the identifier and then processes the message accordingly.

    Such as

    identifier = 0 - sm_bc - Prints chat to all
    identifier = 1 - sm_bcc - runs server command
    identifier = 2 - sm_bca - Admin only messages
    identifier = N - sm_bcx - What ever you want

    Should be a simple set of IF statements or a select case, to process the options differently, but still maintaining the same broadcast code??

    Matt
    __________________
    MoggieX is offline
    Send a message via Skype™ to MoggieX
    blik
    Senior Member
    Join Date: May 2006
    Old 07-08-2008 , 06:56   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #9

    Wow, really nice FLOOR_MASTER might give this a go.
    blik is offline
    FLOOR_MASTER
    Senior Member
    Join Date: Mar 2008
    Old 07-08-2008 , 09:51   Re: Server Chat Relay v0.1 (7/05)
    Reply With Quote #10

    MoggieX - extending the type of messages beyond broadcasting chat is definitely the next step, but only after adding some form of SCR client authentication. Ideally, the system would also permit targeting specific servers and way (way down the road) remote administration via admin menus.
    FLOOR_MASTER is offline
    Reply


    Thread Tools
    Display Modes

    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 22:31.


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