Commentçamarche.net
CodeS-SourceS
Rechercher un code, un tuto, une réponse

G-ircd1.0

4/5 (16 avis)

Vue 7 712 fois - Téléchargée 452 fois

Description

Le voilà enfin, le G-IRCD1.0 est arrivé.
Le G-IRCD est un serveur IRC qui se veut le plus proche possible de la référence en matière d'IRCD : UnrealIRCd. Le développement du G-IRCD a commencé le 20/04/2004. À cette date là, j'ai commencé à écrire les premières lignes du programme. J'étais très motivé jusqu'au moment où, en Août, je décida d'arrêter le développement du G-IRCD par manque de motivation. Personnellement, je pense que rester motivé est une des choses les plus difficiles tout au long d'un projet. J'en ai été ici victime.
Le 28/01/2005, j'ai décidé de reprendre le développement du G-IRCD.
Cette version 1.0, n'a pas été béta-testée, elle a surtout vu le jour pour que les gens puissent voir où j'en suis, et apporter des suggestions, faire des rapports de bug, pour m'aider tout au long de la suite du développement. C'est pourquoi il n'y a quasiment aucune doc. Cela m'apporte aussi de la motivation. Elle est linkless, c'est à dire qu'elle ne gère pas de links avec d'autres serveurs, ou services IRC.
À vrai dire, la véritable première version du G-IRCD sera la 2.0. Elle permettera la gestion des links, et sera améliorée, corrigée...
C'est pourquoi je voudrais, si vous le voulez bien, faire des rapports de bug (voir la section Bug Report du site du G-IRCD (/credits)), pour m'aider à améliorer ce programme ! Merci

Source / Exemple :


on 1:start: {
  if (!$isdir(System)) {
    mkdir System
  }
  echo -s 4Type /start, to start the server
  echo -s Please visit http://www.g-neration.com/G-IRCD/
  echo -s You can configure the server by editing g-ircd.conf, and by modifying rehash.g
  if ($readini(System\G-IRCD.dat,GlobalVars,firststart) != no) {
    writeini -n System\G-IRCD.dat GlobalVars creationtime $asctime
    writeini -n System\G-IRCD.dat GlobalVars firststart no
  }
}

alias cleanup {
  var %i 1
  set %systemdir $mircdir $+ System\
  set %nbdfiles $calc($findfile(%systemdir ,*,0,0,) - 1)
  log Cleaning up the database...
  while (%i <= %nbdfiles) {
    set %tmpfile $findfile(%systemdir ,*,%i,0,)
    if (($nopath(%tmpfile) != G-IRCD.dat) && (%tmpfile)) {
      log Removing %tmpfile
      .remove $shortfn(%tmpfile)
    }
    inc %i
  }
}

alias sw {
  set %lastsw sw $1-
  echo @sw 12 $+ %lastsw
  sockwrite -tn $1 $2-
}
alias log { write log.txt $1- | echo @G-IRCD $1- }
alias randsock { return gircd $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(a,z) $+ $rand(A,Z) $+ $rand(A,Z) $+ $rand(1000,9999) $+ $rand(10,99) $+ $rand(a,z) }
alias randping { return $rand(10,99) $+ $rand(A,Z) $+ $rand(0,9) $+ $rand(A,Z) $+ $rand(A,Z) $+ $rand(A,Z) $+ $rand(0,9) }

alias start {
  ;Démarrage du serveur
  
  window -e @G-IRCD
  ;window -e @sr
  cleanup
  log Removing temporary variables...
  unset %*
  log Reading configuration for rehash...
  rehash
  rh
  addmap %me 0 %me %me.info
  ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CHANGER ICI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  log Server ready to listen to the Internet...
  var %i 1
  ;Boucle servant à mettre en écoute les ports
  while (%i <= $gettok(%ports,0,300)) {
    set %tport $gettok(%ports,%i,300)
    socklisten gircd $+ %i %tport
    log 14Listening port : %tport
    inc %i
  }
  log 4Server started !
  writeini -n System\G-IRCD.dat GlobalVars online $asctime
}

alias usergiven {
  ;Alias servant à vérifier si l'user donné (sous forme de sockname) a déjà donné sa commande USER.
  if ($1) {
    inc %usergiventimes_ [ $+ [ $1 ] ]
    if (%usergiventimes_ [ $+ [ $1 ] ] >= 10) {
      .timerusergiven $+ $1 off
      halt
    }
    .timerusergiven $+ $1 off
    if (%usergiven_ [ $+ [ $1 ] ] == on) {
      if (!$isco($socknick($sockname))) {
        sw $1 : $+ %me NOTICE %nick_of_sockname_ [ $+ [ $1 ] ] :*** If you are having problems connecting due to ping timeouts, please type /quote pong %ping_ [ $+ [ $1 ] ] or /raw pong %ping_ [ $+ [ $1 ] ] now.
        sw $1 : $+ %me NOTICE %nick_of_sockname_ [ $+ [ $1 ] ] :*** %me running version G-IRCD1.1
        sw $1 PING : $+ %ping_ [ $+ [ $1 ] ]
        .timerping $+ $1 1 %pingfreq /pingverif $1
        set %usergiven_ [ $+ [ $1 ] ] off
        hello $1
      }
      else {
        sw $1 ERROR :Closing Link: Nickname is already in use. Please change.
        sockclose2 $1
        .timerkill $+ $1 -m 1 200 /sockclose $1
      }
    }
    else {
      ;Sinon, on refait appel à cette même fonction dans une seconde, pour voir s'il ne l'a toujours pas donné, et ainsi de suite.
      .timerusergiven $+ $1 1 1 /usergiven $1
    }
  }
}

on *:socklisten:gircd*: {
  ;On créé un nom aléatoire de socket
  set %randsock $randsock
  ;On l'accepte en lui donnant le nom aléatoire
  sockaccept %randsock
  ;On détermine l'ip du client venant de se connecter
  set %ip_ [ $+ [ %randsock ] ] $sock(%randsock).ip
  
  ;Vérification du nombre de sessions pour l'ip
  if (%sessions_ [ $+ [ %ip_ [ $+ [ %randsock ] ] ] ] >= %slimit) {
    log 7Killed %ip_ [ $+ [ %randsock ] ] : Session limit exceeded
    sw %randsock ERROR :Closing Link: Session limit exceeded
    sockclose2 %randsock
    .timerkill $+ %randsock -m 1 200 /sockclose %randsock
  }
  else {
    inc %nbdconnects
    set %port_ [ $+ [ %randsock ] ] $sock($sockname).port
    inc %sessions_ [ $+ [ %ip_ [ $+ [ %randsock ] ] ] ]
    sw %randsock : $+ %me NOTICE AUTH :*** Looking up your hostname...
    set %dnssock %randsock
    ;dns %ip_ [ $+ [ %randsock ] ]
    if ($dllcall(G-IRCD.dll,dllcallreturn,GDNS,%ip_ [ $+ [ %randsock ] ] %randsock)) { }
    sw %randsock : $+ %me NOTICE AUTH :*** Checking ident...
  }
}

alias dllcallreturn { }

on *:sockclose:gircd*: {
  log 4Déconnexion : $socknick($sockname) ( $+ $fullhost($sockname) $+ )
  set %quitchans %chans_ [ $+ [ $sockname ] ]
  set %qfullhost $fullhost($sockname)
  set %qnick $socknick($sockname)
  set %qserv %server_ [ $+ [ $socknick($sockname) ] ]
  set %quitraison_ [ $+ [ $sockname ] ] Quit: Connection reset by peer
  sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ $sockname ] ]
  sockclose2 $sockname
  gquit $sockname Connection reset by peer
}

alias sockclose2 {
  if ($1) {

    if (%server_ [ $+ [ $socknick($1) ] ] == %me) {
    ;Envoyer la notice à tous les IRCops locaux
    set %ilf $ircoplistfile
    if (!$exists(%ilf)) {
      goto sockcloseend
    }
    var %file $gopen(%ilf)
    while ($fread(%file)) {
      set %r $gettok($ifmatch,1,32)
      if (o isin %umodes_ [ $+ [ %r ] ]) {
        if (%server_ [ $+ [ %r ] ] == %me) {
          if (c isincs %snomask_ [ $+ [ %r ] ]) {
            if ($socknick($1)) {
              sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %lonick :*** Notice -- client exiting: $socknick($1) ( $+ $gettok($fullhost($1),2-,$asc(!)) $+ ) $chr(91) $+  %quitraison_ [ $+ [ $1 ] ] $+ $chr(93)
              ;*** Notice -- Client exiting: G-FACTION[GTASA] (G-FACTION@127.0.0.2) [Quit: ]
            }
          }
        }
      }
    }
    .fclose %file
    :sockcloseend
    ;Fin
    }
    
    whowas.add.private $1
    tmpshun.del $socknick($1)
    set %sockclosenick $socknick($1)
    dec %sessions_ [ $+ [ $sock($1).ip ] ]
    unset %connectiontime_ [ $+ [ $1 ] ]
    unset %chans_ [ $+ [ $1 ] ]
    unset %reginserver_ [ $+ [ $1 ] ]
    unset %realname_ [ $+ [ $socknick($1) ] ]
    unset %nick_ [ $+ [ $socknick($1) ] ]
    if (%ircop_ [ $+ [ $socknick($1) ] ]) {
      delircoplist  %nick_of_sockname_ [ $+ [ $1 ] ]
    }
    unset %ircop_ [ $+ [ $socknick($1) ] ]
    unset %nick_ [ $+ [ $socknick($1) ] ]
    unset %snomask_ [ $+ [ $socknick($1) ] ]
    unset %umodes_ [ $+ [ $socknick($1) ] ]
    unset %identd_ [ $+ [ $socknick($1) ] ]
    unset %server_ [ $+ [ $socknick($1) ] ]
    unset %ping_ [ $+ [ $1 ] ]
    unset %usergiven_ [ $+ [ $1 ] ]
    unset %port_ [ $+ [ $1 ] ]
    unset %vraiehost_ [ $+ [ $1 ] ]
    unset %sockname_ [ $+ [ $socknick($1) ] ]
    unset %nick_of_sockname_ [ $+ [ $1 ] ]
    unset %host_ [ $+ [ $1 ] ]
    unset %ip_ [ $+ [ $1 ] ]
    unset %nick_of_sockname_ [ $+ [ $1 ] ]
    delservnick %sockclosenick
  }
}

