/* Sequence Local Server - DMS - February 2003 - by Bob Le Gob */ /******************************************************************************* Functions *******************************************************************************/ /******************************************************************************* Functions: Module main callbacks *******************************************************************************/ /******************************************************************************* client part of the module has been deleted cli -> CLIENT : Client <- I : Not used *******************************************************************************/ fun cbDeleteClient (cli) = _DMSeventTag this CtoU cli "ended" nil nil nil; 0;; /******************************************************************************* destroys a client from -> DMI : Not used user -> User : User triggering the action action -> S : Not used param -> S : Not used others -> [User r1] : Not used tag -> Tag : Not used <- I : Not used *******************************************************************************/ fun cbDestroy (from, user, action, param, others, tag) = let UtoC user -> cli in ( _DMSdelClientDMI this cli; _DMSeventTag this user "destroyed" nil nil nil; ); 0;; /******************************************************************************* creates a client from -> DMI : Not used user -> User : User triggering the action action -> S : Not used param -> S : Not used others -> [User r1] : Not used tag -> Tag : Not used p -> S : Sequence length <- I : Not used *******************************************************************************/ fun cbStart (from, user, action, param, others, tag, p) = if _DMScreateClientDMI this UtoC user p then _DMSeventTag this user "entering" nil nil nil else nil; 0;; /******************************************************************************* Functions: Module instanciation *******************************************************************************/ /******************************************************************************* Standard IniDMI s -> S : Not used <- I : Not used *******************************************************************************/ fun IniDMI(s)= let _DMSgetDef this "dmi" -> l in let getInfo l "sequence" -> s in ( _DMSregister this nil @cbDeleteClient nil; _DMSdefineActions this (["start" (mkfun7 @cbStart s)]):: (["destroy" @cbDestroy]):: nil; ); 0;;