IRC gateway - a new way

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Mon Jul 09, 2007 4:03 pm

  • Because my last attempt at an IRC gateway was "a bit" hard to install and to change (the gateway started the server and communicated using stdin/stdout, so one couldn't change the gateway while the server was running), I made a new one. This time, I added a feature to the engine to support it:

    New cvar: log_dest_udp - contains a space separated list of IP addresses and ports to send all console output to (in the same format as QW rcon data)

    Basically, my IRC gateway now is an external process that uses rcon to retrieve log_dest_udp from the server, adds itself to the list and uses rcon to send the changed value to the server (yes, this does have a race condition, but should usually not be an issue... as a workaround, one can regularily request that cvar and add oneself to it when needed, but my gateway is not doing this yet). Then it can see all console messages, and use rcon to talk to the server. So setting it up is much easier now - just point it to some Nexuiz server with a rcon password, and that's it.

    It already supports color codes, special fonts, chat in both direction, and a somewhat clumsy but simple way to add plugins. The RBI KH server already uses the new gateway (that you can watch it on irc.oftc.net, #Nexuiz-Pwayers isn't a secret any more anyway). A newly added feature is notification about free player slots.

    I'll release it shortly after the next Nexuiz release, which will be a minor one and quite soon.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Mon Jul 09, 2007 5:21 pm

  • That sounds very interesting, indeed. Just make sure to wait for Mr ATI Victim ™ to check out the update before its release ;)
    IRC quote:
    [kojn] I've been coming a bit more recently
    [kojn] she took it the dirty way
    GreEn`mArine
    Forum addon
     
    Posts: 1509
    Joined: Tue Feb 28, 2006 9:33 pm
    Location: Germany

Fri Jul 13, 2007 11:32 am

  • First test version of the gateway:

    http://hagger.rbi.informatik.uni-frankf ... ew.tar.bz2

    Not licensed for anything but personal use with or without modification yet, but it will be either BSD, GPL2 or GPL3 licensed, I have not decided yet. Note that it requires a DP build from svn - it does NOT work with Nexuiz 2.3!
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Jul 13, 2007 12:54 pm

  • wow I really like these closed open-source perl scripts :o
    Closed, because a usual programmer who doesn't know perl won't get what is happening in your script.
    IRC quote:
    [kojn] I've been coming a bit more recently
    [kojn] she took it the dirty way
    GreEn`mArine
    Forum addon
     
    Posts: 1509
    Joined: Tue Feb 28, 2006 9:33 pm
    Location: Germany

Fri Jul 13, 2007 2:30 pm

  • GreEn`mArine wrote:wow I really like these closed open-source perl scripts :o
    Closed, because a usual programmer who doesn't know perl won't get what is happening in your script.

    Even perl programmers won't understand perl scripts written by someone else. That's what perl was designed for ;)
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm

Fri Jul 13, 2007 2:35 pm

  • Can someone explain how exactly this works?

    I know what a gateway is.
    I know what IRC is.

    What does this thing do?
    Dokujisan
    Forum addon
     
    Posts: 1199
    Joined: Sat Oct 07, 2006 4:31 pm
    Location: Louisville, Kentucky

Fri Jul 13, 2007 3:16 pm

  • my guess would be that the term gateway is that this scripts offer a way for the nexuis server to communicate with the script, which again communicates with IRC.
    the spice extend life!
    the spice expand conciousness!
    the spice is vital to space travel!
    sooooo.. tell me what you want, waht you really-really want
    I will proceed directly to the intravenous injection of hard drugs, please.
    User avatar
    tChr
    Forum addon
     
    Posts: 1501
    Joined: Tue Feb 28, 2006 9:11 pm
    Location: Trondheim, Norway

Fri Jul 13, 2007 3:25 pm

  • I saw the one example where slot openings on the server would be announced in IRC.

    So there would be a bot in IRC that communicates with the Nexuiz server?
    Dokujisan
    Forum addon
     
    Posts: 1199
    Joined: Sat Oct 07, 2006 4:31 pm
    Location: Louisville, Kentucky

Fri Jul 13, 2007 7:37 pm

  • Yeah.. the old irc gateway would connect to a server/channel and just post chat from the server and some important news like new maps to the channel. And allow people to 'say' stuff to people on the server.
    Useful to keep a watchful eye on the server.
    User avatar
    esteel
    Site admin and forum addon
     
    Posts: 3924
    Joined: Wed Mar 01, 2006 8:27 am

Fri Jul 13, 2007 7:52 pm

  • Whoa. People in IRC could talk on the Nexuiz server?
    How would they do that? Would it be like sending a command to a bot?

    That's very interesting
    Dokujisan
    Forum addon
     
    Posts: 1199
    Joined: Sat Oct 07, 2006 4:31 pm
    Location: Louisville, Kentucky

Fri Jul 13, 2007 8:34 pm

Fri Jul 13, 2007 9:23 pm

  • Just watch it on irc.oftc.net, #Nexuiz-Pwayers.

    You can send chat to a server by writing "hectorNex: whatever" (so you actually talk to the bot). And whatever they write on that server, you can see in the channel.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Jul 13, 2007 9:38 pm

  • Dokujisan wrote:Can someone explain how exactly this works?

    I know what a gateway is.
    I know what IRC is.

    What does this thing do?


    • pass chat messages between Nexuiz server and IRC channel
    • spam scores at end of match to the IRC channel (actually, this is the hardest part, as it has to shorten nicknames to make the next fit in one IRC message)
    • spam the channel about the server getting full or getting free slots again

    What the RBI specific plugin does is:

    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sat Jul 28, 2007 10:37 am

  • I just added NickServ authentication as a feature. It works like this:

    Code: Select all
    > USER ...
    > NICK mywantednick
    < 433 nick already in use:
      > NICK somethingelse
      < 433 nick already in use:
        > NICK somethingelse
        ....
    until:
    < 001 welcome to the network
    ? If my nickname is not what I wanted:
      > MSG NickServ GHOST mywantednick password
      > NICK mywantednick
      < 433 nick already in use: then ghost again
      until:
      > somethingelse is now known as mywantednick
    > MSG NickServ IDENTIFY password
    sleep one second
    > JOIN #channel


    Can anyone tell me if the commands I use have an one-to-one equivalent on Quakenet? If they have, I will also add Quakenet support. I need the equivalents of:

    MSG NickServ IDENTIFY password: tells services that you are indeed yourself so you get autovoice or autoop when joining some channels
    MSG NickServ GHOST mynickname password: kills the one currently using mynickname off the server (or on some networks, just renames him to something like Guest309) so I can now take it myself

    If there are really one-to-one equivalents, I will change my code to make the commands configurable in the configuration file, like

    irc_nickserv_identify = PRIVMSG NickServ :IDENTIFY $p
    irc_nickserv_ghost = PRIVMSG NickServ :GHOST $n $p

    so Quakenet users can just override them with whatever Quakenet wants.

    Maybe I should also make a identify-only mode that, if ghosting didn't work out, still goes ahead. Currently it would try infinitely to get the nick, but first thing I will do now is make an attempts limit for that.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sat Jul 28, 2007 11:06 am

  • Actually, I just implemented that part:

    irc_nickserv_password = joshua
    irc_nickserv_identify = PRIVMSG NickServ :IDENTIFY %2$s
    irc_nickserv_ghost = PRIVMSG NickServ :GHOST %1$s %2$s
    irc_nickserv_ghost_attempts = 3

    Yes, the attempt limiting does work now too. BTW, this is %1$s and %2$s, because Perl's printf already provides this special syntax for the first and the second parameter (nick and password). Setting the attempts to 0 of course disables this ghosting.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sat Jul 28, 2007 1:19 pm

  • for quakenet, the command to login :

    Code: Select all
    /msg Q@CServe.quakenet.org AUTH username password


    You have to use your Q username , and an account can't be created by a script.

    http://quakenet.org/faq/faq.php?c=1&f=51#51
    Ronan
    Alien trapper
     
    Posts: 292
    Joined: Tue Mar 20, 2007 10:25 pm
    Location: France

Sat Jul 28, 2007 3:42 pm

  • divVerent wrote:Can anyone tell me if the commands I use have an one-to-one equivalent on Quakenet? If they have, I will also add Quakenet support. I need the equivalents of:

    Quakenet doesn't have nickname reservation, so authenticating the bot on qnet is only useful if you want to give it voice/op/etc. automagically.
    And i suggest you implement the challenge-response authentification instead of the simple auth command ronan posted ;)
    http://www.quakenet.org/faq/faq.php?c=52&f=240#240
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm

Sat Jul 28, 2007 4:55 pm

  • Okay, then it may be working now.

    irc_quakenet_authname = ...
    irc_quakenet_password = ...

    is how to configure it now.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sun Jul 29, 2007 4:36 pm

  • Your quakenet support is working fine :wink:
    Ronan
    Alien trapper
     
    Posts: 292
    Joined: Tue Mar 20, 2007 10:25 pm
    Location: France

Sun Jul 29, 2007 6:29 pm

  • New config file: http://paste.debian.net/33642

    I finally found a way to make dp_listen an optional parameter (by getting the socket's local address after connecting it to the DP server). Only the six not commented out settings are required now. Also, unspecified port numbers are now regarded as 26000 for DP and 6667 for IRC.

    Tarball updated, BTW.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE



Return to Nexuiz - Development




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest