/* Modification History : $ LB : Loïc Berthelot, CryoNetworks, june 2001 modifications : _definesocks is now followed by _definesocksVersion and _definesocksAuthentication to manage socks 5 parameters. */ defcom skip=skip;; defcom register=register S;; var state=0;; typeof chn0=Chn;; typeof name=S;; fun multiress(res)= if res==nil then 0 else let res ->[[l n] nxt] in (if strcmp l "#" then _setress l hd n else nil; multiress nxt);; fun main(ip,s)= set chn0=_channel; set name=s; set _masterchannel=_openchannel ip nil _envchannel _channel; if (_masterchannel != nil) then nil else _closemachine; _setsocklife _masterchannel; multiress strextr _loadressini; _setress "MachineName" s; _setLocalIPnumber atoi _getress "localIPindex"; if !strcmpi _getress "AutodetectProxy" "no" then _definesocks _getress "ProxySocks" _getress "ProxyMask" else nil; /* $ LB */ _definesocksVersion _getress "SocksVer"; _definesocksAuthentication _getress "Socks5Authentication"; 0;; fun clock(a,b)= _deltimer a; _scriptc chn0 _starterScript;; fun _connected()= _on _channel skip []; _on _channel register [name]; _setenv chn0 nil; _rfltimer _starttimer _channel 100 @clock 0;; fun __show()= set state= if state==0 then ( _showconsole; 1) else (_hideconsole;0) ;; fun __setress(res,val)=_setress res val;;