]> code.delx.au - gnu-emacs-elpa/blobdiff - chess-transport.el
Try to improve the promotion situation on ICS by allowing chess-ply to query for...
[gnu-emacs-elpa] / chess-transport.el
index dcec224f92489bde2c1271c40e210ed263427b28..12dce9a470e41ab06dfee42bf77a2147ea749fa7 100644 (file)
@@ -5,35 +5,35 @@
 ;; receive.  This could be used for transmitting chess.el protocol
 ;; over CTCP, for example.
 ;;
-;; $Revision$
 
 (require 'chess-network)
 
 (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!
-    )
-
-   ((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 game event args)))))
 
 ;; Call `(chess-engine-submit engine STRING)' for text that arrives
 ;; from the inbound transport