L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 06, 2008, 09:11:05 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)  (Read 1498 times)
0 Members and 1 Guest are viewing this topic.
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« on: May 25, 2007, 01:11:34 PM »

This module is now included in SVN.  Please download from there to ensure that you have the latest version and it is compatible with your Bebot version (this is not 0.2.X or 0.3.3 compatible).

The idea for this plugin came from http://bebot.shadow-realm.org/index.php?topic=780.msg5998;topicseen#new

Previously we had two plugins GuildRelay_GUILD.php and Relay_GUILD.php.  Now, many orgs have a setup something like:

privgrp <-> org chat <-> org chat <-> privgrp

Previously Relay_GUILD handed the private group to org chat, and GuildRelay_GUILD handled both the private group and org chat to the other org's bot.

This module replaces both the GuildRelay_GUILD.php and Relay_GUILD.php modules with a unified module that is configurable through !settings.


Known bugs:

None at this time.


Todo items:

None at this time.


Changelog:

  • Configure an option for backwards compatibility (send !gcr in tells instead of only allowing for the relay bot).
  • Confirm that the exterior private group is the one we've set in the Relay option, currently all exterior private groups can use !gcr as long as the person using it has access to the command.
  • Customizable names included for private group and guild chat for relaying (IE: shorten Conquistador Coffee Inc. to CCI).  Now allows for any name to be used.  Defaults to the organizations name.
  • Configurable colors!


To setup and use:

Step 1
Create a new bot to use as the relay.  Add the bots that will be using the relay as members.  Configure the relaybot to autoinvite the bots that will be using it.  (It is highly recommended to disable nearly all plugins on the relaybot.  As you are only using it for relaying purposes, there should be no reason why anyone needs access to it other than the bots and yourself.)

Step 2
Install the Relay.php plugin onto the bots that will be using the relay.  Make sure to disable GuildRelay_GUILD.php and Relay_GUILD.php as this will conflict with them.

Step 3
Give the bots that will be relaying the correct access level and permissions to use !gcr. (So if Bot1 is relaying to Bot2 via Relay1, Bot1 needs access to !gcr on Bot2 via pgmsg, and vice versa.)

Step 4
Restart the bots if you haven't already, and configure your settings to your specifications.

Step 5
Enjoy lightning quick relay messages, and less bot lag (due to no longer queueing the relay messages via /tell).
« Last Edit: May 30, 2007, 01:34:39 PM by Ebag333 » Logged
kuznechik
BeBot Contributor
Rookie
*******
Offline Offline

Gender: Male
Posts: 60



Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #1 on: May 27, 2007, 05:24:50 AM »

smells nice. Gonna test it
Logged

Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #2 on: May 27, 2007, 08:08:02 PM »

Quote from: Ebag333 on May 25, 2007, 01:11:34 PM

Todo items:

Configure an option for backwards compatibility (send !gcr in tells instead of only allowing for the relay bot).

If you add this, please clearly state that it is a discouraged way of doing relays, and should only be used between two bots, not more.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #3 on: May 28, 2007, 05:20:26 AM »

Does this relay prevent persons banned or blacklisted from the one org to take part in chat via relay? Would such a filter be fesable to impliment?

How does the relay bot work? Is it possible for anyone to join a relay channel? Are one notified as new bots attach to the relay?

I haven't looked at the module yet, but the ide is very nice and if done right security wise it would be a major improvement over the old way.

Good job!
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #4 on: May 28, 2007, 11:05:09 AM »

We actually need a central ignore feature that covers all relays, including IRC.

This should probably be simply string based, although it is feasible to take into account the blacklist/banlist as well for the ingame relays.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #5 on: May 29, 2007, 04:16:46 AM »

Well, back from the long weekend.  Glad to see some people are at least interested in this a bit.  Smiley

Quote from: Khalem on May 27, 2007, 08:08:02 PM
If you add this, please clearly state that it is a discouraged way of doing relays, and should only be used between two bots, not more.

Since I just use a !setting, it's really only designed for 1 bot.

The way I figure it, if you're using a relay bot you can have as many bots as you want, but you still only need 1 relay bot.  If you just have a simple 2 org setup, then you still only need 1 bot to relay to, just it's not a central bot.

If you need multiple relay bots, then you're looking to do something out of the norm anyway.

Quote from: Blueeagle on May 28, 2007, 05:20:26 AM
Does this relay prevent persons banned or blacklisted from the one org to take part in chat via relay? Would such a filter be fesable to impliment?

