Raised This Month: $ Target: $400
 0% 

IRC Relay


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Plugin ID:
16
Plugin Version:
1.0.2b
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plugin to relay stuff from game server, to IRC channels
    Unapprover:
    Reason for Unapproving:
    Outdated, refer to http://forums.alliedmods.net/showthread.php?p=584972
    Old 05-30-2007 , 15:31   IRC Relay
    Reply With Quote #1

    This plugin was meant to just relay messages from our IRC channel, to the game server, and back. But over the last month or two, i have added loads more stuff to the plugin. But it is by no means finished.

    I decided to release the plugin now, because people have been asking me to for a while. So you can have it now, with the features it has, and when I add more, the post will be updated.


    FEATURES:
    • Main Features
      • Message the whole server, or individual players in your source server from IRC
      • Messaging IRC from in game
      • Ability to view all game chat messages from IRC
      • Ability to authenticate with IRC
      • Player listings, and with scores
      • Detailed player info
        • Can view detailed information about a player from ingame
      • Server information
      • Run Rcon commands from IRC
      • Kick & Ban players from IRC
      • Output to IRC when playersr are banned
      • Magic 8ball (Just because i can ^^)
      • Support for multiple IRC relay's in the same channel
      • Define-able relay "groups" for executing commands on multiple servers at once
      • Multiple channel support (10 max)
      • Define-able Master Channel
      • Customizable command permissions
      • Flood protection
    • API Features
      • Ability to send messages through IRC Relay from your plugin.
      • Ability for plugins to register their own commands with the relay, and get callbacks when its used.
      • Ability to set which user level should be able to run the command.
    REQUIREMENTS:CVARS:
    • irc_nickname
      • The nickname the bot should use
      • This must be unique to the network
    • irc_name
      • The 'real name' of the bot (Set to anything, I suggest 'Yarrr')
    • irc_login
      • The auth login
    • irc_pass
      • The auth password
    • irc_name_trigger
      • The trigger for this relay
    • irc_channel
      • List of channels the relay should join, Seperate by [space]
      • Max 10 channels
    • irc_master_channel
      • The main channel to run commands from
    • irc_groups
      • The group to add this relay to, seperate by [space]
      • Max 10 groups
    • irc_debug
      • Only enable if the bot isnt joining. Prints all IRC data to server console
    • irc_master
      • Is this the main relay
      • The relay with this cvar set to 1 will answer to general commands like !relayhelp (ONLY SET ONE RELAY AS MASTER)
    • irc_color
      • Use team colors for player names in IRC
    • irc_notice
      • Sets relay responses to use NOTICE, only use if you dont like the current reply method
      • May trigger notice protection on NNS clients
    • irc_server
      • allow the relay to join any IRC server
    • irc_port
      • The irc server port to connect to
    • irc_password
      • The server's connection password (optional)
    • irc_auth
      • The Auth string to 'login' to the server
      • GameSurge (ChanServ)
        • AUTHSERV AUTH %s %s
      • QuakeNet (Q)
    CHANGELOG:
    • 1.0.0
      • Initial Release
    • 1.0.1
      • Fixed un-assigned not showing name
      • Added irc_server, irc_port, irc_password for joining other servers
      • Fixed relays not always joining /me slaps ChanServ
      • Added irc_auth to manually set the authentication string
    • 1.0.2
      • Fixed multiple bots spamming you with the welcome msg on JOIN
      • All commands run on a 'per-user' permission config.
      • Fixed broken version number in last release ><
      • Fixed relays not joining on late load
      • Fixed !relayversion not working in 1.0.1
      • New file for command permissions (/sourcemod/configs/ircrelay/permissions.txt
      • Updated IrcRegisterCommand native to use the new permission types
      • Stopped some excess flood messages with multiple channels
      • Fixed player names not being found
    • 1.0.2b
      • Fixed to work with sockets 1.2.0.0
    CREDITS:
    Thank you to the following:
    Viper: Allowing me to test on GameConnect servers
    BAILOPAN: For sourcemod and help
    cybermind: for register help
    FlyingMongoose: For pointing out stupid mistakes i made ><, ideas, and 8ball responses
    DaveB, and devicenull: Ideas

    and anyone else I forgot

    Thanks to GameConnect for allowing me to test this on their servers. As well as the download mirror.

    Download: http://www.steamfriends.com/download...p13_fileid/178
    __________________
    Tumblr Me: http://raspberryteen.tumblr.com


    // Yarrrr!

    Last edited by Olly; 02-13-2008 at 19:19. Reason: You forgot to update the bbcode url. You only updated the display
    Olly is offline
    Send a message via MSN to Olly
    Olly
    Senior Member
    Join Date: Mar 2007
    Location: UK
    Old 05-30-2007 , 15:32   Re: [PLUGIN] IRC Relay
    Reply With Quote #2

    Installation
    1. Download the plugin package from HERE
    2. Upload the contents of the package to your gameservers mods folder. (cstrike for CS:S, dod for DOD:S...etc)
    3. Open the /cfg/sourcemod/ircrelay.cfg file, and edit the plugin settings to fit your needs.
    4. Open /cfg/server.cfg add this: exec sourcemod/ircrelay.cfg
    5. Open /addons/sourcemod/configs/ircrelay/permissions.txt - And edit to fit your needs
    6. To load the plugin; Either
      1. type: 'sm plugins load ircrelay.smx' (without quotes in rcon)
      2. Wait for a map change
      3. Restart your server
    The relay should join the specified channel(s) within about 5-20 seconds.
    __________________
    Tumblr Me: http://raspberryteen.tumblr.com


    // Yarrrr!

    Last edited by ^BuGs^; 07-27-2007 at 17:03. Reason: // Yarrrr!
    Olly is offline
    Send a message via MSN to Olly
    Olly
    Senior Member
    Join Date: Mar 2007
    Location: UK
    Old 05-30-2007 , 15:32   Re: [PLUGIN] IRC Relay
    Reply With Quote #3

    Useage

    Triggers
    The relay works on a system of triggers, so that the plugin can support multiple relays in the same channel. For example; if you set irc_name_trigger "relay1" to run a command on that relay, for example you would run !msg relay1 Hello all. This will send a public command to the server that is running the relay with the trigger name of 'relay1'.

    You can also specify groups to use as the trigger, so you can run a command on multiple servers at the same time. For example if you set irc_groups "main warserver" then you can run the same command as above with the group (prefixed with #) as the trigger. Example: !msg #main Hello All. That will send a public message to all of the relays that are in the 'main' group. Also every relay answers to the #all group by default. This is so that you could run !msg #all Welcome to [your clan] Servers! which would message everyone in all of your servers.

    Every command will accept the name trigger assigned to that specific relay, or a group trigger.

    Command Syntax
    The command syntax for all of the commands is:
    ![command] [trigger] [arguments]
    So each part of the command is separated by a [space]

    Help
    You can run !relayhelp which will make the master relay print some basic help about the useage of the plugin. Also you can run !commands which will print off the list of all of the commands which will work on that relay. Any registered commands from external plugins will also be listed here.

    In addition to the above commands, you can type the command without any arguments or triggers, to get basic description of the command, and also the command syntax. For example, type !msg and the relay will show the details about the 'msg' command.

    Player Names
    Some commands require a player name. Player names can either be fully typed out (dont use [space]'s) or you can use a partial name. For example. If I was playing in your server as -[GC]- Olly, To view detailed information about me, you would run the command; !playerinfo [trigger] olly. If there is more than one player that matches the partial name, the command will not run. This is to stop accidentally banning multiple people from typing a partial name that appears in other people's names.

    If you are having trouble setting up the relay or using it. Come find me at #gameconnect, or #sourcemod on GameSurge

    __________________
    Tumblr Me: http://raspberryteen.tumblr.com


    // Yarrrr!
    Olly is offline
    Send a message via MSN to Olly
    Olly
    Senior Member
    Join Date: Mar 2007
    Location: UK
    Old 05-30-2007 , 15:33   Re: [PLUGIN] IRC Relay
    Reply With Quote #4

    IRC Relay API
    I have included some api natives and commands so that the IRC relay can be used to make your plugin; message people in your IRC channel, Register IRC commands to use on your plugin.

    Broadcast
    You can send a simple messages to the irc channel(s) using this ConVar.
    irc_broadcast [master] [message]
    For example irc_broadcast 1 test will send the message of 'test' to the master channel. irc_broadcast 0 test will send 'test' to all channels but master.

    IrcMessage
    This native is a better way of sending messages to channels from your plugin. Once you include the inc file (ircrelay.inc) you can call IrcMessage. This is the native.

    Code:
    /*********************************************************
     * Sends a message to a channel
     *
     * @param    destination            Which channels to send the message to.
                            CHAN_MASTER - Send message to master channel
                            CHAN_NOT_MASTER - Send to all channels but master
                            CHAN_ALL - Send message to all channels.
     * @param    String:message[]        The message to send
     * @param    ...                Format Arguments
     * @noreturn        
     *********************************************************/
    native IrcMessage(destination, String:message[], any:...);
    RegisterIrcCommand
    This native is used to register your own commands to the relay. So if someone runs the command !foobar from IRC and your channel has registered it, then your plugin will get a callback to say that this command has been run.

    Code:
    /*********************************************************
     *  This native will allow external plugins to register their own command
     *
     * @param    String:command[]        The command to add eg: "!mycommand"
     * @param   String:mode[]            The minimum user mode to run this cmd (@, %, +)
     * @param    Function:callback        The callback for once that command has been run on the irc server
     * @noreturn        
     *********************************************************/
    native RegisterIrcCommand(String:command[], String:permissions[], IrcCallbackFunc:callback);
    IrcGetCmdArgc
    This native can be called from the callback function in your plugin to return how many arguments were sent along with the command that triggered the callback.

    Code:
    /*********************************************************
     *  This native return the amount of arguments are in the command
     *
     * @return the amount of arguments        
     *********************************************************/
    native IrcGetCmdArgc();
    IrcGetCmdArgv
    This native is used to return the value of a specific argument that was used in the command.

    Code:
    /*********************************************************
     *  This native will get the value of one of the commands
     *
     * @param    argnum            The argument number to get
     * @param    maxlen            The max length for the buffer
     * @param    String:argv[]        The place to store the arg string
     * @noreturn        
     *********************************************************/
    native IrcGetCmdArgv(argnum, maxlen, String:argv[]);
    Plugin Example
    Here is an example plugin to show how to use the API natives in your own plugin

    Code:
    #pragma semicolon 1
    #include <sourcemod>
    #include <ircrelay>
    #include <string>
    
    public Plugin:myinfo = 
    {
        name = "Some Plugin",
        author = "Olly",
        description = "Example of registering your own command",
        version = "1.0.0",
        url = "http://www.gameconnect.info"
    };
    
    // When all plugins are loaded
    public OnServerCfg()
    {
        // Register the command "!mycmd" that is accessable from all channels
        // Use MyCallback as the callback
        RegisterIrcCommand("!mycmd", CHAN_ALL, MyCallback);
        
        // Send a message to the master channel to show the command has been registered
        IrcMessage(CHAN_MASTER, "Registered IrcCommand!");
    }
    
    // This will get called when someone types the command in IRC
    public MyCallback()
    {
        new ArgCount = IrcGetCmdArgc();
        new String:arg0[512];
        new String:arg1[512];    
    
        // Get the values of argument 0 and 1
        IrcGetCmdArgv(0, 511, arg0);
        IrcGetCmdArgv(1, 511, arg1);
        
        // Send another message to show that the command got called from irc
        IrcMessage(CHAN_ALL, "MyCommand - Argument Count: %d - Argument 0: %s - Argument 1: %s", ArgCount, arg0, arg1 );
    }
    Enjoy!

    // Yarr!
    __________________
    Tumblr Me: http://raspberryteen.tumblr.com


    // Yarrrr!

    Last edited by Olly; 06-01-2007 at 15:50. Reason: //
    Olly is offline
    Send a message via MSN to Olly
    Ravager01
    Member
    Join Date: Jul 2006
    Old 05-30-2007 , 15:35   Re: [PLUGIN] IRC Relay
    Reply With Quote #5

    Very nice. ^_^
    Ravager01 is offline
    FlyingMongoose
    Veteran Member
    Join Date: Mar 2004
    Old 05-30-2007 , 15:37   Re: [PLUGIN] IRC Relay
    Reply With Quote #6

    Amazing...and terrifying
    __________________
    Please do NOT PM for support.

    Only ask for support in plugin threads.

    TunedChaos.com - Precision Tuned Game Servers
    FlyingMongoose is offline
    L. Duke
    Veteran Member
    Join Date: Apr 2005
    Location: Walla Walla
    Old 05-30-2007 , 15:43   Re: [PLUGIN] IRC Relay
    Reply With Quote #7



    I'm terrified!
    L. Duke is offline
    trawiator
    Senior Member
    Join Date: Nov 2004
    Old 05-30-2007 , 16:25   Re: [PLUGIN] IRC Relay
    Reply With Quote #8

    Hello Olly. Can you add DoD:S and QuakeNet support?
    trawiator is offline
    Olly
    Senior Member
    Join Date: Mar 2007
    Location: UK
    Old 05-30-2007 , 16:31   Re: [PLUGIN] IRC Relay
    Reply With Quote #9

    Quote:
    Originally Posted by trawiator View Post
    Hello Olly. Can you add DoD:S and QuakeNet support?
    DOD works, as well as any other (most) Source based mods. But at the moment, i havnt added the team names for other mods yet though. But 99% of the functionality will work.

    QuakeNet works, and will be enabled in the next version
    __________________
    Tumblr Me: http://raspberryteen.tumblr.com


    // Yarrrr!
    Olly is offline
    Send a message via MSN to Olly
    Ravager01
    Member
    Join Date: Jul 2006
    Old 05-30-2007 , 17:18   Re: [PLUGIN] IRC Relay
    Reply With Quote #10

    Two bugs so far, mainly minor, unless you think otherwise.
    • When a player says "0" in say_team, the irc relay plugin outputs a blank message along with the player's name.
    • When an 'unassigned' player speaks in chat, only the message is displayed, and not the player's name.
    Ravager01 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 11:02.


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