Editing Relay

From Bebot Wiki 2
Jump to navigationJump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 18: Line 18:
 
'''2.1 Using tells'''
 
'''2.1 Using tells'''
  
PROS: very quick & easy setup, no relay-bot nor other complicated stuff needed
+
PROS: easy setup, no relay-bot needed
 
+
CONS: Only works with 2 bots, possibly illegal, tells might be dropped by the server if coming in to fast1)
CONS: Only works with 2 bots, possibly risky, tells might be dropped by the server if coming in too fast ...
 
  
 
Using tells as relay is discouraged nowadays (and you even run the risk of having your bots banned by funcom without warning), but we will describe it shortly nonetheless. Use at your own risk!
 
Using tells as relay is discouraged nowadays (and you even run the risk of having your bots banned by funcom without warning), but we will describe it shortly nonetheless. Use at your own risk!
  
Assuming you have two bots “bot1” and “bot2”, you start by allowing each bot to relay to each other. You could do a “!member add bot2” on bot1 and vice versa, but the member-list of org-bots might get wiped during roster-updates. So rather refer to section 2.4.2 as to how to create a new security group named “relaybots” with SUPERADMIN level on both bots and then make them member on the other bot's group.
+
Assuming you have two bots “bot1” and “bot2”, you start by allowing each bot to relay to each other. You could do a “!member add bot2” on bot1 and vice versa, but the member-list of org-bots might get wiped during roster-updates. Refer to section 2.3.2 as to how to create a new security group named “relaybots” with SUPERADMIN level on both bots and then make them member on the other bot's group.
  
 
If you've done this, you let bot1 relay to bot2:
 
If you've done this, you let bot1 relay to bot2:
Line 52: Line 51:
 
'''2.2 Using IRC'''
 
'''2.2 Using IRC'''
  
PROS: scales well, no relay-bot needed, medium setup, allows linking between different game-servers & even cross-games
+
PROS: scales well, no relay-bot needed, easy setup, allows linking between different game-servers and even games
 
+
CONS: increases latency, order of messages not guaranteed, item-references will be broken, possibly insecure, doesn't look as nice as the other links
CONS: increases latency, order of messages not guaranteed, item-refs could be broken, possibly insecure
 
  
 
Before you start, please acknowledge that relaying via IRC is considered deprecated, yet it will still work.
 
Before you start, please acknowledge that relaying via IRC is considered deprecated, yet it will still work.
Line 72: Line 70:
  
  
'''2.3 Using WebSocket'''
+
'''2.3 Using a private channel'''
 
 
PROS: scales up to thousand bots, nice speed, possible sharing of online-lists if all bots are using the same protocol
 
 
 
CONS: Needs access to a highway websocket that all bots must be able to join & communicate with, complex setup
 
 
 
This is a compatible option available only into most recent bots (Bebot, Tyrbot, Nadybot). Most common choice is to use the websocket publicly provided for Nadybot.
 
From there, your Nadybot(s) relay should be using websocket+highway+tyrbot layers (aes-gcm-encryption being optionnal) which will maximize the compatiliby with Tyrbot(s). You should check their respective documentation (as detailed lower) if you ever met issues with those 2 bots.
 
Also beware that, if you use such public websocket, the AES-GCM encryption goes from optionnal to mandatory for privacy protection !
 
 
 
So from version 0.7.21 under PHP 7.0 or more, Bebot(s) will also be able to jump into the room and all bots should speak together, no matter which.
 
 
 
For Bebot hosts, the WebSocket Relay is configured like this:
 
 
 
    /tell org1bot !set websocket Room example2-test0-room9-1234abc-xyz789
 
    /tell org1bot !set websocket Password C0mpl3x-P4ssW0rD!
 
   
 
Assuming that our Org1 is called “The proud and well-known fr00bs of Rubi Ka”, relayed messages from your guildchat would be displayed on Org2 as [Org2] Org2Bot: [The proud and well-known fr00bs of Rubi Ka] [Channel] Pigtail: Test. You might want to shorten that “The proud and well-known fr00bs of Rubi Ka” a bit:
 
 
 
    /tell org1bot !set websocket Label OrgShorten
 
  