Quote from: Khalem on May 28, 2007, 11:05:09 AM
We actually need a central ignore feature that covers all relays, including IRC.

Agreed, this should be a central rather than relay specific feature.

Though you may want to ban someone from using the bots commands, but not from having their text relayed.  Hmm, and the tricky part will be that even if you ban someone from your bot, if the person is getting relayed you'll still see their chat no matter what.

Maybe I'll throw in an option "Relay banned users text" or something.

Quote from: Blueeagle on May 28, 2007, 05:20:26 AM
How does the relay bot work? Is it possible for anyone to join a relay channel? Are one notified as new bots attach to the relay?

All I did for the relay channel was take a normal Bebot, rip out all the plugins I could, lock down all the remaining commands to Owner only, then setup the bots I wanted to join as members with autoinvite for them on.

This way no one can join the bot, even if they're a member of it (that shouldn't ever happen, but...).

Since the relay module autoaccepts invites, the bots will join the relay chan when they get the invite (on log), and the relay connection is made.

So all in all *VERY* simple, really.

As I mentioned before I do need to fix it to confirm that the invite is from the bot set as the relay....

Anyway, there's currently no notification on joining the relay.  I've always found those to be quite annoying myself.  Cheesy

One of my future goals is to bring in everything relay related into one unified plugin.  Still need to bring member join/parts into that, which would be easier if the formatting done was a core plugin rather than the customized one in the logon plugin.

* Ebag333 edits

Updated to make it more coherent.  Writing at 2:30 in the morning after driving for 13 hours over the weekend FTL.
« Last Edit: May 29, 2007, 12:38:05 PM by Ebag333 » Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #6 on: May 29, 2007, 02:07:37 PM »

Updated the original post, and new Relay.php is zipped and attached.



Changes:

  • Added an option for backwards compatibility (send !gcr in tells instead of only allowing for the relay bot).  This uses the same bot referenced in the Relay setting, so we only allow for one bot.  A warning is put in about using tells, and this defaults to a private group. (Note: this makes no use of $guild_relay_target in Bot.conf.  In fact, $guild_relay_target is not used at all as I find it much easier to handle it ingame than in the .conf file. Smiley )

  • We now confirm that the exterior private group is the one we've set in the Relay option for the purposes of commands used as well as invites to the group.  Now we can only use !gcr from the private group that we've configured in the settings.  !gcr is usable from any source in /tell, this is left this way to allow for multiple bots to be sending into a single source (sort of a one-way messaging or notification system).



At this point the plugin is just about as locked down as I can make it.  Not only does the bot that's trying to send a relay message (whether via /tell or pgroup) have to have access to it, but we validate that the exterior private group is the one we want (for accepting the invite and handling !gcr commands).

I can't think of any ways to abuse this, at least (assuming you configured your setup properly!).  Smiley

Unless anyone else has any suggestions or ideas, I'll consider this finished.  Smiley
« Last Edit: May 29, 2007, 02:16:55 PM by Ebag333 » Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #7 on: May 29, 2007, 02:52:17 PM »

Quote from: Ebag333 on May 29, 2007, 02:07:37 PM
Unless anyone else has any suggestions or ideas, I'll consider this finished.  Smiley
Looks like nice work, I do have two suggestions though:
  • add color schemes for the channel name, user and chat string, so people that want to change them can do so during runtime.
  • add settings for guest channel name (priv group) and org name on sending side, so if people want to use shortcuts they can do that

Both are mostly for convenienve Smiley
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #8 on: May 29, 2007, 03:32:39 PM »

Quote from: Alreadythere on May 29, 2007, 02:52:17 PM
Looks like nice work, I do have two suggestions though:
  • add color schemes for the channel name, user and chat string, so people that want to change them can do so during runtime.

Well, I'm currently using the default colors for it, which uses ##highlight## and ##normal## for it (which I assume are configurable somewhere?).

Quote from: Alreadythere on May 29, 2007, 02:52:17 PM
  • add settings for guest channel name (priv group) and org name on sending side, so if people want to use shortcuts they can do that

Excellent suggestion!

* Ebag333 runs off to implement this
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #9 on: May 29, 2007, 03:37:50 PM »

Quote from: Ebag333 on May 29, 2007, 03:32:39 PM
Quote from: Alreadythere on May 29, 2007, 02:52:17 PM
Looks like nice work, I do have two suggestions though:
  • add color schemes for the channel name, user and chat string, so people that want to change them can do so during runtime.
