Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 554af229a759ba8501e0143ef8c3864c39055cce
  • master par défaut protégée
  • rust-playlist-sync
  • rust
  • fix-qt-deprecated-qvariant-type
  • fix-mpris-qtwindow-race-condition
  • rust-appimage-wayland
  • windows-build-rebased
  • v2.5 protégée
  • v2.4 protégée
  • v2.3-1 protégée
  • v2.3 protégée
  • v2.2 protégée
  • v2.1 protégée
  • v2.0 protégée
  • v1.8-3 protégée
  • v1.8-2 protégée
  • v1.8-1 protégée
  • v1.8 protégée
  • v1.7 protégée
  • v1.6 protégée
  • v1.5 protégée
  • v1.4 protégée
  • v1.3 protégée
  • v1.2 protégée
  • v1.1 protégée
  • v1.0 protégée
27 résultats

module_repo.c

Blame
    • Kubat's avatar
      554af229
      DB & MODULE: Check for obfuscation mode. · 554af229
      Kubat a rédigé
      The obfuscation download mode can't change for the moment. It would
      require to 'translate' filepaths, or be able to deal with non uniform
      databases, don't do that for the moment.
      
      Also update the changelog.
      DB & MODULE: Check for obfuscation mode.
      Kubat a rédigé
      The obfuscation download mode can't change for the moment. It would
      require to 'translate' filepaths, or be able to deal with non uniform
      databases, don't do that for the moment.
      
      Also update the changelog.
    Sam.pm 3,06 Kio
    package Sam;
    
    require Exporter;
    our @ISA = qw(Exporter);
    our @EXPORT_OK = qw(start);
    
    use strict;
    use warnings;
    
    use POE;
    use POE::Component::IRC;
    use DBI;
    use JSON;
    use Logging;
    use commands::parser;
    
    my $log = Logging->new('STDOUT', 1);
    
    # config
    my $serveur = 'IRC.iiens.net';
    my $nick = 'Sam';
    my $port = 6667;
    my $ircname = 'nightiies';
    my $username = 'nightiies';
    my @channels = qw(#nightiies #bigphatsubwoofer);
    my $admin = 'moise';
    my $baseurl = 'http://nightiies.iiens.net/sam/';
    my %lastID;
    my %commandes_admin = ("cycle" => \&cycle);
    
    my $debug = 0;
    
    # mode debug
    if ($#ARGV + 1) {
    	@channels = qw(#hormone);
    	$nick = 'glloq';
    	$debug = 1;
    }
    
    
    local $/;
    open CONF, '<', 'sam.conf';
    my $json = <CONF>;
    my $conf = decode_json($json);
    
    
    my ($irc) = POE::Component::IRC->spawn();
    my $dbh = DBI->connect('DBI:mysql:'.$conf->{'bdd'}.';host='.$conf->{'host'}, $conf->{'user'}, $conf->{'passwd'}, {
    	    PrintError => 0,
    	    AutoCommit => 1,
    		mysql_auto_reconnect => 1
    	})
    	or die("Couldn't connect to database: ".DBI->errstr);
    
    # Evenements que le bot va gérer
    POE::Session->create(
    	inline_states => {
            _start     => \&bot_start,
            irc_001    => \&on_connect,
            irc_public => \&on_speak,
            irc_msg    => \&on_query,
            irc_invite => \&on_invite
    	},
    );
    
    
    sub cycle
    {
    	my ($arg) = @_;