alias pingverif {
  if ($1) {
    .timerping $+ $1 off
    if (%pongdonne_ [ $+ [ $1 ] ]) {
      set %pongdonne_ [ $+ [ $1 ] ] $false
      set %ping_ [ $+ [ $1 ] ] $randping
      sw $1 PING : $+ %ping_ [ $+ [ $1 ] ]
      .timerping $+ $1 1 %pingfreq /pingverif $1
    }
    else {
      set %quitchans %chans_ [ $+ [ $1 ] ]
      set %qfullhost $fullhost($1)
      set %qnick $socknick($1)
      set %gserv %server_ [ $+ [ $socknick($1) ] ]
      ;sw $1 ERROR :Closing Link: Ping timeout
      set %quitraison_ [ $+ [ $1 ] ] Quit: Ping Timeout
      sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ $1 ] ]
      sockclose2 $1
      gquit $1 Ping Timeout
      ;.timerkill $+ $1 -m 1 200 /sockclose $1
    }
  }
}
alias applymodesonrequest {
  if ($2) {
    unset %endmodes
    set %tnick $socknick($1)
    set %tmodes $2
    ;Chargement des possibles flags de l'users
    set %tflags %oline. [ $+ [ %ircop_ [ $+ [ %tnick ] ] ] ] [ $+ [ .flags ] ]
    
    ;Analyse des modes qu'envoit le client...
    ;On regroupe les modes par signe (grâce à $positivemodes et $negativemodes)
    set %tmodes.pos $positivemodes(%tmodes)
    set %tmodes.neg $negativemodes(%tmodes)
    var %i 1
    set %len $len(%tmodes)
    unset %tumodes
    set %tumodes %umodes_ [ $+ [ %tnick ] ]
    while (%i <= %len) {
      set %tlettre $mid(%tmodes,%i,1)
      if (%tlettre isincs %tmodes.pos) {
        set %signe $chr(43)
      }
      elseif (%tlettre isincs %tmodes.neg) {
        set %signe $chr(45)
      }
      if ((%tlettre != $chr(43)) && (%tlettre != $chr(45))) {
        if (%signe == $chr(43)) {
          if (!$3) {
            if (%tlettre isincs %tumodes) {
              sw $1 : $+ %me 525 %tnick :You already have this umode ( $+ %tlettre $+ )
              goto endwhileumode
            }
          }
        }
        if (%signe == $chr(45)) {
          if (!$3) {
            if (%tlettre !isincs %tumodes) {
              sw $1 : $+ %me 526 %tnick :You don't have this umode ( $+ %tlettre $+ )
              goto endwhileumode
            }
          }
        }
      }
      ;Commençons par nous occuper des modes que tout le monde peut se foutre
      if ((%tlettre === s) || (%tlettre === i) || (%tlettre === w) || (%tlettre === R) || (%tlettre === V)) {
        if (%tlettre !== s) {
          set %endmodes %endmodes $+ %signe $+ %tlettre
          umodesrv %signe %tnick %tlettre
        }
        if (%tlettre === s) {
          if ($3) {
            set %tsnomask $3
            set %tsnomask.pos $positivemodes(%tsnomask)
            set %tsnomask.neg $negativemodes(%tsnomask)
            ;<- :irc.G-SERVER.net 008 G-FACTION :Server notice mask (+cfvGqs)
            var %o 1
            set %len2 $len(%tsnomask)
            while (%o <= %len2) {
              set %ttsnomask $mid(%tsnomask,%o,1)
              if (%ttsnomask isincs %tsnomask.pos) {
                set %signe2 $chr(43)
              }
              elseif (%ttsnomask isincs %tsnomask.neg) {
                set %signe2 $chr(45)
              }
              set %tttsnomask %snomask_ [ $+ [ %tnick ] ]
              ;sw $1 : $+ %me 999 %tnick :tttsnomask: %tttsnomask && ttsnomask: %ttsnomask
              if ((%ttsnomask != $chr(43)) && (%ttsnomask != $chr(45))) {
                if (%signe2 == $chr(43)) {
                  if (%ttsnomask isincs %tttsnomask) {
                    sw $1 : $+ %me 527 %tnick :You already have this snomask ( $+ %ttsnomask $+ )
                    goto endwhilesnomask
                  }
                }
                elseif (%signe2 == $chr(45)) {
                  if (%ttsnomask !isincs %tttsnomask) {
                    sw $1 : $+ %me 528 %tnick :You don't have this snomask ( $+ %ttsnomask $+ )
                    goto endwhilesnomask
                  }
                }
              }
              if ((%ttsnomask === k) || (%ttsnomask === s)) {
                ;<- :irc.G-SERVER.net 008 G-FACTION :Server notice mask (+cfvGqs)
                ;sw $1 : $+ %me 999 %tnick :haha1
                snomasksrv %signe2 %tnick %ttsnomask
                sw $1 : $+ %me 008 %tnick :Server notice mask ( $+ $chr(43) $+ %snomask_ [ $+ [ %tnick ] ] $+ )
              }
              elseif ((%ttsnomask === c) || (%ttsnomask === j) || (%ttsnomask === n) || (%ttsnomask === q) || (%ttsnomask === v) || (%ttsnomask === G) || (%ttsnomask === F) || (%ttsnomask === o)) {
                if (%ttsnomask !== F) {
                  if (o isin %tumodes) {
                    snomasksrv %signe2 %tnick %ttsnomask
                    sw  $1 : $+ %me 008 %tnick :Server notice mask ( $+ $chr(43) $+ %snomask_ [ $+ [ %tnick ] ] $+ )
                  }
                  else {
                    sw $1 : $+ %me 523 %tnick :Permission Denied - You do not have the correct IRC Operator privileges for this snomask
                  }
                }
                else {
                  if (o isincs %tumodes) {
                    snomasksrv %signe2 %tnick %ttsnomask
                    sw  $1 : $+ %me 008 %tnick :Server notice mask ( $+ $chr(43) $+ %snomask_ [ $+ [ %tnick ] ] $+ )
                  }
                  else {
                    sw $1 : $+ %me 523 %tnick :Permission Denied - You do not have the correct IRC Operator privileges for this snomask
                  }
                }
              }
              else {
                if ((%ttsnomask != $chr(43)) && (%ttsnomask != $chr(45))) {
                  sw $1 : $+ %me 524 %tnick : $+ %ttsnomask : Unknown Snomask
                }
              }
              :endwhilesnomask
              inc %o
            }
          }
          if (%signe == $chr(43)) {
            if (s !isincs %tumodes) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
          }
          if (%signe == $chr(45)) {
            if (s isincs %tumodes) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
          }
        }
      }
      elseif (%tlettre === x) {
        if (%signe == $chr(43)) {
          set %host_ [ $+ [ $1 ] ] %host.bak_ [ $+ [ $1 ] ]
        }
        elseif (%signe == $chr(45)) {
          set %host_ [ $+ [ $1 ] ] %vraiehost_ [ $+ [ $1 ] ]
        }
        set %endmodes %endmodes $+ %signe $+ %tlettre
        umodesrv %signe %tnick %tlettre
      }
      elseif (%tlettre === B) {
        set %endmodes %endmodes $+ %signe $+ %tlettre
        umodesrv %signe %tnick %tlettre
        botmotd $1
      }
      ;Puis, on s'occupe des modes qui vont demander de se référer à la o:line de l'utilisateur.
      elseif ((%tlettre === p) || (%tlettre === H) || (%tlettre === W) || (%tlettre === N) || (%tlettre === o) || (%tlettre === O) || (%tlettre === A) || (%tlettre === C) || (%tlettre === a) || (%tlettre === g)) {
        if (o isin %tumodes) {
          if (%tlettre === N) {
            if (N isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === o) {
            if (O isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === O) {
            if (o isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === A) {
            if (A isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === C) {
            if (C isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === a) {
            if (a isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
          elseif (%tlettre === g) {
            if (g isincs %tflags) {
              set %endmodes %endmodes $+ %signe $+ %tlettre
              umodesrv %signe %tnick %tlettre
            }
            else {
              sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
            }
          }
        }
        else {
          ;Note : +raw.txt
          sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
        }
      }
      elseif (%tlettre === h) {
        if (h isincs %tflags) {
          set %endmodes %endmodes $+ %signe $+ %tlettre
          umodesrv %signe %tnick %tlettre
        }
        else {
          sw $1 : $+ %me 522 :Permission Denied - You do not have the correct IRC Operator privileges for this umode
        }
      }
      
      
      /*Memo :
      Faire //mode $me -o
      Revient à faire : -oOhaANW
      Ca n'enleve naturellement pas ceux-ci : +wgsx

  • /
else { if ((%tlettre != $chr(45)) && (%tlettre != $chr(43))) { sw $1 : $+ %me 501 %tnick : $+ %tlettre : Unknown MODE flag } } :endwhileumode inc %i } if (%endmodes) { sw $1 : $+ %tnick MODE %tnick : $+ $reconvmodes(%endmodes) sendmultiserver : $+ %tnick MODE %tnick : $+ $reconvmodes(%endmodes) } } } alias applyumodesoline { set %tnick $socknick($1) unset %ttumodes set %tumodes %oline. [ $+ [ %ircop_ [ $+ [ %tnick ] ] ] ] [ $+ [ .flags ] ] if (o isincs %tumodes) { set %ttumodes %ttumodes $+ O } if (O isincs %tumodes) { set %ttumodes %ttumodes $+ o } set %ttumodes %ttumodes $+ $replacecs(%tumodes,a,a,A,A,N,N,C,C,g,g,h,h,w,w,R,,D,,n,,K,,G,,k,,b,,B,,t,,z,,Z,,v,,H,,W,,r,) umodesrv $chr(43) %tnick %ttumodes sw $1 : $+ %tnick MODE %tnick : $+ $chr(43) $+ %ttumodes } alias gopen { ;made by G-FACTION var %handle $+(FILE::,$rand($calc($ticks/4*2/5),$ticks)) .fopen %handle $1 if ($fopen(%handle).err) { .fclose %handle | return 0 } else { return %handle } } alias botmotd { if ($1) { if ($exists(%botmotdfile)) { set %botmotdnick $socknick($1) sw $1 : $+ %me NOTICE %botmotdnick :- %me Bot Message Of The Day - var %file $gopen(%botmotdfile) while ($fread(%file)) { sw $1 : $+ %me NOTICE %botmotdnick :- $+ $ifmatch } .fclose %file sw $1: $+ %me NOTICE %botmotdnick :End of /BOTMOTD command. } else { sw $1 : $+ %me NOTICE %botmotdnick :BOTMOTD File not found } } .fclose %file } alias umodesrv { if ($2) { if ($1 == $chr(43)) { set %tumodes $removecs(%umodes_ [ $+ [ $2 ] ],$3) set %umodes_ [ $+ [ $2 ] ] %tumodes $+ $3 } elseif ($1 == $chr(45)) { set %umodes_ [ $+ [ $2 ] ] $removecs(%umodes_ [ $+ [ $2 ] ],$3) } } } alias snomasksrv { ;signe nick snomask if ($2) { if ($1 == $chr(43)) { set %tsnomask2 $removecs(%snomask_ [ $+ [ $2 ] ],$3) set %snomask_ [ $+ [ $2 ] ] %tsnomask2 $+ $3 } elseif ($1 == $chr(45)) { set %snomask_ [ $+ [ $2 ] ] $removecs(%snomask_ [ $+ [ $2 ] ],$3) } } } alias positivemodes { unset %positivemodes if (($left($1,1) != $chr(45)) && ($left($1,1) != $chr(43))) { set %tmodes + $+ $1- } else { set %tmodes $1- } set %tmodes - $+ %tmodes if ($1) { var %i 1 set %len $len($1-) set %tokenmodes $gettok(%tmodes,0,43) while ($calc(%i + 1) <= %tokenmodes) { set %positivemodes %positivemodes $+ $deltok($gettok(%tmodes,$calc(%i + 1),43),2-,45) inc %i } } return %positivemodes } alias negativemodes { unset %negativemodes if (($left($1,1) != $chr(45)) && ($left($1,1) != $chr(43))) { set %tmodes + $+ $1- } else { set %tmodes $1- } set %tmodes + $+ %tmodes if ($1) { var %i 1 set %len $len($1-) set %tokenmodes $gettok(%tmodes,0,45) while ($calc(%i + 1) <= %tokenmodes) { set %negativemodes %negativemodes $+ $deltok($gettok(%tmodes,$calc(%i + 1),45),2-,43) inc %i } } return %negativemodes } alias isatleast { ;$isatleast(mode,nick,chan) ; 1 2 3 ;Exemple : $isatleast(h,G-FACTION,#scripts) va retourner $true si je suis op, halfop, ou owner :p if ($3) { set %chanfile $chanfile($3) if (!$exists(%chanfile)) { goto isatleastend } var %file $gopen(%chanfile) while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %is $left(%r,1) set %tnick $right(%r,$calc($len(%r) - 1)) } else { set %is rien set %tnick %r } if (%tnick == $2) { set %iss %is } } .fclose %file :isatleastend if ($1 === o) { if ((%iss == $chr(64)) || (%iss == $chr(126)) || (%iss == $chr(38))) { set %isatleast yes } else { set %isatleast no } } elseif ($1 == h) { if ((%iss == $chr(64)) || (%iss == $chr(126)) || (%iss == $chr(37)) || (%iss == $chr(38))) { set %isatleast yes } else { set %isatleast no } } elseif ($1 == v) { if ((%iss == $chr(64)) || (%iss == $chr(126)) || (%iss == $chr(37)) || (%iss == $chr(43)) || (%iss == $chr(38))) { set %isatleast yes } else { set %isatleast no } } elseif ($1 == q) { if (%iss == $chr(126)) { set %isatleast yes } else { set %isatleast no } } elseif ($1 == a) { if ((%iss == $chr(38)) |- (%iss == $chr(126))) { set %isatleast yes } else { set %isatleast no } } if (%isatleast == yes) { return $true } else { return $false } } } alias strongerthan { ;$strongerthan(a,q) = $false (a pas plus fort que q) if ($2) { if ($1 == q) { return $true } elseif ($1 == a) { if ($2 == q) { return $false } else { return $true } } elseif ($1 == o) { if (($2 == a) || ($2 == q)) { return $false } else { return $true } } elseif ($1 == h) { if (($2 == o) || ($2 == a) || ($2 == q)) { return $false } else { return $true } } elseif ($1 == v) { if (($2 == h) || ($2 == o) || ($2 == a) || ($2 == q)) { return $false } else { return $true } } elseif ($1 == NULL) { if ($2 == NULL) { return $true } else { return $false } } } } alias nfochanfile { if ($1) { return $mircdir $+ System\ $+ $1 $+ .nfo } } alias chmodestxsrv { ;chmodesrv +- Chan Mode if ($3) { if ($1 == $chr(43)) { set %m $replacecs($3,N,1,S,3,C,4,T,5) writeini -n $nfochanfile($2) STXM %m on } elseif ($1 == $chr(45)) { set %m $replacecs($3,N,1,S,3,C,4,T,5) writeini -n $nfochanfile($2) STXM %m off } } } alias chmodedynsrv { ;chmodedynsrv +- #chan k lepass ; 1 2 3 4 echo -a 10chmodedynsrv $1- if ($3) { if ($1 == $chr(43)) { set %m $replacecs($3,L,2) writeini -n $nfochanfile($2) DYNM %m on writeini -n $nfochanfile($2) DYNM %m $+ .arg $4 } elseif ($1 == $chr(45)) { set %m $replacecs($3,L,2) writeini -n $nfochanfile($2) DYNM %m off } } } alias sendchannel { ;sendchannel #chan Le message... ^^ if ($2) { var %o 0 if (!$exists($chanfile($1))) { goto sendchannelend } var %file $gopen($chanfile($1)) while ($fread(%file)) { inc %o set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) } else { set %tempnick %r } if (($sock(%sockname_ [ $+ [ %tempnick ] ])) && (%server_ [ $+ [ %tempnick ] ] == %me)) { ;echo -a 7sw %sockname_ [ $+ [ %tempnick ] ] $2- sw %sockname_ [ $+ [ %tempnick ] ] $2- } else { if (!$sock($+(gserv.,$passerelle(%server_ [ $+ [ %tempnick ] ])))) { ;Ghost repéré... echo @sr 3Ghost repéré, ligne %o de $chanfile($1) supprimée ( $+ $read($chanfile($1),%o) $+ ) write -dl $+ %o $chanfile($1) } } } .fclose %file :sendchannelend } } alias chmodestatussrv { ;chmodestatussrv +- Chan Mode Personne ; 1 2 3 4 echo @sr 13Entering chmodestatussrv function echo @sr 131: $1 2: $2 3: $3 4: $4 if ($4) { unset %laligne var %i 0 var %file $gopen($chanfile($2)) while ($fread(%file)) { inc %i set %r $ifmatch ;echo -a 2 $+ %r if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) } else { set %tempnick %r } if (%tempnick == $4) { ;echo -a 4Personne repérée... set %laligne %i echo @sr 13Laligne: %laligne echo @sr 13Personne: %tempnick } } .fclose %file if (%laligne) { echo @sr 13chmodestatussrv : delete line : %laligne in $chanfile($2) write -dl $+ %laligne $chanfile($2) } if ($1 == $chr(43)) { set %tempstsm $readini($nfochanfile($2),STSM,$4) set %tempstsm $removecs(%tempstsm,$3) set %tempstsm %tempstsm $+ $3 writeini -n $nfochanfile($2) STSM $4 %tempstsm echo @sr 13write $chanfile($2) $replace($strongermode(%tempstsm),v,$chr(43),h,$chr(37),o,$chr(64),q,$chr(126),a,$chr(38)) $+ $4 write $chanfile($2) $replace($strongermode(%tempstsm),v,$chr(43),h,$chr(37),o,$chr(64),q,$chr(126),a,$chr(38)) $+ $4 } elseif ($1 == $chr(45)) { set %tempstsm $readini($nfochanfile($2),STSM,$4) set %tempstsm $removecs(%tempstsm,$3) if (!%tempstsm) { set %tempstsm z } writeini -n $nfochanfile($2) STSM $4 %tempstsm set %tstrongermode $strongermode(%tempstsm) if (%tstrongermode != NULL) { echo @sr 13write $chanfile($2) $replace(%tstrongermode,v,$chr(43),h,$chr(37),o,$chr(64),q,$chr(126),a,$chr(38),z,) $+ $4 write $chanfile($2) $replace(%tstrongermode,v,$chr(43),h,$chr(37),o,$chr(64),q,$chr(126),a,$chr(38),z,) $+ $4 } else { echo @sr 13write $chanfile($2) $4 write $chanfile($2) $4 } } } } alias strongermode { ;Alias définissant le plus fort mode de ceux proposés, sans l'ordre 'qaohv' if ($1) { unset %sm if ((v isincs $1) && (h !isincs $1) && (o !isincs $1) && (a !isincs $1) && (q !isincs $1)) { set %sm v } elseif ((h isincs $1) && (o !isincs $1) && (a !isincs $1) && (q !isincs $1)) { set %sm h } elseif ((o isincs $1) && (a !isincs $1) && (q !isincs $1)) { set %sm o } elseif ((a isincs $1) && (q !isincs $1)) { set %sm a } elseif (q isincs $1) { set %sm q } else { set %sm NULL } return %sm } } alias reconvmodes { if ($1) { var %i 1 unset %endstr unset %derniersigne while (%i <= $len($1)) { set %rmode $mid($1,%i,1) if ((%rmode == $chr(43)) || (%rmode == $chr(45))) { if (%rmode != %derniersigne) { set %derniersigne %rmode set %endstr %endstr $+ %rmode } goto finwhile } else { set %endstr %endstr $+ %rmode } :finwhile inc %i } return %endstr } } alias chbanlist { ;chbanlist %chsigne %chchan $quelargument(%i,%chmodes) %chnick $ctime extension(bl par exemple) ;chbanlist + #G-FACTION *lol*!*@* G-FACTION 1108716436 bl ; 1 2 3 4 5 6 echo -a 13 $+ $1- if ($6) { echo -a haha unset %laligne set %banfile $mirc $+ System\ $+ $2 $+ $chr(46) $+ $6 echo -a 3 $+ %banfile if (!$exists(%banfile)) { echo -a mwahaa goto chbanlistend } echo -a 4KJHBZRF var %i 0 if (($3 == $chr(42)) || ($3 == $chr(33)) || ($3 == $chr(64))) { echo -a !!!1 set %bmask *!*@* } elseif (($chr(64) !isin $3) && ($chr(33) !isin $3) && ($chr(42) !isin $3)) { echo -a !!!2 set %bmask $3 $+ !*@* echo -a %bmask :) } elseif (($chr(64) !isin $3) && ($chr(33) !isin $3)) { echo -a !!!5 set %bmask $3 $+ !*@* } else { echo -a !!!4 set %bmask $3 } var %file $gopen(%banfile) while ($fread(%file)) { inc %i ;set %r $read(%banfile,n,%i) set %r $ifmatch echo -a $gettok(%r,1,32) == %bmask if ($gettok(%r,1,32) == %bmask) { set %laligne %i } } .fclose %file :chbanlistend if (%laligne) { if ($1 == $chr(43)) { goto chbanlistend2 } else { write -dl $+ %laligne %banfile } } if ($1 == $chr(43)) { if (%bmask != ERROR) { write %banfile %bmask $4 $5 ;<- :G-FACTION!~G-FACTION@EpiK-5A393E5B.fbx.proxad.net MODE #g-faction +b pa!*@* echo -a sendchannel $2 : $+ $fullhost(%sockname_ [ $+ [ $4 ] ]) MODE $2 $1 $+ $iif($6 == bl,b,e) %bmask sendchannel $2 : $+ $fullhost(%sockname_ [ $+ [ $4 ] ]) MODE $2 $1 $+ $iif($6 == bl,b,e) %bmask } else { if ($6 == bl) { set %mot ban } elseif ($6 == el) { set %mot exception } sw %sockname_ [ $+ [ $4 ] ] : $+ %me 531 $4 :Invalid %mot mask ( $+ $3 $+ ) halt } } else { if (%laligne) { sendchannel $2 : $+ $fullhost(%sockname_ [ $+ [ $4 ] ]) MODE $2 $1 $+ $iif($6 == bl,b,e) %bmask } } :chbanlistend2 } else { echo -a 4!!!!!!!!!!!!!!!!!!!!!!!!!!! } } alias banfile { if ($1) { return $mircdir $+ System\ $+ $1 $+ .bl } } alias exceptfile { if ($1) { return $mircdir $+ System\ $+ $1 $+ .el } } alias zline.add { ;zline.add host $ctime timetoexpire host_zlineur raison ; 1 2 3 4 5 if ($5) { write $linesfile Z $1- } } alias zline.del { if ($1) { var %i 0 set %zfile $linesfile if (!$exists(%zfile)) { halt } unset %zline unset %r var %file $gopen(%zfile) while ($fread(%file)) { inc %i set %r $ifmatch if ($gettok(%r,1,32) == Z) { if ($gettok(%r,2,32) == $1) { write -dl $+ %i %zfile break } } inc %i } .fclose %file } } alias zline.infos { if ($1) { set %zfile $linesfile if (!$exists(%zfile)) { goto zlineinfosend } unset %zline unset %zinfos var %file $gopen(%zfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == Z) { if ($gettok(%r,2,32) == $1) { set %zinfos $gettok(%r,3-,32) } } } .fclose %file if (%zinfos) { return %zinfos } } :zlineinfosend } alias quelargument { ;$quelargument(numero,modes) ; 1 2 ;+oooo Nick1 Nick2 Nick3 Nick4 ;On veut savoir quel est l'argument du 3ème 'o' par exemple. Ici : Nick3 var %i 1 set %qlen $len($2) unset %args unset %quelargument while (%i <= %qlen) { set %qmode $mid($2,%i,1) if (%qmode isincs aqhovbeklL) { ;Si le mode doit comporter un argument ;On incrémente la variable qui compte le nombre d'args inc %args } if (%i == $1) { set %quelargument $gettok($2,$calc(%args + 1),32) } inc %i } return %quelargument } alias sendbanlist { ;sendbanlist sockname chan ; 1 2 if ($2) { set %blnick $socknick($1) set %banfile $banfile($2) if (!$exists(%banfile)) { goto sendbanlistend } var %file $gopen(%banfile) while ($fread(%file)) { set %r $ifmatch sw $1 : $+ %me 367 %blnick $2 $gettok(%r,1-3,32) } .fclose %file :sendbanlistend sw $1 : $+ %me 368 %blnick $2 :End of Channel Ban List } } alias sendexceptlist { ;sendbanlist sockname chan ; 1 2 if ($2) { set %exnick $socknick($1) set %exceptfile $exceptfile($2) if (!$exists(%exceptfile)) { goto sendexceptlistend } set %file $gopen(%exceptfile) while ($fread(%file)) { set %r $ifmatch sw $1 : $+ %me 348 %exnick $2 $gettok(%r,1-3,32) } .fclose %file :sendexceptlistend sw $1 : $+ %me 349 %exnick $2 :End of Channel Exception List } } alias banalreadyexists { if ($3) { set %banfile $mircdir $+ System\ $+ $1 $+ . $+ $3 set %bae $false if (!$exists(%banfile)) { goto banalreadyexistsend } set %file $gopen(%banfile) while ($fread(%file)) { set %read $ifmatch if ($gettok(%read,1,32) == $2) { set %bae $true } } .fclose %file :banalreadyexistsend return %bae } } alias applychmodesonrequest { ;applychmodesonrequest Sockname Chan Modes- ; ; 1 2 3- if ($3) { ;$sockname $+ $chr(96) $+ %me $2- set %tsock $gettok($1,1,96) set %samode $false if ($gettok($1,2,96)) { set %chnick $ifmatch set %samode $true } else { set %chnick $socknick(%tsock) } set %chchan $2 set %chmodes $3- set %chmodes.pos $positivemodes($gettok(%chmodes,1,32)) set %chmodes.neg $negativemodes($gettok(%chmodes,1,32)) var %i 1 unset %endchmodes unset %endstatusmodes unset %enddynmodes unset %chargs set %chlen $len($3) set %operoverride $false if (%ircop_ [ $+ [ %chnick ] ]) { set %tflags %oline. [ $+ [ %ircop_ [ $+ [ %chnick ] ] ] ] [ $+ [ .flags ] ] if (v isincs %tflags) { set %operoverride $true } } while (%i <= %chlen) { set %chlettre $mid(%chmodes,%i,1) set %chlettre2 $replacecs($mid(%chmodes,%i,1),N,1,L,2,S,3,C,4,T,5) if ((%chlettre == $chr(43)) || (%chlettre == $chr(45))) { ;Alors il s'agit d'un + ou - goto endofchlettrewhile } if (%chlettre isincs %chmodes.pos) { set %chsigne $chr(43) } elseif (%chlettre isincs %chmodes.neg) { set %chsigne $chr(45) } ;Regroupons par type de mode if (%chlettre isincs icmnprstACMKNOQRSVT) { ;Ce sont des static modes ;Regroupons par ordre de privileges requis if (%chsigne == $chr(43)) { if ($readini($nfochanfile(%chchan),STXM,%chlettre2) == on) { goto endofchlettrewhile } } elseif (%chsigne == $chr(45)) { if ($readini($nfochanfile(%chchan),STXM,%chlettre2) != on) { goto endofchlettrewhile } } if (%chlettre isincs imnt) { ;Ce sont les modes où il faut au moins être halfop pour pouvoir les mettre if (($isatleast(h,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %endchmodes %endchmodes $+ %chsigne $+ %chlettre chmodestxsrv %chsigne %chchan %chlettre } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre isincs scpoCMKNQRSVT) { ;Modes où il faut être au moins op if (($isatleast(o,%chnick,%chchan)) || (%operoverride) || (%samode)) { if (%chsigne == $chr(43)) { if (%chlettre === s) { if (p isincs $chmodes(%chchan)) { chmodestxsrv $chr(45) %chchan p set %endchmodes %endchmodes $+ $chr(45) $+ p } } elseif (%chlettre === p) { if (s isincs $chmodes(%chchan)) { chmodestxsrv $chr(45) %chchan s set %endchmodes %endchmodes $+ $chr(45) $+ s } } } set %endchmodes %endchmodes $+ %chsigne $+ %chlettre chmodestxsrv %chsigne %chchan %chlettre } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre === O) { ;Mode uniquement appliquable par les IRCops if ((o isin %umodes_ [ $+ [ %chnick ] ]) || (%samode)) { set %endchmodes %endchmodes $+ %chsigne $+ %chlettre chmodestxsrv %chsigne %chchan %chlettre } else { sw %tsock : $+ %me 529 %chnick %chchan :Opers Only mode (+O) can only be set by IRC Operators. } } elseif (%chlettre === A) { if ((a isin %umodes_ [ $+ [ %chnick ] ]) || (N isincs %umodes_ [ $+ [ %chnick ] ]) || (%samode)) { set %endchmodes %endchmodes $+ %chsigne $+ %chlettre chmodestxsrv %chsigne %chchan %chlettre } else { sw %tsock : $+ %me 530 %chnick %chchan :Admins Only mode (+A) can only be set by Administrators. } } } elseif (%chlettre isincs vhoaq) { ;Ce sont des status modes if ($quelargument(%i,%chmodes)) { if (%chsigne == $chr(43)) { if (%chlettre isincs $readini($nfochanfile(%chchan),STSM,$quelargument(%i,%chmodes))) { goto endofchlettrewhile } } elseif (%chsigne == $chr(45)) { if (%chlettre !isincs $readini($nfochanfile(%chchan),STSM,$quelargument(%i,%chmodes))) { goto endofchlettrewhile } } write haha.txt juste avant le $eval($ison,0) if (($ison(%chnick,%chchan)) || (%samode)) { write haha.txt juste avant le $eval($ison,0) 2 if (!$ison($quelargument(%i,%chmodes),%chchan)) { write haha.txt dans le ison 2 ! ;<- :besancon3.fr.epiknet.org 401 G-FACTION mdr :No such nick/channel if (!%samode) { sw %tsock : $+ %me 401 %chnick $quelargument(%i,%chmodes) :No such nick/channel } goto hahaha } } else { ;<- :besancon3.fr.epiknet.org 482 G-FACTION #lol :You're not channel operator if (!%samode) { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } goto hahaha } else { } if (%chlettre === v) { if (($isatleast(h,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %endstatusmodes %endstatusmodes $+ %chsigne $+ %chlettre chmodestatussrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre === h) { if (($isatleast(o,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %endstatusmodes %endstatusmodes $+ %chsigne $+ %chlettre chmodestatussrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre === o) { if (($isatleast(o,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %endstatusmodes %endstatusmodes $+ %chsigne $+ %chlettre chmodestatussrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif ((%chlettre === a) || (%chlettre === q)) { if (($isatleast(q,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %endstatusmodes %endstatusmodes $+ %chsigne $+ %chlettre chmodestatussrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } :hahaha } } elseif (%chlettre isincs beklL) { ;Alors ce sont des dynamic modes if (%chlettre === e) { set %format el } elseif (%chlettre === b) { set %format bl } if (%chlettre !isincs eb) { if (%chsigne == $chr(43)) { if ($readini($nfochanfile(%chchan),DYNM,%chlettre2) == on) { if ($readini($nfochanfile(%chchan),DYNM,%chlettre2 $+ .arg) == $quelargument(%i,%chmodes)) { goto endofchlettrewhile } } } elseif (%chsigne == $chr(45)) { if ($readini($nfochanfile(%chchan),DYNM,%chlettre2) != on) { goto endofchlettrewhile } } } if ((%chlettre === b) || (%chlettre === e)) { ;Le fichier de banlist d'un canal est #canal.bl ;Le format dans le fichier : Mask Banner ctime if (!$len($quelargument(%i,%chmodes))) { if (%chlettre === b) { sendbanlist %tsock %chchan goto endofchlettrewhile } elseif (%chlettre === e) { sendexceptlist %tsock %chchan goto endofchlettrewhile } } if (($isatleast(h,%chnick,%chchan)) || (%operoverride) || (%samode)) { if ($len($quelargument(%i,%chmodes))) { ;set %enddynmodes %enddynmodes $+ %chsigne $+ %chlettre chbanlist %chsigne %chchan $quelargument(%i,%chmodes) %chnick $ctime %format ;set %chargs %chargs $quelargument(%i,%chmodes) } } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif ((%chlettre === k) || (%chlettre === l) || (%chlettre === L)) { if (%chsigne == $chr(43)) { if (!$quelargument(%i,%chmodes)) { goto endofchlettrewhile } } if (%chsigne == $chr(43)) { if (%chlettre === L) { if (l isincs $chmodes(%chchan)) { ;974 G-FACTION L :+l must be set if (!$correctchanname($quelargument(%i,%chmodes))) { ;403 G-FACTION l :No such channel sw $1 : $+ %me 403 %chnick $quelargument(%i,%chmodes) :No such channel goto endofchlettrewhile } } else { sw $1 : $+ %me 974 %chnick L :+l must be set goto endofchlettrewhile } } } if (%chlettre === k) { if (($isatleast(h,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %enddynmodes %enddynmodes $+ %chsigne $+ %chlettre chmodedynsrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre === l) { if (($isatleast(o,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %enddynmodes %enddynmodes $+ %chsigne $+ %chlettre chmodedynsrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } elseif (%chlettre === L) { if (($isatleast(q,%chnick,%chchan)) || (%operoverride) || (%samode)) { set %enddynmodes %enddynmodes $+ %chsigne $+ %chlettre chmodedynsrv %chsigne %chchan %chlettre $quelargument(%i,%chmodes) set %chargs %chargs $quelargument(%i,%chmodes) } else { sw %tsock : $+ %me 482 %chnick %chchan :You're not channel operator } } } } else { ;<- :besancon.fr.epiknet.org 472 G-FACTION ^ :is unknown mode char to me sw %tsock : $+ %me 472 %chnick %chlettre :is unknown mode char to me } :endofchlettrewhile inc %i } if (%endchmodes) { ;<- :irc.G-SERVER.net MODE #G-FACTION +i if (!%samode) { sendchannel %chchan : $+ $fullhost(%sockname_ [ $+ [ %chnick ] ]) MODE %chchan $reconvmodes(%endchmodes) sendmultiserver : $+ %chnick MODE %chchan $reconvmodes(%endchmodes) } else { sendchannel %chchan : $+ %me MODE %chchan $reconvmodes(%endchmodes) sendmultiserver : $+ %me MODE %chchan $reconvmodes(%endchmodes) } } if (%endstatusmodes) { if (!%samode) { sendchannel %chchan : $+ $fullhost(%sockname_ [ $+ [ %chnick ] ]) MODE %chchan $reconvmodes(%endstatusmodes) %chargs sendmultiserver : $+ %chnick MODE %chchan $reconvmodes(%endstatusmodes) %chargs } else { sendchannel %chchan : $+ %me MODE %chchan $reconvmodes(%endstatusmodes) %chargs sendmultiserver : $+ %me MODE %chchan $reconvmodes(%endstatusmodes) %chargs } } if (%enddynmodes) { if (!%samode) { echo -a fonction modes echo -a sendchannel %chchan : $+ $fullhost(%sockname_ [ $+ [ %chnick ] ]) MODE %chchan $reconvmodes(%enddynmodes) %chargs sendchannel %chchan : $+ $fullhost(%sockname_ [ $+ [ %chnick ] ]) MODE %chchan $reconvmodes(%enddynmodes) %chargs sendmultiserver : $+ %chnick MODE %chchan $reconvmodes(%enddynmodes) %chargs } else { sendchannel %chchan : $+ %me MODE %chchan $reconvmodes(%enddynmodes) %chargs sendmultiserver : $+ %me MODE %chchan $reconvmodes(%enddynmodes) %chargs } } } } alias verifyshunlines { if ($1) { var %lol $gettok($vraiefullhost($1),2,33) set %vffile $linesfile if (!$exists(%vffile)) { goto tend } var %file $gopen(%vffile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == s) { if ($gettok(%r,2,32) iswm %lol) { return $true } } } .fclose %file :tend return $false } } on *:sockread:gircd*: { sockread %sr echo @sr $sockname : %nick_of_sockname_ [ $+ [ $sockname ] ] :4 %sr tokenize 32 %sr if ($isreginserver($sockname)) { ;Les commandes diverses lorsqu'on a déjà passé la phase auth. if (($verifyshunlines($sockname)) || ($shunned($socknick($sockname)))) { if ($1 == PONG) { if ($2) { set %tpong $remove($2,$chr(58)) if (%tpong == %ping_ [ $+ [ $sockname ] ]) { set %pongdonne_ [ $+ [ $sockname ] ] $true } } else { ;<- :besancon.fr.epiknet.org 409 G-FACTION :No origin specified sw $sockname : $+ %me 409 $socknick($sockname) :No origin specified } } elseif ($1 == ADMIN) { goto admin } goto toutefin } if ($1 == VERSION) { version $sockname } elseif ($1 == LUSERS) { lusers $sockname } elseif ($1 == MOTD) { motd $sockname } elseif ($1 == G) { if ($1 === G) { sw $sockname : $+ %me 999 $socknick($sockname) :<G-FACTION> bouh :þ ! Y te plait mon ircd ? :] } else { sw $sockname : $+ %me 371 $socknick($sockname) :Nan, pas /g, /G !! } } elseif ($1 == BOTMOTD) { botmotd $sockname } elseif ($1 == MODE) { unset %destnick set %tnick $socknick($sockname) /* MODE Nick +modes (+snomasks) MODE #channel +modes MODE #channel +modes Nick 1 2 3 4 Ne pas se baser sur le nombre de tokens pour savoir de quel type de MODE il s'agit Il peut en y avoir plus genre avec "+lLk 1 #chan lemotdepasse"
  • /
if ($left($2,1) != $chr(35)) { /* On vérifie qu'il ne s'agit pas d'un channel, donc d'un usermode $chr(35) = #
  • /
;Nick auquel on va appliquer le mode (en théorie le même nick que celui qui envoit la commande) set %destnick $2 ;Si le nick ne s'applique pas le mode à lui même if (%destnick) { if ($3) { if (%tnick != %destnick) { sw $sockname : $+ %me 502 $socknick($sockname) :Can't change mode for other users } else { applymodesonrequest $sockname $3- } } else { sw $sockname : $+ %me 461 $socknick($sockname) MODE :Not enough parameters } } else { sw $sockname : $+ %me 461 $socknick($sockname) MODE :Not enough parameters } } else { if ($3) { ;Ce sont des chmodes ;applymodesonrequest sockname chan modes applychmodesonrequest $sockname $2 $3- } else { ;:besancon.fr.epiknet.org 324 G-FACTION #legoodies +ntr ;:besancon.fr.epiknet.org 329 G-FACTION #legoodies 1085037574 sw $sockname : $+ %me 324 $socknick($sockname) $2 + $+ $chmodes($2) sw $sockname : $+ %me 329 $socknick($sockname) $2 $creationtime($2) } } } elseif ($1 == OPER) { if ($3) { if ($operexists($2)) { if ($goodoperhost($2,$fullhost($sockname))) { if ($goodoperpass($2,$3)) { set %ircop_ [ $+ [ $socknick($sockname) ] ] $2 addircoplist $socknick($sockname) globops $socknick($sockname) $chr(91) $+ $2 $+ $chr(93) is now an IRCop sw $sockname : $+ $$socknick($sockname) MODE $socknick($sockname) : $+ $chr(43) $+ %opermodes umodesrv $chr(43) $socknick($sockname) %opermodes ;+cjkqvFG snomasksrv $chr(43) $socknick($sockname) %opersnomask sw $sockname : $+ %me 008 $socknick($sockname) :Server notice mask ( $+ %snomask_ [ $+ [ $socknick($sockname) ] ] $+ ) sw $sockname : $+ %me 381 $socknick($sockname) :You are now an IRC Operator applyumodesoline $sockname } else { sw $sockname : $+ %me 464 $socknick($sockname) :Password incorrect globops Failed OPER attempt by $socknick($sockname) ( $+ $fullhost($sockname) $+ ) using UID $2 [FAILEDAUTH] } } else { sw $sockname : $+ %me 491 $socknick($sockname) :No O-lines for your host globops Failed OPER attempt by $socknick($sockname) ( $+ $fullhost($sockname) $+ ) [unknown oper] } } else { sw $sockname : $+ %me 491 $socknick($sockname) :No O-lines for your host globops Failed OPER attempt by $socknick($sockname) ( $+ $fullhost($sockname) $+ ) [unknown oper] } } else { sw $sockname : $+ %me 461 $socknick($sockname) OPER :Not enough parameters } } elseif ($1 == WHOIS) { set %wtnick $socknick($sockname) unset %haha unset %tttt if ($chr(44) !isin $2) { if ($3) { if (%server_ [ $+ [ $remove($3,$chr(58)) ] ] == %me) { set %tttt $remove($3,$chr(58)) } else { set %haha $true sw $+(gserv.,$passerelle(%server_ [ $+ [ $remove($3,$chr(58)) ] ])) : $+ %wtnick WHOIS $remove($3,$chr(58)) : $+ $remove($3,$chr(58)) } } else { set %tttt $2 } } if ($2) { set %nicks %tttt set %nbdnicks $gettok(%nicks,0,44) var %i 1 while (%i <= %nbdnicks) { set %wnick $gettok(%nicks,%i,44) if ($isco(%wnick)) { sw $sockname : $+ %me 311 %tnick %wnick %identd_ [ $+ [ %wnick ] ] %host_ [ $+ [ %sockname_ [ $+ [ %wnick ] ] ] ] * : $+ %realname_ [ $+ [ %wnick ] ] if ($whoischanlist(%wnick,%wtnick)) { ;<- :la-defense.fr.epiknet.org 319 G-FACTION Fonix :#antiboulet #legoodies @#g-faction sw $sockname : $+ %me 319 %wtnick %wnick : $+ $ifmatch } if ((%wnick == %wtnick) || (%ircop_ [ $+ [ %wtnick ] ])) { sw $sockname : $+ %me 379 %wtnick %wnick :is using modes $chr(43) $+ %umodes_ [ $+ [ %wnick ] ] $iif(%snomask_ [ $+ [ %wnick ] ],$+($chr(43),$ifmatch),) sw $sockname : $+ %me 378 %wtnick %wnick :is connecting from *@ $+ $iif($sock(%sockname_ [ $+ [ %wnick ] ]).ip,$ifmatch,%vraiehost_ [ $+ [ %sockname_ [ $+ [ %wnick ] ] ] ]) $iif($sock(%sockname_ [ $+ [ %wnick ] ]).ip,$ifmatch,) } if ((%wnick == %wtnick) || (%ircop_ [ $+ [ %wtnick ] ])) { if ($sock(%sockname_ [ $+ [ %wnick ] ]).rcvd) { sw $sockname : $+ %me 532 %wtnick %wnick :sent $sock(%sockname_ [ $+ [ %wnick ] ]).rcvd bytes sw $sockname : $+ %me 533 %wtnick %wnick :received $sock(%sockname_ [ $+ [ %wnick ] ]).sent bytes } } if (r isincs %umodes_ [ $+ [ %wnick ] ]) { sw $sockname : $+ %me 307 %wtnick %wnick :is a registered nick } sw $sockname : $+ %me 312 %wtnick %wnick %server_ [ $+ [ %wnick ] ] : $+ $serv_sdesc(%server_ [ $+ [ %wnick ] ]) if ($isaway(%wnick)) { sw $sockname : $+ %me 301 %wtnick %wnick : $+ %away_ [ $+ [ %sockname_ [ $+ [ %wnick ] ] ] ] } if ((%ircop_ [ $+ [ %wnick ] ]) || (o isin %umodes_ [ $+ [ %wnick ] ])) { if ((o isin %umodes_ [ $+ [ %wnick ] ])) { sw $sockname : $+ %me 313 %wtnick %wnick :is an IRC operator } if (h isincs %umodes_ [ $+ [ %wnick ] ]) { sw $sockname : $+ %me 310 %wtnick %wnick :is available for help } if (%oline. [ $+ [ %ircop_ [ $+ [ %wnick ] ] $+ .swhois ] ]) { echo -a 9:) sw $sockname : $+ %me 320 %wtnick %wnick : $+ $ifmatch } else { if (%swhois_ [ $+ [ %sockname_ [ $+ [ %wnick ] ] ] ]) { sw $sockname : $+ %me 320 %wtnick %wnick : $+ $ifmatch } } } } else { ;<- :besancon.fr.epiknet.org 401 G-FACTION bidule :No such nick/channel sw $sockname : $+ %me 401 %wtnick %wnick :No such nick } if (W isincs %umodes_ [ $+ [ %wnick ] ]) { if (%wtnick != %wnick) { if ($sock(%sockname_ [ $+ [ %wnick ] ])) { ;*** lol (G-FACTION@127.0.0.2) did a /whois on you. sw %sockname_ [ $+ [ %wnick ] ] : $+ %me NOTICE %wnick :*** %wtnick ( $+ $gettok($vraiefullhost($sockname),2,33) $+ ) did a /whois on you. } else { ;Cet user est situé sur un autre serveur sw $+(gserv.,$passerelle(%server_ [ $+ [ %wnick ] ])) : $+ %me NOTICE %wnick :*** %wtnick ( $+ $gettok($vraiefullhost($sockname),2,33) $+ ) did a /whois on you. } } } inc %i } } else { sw $sockname : $+ %me 431 %wtnick :No nickname given } if (!%haha) { sw $sockname : $+ %me 318 %wtnick %wnick :End of /WHOIS list. } } elseif ($1 == PRIVMSG) { if (!$3) { ;<- :besancon.fr.epiknet.org 411 G-FACTION :No recipient given (NOTICE) sw $sockname : $+ %me 411 $socknick($sockname) :No recipient given (PRIVMSG) halt } set %dest $2 set %tmess $right($3-,$calc($len($3-) - 1)) if ($left(%dest,1) == $chr(35)) { ;Si le message est adressé à un chan... if ($left(%tmess,1) == $chr(1)) { ;Il envoit un ctcp au chan if (C isincs $chmodes(%dest)) { ;404 G-FACTION[GTASA] #G-FACTION :CTCPs are not permitted in this channel (#G-FACTION) sw $sockname : $+ %me 404 $socknick($sockname) %dest :CTCPs are not permitted in this channel ( $+ %dest $+ ) halt } } privmsg %dest $socknick($sockname) %tmess } else { ;Si le message est adressé à un pseudo... if ($isco(%dest)) { set %tpvnick $socknick($sockname) set %dest_umodes %umodes_ [ $+ [ %dest ] ] set %nick_umodes %umodes_ [ $+ [ %tpvnick ] ] if (R isincs %umodes_ [ $+ [ %dest ] ]) { if (r !isincs %nick_umodes) { ;<- :besancon.fr.epiknet.org 486 testR :You must identify to a registered nick to private message G-FACTION sw $sockname : $+ %me 486 %tpvnick :You must identify to a registered nick to private message %dest halt } } if ($sock(%sockname_ [ $+ [ %dest ] ])) { sw %sockname_ [ $+ [ %dest ] ] : $+ %tpvnick PRIVMSG %dest : $+ %tmess } else { if ($sock($+(gserv.,%server_ [ $+ [ %dest ] ]))) { sw $+(gserv.,%server_ [ $+ [ %dest ] ]) : $+ %tpvnick PRIVMSG %dest : $+ %tmess } else { set %tsock $+(gserv.,$passerelle(%server_ [ $+ [ %dest ] ])) if ($sock(%tsock)) { sw %tsock : $+ %tpvnick PRIVMSG %dest : $+ %tmess } } } if ($isaway(%dest)) { sw $sockname : $+ %me 301 %tpvnick %dest : $+ %away_ [ $+ [ %sockname_ [ $+ [ %dest ] ] ] ] } } else { sw $sockname : $+ %me 401 $socknick($sockname) %dest :No such nick/channel } } } elseif ($1 == AWAY) { if ($2) { if ($right($2-,$calc($len($2-) - 1)) != %away_ [ $+ [ $sockname ] ]) { set %away_ [ $+ [ $sockname ] ] $left($right($2-,$calc($len($2-) - 1)),%awaylen) sw $sockname : $+ %me 306 $socknick($sockname) :You have been marked as being away } } else { if (%away_ [ $+ [ $sockname ] ]) { unset %away_ [ $+ [ $sockname ] ] sw $sockname : $+ %me 305 $socknick($sockname) :You are no longer marked as being away } } } elseif ($1 == NOTICE) { set %nnick $socknick($sockname) set %ndest $2 if (!$3) { sw $sockname : $+ %me 411 $socknick($sockname) :No recipient given (NOTICE) halt } if ($chr(35) !isin %ndest) { ;Il s'agit d'un envoi à un user set %nmess $right($3-,$calc($len($3-) - 1)) set %ndest_umodes %umodes_ [ $+ [ %ndest ] ] set %nnick_umodes %umodes_ [ $+ [ %nnick ] ] if (V isincs %ndest_umodes) { set %ncmd PRIVMSG } else { set %ncmd NOTICE } if ($isco(%ndest)) { sw %sockname_ [ $+ [ %ndest ] ] : $+ $fullhost($sockname) %ncmd %ndest : $+ %nmess } else { sw $sockname : $+ %me 401 %nnick %ndest :No such nick/channel } } else { ;Il s'agit d'un envoi à un canal set %nmess $right($3-,$calc($len($3-) - 1)) set %nd %ndest set %nchans $gettok(%nd,0,44) var %o 1 while (%o <= %nchans) { set %ndest $gettok(%nd,%o,44) if ($gettok(%ndest,0,35) > 1) { ;Des modes ont été spécifiés set %nmodes $gettok(%ndest,1,35) set %nchan $chr(35) $+ $gettok(%ndest,2-,35) } else { set %nmodes $false set %nchan %ndest } if (T !isincs $chmodes(%nchan)) { if ($remove(%nmodes,$chr(38),$chr(126))) { var %i 1 set %nlen $len(%nmodes) while (%i <= %nlen) { set %nmode $mid(%nmodes,%i,1) set %ncf $chanfile(%nchan) if (!$exists(%ncf)) { goto noticeend } var %file $gopen(%ncf) while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { if ($strongerthan($replace($left(%r,1),$chr(64),o,$chr(38),a,$chr(126),q,$chr(43),v,$chr(37),h),$replace(%nmode,$chr(64),o,$chr(38),a,$chr(126),q,$chr(43),v,$chr(37),h))) { set %n $right(%r,$calc($len(%r) - 1)) if ($sock(%sockname_ [ $+ [ %n ] ])) { sw %sockname_ [ $+ [ %n ] ] : $+ $fullhost($sockname) NOTICE %nmodes $+ %nchan : $+ %nmess } else { if (%server_ [ $+ [ %n ] ] != %me) { sendmultiserver : $+ %nnick NOTICE %nmodes $+ %nchan : $+ %nmess } } } } } .fclose %file :noticeend inc %i } } else { sendchannel %nchan : $+ $fullhost($sockname) NOTICE %nchan : $+ %nmess sendmultiserver : $+ %nnick NOTICE %nchan : $+ %nmess } } else { ;404 G-FACTION[GTASA] #G-FACTION :NOTICEs are not permitted in this channel (#G-FACTION) sw $sockname : $+ %me 404 %nnick %nchan :NOTICEs are not permitted in this channel ( $+ %nchan $+ ) } inc %o } } } elseif ($1 == JOIN) { /* Yeahhhh begining /join command ! ^^ Il faudra s'occuper des chanmodes i,L,k,s(whois),b Prendre en compte le MAXCHANNELS On va créer une base de données pour les canaux. #chan.nfo Dedans, seront stockées les données des modes statics. (ceux qui sont pas +voqa etc...) Puis on fera une banlist, protectlist, et exceptlist par canal (pas invites list car ça sert à rien). Bien entendu, si l'user joint un canal vide, il doit se retrouver en +o Et puis si l'option "apply +nt modes on channel creation" est activée, on l'fait :)
  • /
if ($2) { ;maxchannels set %tmpchans $whoischanlist($socknick($sockname)) set %nbdchans $gettok(%tmpchans,0,32) if (!%nbdchans) { set %nbdchans 0 } if (%nbdchans < %maxchannels) { join $sockname $1- } else { ;<- :besancon3.fr.epiknet.org 405 G-FACTION #test33 :You have joined too many channels sw $sockname : $+ %me 405 $socknick($sockname) $2 :You have joined too many channels } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == NAMES) { if ($2) { sendnicklist $2 $socknick($sockname) } else { sw $sockname : $+ %me 366 $socknick($sockname) * :End of /NAMES list. } } elseif ($1 == PONG) { :ping if ($2) { set %tpong $remove($2,$chr(58)) if (%tpong == %ping_ [ $+ [ $sockname ] ]) { set %pongdonne_ [ $+ [ $sockname ] ] $true } } else { ;<- :besancon.fr.epiknet.org 409 G-FACTION :No origin specified sw $sockname : $+ %me 409 $socknick($sockname) :No origin specified } } elseif ($1 == PART) { if ($2) { set %chans $2 set %nbdchans $gettok(%chans,0,44) var %i 1 while (%i <= %nbdchans) { part $sockname PART $gettok(%chans,%i,44) $3- inc %i } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == INVITE) { ;INVITE Nick #chan ; 1 2 3 if ($3) { set %tnick $socknick($sockname) set %inick $2 set %ichan $3 unset %operoverride if (%ircop_ [ $+ [ %tnick ] ]) { set %tflags %oline. [ $+ [ %ircop_ [ $+ [ %chnick ] ] ] ] [ $+ [ .flags ] ] if (v isincs %tflags) { set %operoverride $true } } set %tchmodes $replacecs($chmodes(%ichan),1,N,2,L,3,S,4,C,5,T) if ($isco(%inick)) { if (($ison(%tnick,%ichan)) || (%operoverride)) { if (!$ison(%inick,%ichan)) { if ((V !isincs %tchmodes) || (%operoverride)) { sw %sockname_ [ $+ [ %inick ] ] : $+ $fullhost($sockname) INVITE %inick : $+ %ichan set %invited_ [ $+ [ %tchan ] ] [ $+ [ _ $+ [ %chnick ] ] ] $true noticechannel %ichan @ %me %tnick invited %inick into the channel. } else { sw $sockname : $+ %me 518 %tnick :Cannot invite (+V) at channel %ichan } } else { sw $sockname : $+ %me 443 %tnick %inick %ichan :is already on channel } } else { sw $sockname : $+ %me 442 %tnick %ichan :You're not on that channel } } else { sw $sockname : $+ %me 401 %tnick %inick :No such nick/channel } } else { sw $sockname : $+ %me 461 %tnick $1 :Not enough parameters } } elseif ($1 == KNOCK) { set %knocknick $socknick($sockname) set %knockchan $2 if (!$3) { set %knockreason no reason specified } else { set %knockreason $3- } if ($2) { if (!$ison(%knocknick,%knockchan)) { set %knockchmodes $replacecs($chmodes(%knockchan),1,N,2,L,3,S,4,C,5,T) if (i isincs %knockchmodes) { if (K !isincs %knockchmodes) { sw $sockname : $+ %me NOTICE %knocknick :Knocked on %knockchan noticechannel %knockchan @ %me [Knock] by $fullhost($sockname) ( $+ %knockreason $+ ) } else { sw $sockname : $+ %me 480 %knocknick :Cannot knock on %knockchan (No knocks are allowed! (+K)) } } else { sw $sockname : $+ %me 480 %knocknick :Cannot knock on %knockchan (Channel is not invite only!) } } else { sw $sockname : $+ %me 480 %knocknick :Cannot knock on %knockchan (You're already there!) } } else { sw $sockname : $+ %me 461 %knocknick $1 :Not enough parameters } } elseif ($1 == KICK) { if ($3) { kick $2 $socknick($sockname) $3 $right($4-,$calc($len($4-) -1)) } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == WHO) { unset %wdest set %wnick $socknick($sockname) if ($2) { if ($left($2,1) == $chr(43)) { ;Il entre un flag set %wflag $mid($2,2,1) if (%wflag === c) { set %wdest $3 goto channel } elseif (%wflag === a) { ;who +a, donne la liste des tous les users away du serveur if ($3) { ;La présence d'un nick après le flag annule le flag et fait comme si c'était un /who nick set %wdest $3 goto nick } var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch if ($isaway(%r)) { if (i !isincs %umodes_ [ $+ [ %r ] ]) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } } .fclose %file } elseif (%wflag === g) { ;who +g <string> donne la liste de tous les users ayant <string> comme RealName if ($3) { ;Procédure normale. set %wdest $3 if ($chr(42) isin %wdest) { ;Alors l'user utilise les wildcards, ce qui est réservé aux IRCops. if (%ircop_ [ $+ [ %wnick ] ]) { var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch var %wrealname %realname_ [ $+ [ %r ] ] if (%wdest iswm %wrealname) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } } else { ;Il a entré un string normal, pas un wildcard, donc pas de restriction ;Recherche en tokens var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch set %wrealname %realname_ [ $+ [ %r ] ] if ($istok(%wrealname,%wdest,32)) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } } else { ghelp who $sockname } } elseif (%wflag === h) { ;who +h <host>, <host> en wildcard if ($3) { set %wdest $3 var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch set %whost %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] if (%wdest iswm %whost) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } else { ghelp who $sockname } } elseif (%wflag === m) { ;who +m <mode>, a,A,o seulement, pour les non-ircop. if ($3) { set %wmode $left($3,1) ;Le $left sert à éviter que certaines peronnes entrant plusieurs modes puissent feinter (faille) if (%wmode isincs oOaANCghRDWnGkKbiBtzZvHWr) { if (%wmode !isincs aAo) { if (!%ircop_ [ $+ [ %wnick ] ]) { goto wend } } var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch set %wmodes %umodes_ [ $+ [ %r ] ] if (%wmode isincs %wmodes) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } } else { ghelp who $sockname } } elseif (%wflag === n) { ;who +n <nick>, <nick> en wildcard if ($3) { set %wdest $3 var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch if (%wdest iswm %r) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } else { ghelp who $sockname } } elseif (%wflag === u) { ;who +u <username>, donne la liste des users ayant <username> comme username (identd). Wildcards. if ($3) { set %wdest $3 var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch set %wusername %identd_ [ $+ [ %r ] ] if (%wdest iswm %wusername) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } else { ghelp who $sockname } } elseif (%wflag === M) { ;who +M, donne la liste de tous les users qui ont des chans communs avec soi if ($3) { set %wdest $3 goto nick } set %wchans1 %chans_ [ $+ [ $sockname ] ] var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch set %wchans2 %chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] if ($comchans(%wchans1,%wchans2)) { sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } } .fclose %file } elseif (%wflag === R) { ;who +R, donne la liste de tous les users du serveur, et avec leurs vraies hosts. IRCops only. if (%ircop_ [ $+ [ %wnick ] ]) { ;%vraiehost_ [ $+ [ $sockname ] ] var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %vraiehost_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } .fclose %file } } else { ghelp who $sockname } } else { set %wdest $2 if ($left(%wdest,1) == $chr(35)) { ;Alors il /who #chan ;<- :besancon.fr.epiknet.org 352 G-FACTION #my_world LoVeFF leon.epiknet.fr besancon.fr.epiknet.org LeOn Hr :0 LeOn :þ :channel var %file $gopen($chanfile(%wdest)) while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) } else { set %tempnick %r } set %tsockname %sockname_ [ $+ [ %tempnick ] ] sw $sockname : $+ %me 352 %wnick %wdest %identd_ [ $+ [ %tempnick ] ] %host_ [ $+ [ %tsockname ] ] %server_ [ $+ [ %tempnick ] ] %tempnick $whoattr(%tempnick) :0 %realname_ [ $+ [ %tempnick ] ] } .fclose %file } else { ;Alors il /who nick :nick if ($isco(%wdest)) { unset %attr if ($isaway(%wdest)) { set %attr %attr $+ G } else { set %attr %attr $+ H } if (r isincs %umodes_ [ $+ [ %wdest ] ]) { set %attr %attr $+ r } if (%ircop_ [ $+ [ %wdest ] ]) { set %attr %attr $+ $chr(42) } sw $sockname : $+ %me 352 $socknick($sockname) $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %wdest ] ] ] ],1,32) %identd_ [ $+ [ %wdest ] ] %host_ [ $+ [ %sockname_ [ $+ [ %wdest ] ] ] ] %server_ [ $+ [ %wdest ] ] %wdest %attr :0 %realname_ [ $+ [ %wnick ] ] } } } ;<- :besancon.fr.epiknet.org 315 G-FACTION truc :End of /WHO list. :wend sw $sockname : $+ %me 315 $socknick($sockname) %wdest :End of /WHO list. } else { ;sw $sockname : $+ %me 316 $socknick($sockname) :You cannot /WHO the whole server var %file $gopen($userslistfile) while ($fread(%file)) { set %r $ifmatch sw $sockname : $+ %me 352 %wnick $gettok(%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ],1,32) %identd_ [ $+ [ %r ] ] %host_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ] %server_ [ $+ [ %r ] ] %r $whoattr(%r) :0 %realname_ [ $+ [ %r ] ] } .fclose %file sw $sockname : $+ %me 315 $socknick($sockname) %wdest :End of /WHO list. } } elseif ($1 == USERHOST) { if ($2) { set %unick $2 if (%unick == $socknick($sockname)) { set %unick $socknick($sockname) ;<- :besancon.fr.epiknet.org 302 G-FACTION :G-FACTION=+~_G-FACTIO@stmartindheres-1-82-225-54-143.fbx.proxad.net sw $sockname : $+ %me 302 %unick : $+ %unick $+ =+ $+ $vraiefullhost($sockname) } else { if ($isco(%unick)) { if (%ircop_ [ $+ [ $socknick($sockname) ] ]) { sw $sockname : $+ %me 302 $socknick($sockname) : $+ %unick $+ =+ $+ $vraiefullhost(%sockname_ [ $+ [ %unick ] ]) } else { sw $sockname : $+ %me 302 $socknick($sockname) : $+ %unick $+ =+ $+ $fullhost(%sockname_ [ $+ [ %unick ] ]) } } else { sw $sockname : $+ %me 302 $socknick($sockname) : } } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == QUIT) { if ($2) { set %qmsg $right($2-,$calc($len($2-) - 1)) } else { unset %qmsg } set %quitchans %chans_ [ $+ [ $sockname ] ] set %qfullhost $fullhost($sockname) set %qnick $socknick($sockname) set %gserv %server_ [ $+ [ $socknick($sockname) ] ] set %quitraison_ [ $+ [ $sockname ] ] Quit: %qmsg sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ $sockname ] ] sockclose2 $sockname if ($len(%qmsg)) { gquit $sockname Quit: %qmsg } else { gquit $sockname Quit: } } elseif ($1 == ISON) { if ($2) { unset %endisonlist if ($3) { set %isonlist $2- set %isonnum $gettok(%isonlist,0,32) var %i 1 while (%i <= %isonnum) { set %tison $gettok(%isonlist,%i,32) if ($isco(%tison)) { set %endisonlist $addtok(%endisonlist,%tison,32) } inc %i } } else { if ($isco($2)) { set %endisonlist $2 } } sw $sockname : $+ %me 303 $socknick($sockname) : $+ %endisonlist } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif (($1 == HELP) || ($1 == HELPOP)) { ;<- :besancon.fr.epiknet.org 294 G-FACTION :Your help-request has been forwarded to Help Operators if ($2) { if ($left($2,1) == $chr(63)) { if ($2 == $chr(63)) { ghelp index $sockname sw $sockname : $+ %me NOTICE $socknick($sockname) :*** NOTE: As a helpop you have to prefix your text with ? to query the help system, like: /helpop ?usercmds halt } set %hlpstr $right($2,$calc($len($2) - 1)) if (%hlpstr == index) { set %hlpstr error } ghelp %hlpstr $sockname } else { set %hlpstr $2 if (%hlpstr == index) { set %hlpstr error } ghelp %hlpstr $sockname } } else { ghelp index $sockname sw $sockname : $+ %me NOTICE $socknick($sockname) :*** NOTE: As a helpop you have to prefix your text with ? to query the help system, like: /helpop ?usercmds } } elseif ($1 == ADMIN) { :admin admin $sockname } elseif ($1 == RULES) { rules $sockname } elseif ($1 == VHOST) { if ($3) { set %vlogin $2 set %vpass $3 if ($isvhostlogin(%vlogin)) { set %tvhost %vhost_ [ $+ [ %vlogin ] ] if ($goodvhosthost(%vlogin,$fullhost($sockname))) { if ($vhostlogpass(%vlogin,%vpass)) { umodesrv $chr(43) $socknick($sockname) x umodesrv $chr(43) $socknick($sockname) t set %host_ [ $+ [ $sockname ] ] %tvhost sw $sockname : $+ %me MODE $socknick($sockname) :+tx sw $sockname : $+ %me NOTICE $socknick($sockname) :*** Your vhost is %tvhost sendpeoplesnomask v [vhost] %vlogin ( $+ $vraiefullhost($sockname) $+ ) is now using vhost %tvhost } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** [vhost] Login for %vlogin failed - password incorrect sendpeoplesnomask v [vhost] Failed login for vhost %vlogin by $vraiefullhost($sockname) - incorrect password } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** [vhost] Login for %vlogin failed - password incorrect sendpeoplesnomask v [vhost] Failed login for vhost %vlogin by $vraiefullhost($sockname) - incorrect password } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** [vhost] Login for %vlogin failed - password incorrect sendpeoplesnomask v [vhost] Failed login for vhost %vlogin by $vraiefullhost($sockname) - incorrect password } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == CREDITS) { credits $sockname } elseif ($1 == INFO) { info $sockname } elseif ($1 == SETNAME) { if ($2) { if ($len($2-) <= 50) { set %realname_ [ $+ [ $socknick($sockname) ] ] $2- sw $sockname : $+ %me NOTICE $socknick($sockname) :Your "real name" (GCOS) is now set to be $2- - you have to set it manually to undo it } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetName Error: "Real names" may maximum be 50 characters of length } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == WATCH) { if ($2) { set %watch.pos $positivewatch($2-) set %watch.neg $negativewatch($2-) ;delwatchedlist $sockname %watch.neg ;addwatchedlist $sockname %watch.pos var %i 1 var %o 1 set %tok1 $gettok(%watch.pos,0,32) set %tok2 $gettok(%watch.neg,0,32) while (%i <= %tok1) { set %twatch $gettok(%watch.pos,%i,32) addwatchedlist %sockname_ [ $+ [ %twatch ] ] $socknick($sockname) if ($isco(%twatch)) { sw $sockname : $+ %me 604 $socknick($sockname) %twatch %identd_ [ $+ [ %twatch ] ] %host_ [ $+ [ %sockname_ [ $+ [ %twatch ] ] ] ] $signon(%sockname_ [ $+ [ %twatch ] ]) :is online } else { sw $sockname : $+ %me 604 $socknick($sockname) %twatch * * 0 :is offline } inc %i } while (%o <= %tok2) { set %twatch $gettok(%watch.neg,%o,32) delwatchedlist %sockname_ [ $+ [ %twatch ] ] $socknick($sockname) if ($isco(%twatch)) { sw $sockname : $+ %me 602 $socknick($sockname) %twatch %identd_ [ $+ [ %twatch ] ] %host_ [ $+ [ %sockname_ [ $+ [ %twatch ] ] ] ] $signon(%sockname_ [ $+ [ %twatch ] ]) :stopped watching } else { sw $sockname : $+ %me 602 $socknick($sockname) %twatch * * 0 :stopped watching } inc %o } } else { sw $sockname : $+ %me 607 $socknick($sockname) :End of WATCH l } } elseif ($1 == TOPIC) { if ($2) { if ($3) { set %chnick $socknick($sockname) set %operoverride $false if (%ircop_ [ $+ [ %chnick ] ]) { set %tflags %oline. [ $+ [ %ircop_ [ $+ [ %chnick ] ] ] ] [ $+ [ .flags ] ] if (v isincs %tflags) { set %operoverride $true } } set %tchan $2 set %tchmodes $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) if (t isincs %tchmodes) { if (!$isatleast(h,%chnick,%tchan)) { if (!%operoverride) { sw $sockname : $+ %me 482 %chnick %tchan :You're not channel operator halt } } } set %ttopic $right($3-,$calc($len($3-) - 1)) writeini -n $nfochanfile(%tchan) MISC topic $left(%ttopic,%topiclen) writeini -n $nfochanfile(%tchan) MISC ttime $ctime writeini -n $nfochanfile(%tchan) MISC tuser %chnick sendchannel %tchan : $+ $fullhost($sockname) TOPIC %tchan : $+ $left(%ttopic,%topiclen) } else { if ($ttopic($2)) { topic $2 $socknick($sockname) } else { sw $sockname : $+ %me 331 $socknick($sockname) $2 :No topic is set. } } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == LIST) { set %tnick $socknick($sockname) sw $sockname : $+ %me 321 %tnick Channel :Users Name if (!$exists($chanlistfile)) { goto listend } if ($2) { set %option $2 if ($left(%option,1) == $chr(42)) { ;Alors il fait une recherche en wildcards set %clf $chanlistfile var %file $gopen(%clf) while ($fread(%file)) { set %tchan $ifmatch if (%option iswm %tchan) { set %tchmodes $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) if ($replacecs(%tchmodes,s,0,p,0) == %tchmodes) { unset %ircop if (%ircop_ [ $+ [ %tnick ] ]) { set %ircop $true } if ((s !isincs %tchmodes) || (p !isincs %tchmodes) ($ison(%tnick,%tchan)) || (%ircop)) { ;<- :besancon.fr.epiknet.org 322 G-FACTION #besancon 17 :[+ntrSf] bienvenue dans la grotte de l sw $sockname : $+ %me 322 %tnick %tchan $lines($chanfile(%tchan)) : $+ $iif(%tchmodes,[+ $+ $replacecs(%tchmodes,1,N,2,L,3,S,4,C,5,T) $+ $chr(93) $ttopic(%tchan),) } } } } .fclose %file } elseif (($left(%option,1) == $chr(60)) || ($left(%option,1) == $chr(62))) { ;Alors il fait une recherche avec un nombre d'utilisateurs var %i 0 set %clf $chanlistfile var %file $gopen(%clf) if ($left(%option,1) == $chr(60)) { ;< set %lsigne neg set %larg $gettok(%option,1,60) } elseif ($left(%option,1) == $chr(62)) { ;> set %lsigne pos set %larg $gettok(%option,1,62) } while ($fread(%file)) { inc %i set %tchan $ifmatch if (%lsigne == pos) { if ($lines($chanfile(%tchan)) > %larg) { unset %ircop if (%ircop_ [ $+ [ %tnick ] ]) { set %ircop $true } if ((s !isincs $chmodes(%tchan)) || (p !isincs $chmodes(%tchan)) || ($ison(%tnick,%tchan)) || (%ircop)) { sw $sockname : $+ %me 322 %tnick %tchan $lines($chanfile(%tchan)) : $+ $iif($chmodes(%tchan),[+ $+ $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) $+ $chr(93) $ttopic(%tchan),) } } } elseif (%lsigne == neg) { if ($lines($chanfile(%tchan)) < %larg) { unset %ircop if (%ircop_ [ $+ [ %tnick ] ]) { set %ircop $true } if ((s !isincs $chmodes(%tchan)) || (p !isincs $chmodes(%tchan)) || ($ison(%tnick,%tchan)) || (%ircop)) { sw $sockname : $+ %me 322 %tnick %tchan $lines($chanfile(%tchan)) : $+ $iif($chmodes(%tchan),[+ $+ $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) $+ $chr(93) $ttopic(%tchan),) } } } } .fclose %file } elseif ($left(%option,1) == $chr(33)) { set %larg $gettok(%option,1,33) set %clf $chanlistfile var %file $gopen(%clf) while ($fread(%file)) { set %tchan $ifmatch if (%larg !iswm %tchan) { set %tchmodes $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) if ($replacecs(%tchmodes,s,0,p,0) == %tchmodes) { ;<- :besancon.fr.epiknet.org 322 G-FACTION #besancon 17 :[+ntrSf] bienvenue dans la grotte de l sw $sockname : $+ %me 322 %tnick %tchan $lines($chanfile(%tchan)) :[+ $+ %tchmodes $+ $chr(93) $ttopic(%tchan) } } } .fclose %file } } else { set %clf $chanlistfile var %file $gopen(%clf) while ($fread(%file)) { set %tchan $ifmatch set %tchmodes $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) sw $sockname : $+ %me 322 %tnick %tchan $lines($chanfile(%tchan)) :[+ $+ %tchmodes $+ $chr(93) $ttopic(%tchan) } .fclose %file } :listend sw $sockname : $+ %me 323 %tnick :End of /LIST } elseif ($1 == CYCLE) { if ($2) { part $sockname PART $2 :cycling join $sockname JOIN $2 } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } elseif ($1 == LINKS) { sw $sockname : $+ %me 364 $socknick($sockname) %me %me :0 %me.info sw $sockname : $+ %me 365 $socknick($sockname) * :End of /LINKS list. } elseif ($1 == TIME) { sw $sockname : $+ %me 391 $socknick($sockname) %me : $+ $gdate } elseif ($1 == WHOWAS) { if ($2) { set %wwnick $2 if ($exists($whowas.file)) { if ($whowas.exists(%wwnick)) { if (%ircop_ [ $+ [ $socknick($sockname) ] ]) { sw $sockname : $+ %me 314 $socknick($sockname) %wwnick $whowas.vraiehost(%wwnick) } else { sw $sockname : $+ %me 314 $socknick($sockname) %wwnick $whowas.host(%wwnick) } sw $sockname : $+ %me 312 $socknick($sockname) %wwnick $whowas.server(%wwnick) } else { sw $sockname : $+ %me 406 $socknick($sockname) %wwnick :There was no such nickname } sw $sockname : $+ %me 369 $socknick($sockname) %wwnick :End of WHOWAS } else { sw $sockname : $+ %me 406 $socknick($sockname) %wwnick :There was no such nickname sw $sockname : $+ %me 369 $socknick($sockname) %wwnick :End of WHOWAS } } else { sw $sockname : $+ %me 431 $socknick($sockname) :No nickname given } } elseif ($1 == NICK) { if ($2) { ;<- :besancon.fr.epiknet.org 431 G-FACTION :No nickname given set %oldnick $socknick($sockname) set %newnick $right($2,$calc($len($2) - 1)) if (!$correctnickname(%newnick)) { sw $sockname : $+ %me 432 %oldnick $2 :Erroneous Nickname: Illegal characters - Not allowed by the G-NORM halt } if (!$isco(%newnick)) { set %operoverride $false if (%ircop_ [ $+ [ %oldnick ] ]) { set %tflags %oline. [ $+ [ %ircop_ [ $+ [ %oldnick ] ] ] ] [ $+ [ .flags ] ] if (v isincs %tflags) { set %operoverride $true } } if (($nnullepart(%oldnick) == $true) || (%operoverride)) { ;Il est libre remove debug.txt write debug.txt Il est libre ! ;Envoyer une notice à toutes les personnes qui ont le snomask 'n' sendpeoplesnomask n *** Notice -- %oldnick ( $+ $gettok($fullhost(%sockname_ [ $+ [ %oldnick ] ]),2,33) $+ ) has changed his/her nickname to %newnick set %oldfullhost $fullhost($sockname) set %realname_ [ $+ [ %newnick ] ] %realname_ [ $+ [ %oldnick ] ] set %nick_ [ $+ [ %newnick ] ] %nick_ [ $+ [ %oldnick ] ] if (%ircop_ [ $+ [ %oldnick ] ]) { set %ircop_ [ $+ [ %newnick ] ] %ircop_ [ $+ [ %oldnick ] ] } set %snomask_ [ $+ [ %newnick ] ] %snomask_ [ $+ [ %oldnick ] ] set %umodes_ [ $+ [ %newnick ] ] %umodes_ [ $+ [ %oldnick ] ] set %identd_ [ $+ [ %newnick ] ] %identd_ [ $+ [ %oldnick ] ] set %server_ [ $+ [ %newnick ] ] %server_ [ $+ [ %oldnick ] ] set %sockname_ [ $+ [ %newnick ] ] %sockname_ [ $+ [ %oldnick ] ] set %nick_of_sockname_ [ $+ [ $sockname ] ] %newnick unset %realname_ [ $+ [ %oldnick ] ] unset %nick_of_sockname_ [ $+ [ %oldnick ] ] unset %nick_ [ $+ [ %oldnick ] ] unset %ircop_ [ $+ [ %oldnick ] ] unset %snomask_ [ $+ [ %oldnick ] ] unset %identd_ [ $+ [ %oldnick ] ] unset %server_ [ $+ [ %oldnick ] ] unset %sockname_ [ $+ [ %oldnick ] ] whowas.add.private $sockname write debug.txt Variables modifiées ! ;Modifier la liste des users du serveur delservnick %oldnick addservnick %newnick write debug.txt Liste des users du serveur modifiée ! ;Modifier la liste des IRCops if (%ircop_ [ $+ [ %newnick ] ]) { delircoplist %oldnick addircoplist %newnick } write debug.txt Liste des IRCops modifiée ! ;Envoi à tous les users du réseau ayant des chans commun avec lui set %nchans %chans_ [ $+ [ $sockname ] ] unset %ghosts set %ulf $userslistfile var %file $gopen(%ulf) var %i 0 while ($fread(%file)) { ;<- :kaline1-reveuse!~ptitchato@EpiK-18A5E41B.adsl.skynet.be NICK :kaline1-nongrague inc %i set %r $ifmatch echo -a r: %r if ($comchans(%nchans,%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ])) { if ($sock(%sockname_ [ $+ [ %r ] ])) { sw %sockname_ [ $+ [ %r ] ] : $+ %oldfullhost NICK : $+ %newnick } else { set %tsock $+(gserv.,$passerelle(%server_ [ $+ [ %r ] ])) if ($sock(%tsock)) { sw %tsock : $+ %oldnick NICK : $+ %newnick } else { set %ghosts $addtok(%ghosts,%i,32) } } } else { echo -a passé dans le else... if (%r == %newnick) { echo -a passé dans le oldnick... sw $sockname : $+ %oldfullhost NICK : $+ %newnick } } } .fclose %file write debug.txt While d'envoi de NICK passée ! var %y 1 set %gtk $gettok(%ghosts,0,32) while (%y <= %gtk) { write -dl $+ $gettok(%ghosts,%y,32) %ulf inc %y } write debug.txt While de ghosts passée ! ;Modifier son nick dans la nicklist de tous les chans où il est set %nbdchans $numtok(%nchans,32) if (%nbdchans) { var %o 1 write debug.txt 1 while (%o <= %nbdchans) { set %ntchan $gettok(%nchans,%o,32) write debug.txt 2 ntchan: %ntchan set %ncf $chanfile(%ntchan) if (!$exists(%ncf)) { goto nickend } var %u 0 var %file $gopen(%ncf) while ($fread(%file)) { inc %u set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) if (%tempnick == %oldnick) { write -dl $+ %u %ncf write %ncf $left(%r,1) $+ %newnick } } else { set %tempnick %r if (%tempnick == %oldnick) { write -dl $+ %u %ncf write %ncf %newnick } } } .fclose %file set %ntempstsm $readini($nfochanfile(%ntchan),STSM,%oldnick) remini $nfochanfile(%ntchan) STSM %oldnick writeini -n $nfochanfile(%ntchan) STSM %newnick %ntempstsm :nickend inc %o } } sendmultiserver : $+ %oldnick NICK : $+ %newnick } else { ;447 G-FACTION[GTASA] :Can not change nickname while on #G-FACTION (+N) sw $sockname : $+ %me 447 %oldnick :Can not change nickname while on $ifmatch (+N) } } else { ;433 G-FACTION G-FACTION[GTASA] :Nickname is already in use. sw $sockname : $+ %me 433 %oldnick :Nickname is already in use. } } else { sw $sockname : $+ %me 431 $socknick($sockname) :No nickname given } } elseif ($1 == PING) { if ($2) { sw $sockname : $+ %me PONG %me : $+ $2 } else { sw $sockname : $+ %me 409 $socknick($sockname) :No origin specified } } elseif ($1 == WALLOPS) { set %wanick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %wanick ] ]) { set %ulf $userslistfile var %file $gopen(%ulf) while ($fread(%file)) { set %r $ifmatch if (w isincs %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ $fullhost($sockname) WALLOPS $2- } } } .fclose %file sendmultiserver : $+ %wanick WALLOPS $2- } else { sw $sockname : $+ %me 481 %wanick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %wanick $1 :Not enough parameters } } elseif ($1 == GLOBOPS) { set %glnick $socknick($sockname) set %glmess $right($2-,$calc($len($2-) - 1)) if ($2) { if (%ircop_ [ $+ [ %glnick ] ]) { set %ilf $ircoplistfile if (!$exists(%ilf)) { goto globopsend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %glnick :*** Global -- from %glnick $+ : %glmess } } .fclose %file :globopsend } else { sw $sockname : $+ %me 481 %glnick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %glnick $1 :Not enough parameters } } elseif ($1 == CHATOPS) { set %chnick $socknick($sockname) set %chmess $2- if ($2) { if (%ircop_ [ $+ [ %chnick ] ]) { set %ilf $ircoplistfile if (!$exists(%ilf) { goto chatopsend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %chnick :*** ChatOps -- from %chnick $+ : %chmess } } .fclose %ilf :chatopsend } else { sw $sockname : $+ %me 481 %chnick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %chnick $1 :Not enough parameters } } elseif ($1 == LOCOPS) { set %lonick $socknick($sockname) set %lomess $right($2-,$calc($len($2-) - 1)) if ($2) { if (%ircop_ [ $+ [ %lonick ] ]) { set %ilf $ircoplistfile if (!$exists(%ilf)) { goto locopsend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %lonick :*** LocOps -- from %lonick $+ : %lomess } } } .fclose %file :locopsend } else { sw $sockname : $+ %me 481 %lonick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %lonick $1 :Not enough parameters } } elseif ($1 == ADCHAT) { set %lonick $socknick($sockname) set %lomess $2- if ($2) { if (%ircop_ [ $+ [ %lonick ] ]) { set %ilf $ircoplistfile if (!$exists(%ilf)) { goto adchatend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (A isin %umodes_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %lonick :*** AdminChat -- from %lonick $+ : %lomess } } .fclose %file :adchatend } else { sw $sockname : $+ %me 481 %lonick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %lonick $1 :Not enough parameters } } elseif ($1 == NACHAT) { set %lonick $socknick($sockname) set %lomess $2- if ($2) { if (%ircop_ [ $+ [ %lonick ] ]) { set %ilf $ircoplistfile if (!$exists(%ilf)) { goto nachatend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (N isin %umodes_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %lonick :*** NetAdmin.Chat -- from %lonick $+ : %lomess } } .fclose %file :nachatend } else { sw $sockname : $+ %me 481 %lonick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 461 %lonick $1 :Not enough parameters } } elseif ($1 == KILL) { set %knick $socknick($sockname) if ($3) { set %kmess $right($3-,$calc($len($3-) - 1)) if ($isco($2)) { if (%ircop_ [ $+ [ %knick ] ]) { set %kflags %oline. [ $+ [ %ircop_ [ $+ [ %knick ] ] ] ] [ $+ [ .flags ] ] ;Là on met seulement du local kill puisque les links n'éxistent pas encore if (k isin %kflags) { var %a $true echo -a a if (!$sock(%sockname_ [ $+ [ $2 ] ])) { if (%server_ [ $+ [ $2 ] ] != %me) { var %a $false sw gserv. $+ $ifmatch : $+ %knick KILL $2 : $+ %host_ [ $+ [ $sockname ] ] $+ $chr(33) $+ %knick ( $+ %kmess $+ ) ;:G-FACTION KILL huhut :netadmin.G-SERVER.net!G-FACTION (:p) } } echo -a b if (%a) { sw %sockname_ [ $+ [ $2 ] ] : $+ $fullhost($sockname) KILL $2 : $+ %knick } echo -a c set %quitchans %chans_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] set %qfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %qnick $socknick(%sockname_ [ $+ [ $2 ] ]) set %qserv %server_ [ $+ [ $socknick(%sockname_ [ $+ [ $2 ] ]) ] ] set %truc %sockname_ [ $+ [ $2 ] ] set %quitraison_ [ $+ [ %truc ] ] $chr(91) $+ %me $+ $chr(93) Local kill by %knick ( $+ %kmess $+ ) sendpeoplesnomask k *** Notice -- Received KILL message for $fullhost(%truc) from %knick Path: %me $+ ! $+ %knick ( $+ %kmess $+ ) sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ %truc ] ] sockclose2 %truc gquit %truc $chr(91) $+ %me $+ $chr(93) Local kill by %knick ( $+ %kmess $+ ) %truc } else { sw $sockname : $+ %me 481 %knick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %knick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 401 %knick $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 %knick $1 :Not enough parameters } } elseif ($1 == KLINE) { set %knick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %knick ] ]) { set %kflags %oline. [ $+ [ %ircop_ [ $+ [ %knick ] ] ] ] [ $+ [ .flags ] ] if (b isincs %kflags) { if ($left($2,1) != $chr(45)) { ;Pour adder une k:line ;kline <host ou nick> temps raison if ($chr(64) isin $2) { if ($left($2,1) == $chr(43)) { set %khost $right($2,$calc($len($2) - 1)) } else { set %khost $2 } } else { if ($left($2,1) == $chr(43)) { set %khost $right($2,$calc($len($2) - 1)) } else { set %khost $2 } if ($isco($2)) { set %khost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] } else { sw $sockname : $+ %me 401 %knick %khost :No such nick/channel halt } } set %tsecs $duration($replace($3,d,d $+ $chr(32),h,h $+ $chr(32),m,m $+ $chr(32),s,s $+ $chr(32))) if (!$len($kline.infos(%khost))) { if ((%tsecs != 0) && (%tsecs != 0secs) && (%tsecs)) { ;Bon format de durée ;kline.add host $dctime timetoexpire host_klineur raison ; 1 2 3 4 5 set %tasctime $ctime set %treason $iif($len($4-),$4-,no reason) kline.add %khost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** K:Line added for %khost on $asctime(%tasctime) GMT (from $fullhost($sockname) to expire at $asctime($calc(%tasctime + %tsecs)) GMT: %treason $+ ) } else { ;Permanent k:line ! set %tasctime $ctime set %tsecs 0 set %treason $iif($len($4-),$4-,no reason) kline.add %khost %tasctime 0 $fullhost($sockname) %treason sendpeoplesnomask G *** Permanent K:Line added for %khost on $asctime(%tasctime) GMT (from $fullhost($sockname) $+ : %treason $+ ) } } else { halt } } else { ;Il s'agit d'un removal de k:line set %khost $right($2,$calc($len($2) - 1)) if ($chr(64) isin %khost) { set %khost %khost } else { if ($isco(%khost)) { set %khost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ %khost ] ] ] ] } else { sw $sockname : $+ %me 401 %knick %khost :No such nick/channel } } if ($kline.infos(%khost)) { ;Elle existe en effet set %kinfos $kline.infos(%khost) set %setat $asctime($gettok(%kinfos,1,32)) set %kreason $gettok(%kinfos,4-,32) kline.del %khost globops $fullhost($sockname) removed K:Line %khost (set at %setat - reason: %kreason $+ ) } } } else { sw $sockname : $+ %me 481 %knick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %knick :Permission Denied- You do not have the correct IRC operator privileges } } else { if (%ircop_ [ $+ [ %knick ] ]) { stats K $sockname } else { sw $sockname : $+ %me 481 %knick :Permission Denied- You do not have the correct IRC operator privileges } } } elseif ($1 == GLINE) { set %gnick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %gnick ] ]) { set %gflags %oline. [ $+ [ %ircop_ [ $+ [ %gnick ] ] ] ] [ $+ [ .flags ] ] if (t isincs %gflags) { if ($left($2,1) != $chr(45)) { ;Pour adder une g:line ;gline <host ou nick> temps raison if ($chr(64) isin $2) { if ($left($2,1) == $chr(43)) { set %ghost $right($2,$calc($len($2) - 1)) } else { set %ghost $2 } } else { if ($left($2,1) == $chr(43)) { set %ghost $right($2,$calc($len($2) - 1)) } else { set %ghost $2 } if ($isco(%ghost)) { set %ghost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] } else { sw $sockname : $+ %me 401 %gnick %ghost :No such nick/channel halt } } set %tsecs $duration($replace($3,d,d $+ $chr(32),h,h $+ $chr(32),m,m $+ $chr(32),s,s $+ $chr(32))) if (!$len($gline.infos(%ghost))) { if ((%tsecs != 0) && (%tsecs != 0secs) && (%tsecs)) { ;Bon format de durée ;gline.add host $ctime timetoexpire host_glineur raison ; 1 2 3 4 5 set %tasctime $ctime set %treason $iif($len($4-),$4-,no reason) gline.add %ghost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** G:Line added for %ghost on $asctime(%tasctime) GMT (from $fullhost($sockname) to expire at $asctime($calc(%tasctime + %tsecs)) GMT: %treason $+ ) set %quitchans %chans_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] set %qfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %qnick $socknick(%sockname_ [ $+ [ $2 ] ]) set %qserv %server_ [ $+ [ $socknick(%sockname_ [ $+ [ $2 ] ]) ] ] set %truc %sockname_ [ $+ [ $2 ] ] set %quitraison_ [ $+ [ %truc ] ] User has been banned from %network ( $+ %treason $+ ) sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ %truc ] ] sockclose2 %truc gquit %truc User has been banned from %network ( $+ %treason $+ ) %truc } else { ;Permanent g:line ! set %tasctime $ctime set %tsecs 0 set %treason $iif($len($4-),$4-,no reason) gline.add %ghost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** Permanent G:Line added for %ghost on $asctime(%tasctime) GMT (from $fullhost($sockname) $+ : %treason $+ ) set %quitchans %chans_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] set %qfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %qnick $socknick(%sockname_ [ $+ [ $2 ] ]) set %qserv %server_ [ $+ [ $socknick(%sockname_ [ $+ [ $2 ] ]) ] ] set %truc %sockname_ [ $+ [ $2 ] ] set %quitraison_ [ $+ [ %truc ] ] User has been permanently banned from %network ( $+ %treason $+ ) sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ %truc ] ] sockclose2 %truc gquit %truc User has been permanently banned from %network ( $+ %treason $+ ) %truc } } else { halt } } else { ;Il s'agit d'un removal de g:line set %ghost $right($2,$calc($len($2) - 1)) if ($chr(64) isin %ghost) { set %ghost %ghost } else { if ($isco(%ghost)) { set %ghost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ %ghost ] ] ] ] } else { sw $sockname : $+ %me 401 %gnick %ghost :No such nick/channel } } if ($gline.infos(%ghost)) { ;Elle existe en effet set %ginfos $gline.infos(%ghost) set %setat $asctime($gettok(%ginfos,1,32)) set %greason $gettok(%ginfos,4-,32) gline.del %ghost globops $fullhost($sockname) removed G:Line %ghost (set at %setat - reason: %greason $+ ) } } } else { sw $sockname : $+ %me 481 %gnick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %gnick :Permission Denied- You do not have the correct IRC operator privileges } } else { if (%ircop_ [ $+ [ %gnick ] ]) { stats G $sockname } else { sw $sockname : $+ %me 481 %gnick :Permission Denied- You do not have the correct IRC operator privileges } } } elseif ($1 == STATS) { if ($2) { stats $2 $sockname } else { statshelp $sockname } } elseif ($1 == ZLINE) { set %znick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %znick ] ]) { set %zflags %oline. [ $+ [ %ircop_ [ $+ [ %znick ] ] ] ] [ $+ [ .flags ] ] if (z isincs %zflags) { if ($left($2,1) != $chr(45)) { ;Pour adder une k:line ;kline <host ou nick> temps raison if ($chr(64) isin $2) { if ($left($2,1) == $chr(43)) { set %zhost $right($2,$calc($len($2) - 1)) } else { set %zhost $2 } } else { if ($left($2,1) == $chr(43)) { set %zhost $right($2,$calc($len($2) - 1)) } else { set %zhost $2 } if ($isco($2)) { set %zhost *@ $+ $sock(%sockname_ [ $+ [ $2 ] ]).ip } else { sw $sockname : $+ %me 401 %znick %zhost :No such nick/channel halt } } set %tsecs $duration($replace($3,d,d $+ $chr(32),h,h $+ $chr(32),m,m $+ $chr(32),s,s $+ $chr(32))) if (!$len($zline.infos(%zhost))) { if ((%tsecs != 0) && (%tsecs != 0secs) && (%tsecs)) { ;Bon format de durée ;zline.add host $dctime timetoexpire host_zlineur raison ; 1 2 3 4 5 set %tasctime $ctime set %treason $iif($len($4-),$4-,no reason) zline.add %zhost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** Z:Line added for %zhost on $asctime(%tasctime) GMT (from $fullhost($sockname) to expire at $asctime($calc(%tasctime + %tsecs)) GMT: %treason $+ ) } else { ;Permanent z:line ! set %tasctime $ctime set %tsecs 0 set %treason $iif($len($4-),$4-,no reason) zline.add %zhost %tasctime 0 $fullhost($sockname) %treason sendpeoplesnomask G *** Permanent Z:Line added for %zhost on $asctime(%tasctime) GMT (from $fullhost($sockname) $+ : %treason $+ ) } } else { halt } } else { ;Il s'agit d'un removal de z:line set %zhost $right($2,$calc($len($2) - 1)) if ($chr(64) isin %zhost) { set %zhost %zhost } else { if ($isco(%zhost)) { set %zhost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ %zhost ] ] ] ] } else { sw $sockname : $+ %me 401 %znick %zhost :No such nick/channel halt } } if ($zline.infos(%zhost)) { ;Elle existe en effet set %zinfos $zline.infos(%zhost) set %setat $asctime($gettok(%zinfos,1,32)) set %zreason $gettok(%zinfos,4-,32) zline.del %zhost globops $fullhost($sockname) removed Z:Line %zhost (set at %setat - reason: %zreason $+ ) } } } else { sw $sockname : $+ %me 481 %znick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %znick :Permission Denied- You do not have the correct IRC operator privileges } } else { if (%ircop_ [ $+ [ %znick ] ]) { stats z $sockname } else { sw $sockname : $+ %me 481 %znick :Permission Denied- You do not have the correct IRC operator privileges } } } elseif ($1 == GZLINE) { set %gznick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %gznick ] ]) { set %gzflags %oline. [ $+ [ %ircop_ [ $+ [ %gznick ] ] ] ] [ $+ [ .flags ] ] if (Z isincs %gzflags) { if ($left($2,1) != $chr(45)) { ;Pour adder une gz:line ;gzline <host ou nick> temps raison if ($chr(64) isin $2) { if ($left($2,1) == $chr(43)) { set %gzhost $right($2,$calc($len($2) - 1)) } else { set %gzhost $2 } } else { if ($left($2,1) == $chr(43)) { set %gzhost $right($2,$calc($len($2) - 1)) } else { set %gzhost $2 } if ($isco($2)) { set %gzhost *@ $+ $sock(%sockname_ [ $+ [ $2 ] ]).ip } else { sw $sockname : $+ %me 401 %gznick %gzhost :No such nick/channel halt } } set %tsecs $duration($replace($3,d,d $+ $chr(32),h,h $+ $chr(32),m,m $+ $chr(32),s,s $+ $chr(32))) if (!$len($gzline.infos(%gzhost))) { if ((%tsecs != 0) && (%tsecs != 0secs) && (%tsecs)) { ;Bon format de durée ;gzline.add host $ctime timetoexpire host_gzlineur raison ; 1 2 3 4 5 set %tasctime $ctime set %treason $iif($len($4-),$4-,no reason) gzline.add %gzhost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** Global Z:Line added for %ghost on $asctime(%tasctime) GMT (from $fullhost($sockname) to expire at $asctime($calc(%tasctime + %tsecs)) GMT: %treason $+ ) set %quitchans %chans_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] set %qfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %qnick $socknick(%sockname_ [ $+ [ $2 ] ]) set %qserv %server_ [ $+ [ $socknick(%sockname_ [ $+ [ $2 ] ]) ] ] set %truc %sockname_ [ $+ [ $2 ] ] set %quitraison_ [ $+ [ %truc ] ] Z:lined ( $+ %treason $+ ) sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ %truc ] ] sockclose2 %truc gquit %truc Z:lined ( $+ %treason $+ ) %truc } else { ;Permanent gz:line ! set %tasctime $ctime set %tsecs 0 set %treason $iif($len($4-),$4-,no reason) gzline.add %gzhost %tasctime 0 $fullhost($sockname) %treason sendpeoplesnomask G *** Permanent Global Z:Line added for %gzhost on $asctime(%tasctime) GMT (from $fullhost($sockname) $+ : %treason $+ ) set %quitchans %chans_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] set %qfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %qnick $socknick(%sockname_ [ $+ [ $2 ] ]) set %qserv_ [ $+ [ $socknick(%sockname_ [ $+ [ $2 ] ]) ] ] set %truc %sockname_ [ $+ [ $2 ] ] set %quitraison_ [ $+ [ %truc ] ] Z:lined ( $+ %treason $+ ) sendmultiserver : $+ %qnick QUIT : $+ %quitraison_ [ $+ [ %truc ] ] sockclose2 %truc gquit %truc Z:lined ( $+ %treason $+ ) %truc } } else { halt } } else { ;Il s'agit d'un removal de gz:line set %gzhost $right($2,$calc($len($2) - 1)) if ($chr(64) isin %gzhost) { set %gzhost %gzhost } else { if ($isco(%gzhost)) { set %gzhost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ %gzhost ] ] ] ] } else { sw $sockname : $+ %me 401 %gznick %gzhost :No such nick/channel halt } } if ($gzline.infos(%gzhost)) { ;Elle existe en effet set %gzinfos $gzline.infos(%gzhost) set %setat $asctime($gettok(%gzinfos,1,32)) set %gzreason $gettok(%gzinfos,4-,32) gzline.del %gzhost globops $fullhost($sockname) removed Global Z:Line %gzhost (set at %setat - reason: %gzreason $+ ) } } } else { sw $sockname : $+ %me 481 %gznick :Permission Denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %gznick :Permission Denied- You do not have the correct IRC operator privileges } } else { if (%ircop_ [ $+ [ %gznick ] ]) { stats Z $sockname } else { sw $sockname : $+ %me 481 %gznick :Permission Denied- You do not have the correct IRC operator privileges } } } elseif ($1 == SETIDENT) { ;<- :irc.G-SERVER.net NOTICE G-FACTION :Your nick!user@host-mask is now (G-FACTION!lol@G-SERVER-5D1944FA) - To disable ident set change it manually by /setident'ing again ;SETIDENT <new ident> set %identnick $socknick($sockname) if (%ircop_ [ $+ [ %identnick ] ]) { if ($2) { if ($len($2-) <= 10) { if ($norme($2)) { set %identd_ [ $+ [ $socknick($sockname) ] ] $2 sw $sockname : $+ %me NOTICE $socknick($sockname) :Your nick!user@host-mask is now $chr(40) $+ $fullhost($sockname) $+ $chr(41) - To disable ident set change it manually by /setident'ing again } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetIdent Error: A username may contain a-z, A-Z, 0-9, '-', '~' & '.' - Please only use them } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetIdent Error: Usernames are limited to 10 characters. } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %identnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == CHGNAME) { ;CHGNAME NICK NEWNAME set %identnick $socknick($sockname) if (%ircop_ [ $+ [ %identnick ] ]) { if ($2) { if ($isco($2)) { if ($3) { if ($len($3-) <= 50) { set %realname_ [ $+ [ $2 ] ] $3- sw $sockname : $+ %me NOTICE $socknick($sockname) : $+ $2 $+ 's "real name" (GCOS) is now set to be $3- } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /ChgName Error: "Real names" may maximum be 50 characters of length } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 401 $socknick($sockname) $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %identnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == CHGIDENT) { ;CHGIDENT nick newident set %identnick $socknick($sockname) if (%ircop_ [ $+ [ %identnick ] ]) { if ($2) { if ($isco($2)) { if ($3) { if ($len($3-) <= 10) { if ($norme($replace($3,$chr(126),))) { set %identd_ [ $+ [ $2 ] ] $3 sw $sockname : $+ %me NOTICE $socknick($sockname) : $+ $2 $+ 's nick!user@host-mask is now $chr(40) $+ $fullhost($sockname) $+ $chr(41) } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /ChgIdent Error: A ident may contain a-z, A-Z, 0-9, '-', '~' & '.' - Please only use them } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetIdent Error: Usernames are limited to 10 characters. } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 401 $socknick($sockname) $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %identnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SETHOST) { ;sethost ma-new-host.net set %identnick $socknick($sockname) if (%ircop_ [ $+ [ %identnick ] ]) { if ($2) { if ($len($2) <= 63) { if ($norme($2)) { set %host_ [ $+ [ $sockname ] ] $2 sw $sockname : $+ %me NOTICE $socknick($sockname) :Your nick!user@host-mask is now $chr(40) $+ %host_ [ $+ [ $sockname ] ] $+ $chr(41) - To disable it type /mode %identnick -x } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetHost Error: A hostname may contain a-z, A-Z, 0-9, '-' & '.' - Please only use them } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /SetHost Error: Hostnames are limited to 63 characters. } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %identnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == CHGHOST) { ;chghost nick la-new-host.net set %identnick $socknick($sockname) if (%ircop_ [ $+ [ %identnick ] ]) { if ($3) { if ($isco($2)) { if ($len($3) <= 63) { if ($norme($3)) { set %host_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] $3 sw $sockname : $+ %me NOTICE $socknick($sockname) : $+ $2 $+ 's nick!user@host-mask is now $chr(40) $+ %host_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] $+ $chr(41) } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /ChgHost Error: A hostname may contain a-z, A-Z, 0-9, '-' & '.' - Please only use them } } else { sw $sockname : $+ %me NOTICE $socknick($sockname) :*** /ChgHost Error: Hostnames are limited to 63 characters. } } else { sw $sockname : $+ %me 401 $socknick($sockname) $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 $socknick($sockname) $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %identnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SDESC) { ;-> irc.G-SERVER.net SDESC haha ^^ ;<- :irc.G-SERVER.net NOTICE G-FACTION :Your "server description" is now set to be haha ^^ - you have to set it manually to undo it set %sdescnick $socknick($sockname) if (%ircop_ [ $+ [ %sdescnick ] ]) { if ($2) { set %me.info $2- sw $sockname : $+ %me NOTICE %sdescnick :Your "server description" is now set to be $2- - you have to set it manually to undo it } else { sw $sockname : $+ %me 461 %sdescnick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %sdescnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == DIE) { set %dienick $socknick($sockname) if (%ircop_ [ $+ [ %dienick ] ]) { set %dieflags %oline. [ $+ [ %ircop_ [ $+ [ %dienick ] ] ] ] [ $+ [ .flags ] ] if (D isincs %dieflags) { if ($2) { if ($2 == %diepass) { ;-> irc.G-SERVER.net DIE pass ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- Server Terminating by request of G-FACTION ;<- :irc.G-SERVER.net NOTICE G-FACTION :Server Terminating. G-FACTION ;<- :irc.G-SERVER.net NOTICE G-FACTION :Server Terminating. ;Envoyer les notices à tous les IRCops locaux set %ilf $userslistfile if (!$exists(%ilf)) { goto dieend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- Server Terminating by request of %dienick sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :Server Terminating. %dienick sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :Server Terminating. } } .fclose %file :dieend ;Fin crashserv } else { ;<- :irc.G-SERVER.net 464 G-FACTION :Password Incorrect sw $1 : $+ %me 464 %dienick :Password Incorrect } } else { sw $sockname : $+ %me 461 %dienick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %dienick :Permission denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %dienick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == RESTART) { set %dienick $socknick($sockname) if (%ircop_ [ $+ [ %dienick ] ]) { set %dieflags %oline. [ $+ [ %ircop_ [ $+ [ %dienick ] ] ] ] [ $+ [ .flags ] ] if (R isincs %dieflags) { if ($2) { if ($2 == %restartpass) { ;-> irc.G-SERVER.net RESTART pass ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- Server is Restarting by request of G-FACTION ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- Aieeeee!!! Restarting server... No reason ;Envoyer les notices à tous les IRCops locaux set %ilf $userslistfile if (!$exists(%ilf)) { goto restartend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- Server is Restarting by request of %dienick } if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- Aieeeee!!! Restarting server... $iif($3,$3-,No reason) } } } .fclose %file :restartend ;Fin restartserv } else { ;<- :irc.G-SERVER.net 464 G-FACTION :Password Incorrect sw $1 : $+ %me 464 %dienick :Password Incorrect } } else { sw $sockname : $+ %me 461 %dienick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %dienick :Permission denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %dienick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == REHASH) { ;rehash ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- G-FACTION is rehashing server config file ;<- :irc.G-SERVER.net 382 G-FACTION unrealircd.conf :Rehashing ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- Loading IRCd configuration .. ;<- :irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- Configuration loaded without any problems .. set %rhnick $socknick($sockname) if (%ircop_ [ $+ [ %rhnick ] ]) { set %rhflags %oline. [ $+ [ %ircop_ [ $+ [ %rhnick ] ] ] ] [ $+ [ .flags ] ] if (r isincs %rhflags) { sw $sockname : $+ %me 382 %rhnick g-ircd.g :Rehashing ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto rehashend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- %rhnick is rehashing server config file } } } .fclose %file :rehashend ;Fin rh %rhnick } else { sw $sockname : $+ %me 481 %rhnick :Permission denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %rhnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == LAG) { ;<- :irc.G-SERVER.net 461 G-FACTION LAG :Not enough parameters ;<- :irc.G-SERVER.net 402 G-FACTION hhh :No such server ;<- :irc.G-SERVER.net NOTICE G-FACTION :Lag reply -- irc.G-SERVER.net irc.g-server.net 1108233190 set %lagnick $socknick($sockname) if (%ircop_ [ $+ [ %lagnick ] ]) { if ($2) { if ($2 == %me) { ;Modifier cette condition lors du passage aux links sw $sockname : $+ %me NOTICE %lagnick :Lag reply -- %me $2 $ctime } else { sw $sockname : $+ %me 402 %lagnick :No such server } } else { sw $sockname : $+ %me 461 %lagnick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %lagnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SAJOIN) { ;join $sockname $1- set %joinnick $socknick($sockname) if (%ircop_ [ $+ [ %joinnick ] ]) { if ($3) { if ($isco($2)) { if ($left($3,1) == $chr(35)) { join %sockname_ [ $+ [ $2 ] ] JOIN $3 sw %sockname_ [ $+ [ $2 ] ] : $+ %me NOTICE $2 :*** You were forced to join $3 ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto sajoinend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- %joinnick used SAJOIN to make $2 join $3 } } } .fclose %file :sajoinend ;Fin } else { sw $sockname : $+ %me 403 %joinnick $3 :No such channel } } else { sw $sockname : $+ %me 421 %joinnick $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 %joinnick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %joinnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SAPART) { ;join $sockname $1- set %joinnick $socknick($sockname) if (%ircop_ [ $+ [ %joinnick ] ]) { if ($3) { if ($isco($2)) { if ($left($3,1) == $chr(35)) { part %sockname_ [ $+ [ $2 ] ] PART $3 sw %sockname_ [ $+ [ $2 ] ] : $+ %me NOTICE $2 :*** You were forced to part $3 ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto sapartend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- %joinnick used SAPART to make $2 part $3 } } } .fclose %file :sapartend ;Fin } else { sw $sockname : $+ %me 403 %joinnick $3 :No such channel } } else { sw $sockname : $+ %me 421 %joinnick $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 %joinnick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %joinnick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SAMODE) { ;SAMODE #chan +modes-.... ;applychmodesonrequest $sockname $2 $3- set %sanick $socknick($sockname) if (%ircop_ [ $+ [ %sanick ] ]) { set %saflags %oline. [ $+ [ %ircop_ [ $+ [ %sanick ] ] ] ] [ $+ [ .flags ] ] if (a isincs %saflags) { if ($3) { if ($chanexists($2)) { ;:*** Global -- from irc.G-SERVER.net: G-FACTION used SAMODE #G-FACTION (+i ) ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto samodeend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %sanick :*** Global -- from %me $+ : %sanick used SAMODE $2 ( $+ $3- $+ ) } } .fclose %file :samodeend ;Fin applychmodesonrequest $sockname $+ $chr(96) $+ %me $2- } else { sw $sockname : $+ %me 401 %sanick $2 :No such nick/channel } } else { sw $sockname : $+ %me 461 %sanick $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %sanick :Permission denied- You do not have the correct IRC operator privileges } } else { sw $sockname : $+ %me 481 %sanick :Permission denied- You do not have the correct IRC operator privileges } } elseif ($1 == SHUN) { set %snick $socknick($sockname) if ($2) { if (%ircop_ [ $+ [ %snick ] ]) { if ($left($2,1) != $chr(45)) { ;Pour adder un shun ;shun (+)<host ou nick> temps raison if ($chr(64) isin $2) { if ($left($2,1) == $chr(43)) { set %shost $right($2,$calc($len($2) - 1)) } else { set %shost $2 } } else { if ($left($2,1) == $chr(43)) { set %shost $right($2,$calc($len($2) - 1)) } else { set %shost $2 } if ($isco(%shost)) { set %shost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ $2 ] ] ] ] } else { sw $sockname : $+ %me 401 %snick %shost :No such nick/channel halt } } set %tsecs $duration($replace($3,d,d $+ $chr(32),h,h $+ $chr(32),m,m $+ $chr(32),s,s $+ $chr(32))) if (!$len($shun.infos(%shost))) { if ((%tsecs != 0) && (%tsecs != 0secs)) { ;Bon format de durée ;shun.add host $ctime timetoexpire host_shuner raison ; 1 2 3 4 5 set %tasctime $ctime set %treason $iif($len($4-),$4-,no reason) shun.add %shost %tasctime %tsecs $fullhost($sockname) %treason sendpeoplesnomask G *** Shun added for %shost on $asctime(%tasctime) GMT (from $fullhost($sockname) to expire at $asctime($calc(%tasctime + %tsecs)) GMT: %treason $+ ) } else { ;Permanent shun ! set %tasctime $ctime set %tsecs 0 set %treason $iif($len($4-),$4-,no reason) shun.add %shost %tasctime 0 $fullhost($sockname) %treason sendpeoplesnomask G *** Permanent Shun added for %shost on $asctime(%tasctime) GMT (from $fullhost($sockname) $+ : %treason $+ ) } } else { halt } } else { ;Il s'agit d'un removal de shun set %shost $right($2,$calc($len($2) - 1)) if ($chr(64) isin %shost) { set %shost %shost } else { if ($isco(%ghost)) { set %shost *@ $+ %vraiehost_ [ $+ [ %sockname_ [ $+ [ %shost ] ] ] ] } else { sw $sockname : $+ %me 401 %snick %shost :No such nick/channel } } if ($shun.infos(%shost)) { ;Elle existe en effet set %sinfos $shun.infos(%shost) set %setat $asctime($gettok(%sinfos,1,32)) set %sreason $gettok(%sinfos,4-,32) shun.del %shost globops $fullhost($sockname) removed Shun %shost (set at %setat - reason: %sreason $+ ) } } } else { sw $sockname : $+ %me 481 %snick :Permission Denied- You do not have the correct IRC operator privileges } } else { if (%ircop_ [ $+ [ %snick ] ]) { stats s $sockname } else { sw $sockname : $+ %me 481 %snick :Permission Denied- You do not have the correct IRC operator privileges } } } elseif ($1 == TEMPSHUN) { ;tempshun (+|-)nickname set %tsn $socknick($sockname) if (%ircop_ [ $+ [ %tsn ] ]) { if ($2) { if (($left($2,1) == $chr(43)) || ($left($2,1) == $chr(45))) { set %tsign $left($2,1) set %toshun $right($2,$calc($len($2) - 1)) } else { set %tsign $chr(43) set %toshun $2 } if ($isco(%toshun)) { if (%tsign == $chr(43)) { ;Ajouter %toshun à la liste des temp-shunned if (!$shunned(%toshun)) { tmpshun.add %toshun globops Temporary shun added on user %toshun ( $+ $gettok($vraiefullhost(%sockname_ [ $+ [ %toshun ] ]),2,$asc(!)) $+ ) by %tsn $chr(91) $+ $iif($3-,$3-,no reason) $+ $chr(93) } else { sw $sockname : $+ %me NOTICE %tsn :User ' $+ %toshun $+ ' already shunned } } else { ;Supprimer %toshun de la liste des temp-shunned if ($shunned(%toshun)) { tmpshun.del %toshun globops Removed temporary shun on user %toshun ( $+ $gettok($vraiefullhost(%sockname_ [ $+ [ %toshun ] ]),2,$asc(!)) $+ ) by %tsn } else { ;User 'g0d' is not shunned sw $sockname : $+ %me NOTICE %tsn :User ' $+ %toshun $+ ' is not shunned } } } else { sw $sockname : $+ %me 401 %tsn %toshun :No such nick/channel } } else { sw $sockname : $+ %me 461 %tsn $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %tsn :Permission Denied- You do not have the correct IRC operator privileges } } elseif ($1 == CONNECT) { ;connect server-bloc-name [port] set %connectnick $socknick($sockname) if (%ircop_ [ $+ [ %connectnick ] ]) { if ($2) { if (!$3) { if (%link_ [ $+ [ $2 ] ] [ $+ [ .port ] ]) { ;Ce bloc existe if ($len(%link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ]) >= 3) { set %tempsockname $+(gserv.,$2) sw $sockname : $+ %me NOTICE %connectnick :*** Connecting to $2 $+ $chr(91) $+ %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] $+ ]. echo -a 4set %connect_ [ $+ [ %tempsockname ] ] $sockname $2 %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] set %connect_ [ $+ [ %tempsockname ] ] $sockname $2 %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] sockopen %tempsockname %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] %link_ [ $+ [ $2 ] ] [ $+ [ .port ] ] } else { sw $sockname : $+ %me NOTICE %connectnick :*** Notice -- Host %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] unknown } } else { sw $sockname : $+ %me NOTICE %connectnick :*** Connect: Server $2 is not configured for linking } } else { if ($len(%link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ]) >= 3) { set %tempsockname $+(gserv.,$2) sw $sockname : $+ %me NOTICE %connectnick :*** Connecting to $2 $+ $chr(91) $+ %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] $+ ]. set %connect_ [ $+ [ %tempsockname ] ] $sockname $2 %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] sockopen %tempsockname %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] $3 } else { sw $sockname : $+ %me NOTICE %connectnick :*** Notice -- Host %link_ [ $+ [ $2 ] ] [ $+ [ .ip ] ] unknown } } } else { sw $sockname : $+ %me 461 %tsn $1 :Not enough parameters } } else { sw $sockname : $+ %me 481 %connectnick :Permission Denied- You do not have the correct IRC operator privileges } } elseif ($1 == MAP) { showmap $sockname } else { sw $sockname : $+ %me 421 $socknick($sockname) $1 :Unknown command } } else { if ($1 == NICK) { set %tnick $2 if ($correctnickname(%tnick)) { if (!$isco(%tnick)) { set %sockname_ [ $+ [ %tnick ] ] $sockname set %nick_of_sockname_ [ $+ [ $sockname ] ] %tnick set %nick_ [ $+ [ %tnick ] ] $true } else { ;<- :besancon.fr.epiknet.org 433 * G-FACTION :Nickname is already in use. ;sw $sockname : $+ %me 433 * %tnick :Nickname is already in use. sw $sockname ERROR :Closing Link: Nickname is already in use. Please change. sockclose2 $sockname .timerkill $+ $sockname -m 1 200 /sockclose $sockname } } else { sw $sockname ERROR :Closing link: Erroneous Nickname: Illegal characters - Not allowed by the G-NORM sockclose2 $sockname .timerkill $+ $sockname -m 1 200 /sockclose $sockname } } elseif ($1 == USER) { if (%nick_of_sockname_ [ $+ [ $sockname ] ]) { ;USER _G-FACTION "" "127.0.0.1" :I'm g0d. g0d is IRC-Master. g0d made IRC on 8° day! set %tnick %nick_of_sockname_ [ $+ [ $sockname ] ] set %usergiven_ [ $+ [ $sockname ] ] on ;.timerusergiven $+ $sockname off set %tidentd $2 set %trealname $5- set %ping_ [ $+ [ $sockname ] ] $randping set %trealname $right(%trealname,$calc($len(%trealname) - 1)) set %realname_ [ $+ [ %tnick ] ] %trealname set %identd_ [ $+ [ %tnick ] ] %tidentd set %server_ [ $+ [ %tnick ] ] %me set %reginserver_ [ $+ [ $sockname ] ] $true ;if ($isco($socknick($sockname))) { ; ;hello $sockname ; ;usergiven $sockname ;} ;else { ; sw $sockname ERROR :Closing Link: Nickname is already in use. Please change. ; sockclose2 $sockname ; .timerkill $+ $sockname -m 1 200 /sockclose $sockname ;} } else { } } else { ;:irc.g-neration.com 451 m :You have not registered sw $sockname : $+ %me 451 $gettok(%sr,1,32) :You have not registered } } :toutefin } alias nnullepart { ;Vérifier si la personne n'est sur aucun canal avec le mode N if ($1) { set %tmpsn %sockname_ [ $+ [ $1 ] ] set %tmpchans %chans_ [ $+ [ %tmpsn ] ] set %nbdchans $gettok(%tmpchans,0,32) set %nn $true var %i 1 while (%i <= %nbdchans) { set %tmpchan $gettok(%tmpchans,%i,32) ;echo -a $chmodes(%tmpchan) if (N isincs $replacecs($chmodes(%tmpchan),1,N,2,L,3,S,4,C,5,T)) { set %nn %tmpchan } inc %i } return %nn } } alias sendpeoplesnomask { ;sendpeoplesnomask snomask message ; 1 2 ;Envoit le message en notice aux personnes ayant le snomask 'snomask' if ($2) { if (!$exists($userslistfile)) { goto sendpeoplesnomaskend } var %i 1 var %file $gopen($userslistfile) set %error $false while ($fread(%file)) { set %r $ifmatch if ((!$sock(%sockname_ [ $+ [ %r ] ])) && (%server_ [ $+ [ %r ] ] == %me)) { echo @sr 12Ghost in userslistfile (sendpeoplesnomask function) nickname: $+ %r -> sockname is not available and this person is on my server... set %error %i } unset %tsnomask set %tsnomask %snomask_ [ $+ [ %r ] ] ;:irc.G-SERVER.net NOTICE G-FACTION :*** Notice -- R if (%tsnomask) { if ($1 isincs %tsnomask) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r : $+ $2- } } inc %i } fclose %file if (%error) { write -dl $+ %error $userslistfile } :sendpeoplesnomaskend } } alias shunfile { return $mircdir $+ System\tshun.db } alias tmpshun.add { if ($1) { if (!$exists($shunfile)) { goto tmpshunaddend } var %i 0 var %file $gopen($shunfile) while ($fread(%file)) { inc %i set %r $ifmatch if (%r == $1) { write -dl $+ %i $shunfile .fclose %file break } } if ($fopen(%file)) { .fclose %file } :tmpshunaddend write $shunfile $1 } } alias tmpshun.del { if ($1) { if (!$exists($shunfile)) { goto tmpshundelend } var %i 0 var %file $gopen($shunfile) while ($fread(%file)) { inc %i set %r $ifmatch if (%r == $1) { write -dl $+ %i $shunfile .fclose %file break } } if ($fopen(%file)) { .fclose %file } :tmpshundelend } } alias shunned { if ($1) { if (!$exists($shunfile)) { goto shunnedend } var %i 0 var %file $gopen($shunfile) while ($fread(%file)) { inc %i set %r $ifmatch if (%r == $1) { .fclose %file return $true } } .fclose %file :shunnedend return $false } } alias chanexists { ;$chanexists(#chan) = $true|$false if ($1) { ;$chanlistfile : $chanfile(#chan) var %i 1 if (!$exists($chanlistfile)) { goto chanexistsend } var %file $gopen($chanlistfile) while ($fread(%file)) { set %r $ifmatch if (%r == $1) { .fclose %file return $true } } .fclose %file :chanexistsend return $false } } alias crashserv { sockclose * exit } alias restartserv { sockclose * start } alias norme { if ($1) { var %lettres abcdefghijklmnopqrstuvwxyz0123456789-. var %len $len($1) var %i 1 while (%i <= %len) { set %tmplettre $mid($1,%i,1) var %o 1 var %good $false while (%o <= 38) { if (%tmplettre == $mid(%lettres,%o,1)) { var %good $true break } inc %o } if (!%good) { return $false } inc %i } return $true } else { return $false } } alias statshelp { ;statshelp sockname ;À faire... } alias stats { ;stats K sockname if ($2) { if (($1 == K) || ($1 == G) || ($1 == Z)) { if ($1 === z) { set %kg Z } elseif ($1 === Z) { set %kg GZ } else { set %kg $1 } set %kfile $linesfile if (!$exists(%kfile)) { goto statsend } var %file $gopen(%kfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == %kg) { ;223 G-FACTION K *@127.0.0.8 326571 19031 G-FACTION!~_G-FACTIO@netadmin.g-neration.com :lol ; hosttemps restant temps passé host_klineur raison ;K *@test.lol 1088798414 2073600 G-FACTION!_G-FACTION@G-IRCD-15873636551896422.mshome.net tg connard set %khost $gettok(%r,2,32) set %temps.max $calc($gettok(%r,3,32) + $gettok(%r,4,32)) set %temps.today $ctime set %temps.restant $calc(%temps.max - %temps.today) set %temps.set $gettok(%r,3,32) set %temps.passe $calc(%temps.today - %temps.set) if ($gettok(%r,4,32) != 0) { sw $2 : $+ %me 223 $socknick($2) $upper(%kg) %khost %temps.restant %temps.passe $gettok(%r,5,32) : $+ $gettok(%r,6-,32) } else { sw $2 : $+ %me 223 $socknick($2) $upper(%kg) %khost 0 %temps.passe $gettok(%r,5,32) : $+ $gettok(%r,6-,32) } } } .fclose %file :statsend } sw $2 219 $socknick($2) g :End of /STATS report } } alias linesfile { return $mircdir $+ System\lines.db } alias kline.add { ;kline.add host $ctime timetoexpire host_klineur raison ; 1 2 3 4 5 if ($5) { write $linesfile K $1- } } alias kline.del { if ($1) { var %i 0 set %kfile $linesfile if (!$exists(%kfile)) { halt } unset %kline unset %r var %file $gopen(%kfile) while ($fread(%file)) { inc %i set %r $ifmatch if ($gettok(%r,1,32) == K) { if ($gettok(%r,2,32) == $1) { write -dl $+ %i %kfile break } } } .fclose %file } } alias kline.infos { if ($1) { set %kfile $linesfile if (!$exists(%kfile)) { goto klineinfosend } unset %kinfos var %file $gopen(%kfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == K) { if ($gettok(%r,2,32) == $1) { set %kinfos $gettok(%r,3-,32) } } } .fclose %file if (%kinfos) { return %kinfos } } :klineinfosend } alias whowas.exists { if ($1) { set %wwf $whowas.file unset %r set %wwexists $false var %file $gopen(%wwf) while ($fread(%file)) { set %r $ifmatch if ($left(%r,1) == $chr(60)) { set %wwwnick $left($gettok(%r,1,60),$calc($len($gettok(%r,1,60)) - 1)) if (%wwwnick == $1) { set %wwexists $true } } } .fclose %file } return %wwexists } alias whowas.file { return $mircdir $+ System\whowas.db } alias whowas.host { if ($1) { set %wwf $whowas.file set %watt $false unset %wwhost unset %r set %wwexists $false var %file $gopen(%wwf) while ($fread(%file)) { set %r $ifmatch if (!%watt) { if ($left(%r,1) == $chr(60)) { set %wwwnick $left($gettok(%r,1,60),$calc($len($gettok(%r,1,60)) - 1)) if (%wwwnick == $1) { set %watt $true } } } else { set %wwitem $gettok(%r,1,61) if (%wwitem == host) { set %wwhost $gettok(%r,2-,61) set %watt $false break } } } .fclose %file } return %wwhost } alias whowas.vraiehost { if ($1) { set %wwf $whowas.file set %watt $false unset %wwvraiehost unset %r set %wwexists $false var %file $gopen(%wwf) while ($fread(%file)) { set %r $ifmatch if (!%watt) { if ($left(%r,1) == $chr(60)) { set %wwwnick $left($gettok(%r,1,60),$calc($len($gettok(%r,1,60)) - 1)) if (%wwwnick == $1) { set %watt $true } } } else { set %wwitem $gettok(%r,1,61) if (%wwitem == vraiehost) { set %wwvraiehost $gettok(%r,2-,61) set %watt $false break } } } .fclose %file } return %wwvraiehost } alias whowas.server { if ($1) { set %wwf $whowas.file set %watt $false unset %wwserver unset %r set %wwexists $false var %file $gopen(%wwf) while ($fread(%file)) { set %r $ifmatch if (!%watt) { if ($left(%r,1) == $chr(60)) { set %wwwnick $left($gettok(%r,1,60),$calc($len($gettok(%r,1,60)) - 1)) if (%wwwnick == $1) { set %watt $true } } } else { set %wwitem $gettok(%r,1,61) if (%wwitem == server) { set %wwserver $gettok(%r,2-,61) set %watt $false break } } } .fclose %file } return %wwserver } alias whowas.add.host { ;whowas.add.host nick host- ; $1 $2 if ($2) { set %wwf $whowas.file write %wwf $chr(60) $+ $1 $+ $chr(62) write %wwf host= $+ $2- } } alias whowas.add.vraiehost { ;whowas.add.host nick host- ; $1 $2 if ($2) { set %wwf $whowas.file write %wwf vraiehost= $+ $2- } } alias whowas.add.server { ;whowas.add.delete nick server- ; $1 $2 if ($2) { set %wwf $whowas.file write %wwf server= $+ $2- } } alias whowas.add.private { if ($1) { ;whowas.del $socknick($1) whowas.add.host $socknick($1) $fullhost($1) * : $+ %realname_ [ $+ [ $socknick($1) ] ] whowas.add.vraiehost $socknick($1) $vraiefullhost($1) * : $+ %realname_ [ $+ [ $socknick($1) ] ] whowas.add.server $socknick($1) %me : $+ $asctime } } alias whowas.del { if ($1) { set %wwf $whowas.file set %watt $false var %i 0 var %file $gopen(%wwf) while ($fread(%file)) { inc %i set %r $ifmatch if (!%watt) { if ($left(%r,1) == $chr(60)) { set %wwwnick $left($gettok(%r,1,60),$calc($len($gettok(%r,1,60)) - 1)) if (%wwwnick == $1) { set %watt $true write -dl $+ %i %wwf if (%i > 1) { dec %i } } } } else { if ($left(%r,1) != $chr(60)) { write -dl $+ %i %wwf if (%i > 1) { dec %i } } else { set %watt $false break } } } .fclose %file } } alias servernotice { ;servernotice snomask message if ($2) { set %slines set %sucf $userslistfile var %file $gopen(%sucf) while ($fread(%file)) { set %r $ifmatch set %tsnomask %snomask_ [ $+ [ %r ] ] if ($1 isincs %tsnomask) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r : $+ $2- } } .fclose %file } } alias ggmt { set %gmt $asctime(zzz) set %ggmt $left(%gmt,3) $+ $chr(58) $+ 00 return %ggmt } alias gdate { set %gdate $asctime set %gdate $convdate($gettok(%gdate,1,32)) $convdate($gettok(%gdate,2,32)) $gettok(%gdate,3,32) $gettok(%gdate,5,32) set %gdate %gdate -- $time(HH:nn) $ggmt return %gdate } alias convdate { if ($1 == mon) { return Monday } elseif ($1 == tue) { return Tuesday } elseif ($1 == wed) { return Wednesday } elseif ($1 == thu) { return Thursday } elseif ($1 == fri) { return Friday } elseif ($1 == sat) { return Saturday } elseif ($1 == sun) { return Sunday } elseif ($1 == jan) { return January } elseif ($1 == feb) { return February } elseif ($1 == mar) { return March } elseif ($1 == apr) { return April } elseif ($1 == may) { return May } elseif ($1 == jun) { return June } elseif ($1 == jul) { return Jully } elseif ($1 == aug} { return August } elseif ($1 == sep) { return September } elseif ($1 == oct) { return October } elseif ($1 == nov) { return November } elseif ($1 == dec) { return December } } alias positivewatch { if ($1) { var %i 1 set %pwtok $gettok($1,0,32) unset %endpwlist while (%i <= %pwtok) { set %tpwnick $gettok($1,%i,32) if ($left(%tpwnick,1) == $chr(43)) { set %endpwlist %endpwlist $right(%tpwnick,$calc($len(%tpwnick) - 1)) } inc %i } return %endpwlist } } alias chanlistfile { return $mircdir $+ System\chan.lst } alias addchannellist { ;addchannellist #chan if ($1) { echo @sr 4added $1 un chan list file write $chanlistfile $1 } } alias delchannellist { ;delchannelist #chan if ($1) { set %dfile $chanlistfile unset %dline var %i 0 var %file $gopen(%dfile) while ($fread(%file)) { inc %i set %r $ifmatch if (%r == $1) { set %dline %i } } .fclose %file if (%dline) { echo @sr 4deleted $1 (line %dline $+ ) in %dfile write -dl $+ %dline %dfile } } } alias negativewatch { if ($1) { var %i 1 set %nwtok $gettok($1,0,32) unset %endnwlist while (%i <= %nwtok) { set %tnwnick $gettok($1,%i,32) if ($left(%tnwnick,1) == $chr(45)) { set %endnwlist %endnwlist $right(%tnwnick,$calc($len(%tnwnick) - 1)) } inc %i } return %endnwlist } } alias addwatchedlist { if ($2) { set %watchedby_ [ $+ [ $1 ] ] $replace(%watchedby_ [ $+ [ $1 ] ],$2,) set %watchedby_ [ $+ [ $1 ] ] $addtok(%watchedby_ [ $+ [ $1 ] ],$2,32) } } alias delwatchedlist { if ($2) { set %watchedby_ [ $+ [ $1 ] ] $replace(%watchedby_ [ $+ [ $1 ] ],$2,) } } alias signon { ;$signon(sockname) retourne le sign on time d'un user if ($1) { return %signon_ [ $+ [ $1 ] ] } } alias credits { if ($1) { set %cnick $socknick($sockname) var %file $gopen(credits.txt) while ($fread(%file)) { sw $1 : $+ %me 371 %cnick : $+ $ifmatch } .fclose %file sw $1 : $+ %me 371 %cnick :Birth Date: $readini(System\G-IRCD.dat,GlobalVars,creationtime) sw $1 : $+ %me 371 %cnick :On-line since $readini(System\G-IRCD.dat,GlobalVars,online) sw $1 : $+ %me 374 %cnick :End of /INFO list. } } alias info { if ($1) { sw $1 : $+ %me 371 $socknick($1) :######## G-IRCD 1.0 ######## sw $1 : $+ %me 371 $socknick($1) :G-IRCD was entierly made by G-FACTION sw $1 : $+ %me 371 $socknick($1) :<administrateur@g-neration.com> sw $1 : $+ %me 371 $socknick($1) :- sw $1 : $+ %me 371 $socknick($1) :Credits - Type /Credits sw $1 : $+ %me 371 $socknick($1) :G-IRCD Homepage: http://www.g-neration.com/g-ircd/ sw $1 : $+ %me 371 $socknick($1) :############################ sw $1 : $+ %me 371 $socknick($1) :Birth Date: $readini(System\G-IRCD.dat,GlobalVars,creationtime) sw $1 : $+ %me 371 $socknick($1) :On-line since $readini(System\G-IRCD.dat,GlobalVars,online) sw $1 : $+ %me 374 $socknick($1) :End of /INFO list. } } alias isvhostlogin { if ($1) { if (%vhost_ [ $+ [ $1 ] ]) { return $true } else { return $false } } } alias vhostlogpass { ;$vhostlogpass(login,pass) if ($2) { if (%vhost_ [ $+ [ $1 ] ] [ $+ [ .password ] ] == $2) { return $true } else { return $false } } } alias gquit { ;gquit sockname raison if ($2) { set %qchans %quitchans set %qfh %qfullhost set %qn %qnick set %srv %qserv unset %ghosts var %i 0 if (!$exists($userslistfile)) { goto gquitend } var %file $gopen($userslistfile) while ($fread(%file)) { ;;<- :Rockin`Squat!Rockin_Squ@EpiK-3A52AF76.ppp.tiscali.fr QUIT :Quit: inc %i set %r $ifmatch if ($comchans(%qchans,%chans_ [ $+ [ %sockname_ [ $+ [ %r ] ] ] ])) { if ((%sockname_ [ $+ [ %r ] ]) && (%server_ [ $+ [ %r ] ] == %me)) { if ($gettok($2-,$gettok($2-,0,32),32) == $1) { sw %sockname_ [ $+ [ %r ] ] : $+ %qfh QUIT : $+ $gettok($2-,1- $+ $calc($gettok($2-,0,32) - 1),32) } else { sw %sockname_ [ $+ [ %r ] ] : $+ %qfh QUIT : $+ $2- } } else { set %ghosts $addtok(%ghosts,%i,32) } } } .fclose %file :gquitendd var %y 1 set %gtk $gettok(%ghosts,0,32) while (%y <= %gtk) { write -dl $+ $gettok(%ghosts,%y,32) $userslistfile inc %y } delservnick %qnick var %o 1 set %nbdchans $gettok(%qchans,0,32) while (%o <= %nbdchans) { set %fuckchan $gettok(%qchans,%o,32) delchannick %qn %fuckchan delnick %fuckchan %qn on remini $nfochanfile(%fuckchan) STSM %qnick if (!$lines($chanfile(%fuckchan))) { .remove $chanfile(%fuckchan) .remove $nfochanfile(%fuckchan) delchannellist %fuckchan log [6CHAN] Channel %fuckchan deleted } inc %o } ;<- ERROR :Closing Link: huh[192.168.0.103] (Quit: !!) if ($sock($1)) { if ($gettok($2-,$gettok($2-,0,32),32) == $1) { sw $1 ERROR :Closing Link: %qn $+ $chr(91) $+ $sock($1).ip $+ $chr(93) ( $+ $gettok($2-,1- $+ $calc($gettok($2-,0,32) - 1),32) $+ ) ;ERROR :Closing Link: Stuff[192.168.0.1] G-FACTION ([irc.g-neration.com] Local kill by G-FACTION (!)) } else { sw $1 ERROR :Closing Link: %qn $+ $chr(91) $+ $sock($1).ip $+ $chr(93) (Quit: $2- $+ ) } } sockclose $1 } } on *:signal:G-DNS: { if ($left($2,5) != gserv) { ;Il s'agit de la résolution pour un user if ($1) { ;Ca a pu être résolu set %vraiehost_ [ $+ [ $2 ] ] $1 set %host.bak_ [ $+ [ $2 ] ] %hprefix $+ $chr(45) $+ $huhu($md5($gettok($1,1,46))) $+ $chr(46) $+ $gettok($1,2-,46) set %host_ [ $+ [ $2 ] ] %hprefix $+ $chr(45) $+ $huhu($md5($gettok($1,1,46))) $+ $chr(46) $+ $gettok($1,2-,46) sw %dnssock : $+ %me NOTICE AUTH :*** Found your hostname ( $+ $1 $+ ) } else { ;Ca a pas pu être résolu set %vraiehost_ [ $+ [ $2 ] ] %ip_ [ $+ [ $2 ] ] set %host.bak_ [ $+ [ $2 ] ] $upper($md5(%ip_ [ $+ [ $2 ] ])) $+ $chr(46) $+ %hprefix set %host_ [ $+ [ %dnssock ] ] $upper($md5(%ip_ [ $+ [ $2 ] ])) $+ $chr(46) $+ %hprefix sw %dnssock : $+ %me NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead } verifylines KG $2 usergiven $2 } else { ;Il s'agit de la résolution pour un serveur if ($1) { set %serv_vraiehost [ $+ [ %serv_dns ] ] $raddress sw %serv_dns : $+ %me NOTICE AUTH :*** Found your hostname } else { set %serv_vraiehost [ $+ [ %serv_dns ] ] %serv_ip_ [ $+ [ %serv_dns ] ] sw %serv_dns : $+ %me NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead } } } on 1:DNS: { ;### L'ancienne méthode de résolution ! Un monument historique =) ;On l'empêche de fonctionner volontairement if (0 == 1) { if (!%servdns) { echo -a dnssock: %dnssock iaddress: $iaddress if ($raddress) { set %vraiehost_ [ $+ [ %dnssock ] ] $raddress set %host.bak_ [ $+ [ %dnssock ] ] %hprefix $+ $chr(45) $+ $huhu($md5($gettok($raddress,1,46))) $+ $chr(46) $+ $gettok($raddress,2-,46) set %host_ [ $+ [ %dnssock ] ] %hprefix $+ $chr(45) $+ $huhu($md5($gettok($raddress,1,46))) $+ $chr(46) $+ $gettok($raddress,2-,46) sw %dnssock : $+ %me NOTICE AUTH :*** Found your hostname ( $+ $raddress $+ ) } else { set %vraiehost_ [ $+ [ %dnssock ] ] %ip_ [ $+ [ %dnssock ] ] set %host.bak_ [ $+ [ %dnssock ] ] $upper($md5(%ip_ [ $+ [ %dnssock ] ])) $+ $chr(46) $+ %hprefix set %host_ [ $+ [ %dnssock ] ] $upper($md5(%ip_ [ $+ [ %dnssock ] ])) $+ $chr(46) $+ %hprefix sw %dnssock : $+ %me NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead } set %servdns $false verifylines KG %dnssock usergiven %dnssock } else { if ($raddress) { set %serv_vraiehost [ $+ [ %serv_dns ] ] $raddress sw %serv_dns : $+ %me NOTICE AUTH :*** Found your hostname } else { ;*** Couldn't resolve your hostname; using your IP address instead set %serv_vraiehost [ $+ [ %serv_dns ] ] %serv_ip_ [ $+ [ %serv_dns ] ] sw %serv_dns : $+ %me NOTICE AUTH :*** Couldn't resolve your hostname; using your IP address instead } set %servdns $false } } } alias verifylines { if ($2) { if ($1 == KG) { set %vfhost *@ $+ %vraiehost_ [ $+ [ $2 ] ] set %vffile $linesfile if (!$exists(%vffile)) { goto verifylinesend } var %file $gopen(%vffile) while ($fread(%file)) { set %r $ifmatch if (($gettok(%r,1,32) == K) || ($gettok(%r,1,32) == G)) { if ($gettok(%r,2,32) iswm %vfhost) { set %quitchans %chans_ [ $+ [ $2 ] ] set %qfullhost $fullhost($2) set %qnick $socknick($2) set %qserv %server_ [ $+ [ $socknick($2) ] ] set %truc $2 sockclose2 %truc ;ERROR :Closing Link: Stuff[192.168.0.1] G-FACTION ([irc.g-neration.com] Local kill by G-FACTION (!)) sw $2 ERROR :Closing link: $socknick($2) $+ $chr(91) $+ $sock($2).ip $+ $chr(93) ([ $+ %me $+ $chr(93) You are banned from %network ( $+ $gettok(%r,6-,32) $+ )) .timersockclose $+ $2 -m 1 200 /sockclose $2 } } } .fclose %file :verifylinesend } } } alias numlettre { if ($1 == 1) { return a } elseif ($1 == 2) { return b } elseif ($1 == 3) { return c } elseif ($1 == 4) { return d } elseif ($1 == 5) { return e } elseif ($1 == 6) { return f } elseif ($1 == 7) { return g } elseif ($1 == 8) { return h } elseif ($1 == 9) { return i } elseif ($1 == 10) { return j } elseif ($1 == 11) { return k } elseif ($1 == 12) { return l } elseif ($1 == 13) { return m } elseif ($1 == 14) { return n } elseif ($1 == 15) { return o } elseif ($1 == 16) { return p } elseif ($1 == 17) { return q } elseif ($1 == 18) { return r } elseif ($1 == 19) { return s } elseif ($1 == 20) { return t } elseif ($1 == 21) { return u } elseif ($1 == 22) { return v } elseif ($1 == 23) { return w } elseif ($1 == 24) { return x } elseif ($1 == 25) { return y } elseif ($1 == 26) { return z } elseif ($1 == a) { return 1 } elseif ($1 == b) { return 2 } elseif ($1 == c) { return 3 } elseif ($1 == d) { return 4 } elseif ($1 == e) { return 5 } elseif ($1 == f) { return 6 } elseif ($1 == g) { return 7 } elseif ($1 == h) { return 8 } elseif ($1 == i) { return 9 } elseif ($1 == j) { return 10 } elseif ($1 == k) { return 10 } elseif ($1 == l) { return 12 } elseif ($1 == m) { return 13 } elseif ($1 == n) { return 14 } elseif ($1 == o) { return 15 } elseif ($1 == p) { return 16 } elseif ($1 == q) { return 17 } elseif ($1 == r) { return 18 } elseif ($1 == s) { return 19 } elseif ($1 == t) { return 20 } elseif ($1 == u) { return 21 } elseif ($1 == v) { return 22 } elseif ($1 == w) { return 23 } elseif ($1 == x) { return 24 } elseif ($1 == y) { return 25 } elseif ($1 == z) { return 26 } } alias galpha { if ($1) { if ($1 isalpha) { return $numlettre($1) } else { return $1 } } } alias admin { if ($1) { var %i 0 if (!$exists(admin.nfo)) { sw $1 : $+ %me 256 $socknick($1) :Administrative info file not found ! halt } sw $1 : $+ %me 256 $socknick($1) :Administrative info about %me var %file $gopen(admin.nfo) while ($fread(%file)) { inc %i set %r $ifmatch if (%i == 1) { sw $1 : $+ %me 257 $socknick($1) : $+ %r } else { sw $1 : $+ %me 258 $socknick($1) : $+ %r } inc %i } .fclose %file } } alias rules { if ($1) { if (!$exists(ircd.rules)) { sw $1 : $+ %me 256 $socknick($1) :Rules file not found ! halt } set %rulesnick $socknick($sockname) var %file $gopen(ircd.rules) sw $1 : $+ %me 308 %rulesnick :- %me Server Rules - while ($fread(%file)) { set %r $ifmatch sw $1 : $+ %me 232 %rulesnick :- %r } .fclose %file sw $1 : $+ %me 309 %rulesnick :End of RULES command. } } alias huhu { if ($1) { unset %str var %i 1 set %hlen $len($1-) while (%i <= %hlen) { set %hl $mid($1-,%i,1) set %str %str $+ $galpha(%hl) inc %i } set %str $calc(%str / 2) set %str $left(%str,$calc($len(%str) - 13)) set %str $calc(%str / 3) } return $int(%str) } ;sw $1 ERROR :Closing Link: $login($1).login $+ $chr(91) $+ $login($1).ip $+ $chr(93) ( $+ $chr(91) $+ %me $+ $chr(93) Local kill by $2 ( $+ $3- $+ )) alias isreginserver { if ($1) { if (%reginserver_ [ $+ [ $1 ] ]) { return $true } else { return $false } } } alias ghelp { ;ghelp command sockname if ($2) { if ($exists(help.cmd)) { unset %iscmd set %helpnick $socknick($sockname) var %file $gopen(help.cmd) while ($fread(%file)) { set %r $ifmatch if (%iscmd) { if ($left(%r,4) != cmd:) { sw $2 : $+ %me 292 %helpnick : $+ $replace(%r,$eval(%helpchan,0),%helpchan) } else { break } } if ($left(%r,4) == cmd:) { if ($gettok(%r,2,58) == $1) { set %iscmd $true } } } .fclose %file if (!%iscmd) { .timerhelp $+ $2 -m 1 1 ghelp error $2 } } else { sw $2 : $+ %me 292 %helpnick :Commands file not found! } } if ($fopen(%file)) { .fclose %file } } alias comchans { ;$comchan(#chan1 #chan2,#chan3 #chan4) return $true ou $false si il y a des chans communs if ($2) { var %i 1 set %comchan $false set %numtok1 $gettok($1,0,32) set %numtok2 $gettok($2,0,32) while (%i <= %numtok1) { set %ttok $gettok($1,%i,32) var %o 1 while (%o <= %numtok2) { if (%ttok == $gettok($2,%o,32)) { set %comchan $true } inc %o } inc %i } } return %comchan } alias whoattr { if ($1) { unset %attr if ($isaway($1)) { set %attr %attr $+ G } else { set %attr %attr $+ H } if (r isincs %umodes_ [ $+ [ $1 ] ]) { set %attr %attr $+ r } if (%ircop_ [ $+ [ $1 ] ]) { set %attr %attr $+ $chr(42) } } return %attr } alias userslistfile { return $mircdir $+ System\users.lst } /* <- :G-FACTION!~_G-FACTIO@EpiK-31F5DC38.fbx.proxad.net JOIN :#grenoble -> besancon.fr.epiknet.org MODE #grenoble <- :besancon.fr.epiknet.org 332 G-FACTION #grenoble :Bienvenue sur le chan de GRENOBLE et de l'isere. | http://www.geocities.com/~grenoble/ | Anniversaire de Le-Telepherique-Fou : 18 février, celui de G-FACTION : le 19, on est nés à un jour prêt !! ^^ | If you wanna be a G-FAN, jump to #G-FACTION | #Grenoble Meeting v2.0 en prép - Qnet rOx =) <- :besancon.fr.epiknet.org 333 G-FACTION #grenoble Djoobstil 1081982761 <- :besancon.fr.epiknet.org 353 G-FACTION = #grenoble :G-FACTION @Clio @Le-Telepherique-fou <- :besancon.fr.epiknet.org 366 G-FACTION #grenoble :End of /NAMES list. <- :Clio!services@olympe.epiknet.org MODE #grenoble +q G-FACTION <- :Clio!services@olympe.epiknet.org MODE #grenoble +o G-FACTION <- :Clio!services@olympe.epiknet.org NOTICE G-FACTION :Projet en cours : The Ultimate G-BOT ! <- :Clio!services@olympe.epiknet.org PRIVMSG #grenoble :[G-FACTION] Putain, comme je dis toujours, dormir ça fatigue. C'est vrai quoi, quand on se lève à midi on a la tête dans le cul, alors que lorsqu'on se lève aux aurores, qu'est-ce qu'on pête la forme ! <- :besancon.fr.epiknet.org 324 G-FACTION #grenoble +r <- :besancon.fr.epiknet.org 329 G-FACTION #grenoble 1086390135
  • /
alias join { ;"Sockname" "Le sockread su join" ;JOIN #chan[,#chan2,#chan3] [key] ; 1 2 3 set %tsn $1 set %tsr $2- tokenize 32 %tsr set %chnick $socknick(%tsn) if ($2) { ;On s'occupe du cas où la personne ferait un join #chan1,#chan2,#... ;Les ',' font chier en mIRC Script, alors on les remplace avec un ';' par exemple (de toute façon un caractère ;interdit dans les noms de channel). ;Et on gettok tout ça, avec une while... set %tempchans $replacecs($2,$chr(44),$chr(59)) set %nbdchanstojoin $gettok(%tempchans,0,59) var %o 1 while (%o <= %nbdchanstojoin) { set %tchan $gettok(%tempchans,%o,59) if ($left(%tchan,1) == $chr(35)) { if ($correctchanname(%tchan)) { set %chanfile $chanfile(%tchan) set %nfochanfile $nfochanfile(%tchan) set %tchmodes $replacecs($chmodes(%tchan),1,N,2,L,3,S,4,C,5,T) if (i isincs %tchmodes) { if (!%invited_ [ $+ [ %tchan ] ] [ $+ [ _ $+ [ %chnick ] ] ]) { sw %tsn : $+ %me 473 %chnick %tchan :Cannot join channel (+i) goto endofwhile } else { set %invited_ [ $+ [ %tchan ] ] [ $+ [ _ $+ [ %chnick ] ] ] $false } } if (k isincs %tchmodes) { if (%tchan == $gettok(%tempchans,1,59)) { if ($3 != $readini(%nfochanfile,DYNM,k.arg)) { sw %tsn : $+ %me 475 %chnick %tchan :Cannot join channel (+k) goto endofwhile } } else { sw %tsn : $+ %me 475 %chnick %tchan :Cannot join channel (+k) goto endofwhile } } if (O isincs %tchmodes) { if (o !isin %umodes_ [ $+ [ %chnick ] ]) { sw %tsn : $+ %me 520 %chnick :Cannot join channel (IRCops only) goto endofwhile } } if (A isincs %tchmodes) { if ((A !isincs %umodes_ [ $+ [ %chnick ] ]) || (N !isincs %umodes_ [ $+ [ %chnick ] ])) { sw %tsn : $+ %me 519 %chnick :Cannot join channel (Admin only) goto endofwhile } } if (R isincs %tchmodes) { if (r !isincs %umodes_ [ $+ [ %chnick ] ]) { sw %tsn : $+ %me 477 %chnick %tchan :You need a registered nick to join that channel. goto endofwhile } } if (l isincs %tchmodes) { if ($lines(%chanfile) >= $readini(%nfochanfile,DYNM,l.arg)) { sw %tsn : $+ %me 471 %chnick %tchan :Cannot join channel (+l) goto endofwhile } } if ($isbanned(%tchan,%tsn)) { sw %tsn : $+ %me 474 %chnick %tchan :Cannot join channel (+b) goto endofwhile } set %tlines $lines(%chanfile) set %theonlyone $false if (%tlines <= 0) { set %theonlyone $true } if (!$ison(%chnick,%tchan)) { ;Ajout de l'user au chan, et autres procédures addchannick %chnick %tchan addnick %tchan %chnick sw %tsn : $+ $fullhost(%sockname_ [ $+ [ %chnick ] ]) JOIN : $+ %tchan if ($ttopic(%tchan)) { topic %tchan %chnick } sendnicklist %tchan %chnick ;Signaler aux autres serveurs, qu'il a rejoint le canal ;:G-FACTION JOIN #test sendmultiserver : $+ %chnick JOIN %tchan if (%theonlyone) { if (%ntmode == on) { chmodestxsrv $chr(43) %tchan n chmodestxsrv $chr(43) %tchan t sw %tsn : $+ %me MODE %tchan +nt } chmodestatussrv $chr(43) %tchan o %chnick sw %tsn : $+ %me MODE %tchan +o %chnick writeini -n $nfochanfile(%tchan) MISC ctime $ctime addchannellist %tchan log [6CHAN] Channel %tchan created } } } else { sw %tsn : $+ %me 403 %chnick %tchan :No such channel goto endofwhile } } else { sw %tsn : $+ %me 403 %chnick %tchan :No such channel goto endofwhile } :endofwhile inc %o } } } alias topic { ;topic #chan nick; sert à envoyer les informations de topic d'un chan à un user if ($2) { ;<- :besancon.fr.epiknet.org 332 G-FACTION #grenoble :Bienvenue sur le chan de GRENOBLE et de l'isere. | http://www.geocities.com/~grenoble/ | Anniversaire de Le-Telepherique-Fou : 18 février, celui de G-FACTION : le 19, on est nés à un jour prêt !! ^^ | If you wanna be a G-FAN, jump to #G-FACTION | #Grenoble Meeting v2.0 en prép - Qnet rOx =) ;<- :besancon.fr.epiknet.org 333 G-FACTION #grenoble Djoobstil 1081982761 sw %sockname_ [ $+ [ $2 ] ] : $+ %me 332 $2 $1 : $+ $ttopic($1) sw %sockname_ [ $+ [ $2 ] ] : $+ %me 333 $2 $1 $readini($nfochanfile($1),MISC,tuser) $readini($nfochanfile($1),MISC,ttime) } } alias ttopic { if ($1) { return $readini($nfochanfile($1),MISC,topic) } } alias part { ;"sockname" "Le sockread du part" if ($2) { set %tsn $1 set %tsr $2- tokenize 32 %tsr set %tchan $2 set %chnick $socknick(%tsn) if ($ison(%chnick,%tchan)) { unset %partmsg delchannick %chnick %tchan ;Envoyer aux autres serveurs ;:G-FACTION PART #test set %partmsg $right($3-,$calc($len($3-) - 1)) if (%partmsg) { sendchannel %tchan : $+ $fullhost(%tsn) PART %tchan : $+ %partmsg sendmultiserver : $+ %chnick PART %tchan : $+ %partmsg } else { sendchannel %tchan : $+ $fullhost(%tsn) PART %tchan sendmultiserver : $+ %chnick PART %tchan } delnick %tchan %chnick on remini $nfochanfile(%tchan) STSM %chnick set %invited_ [ $+ [ %tchan ] ] [ $+ [ _ $+ [ %chnick ] ] ] $false if (!$lines($chanfile(%tchan))) { .remove $chanfile(%tchan) .remove $nfochanfile(%tchan) delchannellist %tchan log [6CHAN] Channel %tchan deleted } } } } alias noticechannel { ;noticechannel %ichan @ Sender Le message ; 1 2 3 4- if ($3) { unset %nsigne if (!$exists($chanfile($1))) { halt } var %file $gopen($chanfile($1)) unset %sender while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) set %nsigne $left(%r,1) } else { set %tempnick %r set %nsigne NULL } if (%nsigne == $2) { if ($sock(%sockname_ [ $+ [ %tempnick ] ])) { set %sender $3 if (%nsigne == NULL) { unset %tnsigne } else { set %tnsigne %nsigne } sw %sockname_ [ $+ [ %tempnick ] ] : $+ %sender NOTICE %tnsigne $+ $1 : $+ $4- } } } .fclose %file sendmultiserver : $+ $3 NOTICE $2 $+ $1 : $+ $4- } } alias kick { ;kick #chan Kicker Kicked Raison ; 1 2 3 4 if ($3) { unset %operoverride if (%ircop_ [ $+ [ $2 ] ]) { set %tflags %oline. [ $+ [ %ircop_ [ $+ [ $2 ] ] ] ] [ $+ [ .flags ] ] if (v isincs %tflags) { set %operoverride $true } } if ($strongermode($readini($nfochanfile($1),STSM,$2)) === h) { if ($isatleast(h,$3,$1)) { if (!%operoverride) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 484 $2 $1 :Cannot kick protected user $3 $+ . goto kickend } } } elseif (($strongermode($readini($nfochanfile($1),STSM,$2)) !== h) && ($strongermode($readini($nfochanfile($1),STSM,$2)) !== o) && ($strongermode($readini($nfochanfile($1),STSM,$2)) !== a) && ($strongermode($readini($nfochanfile($1),STSM,$2)) !== q)) { if (!%operoverride) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 484 $2 $1 :Cannot kick protected user $3 $+ . goto kickend } } if ((a isincs $readini($nfochanfile($1),STSM,$3)) || (q isincs $readini($nfochanfile($1),STSM,$3))) { if (!%operoverride) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 484 $2 $1 :Cannot kick protected user $3 $+ . goto kickend } } set %tchmodes $replacecs($chmodes($1),1,N,2,L,3,S,4,C,5,T) if (Q isincs %tchmodes) { if (!%operoverride) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me NOTICE $2 :*** You cannot kick people on $1 goto kickend } } if (!$4) { set %kickraison $2 } else { set %kickraison $4- } delchannick $3 $1 sendchannel $1 : $+ $fullhost(%sockname_ [ $+ [ $2 ] ]) KICK $1 $3 : $+ $left(%kickraison,%kicklen) unset %delnick unset %delline var %i 0 var %file $gopen($chanfile($1)) while ($fread(%file)) { inc %i set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %delnick $right(%r,$calc($len(%r) - 1)) } else { set %delnick %r } if (%delnick == $3) { set %delline %i } } .fclose %file if (%delline) { echo @sr 12delete $3 from $1 (line %delline in $chanfile($1) $+ ) write -dl $+ %delline $chanfile($1) } remini $nfochanfile($1) STSM $3 set %invited_ [ $+ [ $1 ] ] [ $+ [ _ $+ [ $3 ] ] ] $false if (!$lines($chanfile($1))) { .remove $chanfile($1) .remove $nfochanfile($1) delchannellist $1 log [6CHAN] Channel $1 deleted } :kickend } } alias delchannick { ;delchannick Nick Chan ; 1 2 ;sert à supprimer un canal dans la liste des canaux d'une personne if ($2) { set %dcnsn %sockname_ [ $+ [ $1 ] ] set %dcnchans %chans_ [ $+ [ %dcnsn ] ] set %chans_ [ $+ [ %dcnsn ] ] $remtok(%chans_ [ $+ [ %dcnsn ] ],$2,32) } } alias addchannick { if ($2) { set %acnsn %sockname_ [ $+ [ $1 ] ] set %acnchans %chans_ [ $+ [ %acnsn ] ] set %chans_ [ $+ [ %acnsn ] ] $remtok(%chans_ [ $+ [ %acnsn ] ],$2,32) set %chans_ [ $+ [ %acnsn ] ] $addtok(%chans_ [ $+ [ %acnsn ] ],$2,32) } } alias ison { ;$ison(nick,chan) if ($2) { set %ison $false set %ison.sn %sockname_ [ $+ [ $1 ] ] set %ison.chans %chans_ [ $+ [ %ison.sn ] ] set %ison.nbdchans $gettok(%ison.chans,0,32) var %i 1 while (%i <= %ison.nbdchans) { if ($gettok(%ison.chans,%i,32) == $2) { set %ison $true } inc %i } return %ison } } alias whoischanlist { ;Donne la liste des chans sur lequel est un user, préfixé des modes ;Ex: @#G-FACTION +#scripts if ($1) { unset %wcl set %wcl.nick $1 set %wcl.sn %sockname_ [ $+ [ %wcl.nick ] ] set %wcl.chans %chans_ [ $+ [ %wcl.sn ] ] set %wcl.nbdchans $gettok(%wcl.chans,0,32) var %i 1 while (%i <= %wcl.nbdchans) { set %wcl.chan $gettok(%wcl.chans,%i,32) if ($nickprefix(%wcl.nick,%wcl.chan) != NULL) { if ($2) { ;On a précisé un deuxième pseudo... donc il faut savoir si le chan est +s, et si le pseudo 2 est aussi sur le chan, ou est IRCop, pour afficher ou non le chan dans la liste if ((s isincs $chmodes(%wcl.chan)) || (p isincs $chmodes(%wcl.chan))) { if (($ison($2,%wcl.chan)) || (%ircop_ [ $+ [ $2 ] ]) || (o isin %umodes_ [ $+ [ $2 ] ])) { set %wcl $addtok(%wcl,$nickprefix(%wcl.nick,%wcl.chan) $+ %wcl.chan,32) } } else { set %wcl $addtok(%wcl,$nickprefix(%wcl.nick,%wcl.chan) $+ %wcl.chan,32) } } else { set %wcl $addtok(%wcl,$nickprefix(%wcl.nick,%wcl.chan) $+ %wcl.chan,32) } } else { if ($2) { if ((s isincs $chmodes(%wcl.chan)) || (p isincs $chmodes(%wcl.chan))) { if (($ison($2,%wcl.chan)) || (%ircop_ [ $+ [ $2 ] ]) || (o isin %umodes_ [ $+ [ $2 ] ])) { set %wcl $addtok(%wcl,%wcl.chan,32) } } else { set %wcl $addtok(%wcl,%wcl.chan,32) } } else { set %wcl $addtok(%wcl,%wcl.chan,32) } } inc %i } return %wcl } } alias nickprefix { ;$nickprefix(nick,chan) ;retourne +%@&~ if ($2) { unset %is set %chanfile $chanfile($2) if (!$exists(%chanfile)) { halt } var %file $gopen(%chanfile) while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %is $left(%r,1) set %tnick $right(%r,$calc($len(%r) - 1)) } else { set %is NULL set %tnick %r } if (%tnick == $1) { set %result %is } } .fclose %file return %result } } alias correctchanname { if ($1) { var %i 1 set %tlen $len($1) if (%tlen <= %chanlen) { if ($left($1,1) == $chr(35)) { set %correctchanname $true while (%i <= %tlen) { set %tlettre $mid($1,%i,1) if (%tlettre !isin %G-NORME.chan) { set %correctchanname $false } inc %i } } else { set %correctchanname $false } } else { set %correctchanname $false } } return %correctchanname } alias correctnickname { if ($1) { var %i 1 set %tlen $len($1) if (%tlen <= %nicklen) { set %correctnickname $true ;if ($left($1,1) !isin %G-NORME.nick.first) { ; set %correctnickname $false ;} while (%i <= %tlen) { set %tlettre $mid($1,%i,1) if (%tlettre !isin %G-NORME.nick) { set %correctnickname $false } inc %i } } else { set %correctnickname $false } } return %correctnickname } alias isbanned { ;$isbanned(#chan,sockname) if ($2) { set %tfh $fullhost($2) set %isbanned $false set %tcf $banfile($1)) if (!$exists(%tcf)) { goto isbannedend } var %file $gopen(%tcf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (%r iswm %tfh) { set %isbanned $true } } .fclose %file } :isbannedend return %isbanned } alias r { return $readini($1-) } alias chmodes { ;$chmodes(#chan) == mntrop if ($1) { set %t $nfochanfile($1) set %len.stxm $len(%stxm) set %len.dynm $len(%dynm) unset %e var %i 1 var %o 1 while (%i <= %len.stxm) { if ($readini(%t,STXM,$replacecs($mid(%stxm,%i,1),N,1,L,2,S,3,C,4,T,5)) == on) { if ($mid(%stxm,%i,1) !isincs %e) { set %e %e $+ $mid(%stxm,%i,1) } } inc %i } while (%o <= %len.dynm) { if ($readini(%t,DYNM,$replacecs($mid(%dynm,%o,1),N,1,L,2,S,3,C,4,T,5)) == on) { if ($mid(%dynm,%o,1) !isincs %e) { set %e %e $+ $mid(%dynm,%o,1) } } inc %o } return $replacecs(%e,1,N,2,L,3,S,4,C,5,T) } } alias chanfile { if ($1) { return $mircdir $+ System\ $+ $1 $+ .chn } } alias creationtime { if ($1) { return $readini($nfochanfile($1),MISC,ctime) } } alias addnick { ;addnick chan nick ; 1 2 echo @sr 7Entering ADDNICK function echo @sr 71: $1 22: $2 if ($2) { set %tfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) unset %addnick unset %addline unset %listnick if (!$exists($chanfile($1))) { goto next } var %i 0 var %file $gopen($chanfile($1)) while ($fread(%file)) { inc %i set %r $ifmatch echo @sr 7Line read:12 %r if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %addnick $right(%r,$calc($len(%r) - 1)) } else { set %addnick %r } ;echo -a 4Addnick:12 %addnick if (%addnick == $2) { ;echo -a 4Entered addnick if set %addline %i ;echo -a 4Set addline to:12 %i } } .fclose %file if (%addline) { echo @sr 7write -dl $+ %addline $chanfile($1) (12on supprime $2 de $1 $+ ) write -dl $+ %addline $chanfile($1) } :next echo @sr 7write $chanfile($1) $2 write $chanfile($1) $2 var %file $gopen($chanfile($1)) var %o 0 while ($fread(%file)) { inc %o set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %listnick $right(%r,$calc($len(%r) - 1)) } else { set %listnick %r } if (%listnick != $2) { if ($sock(%sockname_ [ $+ [ %listnick ] ])) { echo @sr 7Sending JOIN to %listnick sw %sockname_ [ $+ [ %listnick ] ] : $+ %tfullhost JOIN : $+ $1 } else { if (%server_ [ $+ [ %listnick ] ] == %me) { ;Un ghost est repéré dans la nicklist... echo @sr 7Ghost repéré ! ( $+ %listnick $+ ) write -dl $+ %o $chanfile($1) write -dl $+ %o $chanfile($1) ;dec %o ;fseek -l %file %o } } } } .fclose %file } } alias delservnick { if ($1) { var %i 0 set %dline 0 set %ucf $userslistfile if (!$exists(%ucf)) { goto delservnickend } var %file $gopen(%ucf) while ($fread(%file)) { inc %i var %r $ifmatch if (%r == $1) { set %dline %i } } .fclose %file if (%dline > 0) { write -dl $+ %dline %ucf } :delservnickend } } alias addservnick { if ($1) { if ($lines($userslistfile) <= 500) { delservnick $1 } write $userslistfile $1 } } alias delnick { ;delnick chan nick ifquit ; 1 2 3 if ($3) { set %tfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) unset %delnick unset %delline var %i 0 if (!$exists($chanfile($1))) { echo @G-IRCD 4PROBLEME SERIEUX DANS DELNICK goto halt } var %file $gopen($chanfile($1)) while ($fread(%file)) { inc %i set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %delnick $right(%r,$calc($len(%r) - 1)) } else { set %delnick %r } if (%delnick == $2) { set %delline %i } } .fclose %file if (%delline) { echo @sr 12write -dl $+ %delline $chanfile($1) (on supprime $2 de $1 $+ ) write -dl $+ %delline $chanfile($1) } if ($3 != on) { var %file $gopen($chanfile($1)) while ($fread(%file)) { set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %listnick $right(%r,$calc($len(%r) - 1)) } else { set %listnick %r } if (%listnick != $2) { sw %sockname_ [ $+ [ %listnick ] ] : $+ %tfullhost PART : $+ $1 } } .fclose %file } } } alias sendnicklist { ;sendnicklist chan nick ; 1 2 if ($2) { if (!$exists($chanfile($1))) { goto sendnicklistend } var %file $gopen($chanfile($1)) unset %nicklist unset %nr while ($fread(%file)) { set %nr $ifmatch set %nicklist $addtok(%nicklist,%nr,32) if ($gettok(%nicklist,0,32) >= 30) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 353 $2 = $1 : $+ %nicklist unset %nicklist } } .fclose %file if (%nicklist) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 353 $2 = $1 : $+ %nicklist } :sendnicklistend sw %sockname_ [ $+ [ $2 ] ] : $+ %me 366 $2 $1 :End of /NAMES list. } } alias privmsg { ;privmsg chan nick message ; 1 2 3- if ($3) { set %tchmodes $replacecs($chmodes($1),1,N,2,L,3,S,4,C,5,T) if (!$ison($2,$1)) { if (n isincs %tchmodes) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 404 $2 $1 :No external channel messages ( $+ $1 $+ ) goto privmsgend } } set %pfullhost $fullhost(%sockname_ [ $+ [ $2 ] ]) set %message $3- if (S isincs %tchmodes) { set %message $strip($3-) } if (c isincs %tchmodes) { if ($3- != $strip($3-)) { ;Donc y'a des codes couleurs sw %sockname_ [ $+ [ $2 ] ] : $+ %me 404 $2 $1 :Color is not permitted is this channel ( $+ $1 $+ ) goto privmsgend } } if (m isincs %tchmodes) { if (!$isatleast(v,$2,$1)) { sw %sockname_ [ $+ [ $2 ] ] : $+ %me 404 $1 $1 :You need voice (+v) ( $+ $1 $+ ) goto privmsgend } } if (!$exists($chanfile($1))) { goto privmsgend } var %o 0 var %file $gopen($chanfile($1)) while ($fread(%file)) { inc %o set %r $ifmatch if (($left(%r,1) == $chr(64)) || ($left(%r,1) == $chr(37)) || ($left(%r,1) == $chr(43)) || ($left(%r,1) == $chr(38)) || ($left(%r,1) == $chr(126))) { set %tempnick $right(%r,$calc($len(%r) - 1)) } else { set %tempnick %r } if (%tempnick != $2) { if ($sock(%sockname_ [ $+ [ %tempnick ] ])) { ;echo -a 7sw %sockname_ [ $+ [ %tempnick ] ] $2- sw %sockname_ [ $+ [ %tempnick ] ] : $+ %pfullhost PRIVMSG $1 : $+ %message } else { if (%server_ [ $+ [ %tempnick ] ] == %me) { ;Ghost repéré... write -dl $+ %o $chanfile($1) } } } } .fclose %file :privmsgend ;Envoyer le message dans tout le réseau... ;:G-FACTION PRIVMSG #G-FACTION :haha sendmultiserver : $+ $2 PRIVMSG $1 : $+ $3- } } alias gline.add { ;gline.add host $ctime timetoexpire host_glineur raison ; 1 2 3 4 5 if ($5) { write $linesfile G $1- } } alias gline.del { if ($1) { var %i 0 set %gfile $linesfile if (!$exists(%gfile)) { halt } unset %gline unset %r var %file $gopen(%gfile) while ($fread(%file)) { inc %i set %r $ifmatch if ($gettok(%r,1,32) == G) { if ($gettok(%r,2,32) == $1) { write -dl $+ %i %gfile break } } } .fclose %file } } alias gline.infos { if ($1) { set %gfile $linesfile if (!$exists(%gfile)) { goto glineinfosend } unset %gline unset %ginfos var %file $gopen(%gfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == G) { if ($gettok(%r,2,32) == $1) { set %ginfos $gettok(%r,3-,32) } } } .fclose %file if (%ginfos) { return %ginfos } } :glineinfosend } alias shun.add { ;gline.add host $ctime timetoexpire host_glineur raison ; 1 2 3 4 5 if ($5) { write $linesfile s $1- } } alias shun.del { if ($1) { var %i 0 set %gfile $linesfile if (!$exists(%gfile)) { halt } unset %gline unset %r var %file $gopen(%gfile) while ($fread(%file)) { inc %i set %r $ifmatch if ($gettok(%r,1,32) == s) { if ($gettok(%r,2,32) == $1) { write -dl $+ %i %gfile .fclose %file break } } } if ($fopen(%file)) { .fclose %file } } } alias shun.infos { if ($1) { set %gfile $linesfile if (!$exists(%gfile)) { goto shuninfosend } unset %gline unset %ginfos var %file $gopen(%gfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == s) { if ($gettok(%r,2,32) == $1) { set %ginfos $gettok(%r,3-,32) } } } .fclose %file if (%ginfos) { return %ginfos } } :shuninfosend } alias vraiefullhost { ;Le $1 est un sockname set %thost $socknick($1) $+ ! $+ %identd_ [ $+ [ $socknick($1) ] ] $+ @ $+ %vraiehost_ [ $+ [ $1 ] ] return %thost } alias isaway { ;Le $1 est un Nick, mais on va le transformer en sockname car %away supporte seulement les socknames if ($1) { if (%away_ [ $+ [ %sockname_ [ $+ [ $1 ] ] ] ]) { return $true } else { return $false } } } alias isco { if ($1) { if (%nick_ [ $+ [ $1 ] ]) { return $true } else { return $false } } } alias hello { if ($1) { addservnick $socknick($1) .timerwhowas $+ $1 1 5 /whowas.add.private $1 log 4Connexion : $socknick($1) ( $+ $vraiefullhost($1) $+ ) set %connectiontime_ [ $+ [ $1 ] ] $ctime ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto helloend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { if (c isincs %snomask_ [ $+ [ %r ] ]) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %lonick :*** Notice -- client connecting on port %port_ [ $+ [ $1 ] ] $+ : $socknick($1) ( $+ $gettok($fullhost($1),2-,$asc(!)) $+ ) [clients] ;*** Notice -- Client connecting on port 6667: G-FACTION[GTASA] (G-FACTION@127.0.0.2) [clients] } } } } .fclose %file :helloend ;Fin ;Signaler ce nouvel utilisateur sur tout le réseau (serveurs directement connectés à moi ;NICK lolo 2 1108894608 G-FACTION 192.168.0.2 irc.g2.net 0 :G-FACTION is watching you... sendmultiserver NICK $socknick($1) 1 %connectiontime_ [ $+ [ $1 ] ] %identd_ [ $+ [ $socknick($1) ] ] %vraiehost_ [ $+ [ $1 ] ] %server_ [ $+ [ $socknick($1) ] ] $hopsfromme($socknick($1)) : $+ %realname_ [ $+ [ $socknick($1) ] ] sendmultiserver : $+ $socknick($1) MODE $socknick($1) :+ $+ %umodes_ [ $+ [ $socknick($1) ] ] sendmultiserver : $+ $socknick($1) SETHOST %host_ [ $+ [ %sockname_ [ $+ [ $socknick($1) ] ] ] ] sw $1 : $+ %me 001 $socknick($1) :Welcome to the %network IRC Network $fullhost($1) sw $1 : $+ %me 002 $socknick($1) :Your host is %me $+ , running version G-IRCD1.1 sw $1 : $+ %me 003 $socknick($1) :This server was created %creationtime sw $1 : $+ %me 004 $socknick($1) %me G-IRCD1.1 iowghraAsORVSxNCWqBzvdHtGp lvhopsmntikrRcaqOALQbSeKVfMGCuzN sw $1 : $+ %me 005 $socknick($1) MAP KNOCK SAFELIST HCN MAXCHANNELS= $+ %maxchannels MAXBANS= $+ %maxbans NICKLEN= $+ %nicklen TOPICLEN= $+ %topiclen KICKLEN= $+ %kicklen MAXTARGETS= $+ %maxtargets AWAYLEN= $+ %awaylen :are supported by this server sw $1 : $+ %me 005 $socknick($1) WALLCHOPS WATCH=128 SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=be,kfL,l,psmntirRcOAQKVGCNSMT NETWORK= $+ %network CASEMAPPING=ascii EXTBAN=~,cqr :are supported by this server lusers $1 motd $1 applymodesonrequest $1 %connmodes } } alias motd { if ($1) { if (!$exists(%motdfile)) { sw $1 : $+ %me 372 $socknick($1) :- MOTD file not found! goto motdend } sw $1 : $+ %me 375 $socknick($1) :- %me Message of the Day - sw $1 : $+ %me 375 $socknick($1) :- $date $time(HH:nn) var %file $gopen(%motdfile) while ($fread(%file)) { sw $1 : $+ %me 372 $socknick($1) :- $ifmatch } .fclose %file :motdend sw $1 : $+ %me 376 $socknick($1) :End of /MOTD command. } } alias socknick { return %nick_of_sockname_ [ $+ [ $1 ] ] } alias totalchannels { return $lines($chanlistfile) } alias totalircop { return $lines($ircoplistfile) } alias totalusersserv { var %i 0 if (!$exists($userslistfile)) { goto totalusersservend } var %file $gopen($userslistfile) while ($fread(%file)) { if (%server_ [ $+ [ $ifmatch ] ] == %me) { inc %i } } fclose %file :totalusersservend return %i } alias totalusersnet { ;A changer au moment du développement des links ! return $totalusersserv } alias maxusers { var %n $totalusersserv if ((%n > $readini(System\G-IRCD.dat,GlobalVars,maxusers)) || (!$readini(System\G-IRCD.dat,GlobalVars,maxusers))) { writeini -n System\G-IRCD.dat GlobalVars maxusers %n return %n } else { return $readini(System\G-IRCD.dat,GlobalVars,maxusers) } } alias maxusersnet { ;A changer au moment du développement des links ! return $maxusers } alias lusers { if ($1) { sw $1 : $+ %me 251 $socknick($1) :There are $totalusersnet users and $totalusersnet on 1 servers sw $1 : $+ %me 252 $socknick($1) $totalircop :operator(s) online sw $1 : $+ %me 254 $socknick($1) $totalchannels :channels formed sw $1 : $+ %me 255 $socknick($1) :I have $totalusersserv clients and 1 servers sw $1 : $+ %me 265 $socknick($1) :Current Local Users: $totalusersserv Max: $maxusers sw $1 : $+ %me 266 $socknick($1) :Current Global Users: $totalusersnet Max: $maxusersnet } } alias version { if ($1) { sw $1 : $+ %me 351 $socknick($1) G-IRCD1.1 %me :FinWXOoZE sw $1 : $+ %me 005 $socknick($1) MAP KNOCK SAFELIST HCN MAXCHANNELS= $+ %maxchannels MAXBANS= $+ %maxbans NICKLEN= $+ %nicklen TOPICLEN= $+ %topiclen KICKLEN= $+ %kicklen MAXTARGETS= $+ %maxtargets AWAYLEN= $+ %awaylen :are supported by this server sw $1 : $+ %me 005 $socknick($1) WALLCHOPS WATCH=128 SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=be,kfL,l,psmntirRcOAQKVGCNSMT NETWORK= $+ %network CASEMAPPING=ascii EXTBAN=~,cqr :are supported by this server } } alias fullhost { ;Le $1 est un sockname set %thost $socknick($1) $+ ! $+ %identd_ [ $+ [ $socknick($1) ] ] $+ @ $+ %host_ [ $+ [ $1 ] ] return %thost } alias validflags { if ($1) { set %tflags $1 set %tflags $removecs(%tflags,o,O,a,A,N,C,g,h,R,D,w,n,G,k,K,b,B,t,z,Z,v,H,W,r) if (%tflags) { return $false } else { return $true } } } alias operexists { if ($1) { if (%oline. [ $+ [ $1 ] ]) { return $true } else { return $false } } } alias goodoperpass { if ($2) { if (%oline. [ $+ [ $1 ] ] [ $+ [ .pass ] ] == $2) { return $true } else { return $false } } } alias goodoperhost { ;$goodoperhost(UID,host) if ($2) { if (%oline. [ $+ [ $1 ] ] [ $+ [ .host ] ] iswm $2) { return $true } else { return $false } } } alias goodvhosthost { ;$goodvhosthost(UID,host) if ($2) { if (%vhost_ [ $+ [ $1 ] ] [ $+ [ .from ] ] iswm $2) { return $true } else { return $false } } } alias gzline.add { ;gzline.add host $ctime timetoexpire host_gzlineur raison ; 1 2 3 4 5 if ($5) { write $linesfile GZ $1- } } alias gzline.del { if ($1) { var %i 0 set %gzfile $linesfile if (!$exists(%gzfile)) { halt } unset %gzline unset %r var %file $gopen(%gzfile) while ($fread(%file)) { inc %i set %r $ifmatch if ($gettok(%r,1,32) == GZ) { if ($gettok(%r,2,32) == $1) { write -dl $+ %i %gzfile break } } } .fclose %file } } alias gzline.infos { if ($1) { set %gzfile $linesfile if (!$exists(%gzfile)) { goto gzlineinfosend } unset %gzline unset %gzinfos var %file $gopen(%gzfile) while ($fread(%file)) { set %r $ifmatch if ($gettok(%r,1,32) == GZ) { if ($gettok(%r,2,32) == $1) { set %gzinfos $gettok(%r,3-,32) } } } .fclose %file if (%gzinfos) { return %gzinfos } } :gzlineinfosend } alias addircoplist { if ($1) { unset %iline var %i 0 set %ifile $ircoplistfile if (!$exists(%ifile)) { goto next } var %file $gopen(%ifile) while ($fread(%file)) { inc %i if ($gettok($ifmatch,1,32) == $1) { set %iline %i } } .fclose %file :next if (!%iline) { write %ifile $1 %ircop_ [ $+ [ $1 ] ] } else { write -dl $+ %iline %ifile write %ifile $1 %ircop_ [ $+ [ $1 ] ] } } } alias ircoplistfile { return %sysdir $+ \ircops.lst } alias delircoplist { if ($1) { unset %iline var %i 0 set %ifile $ircoplistfile if (!$exists(%ifile)) { goto next } var %file $gopen(%ifile) while ($fread(%file)) { inc %i if ($gettok($ifmatch,1,32) == $1) { set %iline %i } } .fclose %file if (%iline) { write -dl $+ %iline %ifile } :next } } alias globops { set %gfile $userslistfile if (!$exists($userslistfile)) { goto globopsend } var %file $gopen(%gfile) while ($fread(%file)) { set %r $ifmatch if (%ircop_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { ;<- :irc.g-neration.com NOTICE huh :*** Global -- from huh: :o sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r : $+ $1- } } } .fclose %file :globopsend } alias locops { ;locops USER MESSAGE- if ($2) { ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto locopsend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (O isincs %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { if ($1 != %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** LocOps -- from $1 $+ : $2- } else { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r : $+ $2- } } } } .fclose %file :locopsend ;Fin } } alias rh { if ($1) { set %rh.user $1 ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto rhend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- Loading IRCd configuration .. } } } .fclose %file :rhend ;Fin } else { set %rh.user <G-IRCD> } log [4CONFIG] Rehashing server... (2 $+ %rh.user $+ ) set %nicklen 25 set %chanlen 30 set %G-NORME.chan #abcdefghijklmnopqrstuvwxyz0123456789+~&^âàáäãîïíìöòóôõéèëêuùúûüÿýñ絤£?¡!?¿<>[]`_-{}%$²()\/ set %G-NORME.nick abcdefghijklmnopqrstuvwxyz0123456789âàáäãîïíìöòóôõéèëêuùúûüÿýñç<>[]`_-{}()^\| set %stxm icmnprstACMK1OQRSVT set %dynm bekl2 set %cfgcmds oper me link set %sysdir $mircdir $+ System set %cmd.oper.lines 4 set %cmd.me.lines 3 set %cmd.vhost.lines 3 set %cmd.link.lines 4 delserver %me .remove $confservs unset %incommand set %numeric 1 ;à changer car la prochaine version autorisera les links ! set %confprob $false if (!$1) { unset %oline.* unset %me* unset %link* } if (!$exists(G-IRCD.conf)) { set %confprob $true log [12CONFIG] Unable to find G-IRCD.conf goto rehashend } if (!$exists(help.cmd)) { log [12CONFIG] WARNING: Unable to find help.cmd } var %i 1 set %clines $lines(G-IRCD.conf) while (%i <= %clines) { set %r $read(G-IRCD.conf,n,%i) if (!%incommand) { if ($gettok(%r,2,32)) { if (($right(%r,1) == $chr(123)) || ($gettok(%r,1,32) == serv_listen)) { set %cmdlines 0 set %incommand $gettok(%r,1-,32) } else { inc %i if ($read(G-IRCD.conf,n,%i) == $chr(123)) { set %cmdlines 0 set %incommand $gettok(%r,1-,32) } else { set %confprob $true log [12CONFIG] Missing open brace ( $+ %i $+ ) goto rehashend } } } } else { ;On est dans un bloc ! ;Avant tout, vérifier si c'est pas un } if ($gettok(%incommand,1,32) == oper) { set %oline. $+ $gettok(%incommand,2,32) $true inc %cmdlines set %tuser $gettok(%incommand,2,32) if ($gettok(%r,1,32) == from) { if ($gettok(%r,2,32)) { if (@ isin $gettok(%r,2,32)) { set %oline. $+ %tuser $+ .host $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Invalid host format for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Missing parameter for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == password) { if ($gettok(%r,2,32)) { if ($len($gettok(%r,2,32)) >= 6) { set %oline. $+ %tuser $+ .pass $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Password too short ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Missing parameter for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == flags) { if ($gettok(%r,2,32)) { if ($validflags($gettok(%r,2,32))) { set %oline. $+ %tuser $+ .flags $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Some of the flags doesn't exist (flags: %tflags $+ ). ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Missing parameter for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == swhois) { if ($gettok(%r,2,32)) { set %oline. $+ %tuser $+ .swhois $gettok(%r,2-,32) } else { set %confprob $true log [12CONFIG] Missing parameter for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } else { if ($left(%r,1) == $chr(125)) { dec %cmdlines if (%cmdlines == %cmd. [ $+ [ $gettok(%incommand,1,32) ] ] [ $+ [ .lines ] ] ) { unset %incommand } else { set %confprob $true log [12CONFIG] Missing, or excessive lines in bloc ' $+ $gettok(%incommand,1,32) $+ ' goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } } elseif ($gettok(%incommand,1,32) == me) { inc %cmdlines if ($gettok(%r,1,32) == name) { if ($gettok(%r,2,32)) { set %me $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == info) { if ($gettok(%r,2,32)) { set %me.info $gettok(%r,2-,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == numeric) { if ($gettok(%r,2,32)) { set %tnumeric $gettok(%r,2,32) if (%tnumeric !isalpha) { if (%tnumeric >= 1) { set %me.numeric %tnumeric } else { set %confprob $true log [12CONFIG] Numeric must be > than 1. ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Numeric must be a number. ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Missing parameter for ' $+ $gettok(%r,1,32) $+ ' line. ( $+ %i $+ ) goto rehashend } } else { if ($left(%r,1) == $chr(125)) { dec %cmdlines if (%cmdlines == %cmd. [ $+ [ $gettok(%incommand,1,32) ] ] [ $+ [ .lines ] ] ) { write $serverlist %me %me.numeric %me.info unset %incommand } else { set %confprob $true log [12CONFIG] Missing, or excessive lines in bloc ' $+ $gettok(%incommand,1,32) $+ ' goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } } elseif ($gettok(%incommand,1,32) == vhost) { inc %cmdlines if ($gettok(%r,1,32) == vhost) { if ($gettok(%r,2,32)) { set %vhost_ [ $+ [ $gettok(%incommand,2,32) ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == from) { if ($gettok(%r,2,32)) { set %vhost_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .from ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == password) { if ($gettok(%r,2,32)) { if ($len($gettok(%r,2,32)) >= 6) { set %vhost_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .password ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Password too short ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } else { if ($left(%r,1) == $chr(125)) { dec %cmdlines if (%cmdlines == %cmd. [ $+ [ $gettok(%incommand,1,32) ] ] [ $+ [ .lines ] ] ) { unset %incommand } else { set %confprob $true log [12CONFIG] Missing, or excessive lines in bloc ' $+ $gettok(%incommand,1,32) $+ ' goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } } elseif ($gettok(%incommand,1,32) == link) { inc %cmdlines if ($gettok(%r,1,32) == ip) { if ($gettok(%r,2,32)) { set %link_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .ip ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == port) { if ($gettok(%r,2,32)) { set %link_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .port ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == password-receive) { if ($gettok(%r,2,32)) { if ($len($gettok(%r,2,32)) >= 6) { set %link_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .password_r ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Password too short ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } elseif ($gettok(%r,1,32) == password-connect) { if ($gettok(%r,2,32)) { if ($len($gettok(%r,2,32)) >= 6) { set %link_ [ $+ [ $gettok(%incommand,2,32) ] ] [ $+ [ .password_c ] ] $gettok(%r,2,32) } else { set %confprob $true log [12CONFIG] Password too short ( $+ %i $+ ) goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } else { if ($left(%r,1) == $chr(125)) { dec %cmdlines if (%cmdlines == %cmd. [ $+ [ $gettok(%incommand,1,32) ] ] [ $+ [ .lines ] ] ) { write $confservs $gettok(%incommand,2,32) unset %incommand } else { set %confprob $true log [12CONFIG] Missing, or excessive lines in bloc ' $+ $gettok(%incommand,1,32) $+ ' goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc line ' $+ $gettok(%r,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } } elseif ($gettok(%incommand,1,32) == serv_listen) { inc %cmdlines set %tport $gettok(%incommand,2,32) if ($len(%tport)) { if ($portfree(%tport)) { socklisten gserv $+ %tport %tport } dec %cmdlines unset %incommand } else { set %confprob $true log [12CONFIG] Missing argument in bloc ' $+ $gettok(%incommand,1,32) $+ ' goto rehashend } } else { set %confprob $true log [12CONFIG] Unknown bloc type ' $+ $gettok(%incommand,1,32) $+ '. ( $+ %i $+ ) goto rehashend } } inc %i } :rehashend if (!%confprob) { log [4CONFIG] Configuration loaded without any problem } else { log [4CONFIG] Config file could not be loaded... } if ($1) { ;Envoyer la notice à tous les IRCops locaux set %ilf $ircoplistfile if (!$exists(%ilf)) { goto ttend } var %file $gopen(%ilf) while ($fread(%file)) { set %r $gettok($ifmatch,1,32) if (o isin %umodes_ [ $+ [ %r ] ]) { if (%server_ [ $+ [ %r ] ] == %me) { if (!%confprob) { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- Configuration loaded without any problems .. } else { sw %sockname_ [ $+ [ %r ] ] : $+ %me NOTICE %r :*** Notice -- There was one or several errors - See log.txt for more information } } } } .fclose %file :ttend ;Fin } } alias confservs { return $mircdir $+ System\confservs.lst } on *:socklisten:http: { set %httpsock $calc($rand(1,999999) + $ctime) sockaccept %httpsock sendpage %httpsock } on *:sockread:http: { sockread %httpsr } alias sendpage { if ($1) { var %i 1 set %httplines $lines(index.htm) sw $1 HTTP/1.0 200 OK sw $1 Cache-Control: private sw $1 Content-Type: text/html sw $1 Set-Cookie: PREF=ID=37b5b3f171a73a13:TM=1087929353:LM=1087929353:S=AG7kB9gWNztna9Lc; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; sw $1 Server: GWS/2.1 sw $1 Content-Length: 2569 sw $1 Date: huhu :p sw $1 Connection: Keep-Alive sw $1 $crlf ;while (%i <= %httplines) { ; sw $1 $read(index.htm,%i) ; inc %i ;} sw $1 <html> sw $1 <head> sw $1 <meta http-equiv="Content-Language" content="en"> sw $1 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> sw $1 <title>G-IRCD ( $+ %me $+ )</title> sw $1 </head> sw $1 <body> sw $1 <p align="center"><font color="CC0000"><u><b> $+ %me $+ </b></u></font></p><br><br> if ($gettok(%ports,0,300) >= 2) { set %str.port ports } else { set %str.port port } sw $1 Listening %str.port %ports $+ <br><br> sw $1 Online users : $lines($userslistfile) $+ <br> sw $1 Online IRCop's : $lines($ircoplistfile) $+ <br> sw $1 Channels created : $lines($chanlistfile) $+ <br><br> sw $1 Launched since $readini(System\G-IRCD.dat,GlobalVars,online) $+ <br> sw $1 Server created on $readini(System\G-IRCD.dat,GlobalVars,creationtime) $+ <br><br><br><br><br><br> sw $1 <p align="center"> sw $1 <i><font size="2">Running <a href="http://www.g-neration.com/g-ircd/">G-IRCD 1.0</a></font></i><br> sw $1 <font size="2"><i>By G-FACTION</i></font></p> sw $1 </body> sw $1 </html> sockclose $1 } }

Conclusion :


Téléchargez le zip au lieu de recopier le code ;)

Update (18/02/2005):
G-IRCD1.1 - Zip mis à jour

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.