summaryrefslogtreecommitdiff
path: root/chess-network.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
commit62c13bcfa1933274be856ac5840a933bbaca5f27 (patch)
tree81e2d4ab1a749a4d2561e824708abd60a04d67d0 /chess-network.el
parent171cc1aceb0e9acafe329ff6cd0ca1e2852876ce (diff)
Bug fixes and reducing the TODO list.
Diffstat (limited to 'chess-network.el')
-rw-r--r--chess-network.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/chess-network.el b/chess-network.el
index 7b38ed7..ed1c512 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -4,8 +4,6 @@
;;
(require 'chess-common)
-(require 'chess-fen)
-(require 'chess-algebraic)
(defvar chess-network-regexp-alist
(list
@@ -72,6 +70,10 @@
(function
(lambda ()
(funcall chess-engine-response-handler 'illegal))))
+ (cons "call flag$"
+ (function
+ (lambda ()
+ (funcall chess-engine-response-handler 'call-flag))))
(cons "kibitz\\s-+\\(.+\\)$"
(function
(lambda ()
@@ -106,13 +108,18 @@
(let ((which (read-char "Are you the c)lient or s)erver? "))
proc)
(chess-message 'network-starting)
- (setq proc (if (eq which ?s)
- (start-process "*chess-network*"
- (current-buffer) "/usr/bin/nc"
- "-l" "-p" (read-string "Port: "))
- (open-network-stream "*chess-network*" (current-buffer)
- (read-string "Host: ")
- (read-string "Port: "))))
+ (setq proc
+ (if (eq which ?s)
+ (if (fboundp 'open-network-stream-server)
+ (open-network-stream-server "*chess-network*"
+ (current-buffer)
+ (read-string "Port: "))
+ (start-process "*chess-network*"
+ (current-buffer) "/usr/bin/nc"
+ "-l" "-p" (read-string "Port: ")))
+ (open-network-stream "*chess-network*" (current-buffer)
+ (read-string "Host: ")
+ (read-string "Port: "))))
(if (eq which ?s)
(chess-message 'network-waiting)
(chess-network-handler 'match)
@@ -175,6 +182,9 @@
((eq event 'illegal)
(chess-engine-send nil "illegal\n"))
+ ((eq event 'call-flag)
+ (chess-engine-send nil "call flag\n"))
+
((eq event 'kibitz)
(chess-engine-send nil (format "kibitz %s\n"
(chess-network-flatten-multiline