groworld/comm
2009-04-06 21:15:28 +01:00
..
examples.scm added the 3d stuff 2009-04-06 21:15:28 +01:00
README first pass at XMPP for communication 2009-03-28 11:47:22 +01:00
xmpp.scm improved tls support 2009-04-01 12:15:16 +02:00

Various parts of the groworld multplayer communcation infrastructure
preliminary notes can be found online at -> 
http://lib.fo.am/groworld_multiplayer_prototype#network_protocol

;; exmaple chat client

(require "xmpp.scm")

(define (read-input prompt)
  (display prompt)
  (read-line (current-input-port)))

(define (chat)
  (let ((jid  (read-input "jid: "))
        (pass (read-input "password: "))
        (to   (read-input "chat with: ")))
    (with-xmpp-session jid pass 
                       (set-xmpp-handler 'message print-message)
                       (let loop ()                         
                         (let ((msg (read-line (current-input-port))))
                           (send (message to msg))
                           (loop))))))