Do observe after we have set up AnyEvent listening; otherwise, seemingly we can get...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Nov 2014 00:53:22 +0000 (01:53 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Nov 2014 00:53:22 +0000 (01:53 +0100)
remoteglot.pl

index ec26401..5982eca 100755 (executable)
@@ -93,14 +93,6 @@ $t->cmd("");
 $t->cmd("set shout 0");
 $t->cmd("set seek 0");
 $t->cmd("set style 12");
-if (defined($remoteglotconf::target)) {
-       if ($remoteglotconf::target =~ /^http:/) {
-               fetch_pgn($remoteglotconf::target);
-       } else {
-               $t->cmd("observe $remoteglotconf::target");
-       }
-}
-print "FICS ready.\n";
 
 my $ev1 = AnyEvent->io(
        fh => fileno($t),
@@ -116,6 +108,15 @@ my $ev1 = AnyEvent->io(
                }
        }
 );
+if (defined($remoteglotconf::target)) {
+       if ($remoteglotconf::target =~ /^http:/) {
+               fetch_pgn($remoteglotconf::target);
+       } else {
+               $t->cmd("observe $remoteglotconf::target");
+       }
+}
+print "FICS ready.\n";
+
 # Engine events have already been set up by Engine.pm.
 EV::run;