If you don't want to relay everything & prefer to control sending via a 1st character syntax (e.g. @) :
+
PROS: scales up to 1000 bots, best speed, possible sharing of online-lists if all bots are using the same DB
    /tell org1bot !set websocket nearSyntax @
+
CONS: Needs a dedicated relay-bot
Therefore you'll send to websocket only while using this 1st letter (in org or private channel) :
 
    @ Hello to other orgs
 
  
Once all is set you can initate the persistent connection by :
+
The fastest and most flexible solution is relaying via a private group. All bots you want to connect have to join the same private group and exchange messages via means of !gcr. For this to work, we need a new type of bot, a relay-bot, which has the job of creating the private group and inviting all other bots into this group whenever necessary. The org/raid-bots on the other hand are configured much like a tell-relay.
    /tell org1bot !ws connect
 
(then disconnect if you ever need to remove that persistent connection)
 
 
 
Final element to configure, you need to add all other Orgs signing Tags to your bot so it can display those others online lists. Small issue with WebSocket is you couldn't easily discover those Tags before receiving other Orgs messages, eg :
 
    [Org2Tag] [Priv] Player: hello all!
 
To include that org into you local bot's online, you'd have to add its Tag exactly as you've seen it as follow (keeping upper example) :
 
    /tell org1bot !set online OtherBots Org2Tag
 
And as soon you discover more Org Tags you'd add them separated by commas ',' like this :
 
    /tell org1bot !set online OtherBots Org2Tag,Org3Tag,Org4Tag
 
But to help you discover them faster, once your bot is connected into WebSocket & receiving messages, you could rather do :
 
    /tell org1bot !ws others
 
This command should provide you with the wanted Tags list formatted to be copy-pasted to upper online set. Just beware that if some new Org joined in, or if any Org changed its Tag, you'd have to update & reset that online OtherBots value by redoing this process.
 
 
 
Few other Websocket options are also into :
 
    /tell org1bot !settings websocket
 
 
 
 
 
'''2.4 Using a private channel'''
 
 
 
PROS: scales up to hundred bots, good speed, possible sharing of online-lists if all bots are using the same DB or !gcr/c
 
 
 
CONS: Needs a dedicated relay-bot that all bots will easily join, but means few more configuration
 
 
 
The fastest and most flexible solution is relaying via a private group. All bots you want to connect have to join the same private group and exchange messages. For this to work, we need a new type of bot, a relay-bot, which has the job of creating the private group and inviting all other bots into this group whenever necessary. The org/raid-bots on the other hand are configured much like a tell-relay.
 
  
 
CAVEAT: Before setting up everything, create all the bots you will need and make sure that some time passes so every bot has WHOIS-information on every bot involved. This will wipe out any possible problem related to people and bots not seeing each other.
 
CAVEAT: Before setting up everything, create all the bots you will need and make sure that some time passes so every bot has WHOIS-information on every bot involved. This will wipe out any possible problem related to people and bots not seeing each other.
  
  
'''2.4.1 Setting up the relay-bot'''
+
'''2.3.1 Setting up the relay-bot'''
  
 
Your most important bot is the relay-bot. Its only task is to be online, create the private channel which is used for the communication between your bots and invite all bots you want to link together to this chat. Nothing more. If your relay-bot is offline, your link will be gone, though your raid/guild-bots will continue to work. Once the relay-bot comes on again and all guild/org-bots are invited, the link will work again.
 
Your most important bot is the relay-bot. Its only task is to be online, create the private channel which is used for the communication between your bots and invite all bots you want to link together to this chat. Nothing more. If your relay-bot is offline, your link will be gone, though your raid/guild-bots will continue to work. Once the relay-bot comes on again and all guild/org-bots are invited, the link will work again.
Line 182: Line 135:
  
  
'''2.4.2 Setting up the org/raid-bots'''
+
'''2.3.2 Setting up the org/raid-bots'''
  
 
On your org-bots and raid-bots, you will need to make them use the relaybot's private group as their private group for relaying.  
 
On your org-bots and raid-bots, you will need to make them use the relaybot's private group as their private group for relaying.  
Line 207: Line 160:
 
