collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)  (Read 37384 times)

0 Members and 1 Guest are viewing this topic.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
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.link/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, 08:34:39 pm by Ebag333 »

Offline kuznechik

  • Contributor
  • *******
  • Posts: 60
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #1 on: May 27, 2007, 12:24:50 pm »
smells nice. Gonna test it
Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #2 on: May 28, 2007, 03:08:02 am »

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.
BeBot Founder and Fixer Kingpin

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #3 on: May 28, 2007, 12:20:26 pm »
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!
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #4 on: May 28, 2007, 06:05:09 pm »
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.
BeBot Founder and Fixer Kingpin

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #5 on: May 29, 2007, 11:16:46 am »
Well, back from the long weekend.  Glad to see some people are at least interested in this a bit.  :)

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.

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?

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.

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.  :D

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, 07:38:05 pm by Ebag333 »

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #6 on: May 29, 2007, 09: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. :) )

  • 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!).  :)

Unless anyone else has any suggestions or ideas, I'll consider this finished.  :)
« Last Edit: May 29, 2007, 09:16:55 pm by Ebag333 »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #7 on: May 29, 2007, 09:52:17 pm »
Unless anyone else has any suggestions or ideas, I'll consider this finished.  :)
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 :)

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #8 on: May 29, 2007, 10:32:39 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?).

  • 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #9 on: May 29, 2007, 10:37:50 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.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #10 on: May 30, 2007, 12:35:27 am »
Updated again with Alreadythere's suggestions (both the channel names and color config).

So can we get this in SVN now?  :D

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #11 on: May 30, 2007, 03:14:07 pm »
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).

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #12 on: May 30, 2007, 04:49:29 pm »
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.  :)

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.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #13 on: May 30, 2007, 05:20:58 pm »
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.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Relay.php (Replaces GuildRelay_GUILD.php and Relay_GUILD.php)
« Reply #14 on: May 30, 2007, 07:12:03 pm »
Couple of things.


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


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

Around line 79:
Code: [Select]
<?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 :D ).


Those are the only two problems I see with this.  Other than that, all the changes made look fine.  :)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 225
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal