/******************************************************************************* Module Teleport Client part Version: 1.0 Authors: Sylvain HUET & sebastien DENEUX Last update: 20/06/2001 *******************************************************************************/ defcom Ssetdefault = setdefault S S;; /*set the default entry position of the site [room_name position]*/ defcom Steleport = teleport S S I;; /* teleportation of the user [room_name position flag]*/ defcom SupdatePositionValidity = updatePositionValidity S S I ;; /*update the validity of a position [room_name position validityFlag]*/ defcom SchangeInterfaceState = changeInterfaceState I I ;; /*inform the server of the new state (shown/hidden_ of the interface [state flagMode]*/ /******************************************************************************* teleportation flag value : 1 se teleporter 2 retour arriere 3 se teleporter avec un user (reserve au userTeleport) 4 teleporter un user (reserve au userTeleport) *******************************************************************************/ fun TeleportUser(room_name,position,flag)= /*_fooS strcat "##### teleportUser roomName = " room_name; _fooS strcat "##### teleportUser position = " position; _fooS strcat "##### teleportUser flag = " itoa flag;*/ _DMSsend this Steleport [room_name position flag]; 0 ;; /******************************************************************************* construction tuple des positions (partie pos+validity) *******************************************************************************/ fun BuildLpositions2(l)= if l == nil then nil else let hd l -> [position[valid _]] in ([position atoi valid])::(BuildLpositions2 tl l) ;; /******************************************************************************* construction tuple des positions *******************************************************************************/ fun BuildLpositions(l)= if l==nil then nil else let strextr hd l -> l2 in let getInfo l2 "room_name" -> room_name in let getInfo l2 "positions" -> positions in let BuildLpositions2 strextr positions -> l3 in ([room_name l3])::(BuildLpositions tl l) ;; /******************************************************************************* show the interface flag value 1 userAdmin 2 userTeleport 3 user *******************************************************************************/ fun ShowPositionsInterface(s,default_room_name,default_position,flag,focus) = set positions = BuildLpositions hd strextr s; ShowPositionsInterface2 default_room_name default_position flag focus; 0 ;; /******************************************************************************* update the validity of a position *******************************************************************************/ fun UpdatePositionValidity(room_name,position,validityFlag) = _DMSsend this SupdatePositionValidity [room_name position validityFlag] ;; /******************************************************************************* define the entry default position of the site (if action enter used) *******************************************************************************/ fun UpdateDefaultPosition(room_name,position) = _DMSsend this Ssetdefault [room_name position] ;; /******************************************************************************* show the interface *******************************************************************************/ fun __show(flag,positions,default_room_name,default_position,focus)= ShowPositionsInterface positions default_room_name default_position flag focus; 0 ;; /******************************************************************************* select a position on the interface *******************************************************************************/ fun __select(room_name,position)= /*_DLGMessageBox _channel nil DMSlogin position 0;*/ SelectPosition room_name position ;; /******************************************************************************* open the admistration interface from -> DMI : not used user -> User : the user that run the action action -> S : not used param -> S : not used others -> [User r1] : not used tag -> Tag : not used <- I : nothing special *******************************************************************************/ fun cbHide (from, action, param, others, tag) = HidePositionInterface; 0 ;; /******************************************************************************* called when interface is shown *******************************************************************************/ fun GoShow(flag)= _DMSsend this SchangeInterfaceState [1 flag]; _DMSeventTag this "shown" nil nil nil ;; /******************************************************************************* called when interface is hidden *******************************************************************************/ fun GoHide(flag)= _DMSsend this SchangeInterfaceState [0 flag]; _DMSeventTag this "hidden" nil nil nil ;; /******************************************************************************* *******************************************************************************/ fun IniDMI(param) = set backColor = param; _DMSdefineActions this ["hide" @cbHide]::nil; _DMSeventTag this "in" nil nil nil; 0 ;;