sockets en NS.
#16
Salut,

Donc j'ai modifié comme tu as dit pas de soucis plus de soucis du moins lors du .restart de l'eggdrop lanceur la sockets se lance pas.

Et si je fait .xrestart pour restart la socket idem rien ne se passe.

voici le tcl actuel pour que tu voye mieux j'ai pas cesser de le modif donc je regarderais à tête reposé.

TCL
namespace eval ::socks {
	variable aurore

#********************#
# Service.Socket 1.0 #
#********************#

#**************************#
# Information link reseau. #
#**************************#
 
set aurore(serv) "Aurore.****.fr"
set aurore(ip) "ip"
set aurore(port) "port"
set aurore(pwdlink) "pass"
set aurore(info) "Aurore Services"

#****************************#
# Configuration des sockets. #
#****************************#
 
set aurore(nick) "Hera" 
set aurore(identd) "Hera" 
set aurore(host) "Services.****.fr"
set aurore(nom) "Services-Log"

#***************************#
# Salon de log des sockets. #
#***************************#
 
set aurore(log) "#Services"
set aurore(quit01) "Redemarage Aurore-Service."
set aurore(quit02) "Fermeture Aurore-Service."

#****************************************#
# Lancement de la procédure des sockets. #
#****************************************#
 
utimer 1 [namespace current]::checkconnect
proc checkconnect {} {
	if {![info exists aurore(idx)]} { utimer 30 [namespace current]::checkconnect } else { xconnect:serv }
}
 
 
proc xconnect:serv {} {
	variable aurore
	set aurore(idx) "[connect $::socks::aurore(ip) $::socks::aurore(port)]"
	putdcc $aurore(idx) "PASS $::socks::aurore(pwdlink)"
	putdcc $aurore(idx) "SERVER $::socks::aurore(serv) 1 [unixtime] [unixtime] J09 ACAA\] +s :$::socks::aurore(info)"
	putdcc $aurore(idx) ":$::socks::aurore(serv) NICK $::socks::aurore(nick) '' '' $::socks::aurore(identd) $::socks::aurore(host) $::socks::aurore(serv) '' :$::socks::aurore(nom)"
	putdcc $aurore(idx) ":$::socks::aurore(nick) MODE $::socks::aurore(nick) +owsgkd"
	putdcc $aurore(idx) ":$::socks::aurore(nick) JOIN $::socks::aurore(log)"
	putdcc $aurore(idx) ":$::socks::aurore(nick) MODE $::socks::aurore(log) +ntsv $::socks::aurore(nick)"	
        control $aurore(idx) [namespace current]::controling_server
   utimer 10 [namespace current]::verify
 
}

#***********************************#
# Verify si le serveur est Connecté #
#***********************************#
 
proc verify {} {
	variable aurore
	if [valididx [set [namespace current]::aurore(idx)]] {
		utimer 30 [namespace current]::verify
	} else {
    xconnect:serv
	}
}
 
proc valididx {idx} {
	variable aurore
	set r 0
	foreach j [dcclist] {
		if {[lindex $j 0] == $idx} {
			set r 1
		}
	}
	return $r
}
 
 
proc controling_server {idx arg} {
	variable aurore
	regsub -all {\\} $arg {\\\\} arg
        regsub -all {\{} $arg {\{} arg
        regsub -all {\}} $arg {\}} arg
        regsub -all {\]} $arg {\]} arg
        regsub -all {\[} $arg {\[} arg
        regsub -all {\"} $arg {\"} arg
        regsub -all {\`} $arg {\`} arg
	    set arg1 "[lindex $arg 0]"
	    set arg2 "[lindex $arg 1]"
	    set arg3 "[lindex $arg 2]"
	    set arg4 "[lindex $arg 3]"
	    set arg5 "[lindex $arg 4]"
	    set arg6 "[lindex $arg 5]"
	    set arg7 "[lindex $arg 6]"
	    set arg8 "[lindex $arg 7]"
	    set arg10 "[string trim [lrange $arg 3 end] :]"
	if {$arg2=="PING"} {
   	putdcc $aurore(idx) ":$::socks::aurore(serv) PONG $::socks::aurore(ip) :$::socks::aurore(serv)"
    }	
 
}
 
#**********************#
# Restart des sockets. #
#**********************#
 
bind evnt - prerestart [namespace current]::eva:restart
proc eva:restart {args} {
	variable aurore
	putdcc $aurore(idx) ":$::socks::aurore(serv) SQUIT $::socks::aurore(serv) :Restart Sockets."
}
 
#********************#
# Rehash du Service. #
#********************#
 
bind dcc n "xrehash" [namespace current]::eggy:xrehash
proc eggy:xrehash {nick idx arg} {
	variable aurore
    putdcc $idx "\002Rehash de Aurore-Service et des fichiers\002"
        utimer 4 rehash
}
 
#*********************#
# Restart du Service. #
#*********************#
 
bind dcc n "xrestart" [namespace current]::eggy:xrestart
proc eggy:xrestart {nick idx arg} {
	variable aurore
        putdcc $idx "\002Redémarrage de Aurore-service\002"
    if [valididx [set [namespace current]::aurore(idx)]] {
        putdcc $aurore(idx) ":$aurore(nick) QUIT :::socks::$aurore(quit01)"
        putdcc $aurore(idx) ":$aurore(serv) SQUIT :$::socks::aurore(serv)"
	  foreach kill [utimers] { 
            if {[lindex $kill 1]=="verification"} { killutimer [lindex $kill 2] }
      }
    }
    xconnect:serv
 
}
 
#*****************#
# Die du Service. #
#*****************#
 
bind dcc n "xdie" [namespace current]::eggy:xdie
proc eggy:xdie {nick idx arg} {
        putdcc $idx "\002Arrêt de  Aurore-Service\002"
    if [valididx [set [namespace current]::aurore(idx)]] {
        putdcc $aurore(idx) ":$aurore(nick) QUIT : $aurore(quit02)"
        putdcc $aurore(idx) ":$aurore(serv) SQUIT :$aurore(quit02)"
	  foreach kill [utimers] { 
            if {[lindex $kill 1]=="verification"} { killutimer [lindex $kill 2] }
      }
    }
}
 
#****************************#
# Fin du Service Sockets 1.0 #
#****************************#
 
}
putlog "\0031Service Sockets 1.0 \0034Chargé."


Répondre Avertir


Messages dans ce sujet
sockets en NS. - par aliasangelius - 11/05/2011, 16:57
RE: sockets en NS. - par CrazyCat - 11/05/2011, 17:30
RE: sockets en NS. - par aliasangelius - 11/05/2011, 17:32
RE: sockets en NS. - par djkenny - 11/05/2011, 18:11
RE: sockets en NS. - par aliasangelius - 11/05/2011, 18:28
RE: sockets en NS. - par djkenny - 11/05/2011, 18:42
RE: sockets en NS. - par djkenny - 11/05/2011, 18:46
RE: sockets en NS. - par djkenny - 11/05/2011, 18:50
RE: sockets en NS. - par aliasangelius - 11/05/2011, 19:46
RE: sockets en NS. - par djkenny - 12/05/2011, 17:50
RE: sockets en NS. - par aliasangelius - 12/05/2011, 20:04
RE: sockets en NS. - par djkenny - 13/05/2011, 06:04
RE: sockets en NS. - par djkenny - 13/05/2011, 06:15
RE: sockets en NS. - par CrazyCat - 13/05/2011, 08:59
RE: sockets en NS. - par djkenny - 13/05/2011, 13:03
RE: sockets en NS. - par aliasangelius - 13/05/2011, 16:34
RE: sockets en NS. - par djkenny - 13/05/2011, 20:31
RE: sockets en NS. - par aliasangelius - 14/05/2011, 11:38
RE: sockets en NS. - par djkenny - 14/05/2011, 13:08
RE: sockets en NS. - par aliasangelius - 14/05/2011, 13:41

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté