====== IRCBridgeModule ====== ===== Problems To Solve ===== Using IRCBridgeModule you can not only bridge regions to IRC channels, you can bridge regions to each other through IRC channels. And perhaps best of all - you can bridge from any IRC client into your regions without a heavyweight LL-based viewer... ==== Communications, Command, and Control (C3) ==== The military has long seen a need for communications across diverse spaces, issuing commands through those communications networks, and the feedback controls to show commands were carried out as well as unwanted actions prevented. See [[http://www.globalsecurity.org/military/systems/ground/c3.htm|Communications, Command, and Control]] (globalsecurity) \\ OpenSim can benefit from this as well. In its usual "half a glass is all you get" design, Linden Lab provided a number of ways to send messages within a region and almost none between regions. The best you can do is to put relays at the sim corners to speak "over the fence" to a relay in the next region which repeats what it heard within that region. Clunky. IRCBridgeModule lets you elegantly avoid that clunkiness and provides some interesting possibilities that are extremely not-easy to pull off in SecondLife where llEmail or the clunky HTTP functions and events are your only real external interfaces. ===== History or Why ===== I started playing with the IRCBridgeModule as a potential upgrade for Lani's SubSpace region interconnection. Later as my [[Myriad]] combat and roleplay system evolved the need for a region setting server, I started looking for the Communications, Command, and Control system to let me have a single region setting server work estate wide across many regions. IRCBridgeModule was the solution, and along the way experimenting, there were many other happy accidents to share... so here they are. ===== IRCd ===== First, you need to add an IRC server to your OpenSim server. Many Linux distributions provide these as pre-packaged installs, which you still need to configure. I recommend using specific accounts with passwords in your personal IRC server configuration and loading each region with its own IRC account and password to the server. ==== Channels ==== There are two initial "modes" you can consider regarding how regions create and use IRC channels -- each region has its own IRC channel, or all regions meet in a common "watering hole" channel where they can all send and receive messages to each other I tend to use limited accounts with limited passwords and a watering hole channel. ===== IRC Client ===== Along with an IRC server, you need a desktop IRC client. This lets you login to IRC from outside of the world and interact with people inworld via the IRC Bridge. Some viewers even included IRC clients as part of the viewer communication window. In my opinion this needs to be far more widespread. Until then, I have used Pidgin without any hassles using a straightforward IRC account setup which autojoins my waterhole channel described above. This lets me (theoretically) send messages to any or all of my regions from one IRC input box which is good for administration. ===== OpenSim.ini ===== Enable IRCBridgeModule in your OpenSim.ini. There are three example configurations in the INI that give you a LOT of flexibility on a per-region basis. [[http://opensimulator.org/wiki/IRCBridgeModule|IRCBridgeModule]] (opensimulator) [IRC] enabled = true server = ; your IRC server, such as 127.0.0.1 if it runs on the SAME machine password = nick = ; I suggest the region name for this. randomize_nick = false ; just use the nick rather than nick5437 or something channel = # ; the common IRC channel name like #allregions user = "USER * : OpenSim IRC bot" port = 6667 ; the usual IRC port You do NOT want to open this port to the Internet or forward external connections to it from your router without carefully thinking about who may login and what they may say and do to your regions and chat with this... For the rest of the config - command channels - I recommend to start with this disabled until you've gotten used to things. Uses for different example relay_private and relay_chat are described below. One last specific setting I've customized is msgformat. \\ The default is "PRIVMSG {0} : <{2}> {1}: {3}" \\ You must have the PRIVMSG {0} space colon space or IRC gets upset. \\ I customize my msgformat to remove the <{2}> since my bot nick is the login name for the region - with {0} followed by <{2}> you get the region name twice which is meh. ==== Security ==== Finally for OpenSim.ini - a word about security: \\ The relay channels talk about using a password to restrict relaying from inworld TO the IRC. \\ This isn't really security - a channel sniffer will see the messages with the password in it. \\ Also, before sharing your OpenSim.ini or OpenSim.log - be sure to search for your passwords and sanitize things before sharing. The IRC relay password gets captured in some log files for example as chat messages are relayed. ===== Scripting ===== With the backend infrastructure (OpenSim's IRCBridgeModule, OpenSim.ini configuration, IRCd configuration, logins, passwords, channels, etc) you are ready to use basic Linden Scripting Language calls to unleash the POWER! ===== Example 1: Estate Chat ===== By setting the public chat to relay to IRC, and the IRC to relay to public chat, you can create a cross-region version of the Concierge module chat extension. All of your regions need to login to the same IRC channel in order for this to work. But when you do, anything spoken openly in 1 region will repeat to all other regions. Within a region, you still need the Concierge Module's chat extension to repeat the local chat region wide if that is what you want. ===== Example 2: SubSpace 2 ===== By setting the IRCBridgeModule to use private channels for relays rather than the public chat, you can avoid spamming everyone with chat from all regions, but let them "tune in" using special radio devices. The radio relays to IRC, and listens to other messages from the IRC to relay to you. You can use special message formatting to create radio frequency channels: \\ 15000|message can be split using llParseString2List to get the fake channel number and the message into separate variables. This can allow for "team" or "tactical" chat radios that work on the same channel in all of your estate regions, at once, relaying radio A in region A to radio B in region B listening on the same "subchannel". ===== Example 3: Interactive osNPC ===== By switching IRCBridgeModule to private relay channels, you can script an osNPC that does a number of interesting things: * watches for you to log into the IRC channel for the region, and rezzes itself * sees you log out of the IRC channel and derezzes itself * listens for start, stop, status commands * relays your IRC chat as osNpcSay * relays local inworld chat to the IRC channel * listens for an IRC "im someone message" command to send an llInstantMessage to someone by name, using osAvatarName2Key I use this osNPC setup in my Windrock_Station to have an in-world presence via IRC from work without the need for a text or graphic viewer. From my desktop I run the Pidgin multi-instant-messaging client. \\ I have pidgin automatically log me in to my region IRC server. \\ The osNPC sees my arrival message and rezzes itself, says hello in local chat. \\ The hello gets echoed back to IRC for me as well so I can see the bot rez. \\ When people enter the region, you see that in the IRC channel and can just begin talking to folks within range of the osNPC. The IM function let's me tell people I am sorry I missed them if I didn't see the IRC status change in time (such as when busy at work). ===== Example 4: Swiss Army Administration ===== Expanding the IRC to osNPC bot idea above, practically any region or OpenSim administration task could be performed from the IRC client input box, provided objects with appropriate scripting are listening inworld. Parcel controls to eject or ban? Why not. If you enable the OpenSim osConsoleCommand scripting function, you can even control the OpenSim console itself from IRC -- although I tend to use ssh and screen for this instead. See [[http://opensimulator.org/wiki/OsConsoleCommand|osConsoleCommand]] (opensimulator) ===== Conclusion ===== In summary, the often-overlooked IRCBridgeModule is really a region or grid admin's secret weapon for doing a LOT of interesting and unusual tasks and worth a serious exploration.