Forums » Community Projects

Distributed IRC Relay

Oct 04, 2011 CrazySpence link
http://www.voupr.com/plugin.php?name=dsrelay

I got this Idea sunday night and whipped it together Monday, tested it today essentially the idea is a static relay server and relaying clients that failover when disconnected, no extra Vo accounts or computers being used up by extra VO required

This is just a concept, not polished, the lua script is terrible but it works, take a look, improve if you want, hate it or love it

from the readme:

WHAT IT DOES
The server connects to IRC to a channel of your choice and awaits connections from relay clients, the first client connected becomes relayer.
If relayer should disconnected, timeout or die another relayer is selected from connected clients. What this means is if you do not wish to
pay for a second account for your guild you can distribute the lua script to all guild members and essentially have a continuous relay without
the unnecessary extra account.

WHAT IT DOESNT DO
This is just a concept release, there are none of the "frills" we are used to with our relays, no colours, no !online, no !score however those
are all just limitations of the LUA script and can be altered.

PROTOCOL
Logging on:
-Client connects to server
-Client sends REGISTER nickname password
-server will respond with ACTIVATED if they are the relayer
-IRC Announces who is the relayer
-Server follows up with "Logged In" regardless of relayer status

Relaying:
-Messages to IRC from VO guild chat get sent as RELAY data which the IRC portion will output to the channel
-Messages from IRC must start with !
-The Server will strip the ! and send the rest of the string to the VO plugin as RELAY [irc] <nickname> data
-The Server will handle !/me as well and send the data as RELAY [irc] * nickname data

Failover:
-When a client relaying disconnects the Server will report to IRC that the Relayer has disconnected
-The next minute cycle will upgrade the next connection in the pool to Relayer status
-IRC will announce the relayer

INSTALLATION

Server
-You will need a computer with perl installed, there may be some libraries I use not installed by default but CPAN will have them
-Edit irccls.pl, set the nickname and channel for your relay
-Edit relay.pl change the password variable from "changeme" to something relevant
-Execute relay.pl to start the server, if you have all the dependancies it will start and you will see it output data to the console.

Client:
Edit main.lua, put in the correct password and server values to match your set up

When in vo /relayon and /relayoff will toggle relay connection

Issues:
-ReloadInterface() breaks the client real bad, dont do it without doing /relayoff first
-People complained about the lack of colouring, if you like colours add it
-Does not automatically start on login, I may add this, but this is just a concept release, i expect people to use their own lua scripts as mine is awful. I will do mostly server side fixes only
Oct 06, 2011 CrazySpence link
Now does faction colouring, ReloadInterface() doesnt explode, couple early bugs squashed
Oct 07, 2011 CrazySpence link
-Took slimes event loop so now it behaves more like a slime relay except that it connects to my relay server instead of to IRC directly
-Has been running as the channel 100 relay and Itan Guild relay for the better part of the afternoon
-Successful failover test between 2 VO clients to the server

The current lua script and server I tested with today are not posted on voupr, they should be early next week now that these tests are out of the way I can clean up the code a lil bit

Sample output:

20:53 < RelaySpence:#vrelay> Relayer CrazySpence disconnected
20:53 < RelaySpence> Relayer CrazySpence disconnected
20:53 <@ARF> !well you got the fail part right
20:53 <%CrazySpence> i did it again where i logged off right after the minute cycle lol
20:53 <@ARF> !but it's not over yet.
20:53 <@ARF> :)
20:54 < RelaySpence:#vrelay> iLaZy Registered as relay
20:54 < RelaySpence> iLaZy Registered as relay
20:54 < LaZyPC> !ouch
20:54 < RelaySpence> (guild) [Deneb] <iLaZy> [irc] <LaZyPC> ouch
20:54 < LaZyPC> !nice
20:54 < RelaySpence> (guild) [Deneb] <iLaZy> [irc] <LaZyPC> nice
20:54 <@ARF> !hey it works
20:54 < RelaySpence> (guild) [Deneb] <iLaZy> [irc] <ARF> hey it works
20:54 < RelaySpence> (guild) [Odia] <CrazySpence> epic
20:54 < RelaySpence:#vrelay> [100] <CrazySpence> hark
20:54 < LaZyPC> turning it off now
20:54 < RelaySpence:#vrelay> Relayer iLaZy disconnected
20:54 < RelaySpence> Relayer iLaZy disconnected
20:54 < RelaySpence:#vrelay> CrazySpence Registered as relay
20:54 < RelaySpence> CrazySpence Registered as relay
20:54 < RelaySpence:#vrelay> [100] <CrazySpence> epic win
20:54 < LaZyPC> !double nice
20:54 < RelaySpence> (guild) [Odia] <CrazySpence> [irc] <LaZyPC> double nice
Oct 07, 2011 draugath link
The big problem I see popping up is someone having an older version of the relay than the current, and all of a sudden you have problems with a lack of expected features, or bugs that were fixed in a later version.
Oct 07, 2011 CrazySpence link
well anyone using the relay has to have the same password set as the relay server, you could just change the password if the protocol changes.

For certain guilds, who have certain secret auto plugin dispensers this would not be a problem, others would have to be a manual distribution.
Sep 04, 2012 CrazySpence link
Oh I updated this, I still doubt anyone but me will find it useful still but it's a fun pet project

http://www.voupr.com/plugin.php?name=dsrelay
Feb 18, 2016 jordanmorgan14f link
this thing has been killing me. Mind going more in depth with a perl noob?
Feb 22, 2016 Michael144 link
Get a text editor
Feb 22, 2016 jordanmorgan14f link
I have quite a few environments and multi-syntax editors. I just know jack shit about how to this relay work. Slimes is working fine though, so its all good.