/* comclient.pkg */ defcom ComAPIok = ComAPIok;; defcom ChatNAck = ChatNACK S S;; fun __APIstart ()= { let _channelIP _channel -> a in if (strcmp a _hostIP) && (strcmp a "127.0.0.1") then { _on _channel status ["This client is not authorised to connect to this server.\nOnly local connections are allowed."]; _delline _channel; _on _channel ChatNAck ["" "Line already created"]; _closechannel; 0 } else { _setenv _channel serverenv; _load "comm/comAPI.pkg"; _script "APIMain"; _on _channel ComAPIok []; 0 } };; defcom InitChat = InitChat S I;; fun ChatStart (o,nick,i)= let (findline Lines (_channelIP _channel))-> line in if ((i==1) && line!=nil) then { _fooS "LINES NIL"; set Lines=_channel::Lines; _setenv _channel serverenv; _load "comm/comphone.pkg"; _load "comm/comchat.pkg"; _script mkscript InitChat [nick ChatRoom]; } else { _fooS "LINES PAS NIL"; _on _channel ChatNAck ["" "Chat refused by pair."]; _closechannel; nil } ;; fun __ChatStart (nick)= if findline Lines (_channelIP _channel) then { _fooS "Line Allready connected"; _delline _channel; _on _channel ChatNAck ["" "Line already created"]; _closechannel; nil } else _DLGrflmessage (_DLGMessageBox _channel nil loc "INCOMING" strloc loc "INCOM2" nick::(_channelIP _channel)::nil 1) @ChatStart nick ;; fun _connected ()= { _status "Client connected.\n"; };; fun _closed ()= _delline _channel /* _closemachine*/ ;;