/* Log Server - DMS - feb 98 - by Sylvain HUET */ defcom Cregister=register;; defcom Ccommand=command S;; var world="";; var connex=0;; var hits=0;; typeof lw=LogWin;; var ltime=0;; typeof flog=Logfile;; fun addlog(m)= _logsentence flog m 1; let if time-ltime <60 then "" else (set ltime=time; ctime time) -> p in let strcat strcat p m "\n"-> s in _echoLogW lw s;; fun _comevent(b,s)= _DMSsend this Ccommand [s];; fun _endlog(b)= _DMSdelete this;; fun _resize(x,s)= let x->[win x y w h] in _SIZEwindow lw.winLogW w h x y; 0;; fun startlog()= set flog=_openlog strcat "log/" substr world 0 21 255 60; set lw= let _DMSgetZone this "Log" nil @_resize @_endlog ->[win x y w h] in if win==nil then iniLogW _channel DMSwin nil nil 350 250 "LogWindow" @_endlog @_comevent 0 else iniLogW _channel win x y w h "LogWindow" @_endlog @_comevent 1; _setLogW lw world connex hits; addlog ">>starting"; _DMSsend this Cregister [];; fun __setinfo(t,w,c,h)= _SETtext lw.startLogW t; set world=w; set connex=c; set hits=h; _setLogW lw world connex hits ;; fun IniDMI(param)= 0;; /* set world=strcat strcat param "." _DMSgetName this; startlog;;*/ fun downloadok(s)= _DLGMessageBox _channel DMSwin (_loc this "LOG_MESS" nil) strcat s strcat " : " (_loc this "LOG_MESS2" nil) 0; 0;; fun __downloadFile(f)= _RSCdownload this f f @downloadok 1;; fun __addlog(m)=addlog m;;