Well, I'm currently using the default colors for it, which uses ##highlight## and ##normal## for it (which I assume are configurable somewhere?).
Yes, they can be configured as they are part of the theme in use. But any changes there are global changes for all modules using the theme colors.

If you use schemes that default to the theme colors you are using it will work the same as now if people like the colors or are happy with the global theme colors. But if people want to use specific colors for their relay they can change them easy, without influencing other modules.
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #10 on: May 29, 2007, 05:35:27 PM »

Updated again with Alreadythere's suggestions (both the channel names and color config).

So can we get this in SVN now?  Cheesy
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #11 on: May 30, 2007, 08:14:07 AM »

Nice work.

I fear if we put it into SVN we'll have to move to tells as default (as that's the expected and easiest setup, needing only the two bots that are in the relay).
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #12 on: May 30, 2007, 09:49:29 AM »

Quote from: Alreadythere on May 30, 2007, 08:14:07 AM
Nice work.

I fear if we put it into SVN we'll have to move to tells as default (as that's the expected and easiest setup, needing only the two bots that are in the relay).

Well, from everything I've heard tells aren't the recommended way of doing relays anyway.  Smiley

And it is only one setting.  And they need to change the settings for it to work properly anyway (add the bot they want to relay to).  And I *HAVE* included instructions in !help gcr on how to use the private group relay.

But I do understand your point, and of course it's quite simple to change the default from Pgroup to Tells.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #13 on: May 30, 2007, 10:20:58 AM »

Commited to SVN.

Did some slight changes to a few settings (type), and added some additional safety conditions where I felt they are needed, as well as using normal as default for all schemes.
I added a relay_to_bot($string) function too, which relays $string without any further changes to the relay bot except adding "<pre>gcr ". This can be used in other modules to relay text too.

Adapted the other modules using the relay too.
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #14 on: May 30, 2007, 12:12:03 PM »

Couple of things.


Around line 31:
Code:
<?php
$this 
-> bot -> accesscontrol -> create('pgmsg', 'gcr', 'SUPERADMIN');
?>


Why remove this?  Seems to me this creates a security hole.

Around line 79:
Code:
<?php
function 
tell($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "gcr (.+)$/im", $msg, $info) &&
strtolower($this -> bot -> botname) != strtolower($name) &&
$this -> bot -> settings['Relay']['Status'] &&
strtolower($this -> bot -> settings["Relay"]["Relay"]) == strtolower($name))
?>


Couple of things.  First off, if someone's trying to use !gcr in tells, they have to have access for it to work, so locking the $name to the relay bot seems redundant.  Especially since it's a single channel that's explicitly to the bot, as opposed to the bot being able to join many pgroups and picking up the wrong !gcr's.

Secondly, many people (including myself) use !gcr as a relay for other purposes (such as recieving tells from global bots and being able to post it to org chat).  So locking !gcr to the relay bot only eliminates that "feature".

Personally I think that particular check should be removed (and will for my bots Cheesy ).


Those are the only two problems I see with this.  Other than that, all the changes made look fine.  Smiley
Logged
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« previous next »
 
Jump to:  

Recent
!items database
by cthulhu
[October 05, 2008, 11:36:16 AM]

Supplies needed module
by viper
[October 05, 2008, 11:11:13 AM]

Assist
by Foxy
[October 05, 2008, 05:09:02 AM]

How's 0.5.x coming? Wonde...
by Hyde
[October 04, 2008, 04:59:20 PM]

TWC
by Elesar1
[October 04, 2008, 12:55:59 PM]

Org in AoC
by Alreadythere
[October 04, 2008, 04:50:00 AM]

OnlineOrg
by Slacklin
[October 04, 2008, 03:06:00 AM]

Learning .NET, Mono, C#, ...
by Vhab
[October 04, 2008, 02:39:03 AM]

guild taxes module for ag...
by Elesar1
[October 03, 2008, 09:06:09 AM]

MediaControl
by Elesar1
[October 03, 2008, 08:38:18 AM]
Stats
Members
Total Members: 983
Latest: Titerris
Stats
Total Posts: 10740
Total Topics: 1448
Online Today: 15
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 43
Total: 45
Sudoka
cthulhu

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.32 seconds with 29 queries. (Pretty URLs adds 0.054s, 4q)
Loading...