Therefore you'll send to relay-bot only while using this 1st letter (in org or private channel) :
 
Therefore you'll send to relay-bot only while using this 1st letter (in org or private channel) :
 
     @ Hello to other orgs
 
     @ Hello to other orgs
Note : this syntax will be bypassed by bot's org <-> local private relay.
+
Note : this syntax will be ignored by bot's org <-> local private relay.
 
 
You also have to think about how your own bot will speak with other bots in the relay channel.
 
The bot will first only see other's commands sent with same command_prefix it uses itself (check its Conf/ file) being ! by default.
 
If you have some bots in the relay channel that use various prefixes and you cannot unify them, you can set your bot flexibly :
 
    /tell org1bot !set Relay OtherPrefixs #;.
 
(in this example, it means some external bots into relay channel are using #gcr/c and .gcr/c and your bot could see them now)
 
 
 
If all bots use the same syntax, you could also can change your own bot command_prefix in its Conf/ file (check Configuration page of this wiki) but it will affect all other commands readability from your bot point of view.
 
So an alternative way if you only want to change command far syntax for sending to relay only :
 
    /tell org1bot !set Relay farSyntax .
 
And if other bots also use this far syntax :
 
    /tell org1bot !set Relay OtherPrefixs .
 
  
 
Now that it's done, every org/raid-bot host configured like this should be in the private chat of the relaybot. If they aren't there already, either wait a bit, or join the relay-bot's private group and !invite them one by one. The only thing missing is to configure those bots to allow all linked bots to send them relay-messages via !gcr (or !agcr). Per default for security, only member with the access level MEMBER is allowed to do this.
 
Now that it's done, every org/raid-bot host configured like this should be in the private chat of the relaybot. If they aren't there already, either wait a bit, or join the relay-bot's private group and !invite them one by one. The only thing missing is to configure those bots to allow all linked bots to send them relay-messages via !gcr (or !agcr). Per default for security, only member with the access level MEMBER is allowed to do this.
Line 245: Line 186:
  
  
'''2.4.3 Scalability'''
+
'''2.3.3 Scalability'''
  
 
If you understood what we've just configured, you might have noticed that you can use a single relay-bot to manage different guild-links. If, for example, you now decide that you want to seperate your org-link and your raid-link you can achive this by making all org-bots member of the relaybots security-group on all org-bots (but not on any raid-bot) and all raid-bots members of the security-group relaybots on all raid-bots (but not on any org-bot). This way, you can use a single relay for several totally different relay-groups. The only proble being that the bot-admin can only decide from which bot he/she wants to receive messages, but not to which bots messages should be relayed. So you have to trust each other if you really plan such a weird setup.
 
If you understood what we've just configured, you might have noticed that you can use a single relay-bot to manage different guild-links. If, for example, you now decide that you want to seperate your org-link and your raid-link you can achive this by making all org-bots member of the relaybots security-group on all org-bots (but not on any raid-bot) and all raid-bots members of the security-group relaybots on all raid-bots (but not on any org-bot). This way, you can use a single relay for several totally different relay-groups. The only proble being that the bot-admin can only decide from which bot he/she wants to receive messages, but not to which bots messages should be relayed. So you have to trust each other if you really plan such a weird setup.
Line 252: Line 193:
  
  
'''2.4.4 Sharing the online-list across several bots'''
+
'''2.3.4 Sharing the online-list across several bots'''
  
 
If you are building a bot-network, you will most likely be interested in knowing who is online. And this includes all linked orgs, not just your own. Luckily, this is possible. There are two cases to consider:
 
If you are building a bot-network, you will most likely be interested in knowing who is online. And this includes all linked orgs, not just your own. Luckily, this is possible. There are two cases to consider:
  
  
'''2.4.4.1 All bots use the same DB'''
+
'''2.3.4.1 All bots use the same DB'''
  
 
If you want to share the online-list of all your bots, you need all org/raid-bots to use the same database. Then you only need to tell each bot about all the other bots:
 
If you want to share the online-list of all your bots, you need all org/raid-bots to use the same database. Then you only need to tell each bot about all the other bots:
Line 270: Line 211:
  
  
'''2.4.4.2 At least one bot not using the same DB'''
+
'''2.3.4.2 At least one bot not using the same DB'''
  
Starting from 0.6.3, the online-list of linked bots are automatically syncronized within !gcr protocol (not within !agcr), but all bots have to run at least 0.6.3 or higher for this to work. When you meet these requirements, proceed to set OtherBots as described in 2.4.4.1.
+
Starting from 0.6.3, the online-list of linked bots are automatically syncronized within !grc protocol (not within !agcr), but all bots have to run at least 0.6.3 or higher for this to work. When you meet these requirements, proceed to set OtherBots as described in 2.3.4.1.
  
 
For other bots than Bebot, like Tyr or Buda/Nad, they have their own particular settings, so you have to read their documentation :
 
For other bots than Bebot, like Tyr or Buda/Nad, they have their own particular settings, so you have to read their documentation :
Line 282: Line 223:
 
Tyr: may support agcr natively, requires extra module for !gcr https://github.com/Budabot/Tyrbot/tree/master/modules/extra/relay_gcr
 
Tyr: may support agcr natively, requires extra module for !gcr https://github.com/Budabot/Tyrbot/tree/master/modules/extra/relay_gcr
  
Or do !help in tell with the host bot to check the way to set it up well for !gcr protocol (or !agcr without online lists).
+
Or do !help in tell with the host bot to check the way to set it up well for !grc protocol (or !agcr without online lists).
  
NB : beware that most recent bots (Bebot, Nadybot, Tyrbot) can be set to share online list via websocket as detailed upper.
 
  
 
+
'''2.4 Using a shared database'''
'''2.5 Using a shared database'''
 
  
 
PROS: ok speed (2s delay max), sharing of online-lists, no relay-bot needed
 
PROS: ok speed (2s delay max), sharing of online-lists, no relay-bot needed
 
 
CONS: All bots need to be using the same database
 
CONS: All bots need to be using the same database
  
Line 296: Line 234:
  
 
Keep in mind that this setup only works if all your bots are using the same database. It's can't work elsewise.
 
Keep in mind that this setup only works if all your bots are using the same database. It's can't work elsewise.
First, make sure to grant each of the bots involved in your network access to each other (either by using “!member add botX” or creating a special security group for this as described in 2.4.2. Now do the following (assuming there are three bots, named bot1, bot2 and bot3):
+
First, make sure to grant each of the bots involved in your network access to each other (either by using “!member add botX” or creating a special security group for this as described in 2.3.2. Now do the following (assuming there are three bots, named bot1, bot2 and bot3):
  
 
     /tell bot1 !set Relay StrictNameCheck On
 
     /tell bot1 !set Relay StrictNameCheck On
Line 331: Line 269:
 
'''4. Extension'''
 
'''4. Extension'''
  
PROS : can connect to more than one relay at the time
+
PROS : can connect to more than one relay CONS : uses !agcr protocol without online list sharing.
 
 
CONS : uses !agcr protocol without online list sharing (so if you need it, check upper for grc/c, websocket or DB method)
 
  
 
You may have to connect your bot to more than one relay channel, several networks at the same time.
 
You may have to connect your bot to more than one relay channel, several networks at the same time.
Line 341: Line 277:
 
Then you'll have upto five "Hrelay" (HRelay1, HRelay2, HRelay3, HRelay4 and HRelay5) available in the !settings menu.
 
Then you'll have upto five "Hrelay" (HRelay1, HRelay2, HRelay3, HRelay4 and HRelay5) available in the !settings menu.
 
You can edit any by its number, for example with number 1 you do :
 
You can edit any by its number, for example with number 1 you do :
    !settings HRelay1
+
!settings HRelay1
 
It's then up to you to setup on the same model than described upper.
 
It's then up to you to setup on the same model than described upper.
 
Usually you'd use Channel mode, as Tells will be risky with many bots, & DB mode quite unusable for bots hosted separately.
 
Usually you'd use Channel mode, as Tells will be risky with many bots, & DB mode quite unusable for bots hosted separately.

Please note that all contributions to Bebot Wiki 2 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Bebot Wiki 2:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)