diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-15 05:40:38 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-15 05:40:38 +0000 |
| commit | ef7c29d679c6aaf8dda55772e65800097c46f163 (patch) | |
| tree | 543f39f09bfaa6d44606804c18babff26470d4f8 /chess-transport.el | |
| parent | 6fbcc92505250d896b5d408483822b115bc614c7 (diff) | |
*** no comment ***
Diffstat (limited to 'chess-transport.el')
| -rw-r--r-- | chess-transport.el | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/chess-transport.el b/chess-transport.el index 3a1beba..f88432e 100644 --- a/chess-transport.el +++ b/chess-transport.el @@ -11,29 +11,30 @@ (defvar chess-transport-regexp-alist chess-network-regexp-alist) -(defun chess-transport-handler (event &rest args) +(defun chess-transport-handler (game event &rest args) "This is an example of a generic transport engine." - (cond - ((eq event 'initialize) - ;; Initialize the transport here, if necessary. Make sure that - ;; any housekeeping data you use is kept in buffer-local - ;; variables. Otherwise, multiple games played using the same - ;; kind of transport might collide. For example: - ;; - ;; (set (make-local-variable 'chess-transport-data) (car args)) - ;; - ;; NOTE: Be sure not to return a process, or else chess-engine - ;; will do all the transport work! - t) - - ((eq event 'send) - ;; Transmit the string given in `(car args)' to the outbound - ;; transport from here - ) - - (t - ;; Pass all other events down to chess-network - (apply 'chess-network-handler event args)))) + (unless chess-engine-handling-event + (cond + ((eq event 'initialize) + ;; Initialize the transport here, if necessary. Make sure that + ;; any housekeeping data you use is kept in buffer-local + ;; variables. Otherwise, multiple games played using the same + ;; kind of transport might collide. For example: + ;; + ;; (set (make-local-variable 'chess-transport-data) (car args)) + ;; + ;; NOTE: Be sure not to return a process, or else chess-engine + ;; will do all the transport work! + t) + + ((eq event 'send) + ;; Transmit the string given in `(car args)' to the outbound + ;; transport from here + ) + + (t + ;; Pass all other events down to chess-network + (apply 'chess-network-handler event args))))) ;; Call `(chess-engine-submit engine STRING)' for text that arrives ;; from the inbound transport |
