25 set SOAPstart {<?xml version="1.0" encoding="utf-8"?>
26 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
30 set SOAPend {</soap:Body>
59 set useragent "Scid/$::scidVersion ([tk windowingsystem]; $::tcl_platform(os) $::tcl_platform(machine); rv:$scidVersionDate) Tcl/Tk [
info patchlevel]"
64 proc xmldecrypt {chdata} {
65 foreach from {{\&} {\<} {\>} {\"} {\'}} \
66 to {{\&} < > {"} {'}} { ;
67 regsub -all $from $chdata $to chdata
75 proc xmlencrypt {chdata} {
76 foreach from {{\&} < > {"} {'}} \
77 to {{\&} {\<} {\>} {\"} {\'}} { ;
78 regsub -all $from $chdata $to chdata
87 global ::Xfcc::xfccrc ::Xfcc::xfccrcfile
89 if {[
catch {open $xfccrcfile w} optionF]} {
90 puts stderr "$xfccrcfile can not be created"
93 set size [
expr [
array size ::Xfcc::xfccsrv] / 4]
95 puts $optionF "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
96 puts $optionF "<xfcc>"
97 for {
set i 0} {$i < $size } {
incr i} {
98 if { [regexp {^# } $::Xfcc::xfccsrv($i,0)] && \
99 [regexp {^# } $::Xfcc::xfccsrv($i,1)] && \
100 [regexp {^# } $::Xfcc::xfccsrv($i,2)] && \
101 [regexp {^# } $::Xfcc::xfccsrv($i,3)] } {
103 puts $optionF "\t<server>"
104 puts $optionF "\t\t<name>Server</name>"
105 puts $optionF "\t\t<uri>http://</uri>"
106 puts $optionF "\t\t<user>User_Name</user>"
107 puts $optionF "\t\t<pass>Password</pass>"
108 puts $optionF "\t\t<rating>Rating</rating>"
109 puts $optionF "\t</server>"
117 puts $optionF "\t<server>"
118 puts $optionF "\t\t<name>$::Xfcc::xfccsrv($i,0)</name>"
119 puts $optionF "\t\t<uri>$::Xfcc::xfccsrv($i,1)</uri>"
120 puts $optionF "\t\t<user>$::Xfcc::xfccsrv($i,2)</user>"
121 puts $optionF "\t\t<pass>$::Xfcc::xfccsrv($i,3)</pass>"
122 puts $optionF "\t\t<rating>$::Xfcc::xfccsrv($i,4)</rating>"
123 puts $optionF "\t</server>"
126 puts $optionF "</xfcc>"
135 proc DeleteServer {} {
138 set ::Xfcc::Server "# $::Xfcc::xfccsrv($::Xfcc::Oldnum,0)"
139 set ::Xfcc::Username "# $::Xfcc::xfccsrv($::Xfcc::Oldnum,2)"
140 set ::Xfcc::Password "# $::Xfcc::xfccsrv($::Xfcc::Oldnum,3)"
141 set ::Xfcc::Rating "# $::Xfcc::xfccsrv($::Xfcc::Oldnum,4)"
142 set ::Xfcc::URI "# $::Xfcc::xfccsrv($::Xfcc::Oldnum,1)"
143 set ::Xfcc::xfccsrv($::Xfcc::Oldnum) $::Xfcc::Server
150 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,0) $::Xfcc::Server
151 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,2) $::Xfcc::Username
152 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,3) $::Xfcc::Password
153 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,1) $::Xfcc::URI
154 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,4) $::Xfcc::Rating
156 set size [
expr [
array size ::Xfcc::xfccsrv] / 4]
159 .configXfccSrv.xfccSrvList configure -height [
expr $size+2]
161 set ::Xfcc::xfccsrv($size,0) "Unique_ServerName"
162 set ::Xfcc::xfccsrv($size,2) "Your_Login"
163 set ::Xfcc::xfccsrv($size,3) "SeCrEt!"
164 set ::Xfcc::xfccsrv($size,4) "Rating"
165 set ::Xfcc::xfccsrv($size,1) "http://"
167 set ::Xfcc::Server $::Xfcc::xfccsrv($size,0)
168 set ::Xfcc::Username $::Xfcc::xfccsrv($size,2)
169 set ::Xfcc::Password $::Xfcc::xfccsrv($size,3)
170 set ::Xfcc::Rating $::Xfcc::xfccsrv($size,4)
171 set ::Xfcc::URI $::Xfcc::xfccsrv($size,1)
173 lappend ::Xfcc::lsrvname [list $::Xfcc::xfccsrv($size,0)]
175 set ::Xfcc::Oldnum $size
181 proc xfccsrvstore {} {
182 set number [ .configXfccSrv.xfccSrvList curselection]
183 if {!($number > 0)} {
186 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,0) $::Xfcc::Server
187 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,2) $::Xfcc::Username
188 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,3) $::Xfcc::Password
189 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,4) $::Xfcc::Rating
190 set ::Xfcc::xfccsrv($::Xfcc::Oldnum,1) $::Xfcc::URI
192 set ::Xfcc::Server $::Xfcc::xfccsrv($number,0)
193 set ::Xfcc::Username $::Xfcc::xfccsrv($number,2)
194 set ::Xfcc::Password $::Xfcc::xfccsrv($number,3)
195 set ::Xfcc::Rating $::Xfcc::xfccsrv($number,4)
196 set ::Xfcc::URI $::Xfcc::xfccsrv($number,1)
198 set ::Xfcc::Oldnum $number
199 .configXfccSrv.xfccSrvList selection set $number
205 proc config {configfile} {
206 global ::Xfcc::xfccrc ::Xfcc::xfccrcfile
208 set xfccrcfile $configfile
211 set size [
expr [
array size ::Xfcc::xfccsrv] / 4]
213 set w ".configXfccSrv"
214 if {[
winfo exists $w]} {
221 set ::Xfcc::Server $::Xfcc::xfccsrv($::Xfcc::Oldnum,0)
222 set ::Xfcc::Username $::Xfcc::xfccsrv($::Xfcc::Oldnum,2)
223 set ::Xfcc::Password $::Xfcc::xfccsrv($::Xfcc::Oldnum,3)
224 set ::Xfcc::Rating $::Xfcc::xfccsrv($::Xfcc::Oldnum,4)
225 set ::Xfcc::URI $::Xfcc::xfccsrv($::Xfcc::Oldnum,1)
226 set ::Xfcc::showPass 0
230 wm title $w "\[$xfccrcfile\]"
232 ttk::frame $w.buttons
233 ttk::button $w.bOk -text OK -command "::Xfcc::xfccsrvstore; ::Xfcc::SaveXfcc; destroy .configXfccSrv"
234 ttk::button $w.bAdd -text [
::tr "GlistAddField"] -command {
238 ttk::button $w.bDelete -text [
::tr "GlistDeleteField"] -command {
241 ttk::button $w.bCancel -text [
::tr "Cancel"] -command "destroy $w"
242 grid $w.bAdd -in $w.buttons -row 0 -column 0 -pady "5 0" -sticky nw
243 grid $w.bDelete -in $w.buttons -row 0 -column 1 -padx "10 0" -pady "5 0" -sticky nw
244 grid $w.bOk -in $w.buttons -row 0 -column 3 -padx 5 -pady "15 5"
245 grid $w.bCancel -in $w.buttons -row 0 -column 4 -padx 5 -pady "15 5"
246 grid columnconfigure $w.buttons 2 -weight 1
248 listbox $w.xfccSrvList -height [
expr [
array size ::Xfcc::xfccsrv] / 4 + 1] -width 60 -selectmode single -list ::Xfcc::lsrvname
250 $w.xfccSrvList selection set $::Xfcc::Oldnum
252 ttk::label $w.lxfccSrv -text [
::tr CCDlgServerName]
253 ttk::label $w.lxfccUid -text [
::tr CCDlgLoginName]
254 ttk::label $w.lxfccPas -text [
::tr CCDlgPassword]
255 ttk::checkbutton $w.showPass -text [
::tr CCDlgShowPassword] -variable ::Xfcc::showPass -command {
256 if {$::Xfcc::showPass} {
257 .configXfccSrv.xfccPas configure -show {}
259 .configXfccSrv.xfccPas configure -show *
262 ttk::label $w.lxfccURI -text [
::tr CCDlgURL]
263 ttk::label $w.lxfccrtype -text [
::tr CCDlgRatingType]
265 ttk::entry .configXfccSrv.xfccSrv -width 60 -textvariable ::Xfcc::Server
266 ttk::entry .configXfccSrv.xfccUid -width 60 -textvariable ::Xfcc::Username
267 ttk::entry .configXfccSrv.xfccPas -width 60 -textvariable ::Xfcc::Password -show *
268 ttk::entry .configXfccSrv.xfccURI -width 60 -textvariable ::Xfcc::URI
270 if {$::tcl_version >= 8.5} {
271 ttk::combobox .configXfccSrv.xfccrtype -values [
sc_info ratings] -width 7 -textvariable ::Xfcc::Rating
273 eval tk_optionMenu .configXfccSrv.xfccrtype ::Xfcc::Rating [
sc_info ratings]
274 .configXfccSrv.xfccrtype configure -indicatoron 0 -width 7 -takefocus 1
279 bind .configXfccSrv.xfccSrvList <<ListboxSelect>> {
283 grid $w.xfccSrvList -sticky e -columnspan 6 -column 0 -row 0 -rowspan $number
285 grid $w.lxfccSrv -sticky e -columnspan 2 -column 0 -row [
expr {$number + 1}]
286 grid $w.lxfccUid -sticky e -columnspan 2 -column 0 -row [
expr {$number + 2}]
287 grid $w.lxfccPas -sticky e -columnspan 2 -column 0 -row [
expr {$number + 3}]
288 grid $w.showPass -sticky w -columnspan 4 -column 2 -row [
expr {$number + 4}]
289 grid $w.lxfccURI -sticky e -columnspan 2 -column 0 -row [
expr {$number + 5}]
290 grid $w.lxfccrtype -sticky e -columnspan 2 -column 0 -row [
expr {$number + 6}]
292 grid $w.xfccSrv -sticky w -columnspan 4 -column 2 -row [
expr {$number + 1}]
293 grid $w.xfccUid -sticky w -columnspan 4 -column 2 -row [
expr {$number + 2}]
294 grid $w.xfccPas -sticky w -columnspan 4 -column 2 -row [
expr {$number + 3}]
295 grid $w.xfccURI -sticky w -columnspan 4 -column 2 -row [
expr {$number + 5}]
296 grid $w.xfccrtype -sticky w -columnspan 4 -column 2 -row [
expr {$number + 6}]
299 grid $w.buttons -sticky news -columnspan 6 -column 0 -row [
expr {$number + 7}]
301 bind $w <Escape> "$w.bCancel invoke"
302 bind $w <F1> { helpWindow CCXfccSetupDialog}
309 proc ReadConfig {xfccrcfile} {
314 if {[
catch {open $xfccrcfile r} optionF]} {
317 set xfccrc [read $optionF]
319 set dom [dom parse $xfccrc]
320 set doc [$dom documentElement]
321 set aNodes [$doc selectNodes {/xfcc/server}]
325 set ::Xfcc::lsrvname {}
327 foreach srv $aNodes {
328 set name [$srv selectNodes {string(name)}]
329 set uri [$srv selectNodes {string(uri)}]
330 set username [$srv selectNodes {string(user)}]
331 set password [$srv selectNodes {string(pass)}]
332 set rating [$srv selectNodes {string(rating)}]
334 set ::Xfcc::xfccsrv($number,0) $name
335 set ::Xfcc::xfccsrv($number,1) $uri
336 set ::Xfcc::xfccsrv($number,2) $username
337 set ::Xfcc::xfccsrv($number,3) $password
338 set ::Xfcc::xfccsrv($number,4) $rating
340 lappend ::Xfcc::lsrvname [list $name]
352 proc SOAPError {server xml} {
355 regsub -all {.*<soap:Fault>} $xml {<error>} xml
356 regsub -all {</soap:Fault>.*} $xml {</error>} xml
358 regsub -all {.*<MakeAMoveResponse.*\">} $xml {<error>} xml
359 regsub -all {</MakeAMoveResponse>.*} $xml {</error>} xml
360 regsub -all {<MakeAMoveResult>} $xml {<faultstring>} xml
361 regsub -all {</MakeAMoveResult>} $xml {</faultstring>} xml
363 set dom [dom parse $xml]
364 set doc [$dom documentElement]
366 set aNodes [$doc selectNodes //error]
367 foreach game $aNodes {
368 set fcode [$game selectNodes {string(faultcode)}]
369 set fstring [$game selectNodes {string(faultstring)}]
370 switch -regexp -- $fstring \
376 set Title "Scid Error"
377 set Error "$server reported an unknown error."
378 tk_messageBox -icon warning -type ok -parent . \
379 -title $Title -message $Error
381 "FeatureUnavailable" {
384 "AuthenticationFailed" {
386 set Title "Scid Authentication Failure!"
387 set Error "Could not authenticate to the Xfcc-Server.\nPlease check Username and Password for $server."
388 tk_messageBox -icon warning -type ok -parent . \
389 -title $Title -message $Error
403 "InvalidMoveNumber" {
425 proc ProcessAll {path} {
429 set ::Xfcc::xfccstate {}
431 set dom [dom parse $xfccrc]
432 set doc [$dom documentElement]
434 set aNodes [$doc selectNodes {/xfcc/server}]
436 foreach srv $aNodes {
441 set rating [$srv selectNodes {string(rating)}]
459 proc Receive {uri username password} {
461 set xmlmessage $::Xfcc::SOAPstart
463 append xmlmessage {<GetMyGames xmlns="http://www.bennedik.com/webservices/XfccBasic">}
464 append xmlmessage "<username>$username</username>"
465 append xmlmessage "<password>$password</password>"
466 append xmlmessage "</GetMyGames>"
467 append xmlmessage $::Xfcc::SOAPend
470 set token [::http::geturl $uri \
471 -type "text/xml; charset=\"utf-8\"" \
475 set xmlresult [::http::data $token]
476 ::http::cleanup $token
497 proc SendMove {uri username password gameid movecount move comment \
498 resign acceptdraw offerdraw claimdraw} {
506 set xmlmessage $::Xfcc::SOAPstart
507 append xmlmessage {<MakeAMove xmlns="http://www.bennedik.com/webservices/XfccBasic">}
508 append xmlmessage "<username>$username</username>"
509 append xmlmessage "<password>$password</password>"
510 append xmlmessage "<gameId>$gameid</gameId>"
511 append xmlmessage "<resign>$resign</resign>"
512 append xmlmessage "<acceptDraw>$acceptdraw</acceptDraw>"
513 append xmlmessage "<movecount>$movecount</movecount>"
514 append xmlmessage "<myMove>$move</myMove>"
515 append xmlmessage "<offerDraw>$offerdraw</offerDraw>"
516 append xmlmessage "<claimDraw>$claimdraw</claimDraw>"
517 append xmlmessage "<myMessage>$comment</myMessage>"
518 append xmlmessage "</MakeAMove>"
519 append xmlmessage $::Xfcc::SOAPend
529 set token [::http::geturl $uri \
530 -type "text/xml; charset=\"utf-8\"" \
534 set xmlresult [::http::data $token]
535 ::http::cleanup $token
542 proc Send {name gameid movecount move comment \
543 resign acceptdraw offerdraw claimdraw} {
546 set dom [dom parse $xfccrc]
547 set doc [$dom documentElement]
549 set aNodes [$doc selectNodes {/xfcc/server}]
551 foreach srv $aNodes {
552 set server [$srv selectNodes {string(name)}]
553 set uri [$srv selectNodes {string(uri)}]
554 set username [$srv selectNodes {string(user)}]
555 set password [$srv selectNodes {string(pass)}]
557 if {$name == $server} {
561 if {$resign == "true"} {
564 if {$acceptdraw == "true"} {
567 if {$claimdraw == "true"} {
570 if {$offerdraw == "true"} {
575 $gameid $movecount $move $comment \
576 $resign $acceptdraw $offerdraw $claimdraw]
598 proc WritePGN {path name rating xml} {
601 regsub -all {.*<GetMyGamesResult>} $xml {<GetMyGamesResult>} xml
602 regsub -all {</GetMyGamesResult>.*} $xml {</GetMyGamesResult>} xml
604 set dom [dom parse $xml]
605 set doc [$dom documentElement]
607 set aNodes [$doc selectNodes //XfccGame]
608 foreach game $aNodes {
626 set myTurn [$game selectNodes {string(myTurn)}]
644 if {$whiteCountry == ""} {
647 if {$whiteIccfID == ""} {
650 if {$whiteFideID == ""} {
653 if {$blackCountry == ""} {
656 if {$blackIccfID == ""} {
659 if {$blackFideID == ""} {
664 if {$WhiteNA == ""} {
667 if {$BlackNA == ""} {
670 if {$WhiteNA == ""} {
671 set WhiteNA "white@unknown.org"
673 if {$BlackNA == ""} {
674 set BlackNA "black@unknown.org"
682 set variant [$game selectNodes {string(variant)}]
684 set filename [
file nativename [
file join $path "$name-$id.pgn"]]
685 file delete $filename
691 if { ($Result == "Cancelled") } {
693 }
elseif {($variant == "chess") || ($variant == "") || ($variant == "randompieces") || ($variant == "upsidedown") || ($variant == "loosers") || ($variant == "nocastle")} {
700 if {[
catch {open $filename w} pgnF]} {
704 puts $pgnF "\[Event \"$Event\"\]"
705 puts $pgnF "\[Site \"$Site\"\]"
706 puts $pgnF "\[Date \"$Date\"\]"
707 puts $pgnF "\[Round \"$Round\"\]"
708 puts $pgnF "\[White \"$White\"\]"
709 puts $pgnF "\[Black \"$Black\"\]"
710 puts $pgnF "\[White$rating \"$WhiteElo\"\]"
711 puts $pgnF "\[Black$rating \"$BlackElo\"\]"
712 puts $pgnF "\[TimeControl \"$TimeControl\"\]"
713 puts $pgnF "\[GameId \"$GameId\"\]"
714 puts $pgnF "\[Source \"$Source\"\]"
715 puts $pgnF "\[WhiteNA \"$WhiteNA\"]"
716 puts $pgnF "\[BlackNA \"$BlackNA\"]"
717 puts $pgnF "\[Mode \"XFCC\"\]"
718 puts $pgnF "\[CmailGameName \"$name-$id\"\]"
720 if {$whiteCountry != ""} {
721 puts $pgnF "\[WhiteCountry \"$whiteCountry\"\]"
723 if {$blackCountry != ""} {
724 puts $pgnF "\[BlackCountry \"$blackCountry\"\]"
726 if {$whiteIccfID > 0} {
727 puts $pgnF "\[WhiteIccfID \"$whiteIccfID\"\]"
729 if {$blackIccfID > 0} {
730 puts $pgnF "\[BlackIccfID \"$blackIccfID\"\]"
732 if {$whiteFideID > 0} {
733 puts $pgnF "\[WhiteFideID \"$whiteFideID\"\]"
735 if {$blackFideID > 0} {
736 puts $pgnF "\[BlackFideID \"$blackFideID\"\]"
738 if {$setup == "true"} {
739 puts $pgnF "\[FEN \"$fen\"\]"
745 switch -regexp -- $Result \
747 puts $pgnF "\[Result \"*\"\]\n"
749 "AdjudicationPending" {
750 puts $pgnF "\[Result \"*\"\]\n"
753 puts $pgnF "\[Result \"1-0\"\]\n"
756 puts $pgnF "\[Result \"0-1\"\]\n"
759 puts $pgnF "\[Result \"1/2-1/2\"\]\n"
762 puts $pgnF "\[Result \"0-1\"\]\n"
765 puts $pgnF "\[Result \"1-0\"\]\n"
768 puts $pgnF "\[Result \"1/2-1/2\"\]\n"
771 puts $pgnF "\[Result \"$Result\"\]\n"
778 puts $pgnF "{$name-$id}"
784 if {[
string range $moves end end] != "\}"} {
785 if {($myTurn == "true") && ($mess != "")} {
786 puts -nonewline $pgnF "\{"
787 puts -nonewline $pgnF $mess
793 if {($Result != "Ongoing") && ($mess != "")} {
794 puts -nonewline $pgnF "\{"
795 puts -nonewline $pgnF $mess
800 switch -regexp -- $Result \
804 "AdjudicationPending" {
814 puts $pgnF "1/2-1/2\n"
817 puts $pgnF "\{White Defaulted\} 0-1\n"
820 puts $pgnF "\{Black Defaulted\} 1-0\n"
823 puts $pgnF "\{Both Defaulted\} 1/2-1/2\n"
834 proc PrintStatus {path name xml} {
835 regsub -all {.*<GetMyGamesResult>} $xml {<GetMyGamesResult>} xml
836 regsub -all {</GetMyGamesResult>.*} $xml {</GetMyGamesResult>} xml
838 set dom [dom parse $xml]
839 set doc [$dom documentElement]
841 set aNodes [$doc selectNodes //XfccGame]
842 foreach game $aNodes {
843 set id [$game selectNodes {string(id)}]
844 set myTurn [$game selectNodes {string(myTurn)}]
845 set daysPlayer [$game selectNodes {string(daysPlayer)}]
846 set hoursPlayer [$game selectNodes {string(hoursPlayer)}]
847 set minutesPlayer [$game selectNodes {string(minutesPlayer)}]
848 set daysOpponent [$game selectNodes {string(daysOpponent)}]
849 set hoursOpponent [$game selectNodes {string(hoursOpponent)}]
850 set minutesOpponent [$game selectNodes {string(minutesOpponent)}]
851 set drawOffered [$game selectNodes {string(drawOffered)}]
852 set setup [$game selectNodes {string(setup)}]
853 set fen [$game selectNodes {string(fen)}]
854 set variant [$game selectNodes {string(variant)}]
855 set noOpeningBooks [$game selectNodes {string(noOpeningBooks)}]
856 set noDatabases [$game selectNodes {string(noDatabases)}]
857 set noTablebases [$game selectNodes {string(noTablebases)}]
858 set noEngines [$game selectNodes {string(noEngines)}]
859 set Result [$game selectNodes {string(result)}]
860 set TimeControl [$game selectNodes {string(timeControl)}]
867 if { [regexp {\+} $TimeControl] } {
868 set TC [
split $TimeControl "+"]
869 set gametime [
expr {[lindex $TC 0] / 86400}]
870 set increment [
expr {[lindex $TC 1] / 86400}]
875 append TC "d (Fischer)"
876 }
elseif { [regexp {\/} $TimeControl] } {
877 set TC [
split $TimeControl "/"]
878 set moves [
expr {[lindex $TC 0]}]
879 set days [
expr {[lindex $TC 1] / 86400 }]
885 if { ($moves == 10) && ($days == 50) } {
890 set mytime [
expr $daysPlayer*24*60+$hoursPlayer*60+$minutesPlayer]
891 set opptime [
expr $daysOpponent*24*60+$hoursOpponent*60+$minutesOpponent]
893 if {[$game selectNodes {string(hasWhite)}] == "true"} {
894 set clockW [
format "%2ud %2u:%2u" $daysPlayer $hoursPlayer $minutesPlayer]
895 set clockB [
format "%2ud %2u:%2u" $daysOpponent $hoursOpponent $minutesOpponent]
897 set clockB [
format "%2ud %2u:%2u" $daysPlayer $hoursPlayer $minutesPlayer]
898 set clockW [
format "%2ud %2u:%2u" $daysOpponent $hoursOpponent $minutesOpponent]
900 lappend ::Xfcc::xfccstate [list \
902 [list "myTurn" $myTurn] \
903 [list "clockW" $clockW] \
904 [list "clockB" $clockB] \
905 [list "drawOffered" $drawOffered]\
906 [list "setup" $setup] \
908 [list "variant" $variant] \
909 [list "noOpeningBooks" $noOpeningBooks] \
910 [list "noTablebases" $noTablebases] \
911 [list "noDatabases" $noDatabases] \
912 [list "noEngines" $noEngines] \
913 [list "result" $Result] \
914 [list "TimeControl" $TC] \
915 [list "message" $mess] \
916 [list "mytime" $mytime] \
917 [list "opptime" $opptime] \
918 [list "serverInfo" $serverinfo]]
922 file delete $filename
924 if {[
catch {open $filename w} stateF]} {
927 puts $stateF "# Scid options file"
928 puts $stateF "# State file for correspondence chess"
929 puts $stateF "# Version: $::scidVersion, $::scidVersionDate"
930 puts $stateF "# This file is generated automatically. Do NOT edit."
933 set ::Xfcc::lastupdate [
clock seconds]
934 set curtime [
clock format $::Xfcc::lastupdate]
936 puts $stateF "# Last Update: $curtime"
938 foreach i { ::Xfcc::lastupdate \
939 ::Xfcc::xfccstate } {
940 puts $stateF "set $i [list [
set $i]]"
963 namespace eval CorrespondenceChess {
969 set CorrBase [
file nativename [
file join $scidDataDir "Correspondence.si4"]]
972 set Inbox [
file nativename [
file join $scidDataDir "Inbox"]]
974 set Outbox [
file nativename [
file join $scidDataDir "Outbox"]]
977 set Connector [
file nativename [
file join $scidDataDir "connector.xml"]]
981 set xfccrcfile [
file nativename [
file join $scidConfigDir "xfccrc"]]
986 set PluginPath [
file nativename [
file join $scidDataDir "Plugins/Correspondence"]]
989 set XfccFetchcmd "./Xfcc-Receive.pl"
991 set XfccSendcmd "./Xfcc-Send.pl"
1001 set ListOnlyOwnMove 0
1005 set CCOrderClassic 0
1007 set CCOrderTimePerMove 2
1008 set CCOrderStartDate 3
1009 set CCOrderOppTime 4
1012 set ListOrder $CCOrderClassic
1015 set mailer "/usr/bin/nail"
1019 set mailermode "mailx"
1031 set clipboardText ""
1039 proc getPage { url } {
1040 set token [::http::geturl $url]
1041 set data [::http::data $token]
1042 ::http::cleanup $token
1051 proc chooseFile {i filespecs} {
1053 set fullname [
tk_getOpenFile -initialdir $idir -title "Scid Correspondence Chess: Select $i"]
1054 if {$fullname == ""} {
return}
1064 proc chooseCorrBase {} {
1065 global ::CorrespondenceChess::CorrBase
1067 set filetype { "Scid databases" {".si4" ".si"} }
1068 set CorrBase [
chooseFile "default correspondence chess DB..." $filetype]
1076 proc chooseInbox {} {
1077 global ::CorrespondenceChess::Inbox
1079 set filetype { "All files" {".*"} }
1080 set Inbox [
file dirname [
chooseFile "default correspondence chess Inbox..." $filetype]]
1088 proc chooseOutbox {} {
1089 global ::CorrespondenceChess::Outbox
1091 set filetype { "All files" {".*"} }
1092 set Outbox [
file dirname [
chooseFile "default correspondence chess Outbox..." $filetype]]
1103 proc chooseFetch {} {
1104 global ::CorrespondenceChess::XfccFetchcmd
1106 set filetype { "All files" {".*"} }
1107 set XfccFetchcmd [
chooseFile "default correspondence chess Fetch Tool..." $filetype]
1114 proc chooseSend {} {
1115 global ::CorrespondenceChess::XfccSendcmd
1117 set filetype { "All files" {".*"} }
1118 set XfccSendcmd [
chooseFile "default correspondence chess Send Tool..." $filetype]
1124 proc checkXfccrc {} {
1125 global ::CorrespondenceChess::xfccrcfile
1127 if {![
file exists $xfccrcfile]} {
1128 if {[
catch {open $xfccrcfile w} optionF]} {
1129 tk_messageBox -title "Scid: Unable to write file" -type ok -icon warning \
1130 -message "Unable to write options file: $xfccrcfile\n$optionF"
1132 puts $optionF "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
1133 puts $optionF "<xfcc>"
1134 puts $optionF "<server>"
1135 puts $optionF " <name>ServerName</name>"
1136 puts $optionF " <uri>http://</uri>"
1137 puts $optionF " <user>UserName</user>"
1138 puts $optionF " <pass>PassWord</pass>"
1139 puts $optionF "</server>"
1140 puts $optionF "</xfcc>"
1149 proc checkCorrBase {} {
1150 global ::CorrespondenceChess::CorrBase
1152 if {![
file exists $CorrBase]} {
1153 set currbase [
sc_base current]
1154 set fName [
file rootname $CorrBase]
1155 if {[
catch {
sc_base create $fName} newbase]} {
1168 proc checkInOutbox {} {
1169 global scidDataDir ::CorrespondenceChess::Inbox ::CorrespondenceChess::Outbox
1171 if {[
file exists $Inbox]} {
1172 if {[
file isfile $Inbox]} {
1173 file rename -force $Inbox "$Inbox.bak"
1177 if {[
catch {
file mkdir "$Inbox"} result]} {
1178 set ::CorrespondenceChess::Inbox [
file nativename [
file join $scidDataDir "Inbox"]]
1183 if {[
file exists $Outbox]} {
1184 if {[
file isfile $Outbox]} {
1185 file rename -force $Outbox "$Outbox.bak"
1189 if {[
catch {
file mkdir "$Outbox"} result]} {
1190 set ::CorrespondenceChess::Inbox [
file nativename [
file join $scidDataDir "Outbox"]]
1199 proc saveCCoptions {} {
1202 tk_messageBox -title "Scid: Unable to write file" -type ok -icon warning \
1203 -message "Unable to write options file: [
scidConfigFile correspondence]\n$optionF"
1210 puts $optionF "# Scid options file"
1211 puts $optionF "# Version: $::scidVersion, $::scidVersionDate"
1212 puts $optionF "# This file contains commands in the Tcl language format."
1213 puts $optionF "# If you edit this file, you must preserve valid Tcl"
1214 puts $optionF "# format or it will not set your Scid options properly."
1217 foreach i { ::CorrespondenceChess::CorrBase \
1218 ::CorrespondenceChess::Inbox \
1219 ::CorrespondenceChess::Outbox \
1220 ::CorrespondenceChess::XfccFetchcmd \
1221 ::CorrespondenceChess::XfccSendcmd \
1222 ::CorrespondenceChess::mailer \
1223 ::CorrespondenceChess::bccaddr \
1224 ::CorrespondenceChess::mailermode \
1225 ::CorrespondenceChess::attache \
1226 ::CorrespondenceChess::subject \
1227 ::CorrespondenceChess::PluginPath \
1228 ::CorrespondenceChess::Connector \
1229 ::CorrespondenceChess::RelayGames \
1230 ::CorrespondenceChess::ListOrder } {
1233 puts $optionF "set $i [list [
set $i]]"
1253 foreach i { ::CorrespondenceChess::xfccrcfile \
1255 puts $optionF "set $i [list [
set $i]]"
1269 if {$::CorrespondenceChess::XfccInternal < 0} {
1270 puts $optionF {set ::CorrespondenceChess::XfccInternal 0}
1272 puts $optionF "set ::CorrespondenceChess::XfccInternal $::CorrespondenceChess::XfccInternal"
1274 if {$::CorrespondenceChess::XfccConfirm < 0} {
1275 puts $optionF {set ::CorrespondenceChess::XfccConfirm 0}
1277 puts $optionF "set ::CorrespondenceChess::XfccConfirm $::CorrespondenceChess::XfccConfirm"
1279 if {$::CorrespondenceChess::ListOnlyOwnMove < 0} {
1280 puts $optionF {set ::CorrespondenceChess::ListOnlyOwnMove 0}
1282 puts $optionF "set ::CorrespondenceChess::ListOnlyOwnMove $::CorrespondenceChess::ListOnlyOwnMove"
1287 set ::statusBar "Correspondence chess options were saved to: [
scidConfigFile correspondence]"
1297 eval [
linsert $args 0 $w.bottom.ysc set]
1298 yview moveto [
lindex [$w.bottom.ysc get] 0]
1303 eval [
linsert $args 0 $w.bottom.id yview]
1304 eval [
linsert $args 0 $w.bottom.toMove yview]
1305 eval [
linsert $args 0 $w.bottom.event yview]
1306 eval [
linsert $args 0 $w.bottom.site yview]
1307 eval [
linsert $args 0 $w.bottom.white yview]
1308 eval [
linsert $args 0 $w.bottom.black yview]
1309 eval [
linsert $args 0 $w.bottom.clockW yview]
1310 eval [
linsert $args 0 $w.bottom.clockB yview]
1311 eval [
linsert $args 0 $w.bottom.var yview]
1312 eval [
linsert $args 0 $w.bottom.feature yview]
1318 proc doConfigMenus { } {
1319 set lang $::language
1321 if {! [
winfo exists .ccWindow]} {
1326 set m .ccWindow.menu
1328 foreach idx {0 1} tag {CorrespondenceChess Edit} {
1331 foreach idx {0 1 3 4 6 7 8 9 10 11 13 14} tag {CCConfigure CCConfigRelay CCRetrieve CCInbox CCSend CCResign CCClaimDraw CCOfferDraw CCAcceptDraw CCGamePage CCNewMailGame CCMailMove } {
1334 foreach idx {0 } tag { CCEditCopy } {
1343 proc CallWWWGame {} {
1345 set Extra [
sc_game tags get Extra]
1346 set extraTagsList [
split $Extra "\n"]
1348 foreach i $extraTagsList {
1349 if { [
string equal -nocase [
lindex $i 0] "Source"] } {
1350 set source [
string range $i 8 end-1]
1361 global ::CorrespondenceChess::RelayGames
1365 if {[
catch {open $::CorrespondenceChess::Connector r} connectF]} {
1367 append Error "$::CorrespondenceChess::Connector\n"
1368 append Error [
::tr CCErrDirNotUsable]
1369 tk_messageBox -icon warning -type ok -parent . \
1370 -title $Title -message $Error
1373 set connectxml [read $connectF]
1375 set dom [dom parse $connectxml]
1376 set doc [$dom documentElement]
1377 set aNodes [$doc selectNodes {/connector/server}]
1379 foreach srv $aNodes {
1380 set stripforid [$srv selectNodes {string(stripforid)}]
1382 set text [
string trim [$w.f.text get 1.0 end]]
1383 set ::CorrespondenceChess::RelayGames {}
1384 foreach game [
split $text "\n"] {
1385 set game [
string trim $game]
1386 if {[
string match "*$stripforid*" $game]} {
1387 lappend ::CorrespondenceChess::RelayGames $game
1395 destroy .editCCRelays
1401 proc ConfigureRelay { } {
1402 global ::CorrespondenceChess::RelayGames
1404 puts stderr $::CorrespondenceChess::Connector
1405 if {![
file exists $::CorrespondenceChess::Connector]} {
1406 if {[
catch {open $::CorrespondenceChess::Connector w} connectF]} {
1409 puts $connectF "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
1410 puts $connectF "<connector>"
1411 puts $connectF "\t<server>"
1412 puts $connectF "\t\t<name>ICCF</name>"
1413 puts $connectF "\t\t<stripforid>http://www.iccf-webchess.com/MakeAMove.aspx\?id=</stripforid>"
1414 puts $connectF "\t\t<pgnbaseurl>http://www.iccf-webchess.com/GetPGN.aspx?id=</pgnbaseurl>"
1415 puts $connectF "\t\t<cmailprefix>game</cmailprefix>"
1416 puts $connectF "\t</server>"
1417 puts $connectF "</connector>"
1422 if {[
catch {open $::CorrespondenceChess::Connector r} connectF]} {
1424 append Error "$::CorrespondenceChess::Connector\n"
1425 append Error [
::tr CCErrDirNotUsable]
1426 tk_messageBox -icon warning -type ok -parent . \
1427 -title $Title -message $Error
1432 set oldRelays $::CorrespondenceChess::RelayGames
1434 if {[
winfo exists $w]} {
return}
1439 -background gray90 -foreground black \
1440 -width 60 -height 7 -wrap word -cursor top_left_arrow
1441 $w.desc.text insert end [
::tr "CCDlgConfigRelayHelp"]
1442 $w.desc.text configure -state disabled
1443 pack $w.desc -side top -fill x
1445 pack [ttk::frame $w.b] -side bottom -fill x
1448 foreach g $::CorrespondenceChess::RelayGames {
1449 $w.f.text insert end "$g\n"
1451 pack $w.f -side top -fill both -expand yes
1453 ttk::button $w.b.ok -text OK -command {
1454 ::CorrespondenceChess::RelaysOK
1456 ttk::button $w.b.cancel -text $::tr(Cancel) -command "grab release $w; destroy $w"
1457 pack $w.b.cancel $w.b.ok -side right -padx 5 -pady 5
1467 proc RelayGames { gameurl } {
1468 global ::CorrespondenceChess::Inbox
1470 if {[
catch {open $::CorrespondenceChess::Connector r} connectF]} {
1474 set connectxml [read $connectF]
1476 set dom [dom parse $connectxml]
1477 set doc [$dom documentElement]
1478 set aNodes [$doc selectNodes {/connector/server}]
1480 foreach srv $aNodes {
1481 set name [$srv selectNodes {string(name)}]
1482 set stripforid [$srv selectNodes {string(stripforid)}]
1483 set pgnbaseurl [$srv selectNodes {string(pgnbaseurl)}]
1484 set cmailprefix [$srv selectNodes {string(cmailprefix)}]
1486 if {[regexp "$stripforid" $gameurl]} {
1488 regsub -all "$stripforid" $gameurl {} gameid
1491 set cmailgamename "$cmailprefix$gameid"
1492 set pgnurl "$pgnbaseurl$gameid"
1498 set gamelist [
split $pgn "\n"]
1500 set filename [
file nativename [
file join $::CorrespondenceChess::Inbox "$cmailgamename.pgn"]]
1502 if {[
catch {open $filename w} pgnF]} {
1505 foreach line $gamelist {
1506 if {[
string match "*Result *" $line]} {
1508 puts $pgnF "\[CmailGameName \"$cmailgamename\"\]"
1509 puts $pgnF "\[Source \"$gameurl\"\]"
1510 puts $pgnF "\[Mode \"Relay\"\]"
1527 proc ConsoleResize {} {
1531 bind $w <Configure> {}
1534 set oldheight $::winHeight($w)
1535 set oldwidth $::winWidth($w)
1538 set temp [
wm geometry $w]
1539 set n [
scan $temp "%dx%d+%d+%d" width height x y]
1541 if {$height > 0 && $width > 0} {
1542 if {$height != $oldheight} {
1544 foreach col {id toMove event site white black clockW clockB var feature} {
1545 $w.bottom.$col configure -height $height
1556 bind $w <Configure> { ::CorrespondenceChess::ConsoleResize }
1563 proc EnableEngineAnalysis {on} {
1570 $m entryconfigure 0 -state disabled
1571 $m entryconfigure 1 -state disabled
1572 $m entryconfigure 2 -state disabled
1573 $m entryconfigure 3 -state disabled
1576 foreach w { .maintWin .sortWin .playerInfoWin .repWin \
1577 .fics .metadataWindow .crosstableWin .ecograph \
1578 .glistWin .plist .statsWin .baseWin .tourney \
1579 .pgnWin .main .nedit .ccWindow } {
1581 if {[
winfo exists $w]} {
1582 bind $w <Control-A> {}
1583 bind $w <Control-Shift-2> {}
1590 $m entryconfigure 0 -state normal
1591 $m entryconfigure 1 -state normal
1592 $m entryconfigure 2 -state normal
1593 $m entryconfigure 3 -state normal
1596 foreach w { .maintWin .sortWin .playerInfoWin .repWin \
1597 .fics .metadataWindow .crosstableWin .ecograph \
1598 .glistWin .plist .statsWin .baseWin .tourney \
1599 .pgnWin .main .nedit .ccWindow } {
1601 if {[
winfo exists $w]} {
1602 bind $w <Control-A> makeAnalysisWin
1603 bind $w <Control-Shift-2> "makeAnalysisWin 2"
1604 bind $w <F2> "::makeAnalysisWin 1 0"
1605 bind $w <F3> "::makeAnalysisWin 2 0"
1614 proc List2Clipboard {} {
1616 clipboard append $::CorrespondenceChess::clipboardText
1629 global scidDataDir helpMessage
1632 if {[
winfo exists .ccWindow]} {
1635 set ::CorrespondenceChess::isOpen 0
1638 set ::CorrespondenceChess::isOpen 1
1653 $w.menu add cascade -label CorrespondenceChess -menu $w.menu.correspondence
1654 $w.menu add cascade -label Edit -menu $w.menu.edit
1655 foreach i {correspondence edit} {
1656 menu $w.menu.$i -tearoff 0
1659 $m.correspondence add command -label CCConfigure -command {::CorrespondenceChess::config}
1660 set helpMessage($m.correspondence,0) CCConfigure
1661 $m.correspondence add command -label CCConfigRelay -command {::CorrespondenceChess::ConfigureRelay}
1662 set helpMessage($m.correspondence,1) CCConfigRelay
1664 $m.correspondence add separator
1665 $m.correspondence add command -label CCRetrieve -command { ::CorrespondenceChess::FetchGames }
1666 set helpMessage($m.correspondence,3) CCRetrieve
1668 $m.correspondence add command -label CCInbox -command { ::CorrespondenceChess::ReadInbox }
1669 set helpMessage($m.correspondence,4) CCInbox
1671 $m.correspondence add separator
1672 $m.correspondence add command -label CCSend -command {::CorrespondenceChess::SendMove 0 0 0 0}
1673 set helpMessage($m.correspondence,6) CCSend
1674 $m.correspondence add command -label CCResign -command {::CorrespondenceChess::SendMove 1 0 0 0}
1675 set helpMessage($m.correspondence,7) CCResign
1676 $m.correspondence add command -label CCClaimDraw -command {::CorrespondenceChess::SendMove 0 1 0 0}
1677 set helpMessage($m.correspondence,8) CCClaimDraw
1678 $m.correspondence add command -label CCOfferDraw -command {::CorrespondenceChess::SendMove 0 0 1 0}
1679 set helpMessage($m.correspondence,9) CCOfferDraw
1680 $m.correspondence add command -label CCAcceptDraw -command {::CorrespondenceChess::SendMove 0 0 0 1}
1681 set helpMessage($m.correspondence,10) CCAcceptDraw
1682 $m.correspondence add command -label CCGamePage -command {::CorrespondenceChess::CallWWWGame}
1683 set helpMessage($m.correspondence,11) CCGamePage
1684 $m.correspondence add separator
1685 $m.correspondence add command -label CCNewMailGame -command {::CorrespondenceChess::newEMailGame}
1686 set helpMessage($m.correspondence,13) CCNewMailGame
1687 $m.correspondence add command -label CCMailMove -command {::CorrespondenceChess::eMailMove}
1688 set helpMessage($m.correspondence,14) CCMailMove
1690 $m.edit add command -label CCEditCopy -accelerator "Ctrl+C" -command { ::CorrespondenceChess::List2Clipboard }
1696 ttk::frame $w.bottom
1698 pack $w.top -anchor w -expand no
1699 pack $w.bottom -fill both -expand yes
1701 ttk::scrollbar $w.top.ysc -command { .ccWindow.top.console yview }
1702 text $w.top.console -height 3 -width 80 -wrap word -yscrollcommand "$w.top.ysc set"
1703 ttk::button $w.top.retrieveCC -image tb_CC_Retrieve -command {::CorrespondenceChess::FetchGames}
1704 ttk::button $w.top.sendCC -image tb_CC_Send -command {::CorrespondenceChess::SendMove 0 0 0 0}
1705 ttk::button $w.top.delinbox -image tb_CC_delete -command {::CorrespondenceChess::EmptyInOutbox}
1707 ttk::button $w.top.openDB -text [
::tr "CCOpenDB"] -command {::CorrespondenceChess::OpenCorrespondenceDB}
1708 ttk::button $w.top.inbox -text [
::tr "CCInbox"] -command {::CorrespondenceChess::ReadInbox}
1710 ttk::button $w.top.resign -text [
::tr "CCResign"] -state disabled -command {::CorrespondenceChess::SendMove 1 0 0 0}
1711 ttk::button $w.top.claimDraw -text [
::tr "CCClaimDraw"] -state disabled -command {::CorrespondenceChess::SendMove 0 1 0 0}
1712 ttk::button $w.top.offerDraw -text [
::tr "CCOfferDraw"] -state disabled -command {::CorrespondenceChess::SendMove 0 0 1 0}
1713 ttk::button $w.top.acceptDraw -text [
::tr "CCAcceptDraw"] -state disabled -command {::CorrespondenceChess::SendMove 0 0 0 1}
1715 ttk::button $w.top.help -image tb_help -width 24 -command { helpWindow CCIcons }
1717 ttk::label $w.top.plugins -image tb_CC_spacer -takefocus 0
1718 ttk::label $w.top.onoffline -image tb_CC_offline -takefocus 0
1727 grid $w.top.retrieveCC -stick ewns -column 0 -row 0
1728 grid $w.top.openDB -stick ew -column 0 -row 1 -columnspan 2
1729 grid $w.top.inbox -stick ew -column 0 -row 2 -columnspan 2
1731 grid $w.top.sendCC -stick ewns -column 1 -row 0
1733 grid $w.top.console -column 4 -row 0 -columnspan 8
1734 grid $w.top.ysc -stick ns -column 13 -row 0
1735 grid $w.top.help -stick nsew -column 14 -row 0 -columnspan 2
1737 grid $w.top.delinbox -stick ewns -column 5 -row 1 -rowspan 2
1738 grid $w.top.onoffline -column 6 -row 1
1739 grid $w.top.plugins -column 6 -row 2
1741 grid $w.top.resign -stick ew -column 7 -row 1
1743 grid $w.top.claimDraw -stick ew -column 7 -row 2
1744 grid $w.top.offerDraw -stick ew -column 8 -row 2
1745 grid $w.top.acceptDraw -stick ew -column 9 -row 2
1749 ttk::scrollbar $w.bottom.ysc -command ::CorrespondenceChess::yview
1751 set height $::winHeight($w)
1752 set width $::winWidth($w)
1754 text $w.bottom.id -cursor top_left_arrow -font font_Small -height $height -width 15 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1755 text $w.bottom.toMove -cursor top_left_arrow -font font_Small -height $height -width 4 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1756 text $w.bottom.event -cursor top_left_arrow -font font_Small -height $height -width 10 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1757 text $w.bottom.site -cursor top_left_arrow -font font_Small -height $height -width 10 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1758 text $w.bottom.white -cursor top_left_arrow -font font_Small -height $height -width 15 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1759 text $w.bottom.black -cursor top_left_arrow -font font_Small -height $height -width 15 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1760 text $w.bottom.clockW -cursor top_left_arrow -font font_Small -height $height -width 10 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1761 text $w.bottom.clockB -cursor top_left_arrow -font font_Small -height $height -width 10 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1762 text $w.bottom.var -cursor top_left_arrow -font font_Small -height $height -width 3 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1763 text $w.bottom.feature -cursor top_left_arrow -font font_Small -height $height -width 16 -setgrid 1 -relief flat -wrap none -yscrollcommand ::CorrespondenceChess::yset
1765 grid $w.bottom.id -column 0 -row 1
1766 grid $w.bottom.toMove -column 1 -row 1
1767 grid $w.bottom.event -column 2 -row 1
1768 grid $w.bottom.site -column 3 -row 1
1769 grid $w.bottom.white -column 4 -row 1
1770 grid $w.bottom.black -column 5 -row 1
1771 grid $w.bottom.clockW -column 15 -row 1
1772 grid $w.bottom.clockB -column 16 -row 1
1773 grid $w.bottom.var -column 17 -row 1
1774 grid $w.bottom.feature -column 18 -row 1
1775 grid $w.bottom.ysc -column 19 -row 1 -stick ns
1778 bind $w <Control-Insert> { ::CorrespondenceChess::List2Clipboard }
1779 bind $w <Control-c> { ::CorrespondenceChess::List2Clipboard }
1782 bind $w <Control-Up> { ::CorrespondenceChess::PrevGame}
1783 bind $w <Control-Down> { ::CorrespondenceChess::NextGame}
1784 bind $w <Up> { ::CorrespondenceChess::yview scroll -1 units}
1785 bind $w <Down> { ::CorrespondenceChess::yview scroll 1 units}
1786 bind $w <Prior> { ::CorrespondenceChess::yview scroll -1 pages}
1787 bind $w <Next> { ::CorrespondenceChess::yview scroll 1 pages}
1791 bind $w <F1> { helpWindow Correspondence}
1792 bind $w "?" { helpWindow CCIcons}
1794 bind $w <Configure> { ::CorrespondenceChess::ConsoleResize }
1795 bind $w <Destroy> { ::CorrespondenceChess::EnableEngineAnalysis 1
1796 set ::CorrespondenceChess::isOpen 0 }
1798 foreach f [glob -nocomplain [
file join "$CorrespondenceChess::PluginPath" *]] {
1799 $w.top.plugins configure -image tb_CC_pluginactive
1811 proc updateGamelist {id toMove event site date white black clockW \
1812 clockB var db books tb engines wc bc mess TC \
1813 lastmove drawoffer } {
1814 global ::CorrespondenceChess::num
1815 global ::CorrespondenceChess::clipboardText
1828 foreach tag {id toMove event site white black clockW clockB var feature} {
1830 $w.bottom.$tag configure -state normal
1832 $w.bottom.$tag image create end -align center -image tb_CC_spacer
1838 set TimeDiff [
expr [
clock seconds] - [
clock scan $date -format "%Y.%m.%d"]]
1840 if { $::Xfcc::update > 0 } {
1841 $w.top.onoffline configure -image tb_CC_online
1846 set curpos [$w.bottom.id index insert]
1847 $w.bottom.id image create end -align center -image tb_CC_message
1848 set endpos [$w.bottom.id index insert]
1850 $w.bottom.id tag add idmsg$id $curpos $endpos
1854 set curpos [$w.bottom.id index insert]
1855 $w.bottom.id insert end "$id\n"
1856 set endpos [$w.bottom.id index insert]
1857 $w.bottom.id tag add id$id $curpos $endpos
1862 if { (($clockW == " 0d 0: 0") || ($clockB == " 0d 0: 0")) && (($toMove == "yes") || ($toMove == "no")) } {
1863 $w.bottom.toMove image create end -align center -image tb_CC_outoftime
1867 switch -regexp -- $toMove \
1869 set curpos [$w.bottom.toMove index insert]
1870 $w.bottom.toMove image create end -align center -image $::board::letterToPiece(K)25
1871 $w.bottom.toMove insert end " $toMove"
1872 set endpos [$w.bottom.toMove index insert]
1873 set text "$lastmove ($toMove)"
1876 set curpos [$w.bottom.toMove index insert]
1877 $w.bottom.toMove image create end -align center -image $::board::letterToPiece(k)25
1878 $w.bottom.toMove insert end " $toMove"
1879 set endpos [$w.bottom.toMove index insert]
1880 set text "$lastmove ($toMove)"
1883 set curpos [$w.bottom.toMove index insert]
1884 $w.bottom.toMove image create end -align center -image tb_CC_draw
1885 $w.bottom.toMove insert end "$toMove"
1886 set endpos [$w.bottom.toMove index insert]
1887 set text "$lastmove ($toMove)"
1890 set curpos [$w.bottom.toMove index insert]
1891 $w.bottom.toMove image create end -align center -image tb_CC_yourmove
1892 set endpos [$w.bottom.toMove index insert]
1893 set text "$lastmove"
1896 set curpos [$w.bottom.toMove index insert]
1897 $w.bottom.toMove image create end -align center -image tb_CC_oppmove
1898 set endpos [$w.bottom.toMove index insert]
1899 set text "$lastmove"
1902 set curpos [$w.bottom.toMove index insert]
1903 $w.bottom.toMove insert end "$toMove"
1904 set endpos [$w.bottom.toMove index insert]
1905 set text "$lastmove"
1908 set curpos [$w.bottom.toMove index insert]
1909 $w.bottom.toMove image create end -align center -image tb_CC_postal
1910 set endpos [$w.bottom.toMove index insert]
1911 set text "$lastmove"
1914 set curpos [$w.bottom.toMove index insert]
1915 $w.bottom.toMove image create end -align center -image tb_CC_envelope
1916 set endpos [$w.bottom.toMove index insert]
1917 set text "$lastmove"
1920 set curpos [$w.bottom.toMove index insert]
1921 $w.bottom.toMove image create end -align center -image tb_CC_relay
1922 set endpos [$w.bottom.toMove index insert]
1923 set text "$lastmove"
1925 $w.bottom.toMove tag add toMove$id $curpos $endpos
1927 $w.bottom.toMove insert end "\n"
1931 set curpos [$w.bottom.event index insert]
1932 $w.bottom.event insert end "$event\n"
1933 set endpos [$w.bottom.event index insert]
1934 $w.bottom.event tag add event$id $curpos $endpos
1937 set curpos [$w.bottom.site index insert]
1938 $w.bottom.site insert end "$site\n"
1939 set endpos [$w.bottom.site index insert]
1940 $w.bottom.site tag add site$id $curpos $endpos
1944 if {[lsearch [
image names] $wc] > -1} {
1945 $w.bottom.white image create end -align center -image $wc
1946 $w.bottom.white insert end " "
1948 puts stderr "$wc does not exist"
1951 $w.bottom.white insert end "$white\n"
1954 if {[lsearch [
image names] $bc] > -1} {
1955 $w.bottom.black image create end -align center -image $bc
1956 $w.bottom.black insert end " "
1958 puts stderr "$bc does not exist"
1961 $w.bottom.black insert end "$black\n"
1963 $w.bottom.clockW insert end "$clockW\n"
1964 $w.bottom.clockB insert end "$clockB\n"
1965 $w.bottom.var insert end "$var\n"
1969 if {$db == "false"} {
1970 $w.bottom.feature image create end -align center -image tb_CC_database
1972 if {$books == "false"} {
1973 $w.bottom.feature image create end -align center -image tb_CC_book
1975 if {$tb == "false"} {
1976 $w.bottom.feature image create end -align center -image tb_CC_tablebase
1978 if {!($engines == "true")} {
1979 $w.bottom.feature image create end -align center -image tb_CC_engine
1982 $w.bottom.feature insert end "\n"
1990 foreach tag {id toMove event site white black clockW clockB var feature} {
1991 bind $w.bottom.$tag <Button-1> {
1992 ::CorrespondenceChess::SetSelection %x %y
1993 ::CorrespondenceChess::ProcessServerResult $::CorrespondenceChess::num
1996 $w.bottom.$tag configure -state disable
1999 if {$TimeDiff < -1} {
2000 foreach col {id toMove event site} {
2001 $w.bottom.$col tag configure $col$id -foreground DarkGray -font font_Bold
2008 regsub -all "flag_" $wc "" wc1
2009 regsub -all "flag_" $bc "" bc1
2011 set wc1 [
string toupper $wc1]
2012 set bc1 [
string toupper $bc1]
2014 set ::CorrespondenceChess::clipboardText "$::CorrespondenceChess::clipboardText\n$id\t $event\t$site\t$date\t$white\t$black\t$wc1\t$bc1\t$clockW\t$clockB\t$toMove\t$mess\t$lastmove\t$var\t$db\t$books\t$tb\t$engines\t$TC"
2020 proc SetHighlightedLine {} {
2021 global ::CorrespondenceChess::num
2022 set gamecount $::CorrespondenceChess::glgames
2025 foreach col {id toMove event site white black clockW clockB var feature} {
2026 .ccWindow.bottom.$col tag remove highlight 1.0 end
2030 foreach col {id toMove event site white black clockW clockB var feature} {
2031 .ccWindow.bottom.$col tag add highlight $num.0 [
expr {$num+1}].0
2032 .ccWindow.bottom.$col tag configure highlight -background lightYellow2 -font font_Bold
2040 proc SetSelection {xcoord ycoord} {
2041 global ::CorrespondenceChess::num
2042 set gamecount $::CorrespondenceChess::glgames
2044 set num [
expr {int([.ccWindow.bottom.id index @$xcoord,$ycoord]) + $::CorrespondenceChess::glccstart - 1 }]
2047 if { $num > $gamecount } {
2058 proc emptyGamelist {} {
2060 foreach tag {id toMove event site white black clockW clockB var feature} {
2062 $w.bottom.$tag configure -state normal
2064 $w.bottom.$tag delete 1.0 end
2067 set ::CorrespondenceChess::num 0
2068 set ::CorrespondenceChess::clipboardText ""
2075 proc updateConsole {line} {
2076 set t .ccWindow.top.console
2077 if { [
winfo exists $t] } {
2078 $t insert end "$line\n"
2088 set w .correspondenceChessConfig
2089 if { [
winfo exists $w]} {
2094 wm title $w [
::tr "CCDlgConfigureWindowTitle"]
2096 set ::CorrespondenceChess::sortoptlist [list \
2097 [
::tr "CCOrderClassicTxt"] \
2098 [
::tr "CCOrderMyTimeTxt"] \
2099 [
::tr "CCOrderTimePerMoveTxt"] \
2100 [
::tr "CCOrderStartDate"] \
2101 [
::tr "CCOrderOppTimeTxt"]]
2104 ttk::frame $w.buttons
2105 ttk::button $w.bOk -text OK -command {
2106 ::CorrespondenceChess::saveCCoptions
2107 destroy .correspondenceChessConfig
2109 ttk::button $w.bCancel -text [
::tr "Cancel"] -command "destroy $w"
2111 ttk::labelframe $w.lgeneral -text [
::tr "CCDlgCGeneraloptions"]
2112 ttk::label $w.ldb -text [
::tr "CCDlgDefaultDB"]
2113 ttk::label $w.linbox -text [
::tr "CCDlgInbox"]
2114 ttk::label $w.loutbox -text [
::tr "CCDlgOutbox"]
2116 ttk::labelframe $w.lxfccrc -text [
::tr "CCDlgXfcc"]
2117 ttk::label $w.lxfcc -text [
::tr "CCDlgExternalProtocol"]
2118 ttk::label $w.lfetch -text [
::tr "CCDlgFetchTool"]
2119 ttk::label $w.lsend -text [
::tr "CCDlgSendTool"]
2120 ttk::label $w.lsortopt -text [
::tr "CCDlgSortOption"]
2122 ttk::labelframe $w.lemail -text [
::tr "CCDlgEmailCommunication"]
2123 ttk::label $w.lmailx -text [
::tr "CCDlgMailPrg"]
2124 ttk::label $w.lbccaddr -text [
::tr "CCDlgBCCAddr"]
2125 ttk::label $w.lmoderb -text [
::tr "CCDlgMailerMode"]
2126 ttk::label $w.lattache -text [
::tr "CCDlgAttachementPar"]
2127 ttk::label $w.lsubject -text [
::tr "CCDlgSubjectPar"]
2129 ttk::checkbutton $w.internalXfcc -text [
::tr "CCDlgInternalXfcc"] \
2130 -variable ::CorrespondenceChess::XfccInternal
2131 ttk::checkbutton $w.confirmXfcc -text [
::tr "CCDlgConfirmXfcc"] \
2132 -variable ::CorrespondenceChess::XfccConfirm
2133 ttk::checkbutton $w.onlyOwnMove -text [
::tr "CCDlgListOnlyOwnMove"] \
2134 -variable ::CorrespondenceChess::ListOnlyOwnMove
2136 ttk::scrollbar $w.ysc -command { .correspondenceChessConfig.sortopt yview }
2137 listbox $w.sortopt -height 3 -width 60 -exportselection 0 -selectmode single -list ::CorrespondenceChess::sortoptlist -yscrollcommand "$w.ysc set"
2138 $w.sortopt selection set $::CorrespondenceChess::ListOrder
2139 bind .correspondenceChessConfig.sortopt <<ListboxSelect>> {
2140 set ::CorrespondenceChess::ListOrder [ .correspondenceChessConfig.sortopt curselection ]
2143 ttk::button $w.xfconf -text [
::tr CCConfigure] -command { ::CorrespondenceChess::checkXfccrc
2144 ::Xfcc::config $::CorrespondenceChess::xfccrcfile}
2146 if {$::CorrespondenceChess::XfccInternal < 0} {
2147 $w.internalXfcc configure -state disabled
2148 $w.xfconf configure -state disabled
2151 ttk::entry $w.db -width 60 -textvariable ::CorrespondenceChess::CorrBase
2152 ttk::entry $w.inbox -width 60 -textvariable ::CorrespondenceChess::Inbox
2153 ttk::entry $w.outbox -width 60 -textvariable ::CorrespondenceChess::Outbox
2155 ttk::entry $w.xfccrc -width 60 -textvariable ::CorrespondenceChess::xfccrcfile
2156 ttk::entry $w.fetch -width 60 -textvariable ::CorrespondenceChess::XfccFetchcmd
2157 ttk::entry $w.send -width 60 -textvariable ::CorrespondenceChess::XfccSendcmd
2159 ttk::entry $w.mailx -width 60 -textvariable ::CorrespondenceChess::mailer
2160 ttk::entry $w.bccaddr -width 60 -textvariable ::CorrespondenceChess::bccaddr
2161 ttk::entry $w.attache -width 30 -textvariable ::CorrespondenceChess::attache
2162 ttk::entry $w.subject -width 30 -textvariable ::CorrespondenceChess::subject
2164 ttk::radiobutton $w.moderb1 -text "Mozilla \($::tr(CCDlgThunderbirdEg)\)" -value "mozilla" -variable ::CorrespondenceChess::mailermode
2165 ttk::radiobutton $w.moderb2 -text "Mail-URL \($::tr(CCDlgMailUrlEg)\)" -value "mailurl" -variable ::CorrespondenceChess::mailermode
2166 ttk::radiobutton $w.moderb3 -text "Claws \($::tr(CCDlgClawsEg)\)" -value "claws" -variable ::CorrespondenceChess::mailermode
2167 ttk::radiobutton $w.moderb4 -text "mailx \($::tr(CCDlgmailxEg)\)" -value "mailx" -variable ::CorrespondenceChess::mailermode
2169 ttk::button $w.bdb -text "..." -command {::CorrespondenceChess::chooseCorrBase }
2170 ttk::button $w.binbox -text "..." -command {::CorrespondenceChess::chooseInbox }
2171 ttk::button $w.boutbox -text "..." -command {::CorrespondenceChess::chooseOutbox }
2172 ttk::button $w.bfetch -text "..." -command {::CorrespondenceChess::chooseFetch }
2173 ttk::button $w.bsend -text "..." -command {::CorrespondenceChess::chooseSend }
2175 grid $w.lgeneral -column 0 -row 0 -pady "10 0" -sticky we
2176 grid $w.ldb -in $w.lgeneral -sticky e -column 0 -row 1
2177 grid $w.db -in $w.lgeneral -sticky we -column 1 -row 1 -columnspan 2 -padx 5
2178 grid $w.bdb -in $w.lgeneral -sticky w -column 3 -row 1
2179 grid $w.linbox -in $w.lgeneral -sticky e -column 0 -row 2
2180 grid $w.inbox -in $w.lgeneral -sticky we -column 1 -row 2 -columnspan 2 -padx 5
2181 grid $w.binbox -in $w.lgeneral -sticky w -column 3 -row 2
2182 grid $w.loutbox -in $w.lgeneral -sticky e -column 0 -row 3
2183 grid $w.outbox -in $w.lgeneral -sticky we -column 1 -row 3 -columnspan 2 -padx 5
2184 grid $w.boutbox -in $w.lgeneral -sticky w -column 3 -row 3
2186 grid $w.lxfccrc -column 0 -row 1 -pady 10 -sticky we
2187 grid $w.internalXfcc -in $w.lxfccrc -sticky w -column 0 -row 0 -columnspan 2
2188 grid $w.xfconf -in $w.lxfccrc -sticky w -column 2 -row 0
2189 grid $w.confirmXfcc -in $w.lxfccrc -sticky w -column 0 -row 1
2190 grid $w.onlyOwnMove -in $w.lxfccrc -sticky w -column 1 -row 1 -padx 5
2191 grid $w.lxfcc -in $w.lxfccrc -column 0 -row 2
2192 grid $w.xfccrc -in $w.lxfccrc -sticky we -column 1 -row 2 -columnspan 2 -padx 5
2194 grid $w.lfetch -in $w.lxfccrc -sticky e -column 0 -row 3
2195 grid $w.fetch -in $w.lxfccrc -sticky we -column 1 -row 3 -columnspan 2 -padx 5
2196 grid $w.bfetch -in $w.lxfccrc -sticky w -column 3 -row 3
2197 grid $w.lsend -in $w.lxfccrc -sticky e -column 0 -row 4
2198 grid $w.send -in $w.lxfccrc -sticky we -column 1 -row 4 -columnspan 2 -padx 5
2199 grid $w.bsend -in $w.lxfccrc -sticky w -column 3 -row 4
2201 grid $w.lsortopt -in $w.lxfccrc -sticky e -column 0 -row 5
2202 grid $w.sortopt -in $w.lxfccrc -sticky we -column 1 -row 5 -columnspan 2 -padx "5 0"
2203 grid $w.ysc -in $w.lxfccrc -sticky wns -column 3 -row 5
2205 grid $w.lemail -column 0 -row 2 -sticky we
2206 grid $w.lmailx -in $w.lemail -sticky e -column 0 -row 0
2207 grid $w.mailx -in $w.lemail -sticky we -column 1 -row 0 -padx 5
2208 grid $w.lbccaddr -in $w.lemail -sticky e -column 0 -row 1
2209 grid $w.bccaddr -in $w.lemail -sticky we -column 1 -row 1 -padx 5
2211 grid $w.lmoderb -in $w.lemail -sticky e -column 0 -row 2
2212 grid $w.moderb1 -in $w.lemail -sticky w -column 1 -row 2 -padx 5
2213 grid $w.moderb2 -in $w.lemail -sticky w -column 1 -row 3 -padx 5
2214 grid $w.moderb3 -in $w.lemail -sticky w -column 1 -row 4 -padx 5
2215 grid $w.moderb4 -in $w.lemail -sticky w -column 1 -row 5 -padx 5
2217 grid $w.lattache -in $w.lemail -sticky e -column 0 -row 6
2218 grid $w.attache -in $w.lemail -sticky we -column 1 -row 6 -padx 5
2220 grid $w.lsubject -in $w.lemail -sticky e -column 0 -row 7
2221 grid $w.subject -in $w.lemail -sticky we -column 1 -row 7 -padx 5
2223 grid columnconfigure $w.lgeneral 1 -weight 1
2224 grid columnconfigure $w.lxfccrc 1 -weight 1
2225 grid columnconfigure $w.lemail 1 -weight 1
2226 grid columnconfigure $w 0 -weight 1
2230 grid $w.buttons -column 0 -row 3 -sticky news
2231 bind $w <Escape> "$w.bCancel invoke"
2233 bind $w <F1> { helpWindow CCSetupDialog}
2241 proc startEmailGame {ownname ownmail oppname oppmail gameid} {
2242 global ::CorrespondenceChess::Inbox
2249 set Event "Email correspondence game"
2252 set CmailGameName "CmailGameName \"$gameid\""
2253 set WhiteNA "WhiteNA \"$ownmail\""
2254 set BlackNA "BlackNA \"$oppmail\""
2255 set whiteCountry "WhiteCountry \"EUR\""
2256 set blackCountry "BlackCountry \"EUR\""
2258 set Mode "Mode \"EM\""
2263 set today "$year.$month.$day"
2269 sc_game tags set -event $Event
2271 sc_game tags set -round $Round
2272 sc_game tags set -white $ownname
2273 sc_game tags set -black $oppname
2275 sc_game tags set -eventdate $today
2278 sc_game tags set -extra [list $CmailGameName $WhiteNA $BlackNA $whiteCountry $blackCountry $Mode]
2289 set pgnfile "[
file join $Inbox $gameid].pgn"
2290 sc_base export "current" "PGN" $pgnfile -append 0 -comments 0 -variations 0 \
2291 -space 1 -symbols 0 -indentC 0 -indentV 0 -column 0 -noMarkCodes 0 -convertNullMoves 1
2303 proc newEMailGame {} {
2304 global ::CorrespondenceChess::CorrSlot
2309 if {$CorrSlot > -1} {
2310 set w .wnewEMailGame
2311 if { [
winfo exists $w]} {
return}
2313 wm title $w [
::tr "CCDlgStartEmail"]
2315 set ownemail ::CorrespondenceChess::bccaddr
2321 ttk::label $w.lownname -text [
::tr CCDlgYourName]
2322 ttk::label $w.lownmail -text [
::tr CCDlgYourMail]
2323 ttk::label $w.loppname -text [
::tr CCDlgOpponentName]
2324 ttk::label $w.loppmail -text [
::tr CCDlgOpponentMail]
2325 ttk::label $w.lgameid -text [
::tr CCDlgGameID]
2327 ttk::entry $w.ownname -width 40 -textvariable ownname
2328 ttk::entry $w.ownmail -width 40 -textvariable $ownemail
2329 ttk::entry $w.oppname -width 40 -textvariable oppname
2330 ttk::entry $w.oppmail -width 40 -textvariable oppemail
2331 ttk::entry $w.gameid -width 40 -textvariable gameid
2333 ttk::button $w.bOk -text OK -command {
2334 ::CorrespondenceChess::startEmailGame \
2335 [.wnewEMailGame.ownname get] \
2336 [.wnewEMailGame.ownmail get] \
2337 [.wnewEMailGame.oppname get] \
2338 [.wnewEMailGame.oppmail get] \
2339 [.wnewEMailGame.gameid get]
2340 destroy .wnewEMailGame
2342 ttk::button $w.bCancel -text [
::tr "Cancel"] -command "destroy $w"
2344 grid $w.lownname -sticky e -column 0 -row 0
2345 grid $w.lownmail -sticky e -column 0 -row 1
2346 grid $w.loppname -sticky e -column 0 -row 2
2347 grid $w.loppmail -sticky e -column 0 -row 3
2348 grid $w.lgameid -sticky e -column 0 -row 4
2350 grid $w.ownname -sticky w -column 1 -row 0 -columnspan 2
2351 grid $w.ownmail -sticky w -column 1 -row 1 -columnspan 2
2352 grid $w.oppname -sticky w -column 1 -row 2 -columnspan 2
2353 grid $w.oppmail -sticky w -column 1 -row 3 -columnspan 2
2354 grid $w.gameid -sticky w -column 1 -row 4 -columnspan 2
2357 grid $w.bOk -column 1 -row 5 -pady 10
2358 grid $w.bCancel -column 2 -row 5 -pady 10
2359 bind $w <Escape> "$w.bCancel invoke"
2360 bind $w <F1> { helpWindow CCeMailChess}
2373 proc CallExternal {callstring {param ""}} {
2378 if {[
string match $::tcl_platform(os) "Windows NT"]} {
2379 catch {
exec $::env(COMSPEC) /c "$callstring $param" &}
2381 catch {
exec start "$callstring $param" &}
2385 catch {
exec /bin/sh -c "$callstring $param" &}
2393 proc CheckForCorrDB {} {
2394 global ::windows::switcher::base_types
2395 global ::CorrespondenceChess::Inbox ::CorrespondenceChess::Outbox
2396 global ::CorrespondenceChess::CorrSlot
2399 if {$CorrSlot < 0} {
2401 if {![
winfo exists .ccWindow]} {
2406 if { [
file exists $Inbox] == 0 && ([
file isdirectory $Inbox] == 0) } {
2407 set Title [
::tr CCDlgTitNoInbox]
2408 set Error [
::tr CCErrInboxDir]
2409 append Error "\n $Inbox\n"
2410 append Error [
::tr CCErrDirNotUsable]
2411 tk_messageBox -icon warning -type ok -parent . \
2412 -title $Title -message $Error
2415 if { ([
file exists $Outbox] == 0) && ([
file isdirectory $Outbox] == 0) } {
2416 set Title [
::tr CCDlgTitNoOutbox]
2417 set Error [
::tr CCErrOutboxDir]
2418 append Error "\n $Outbox\n"
2419 append Error [
::tr CCErrDirNotUsable]
2420 tk_messageBox -icon warning -type ok -parent . \
2421 -title $Title -message $Error
2425 set typeCorr [lsearch $base_types {Correspondence chess}]
2428 if {$type == $typeCorr} {
2429 .ccWindow.top.openDB configure -state disabled
2434 if {$CorrSlot < 0} {
2435 set Title [
::tr CCDlgTitNoCCDB]
2436 set Error [
::tr CCErrNoCCDB]
2437 tk_messageBox -icon warning -type ok -parent . \
2438 -title $Title -message $Error
2446 proc OpenCorrespondenceDB {} {
2447 global ::CorrespondenceChess::CorrBase
2454 tk_messageBox -icon warning -type ok -parent . \
2455 -title "Scid: Error opening file" -message $result
2457 if {[
file extension $fName] == ".si3"} {
2459 set CorrBase "[
file rootname $CorrBase].si4"
2462 set ::initialDir(base) [
file dirname $fName]
2475 proc SearchGame {Event Site White Black CmailGameName result refresh} {
2476 global ::CorrespondenceChess::CorrSlot
2483 lappend sPgnlist [
string trim $CmailGameName]
2511 if {$refresh == 1} {
2523 set mnCorr [
expr {[sc_pos moveNumber]-1}]
2529 set mnClip [
sc_pos moveNumber]
2531 if {$side == "white"} {
2532 set plyStart [
expr {$mnCorr*2-1}]
2534 set plyStart [
expr {$mnCorr*2}]
2538 if {$side == "white"} {
2539 set plyEnd [
expr {$mnClip*2-1}]
2541 set plyEnd [
expr {$mnClip*2}]
2546 if {($plyEnd-$plyStart < 2) && ($Mode == "XFCC") && ($result == "*")} {
2547 set Title [
::tr CCDlgDBGameToLong]
2548 set Error [
::tr CCDlgDBGameToLongError]
2549 tk_messageBox -icon warning -type ok -parent . \
2550 -title $Title -message "$Error $mnClip (= ply $plyEnd)"
2556 if {$Mode != "Postal"} {
2561 for {
set x $plyStart} {$x < $plyEnd} {
incr x} {
2572 set move [
sc_game info nextMoveNT]
2576 set comment [
sc_pos getComment]
2583 set basecomment [
sc_pos getComment]
2593 regsub -all {\[.*\]} $basecomment "" sbasecomment
2594 regsub -all {^\s*} $sbasecomment "" sbasecomment
2597 regsub -all "$White:" $sbasecomment "" sbasecomment
2598 regsub -all "$Black:" $sbasecomment "" sbasecomment
2601 regsub -all {\[.*\]} $comment "" scomment
2602 regsub -all {^\s*} $scomment "" scomment
2603 regsub -all "$White:" $scomment "" scomment
2604 regsub -all "$Black:" $scomment "" scomment
2607 if { [
string length $sbasecomment] == 0} {
2608 sc_pos setComment "$comment"
2609 }
elseif { [
string length $scomment] < [
string length $sbasecomment]} {
2611 if { [
string first $scomment $sbasecomment] < 0 } {
2612 sc_pos setComment "$basecomment $comment"
2616 if { [
string first $sbasecomment $scomment] < 0 } {
2617 sc_pos setComment "$basecomment $comment"
2619 sc_pos setComment "$comment"
2623 sc_game tags set -result $result
2630 if {$refresh == 1} {
2654 if {[
winfo exists .glistWin]} {
2659 set Title [
::tr CCDlgDuplicateGame]
2660 set Error [
::tr CCDlgDuplicateGameError]
2661 tk_messageBox -icon warning -type ok -parent . \
2662 -title $Title -message $Error
2674 proc ProcessServerResult {game} {
2675 global ::CorrespondenceChess::CorrSlot
2681 if {$CorrSlot > -1} {
2686 set Event [
sc_game tags get Event]
2687 set Site [
sc_game tags get Site]
2688 set White [
sc_game tags get White]
2689 set Black [
sc_game tags get Black]
2690 set Extra [
sc_game tags get Extra]
2691 set result [
sc_game tags get Result]
2693 set extraTagsList [
split $Extra "\n"]
2696 foreach i $extraTagsList {
2697 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
2698 set CmailGameName [
string range $i 15 end-1]
2705 set drawoffer "false"
2707 foreach xfccextra $::Xfcc::xfccstate {
2708 if { [
string equal -nocase [
lindex $xfccextra 0] "$CmailGameName"] } {
2709 foreach i $xfccextra {
2710 if { [
string equal -nocase [
lindex $i 0] "noEngines"] } {
2711 set noENG [
string range $i 10 end]
2713 if { [
string equal -nocase [
lindex $i 0] "drawOffered"] } {
2714 set drawoffer [
string range $i 12 end]
2719 if {$noENG == "true"} {
2727 SearchGame $Event $Site $White $Black $CmailGameName $result 1
2733 if {($Mode == "EM") || ($Mode == "Relay") || ($Mode == "Postal")} {
2739 foreach dataset $emailData {
2740 if { [
lindex $dataset 0] == $CmailGameName} {
2748 set idx [
llength $emailData]
2749 lappend emailData [list "" "" "" "" ""]
2750 set emailData [
lreplace $emailData $idx $idx \
2751 [list "$CmailGameName" "somewhere@somehost.org" "scid game" [
sc_filter first] "-- "]]
2760 if {$drawoffer == "true"} {
2761 .ccWindow.top.acceptDraw configure -state normal
2762 set comment [
sc_pos getComment]
2763 set drwstr "- [
::tr Draw] -"
2764 if { [regexp "$drwstr" $comment] } {
2766 sc_pos setComment "$comment $drwstr"
2770 .ccWindow.top.acceptDraw configure -state disabled
2789 set Event [
sc_game tags get Event]
2790 set Site [
sc_game tags get Site]
2791 set Extra [
sc_game tags get Extra]
2793 set extraTagsList [
split $Extra "\n"]
2796 foreach i $extraTagsList {
2797 if { [
string equal -nocase [
lindex $i 0] "Mode"] } {
2798 set Mode [
string range $i 6 end-1]
2802 set m .menu.play.correspondence
2805 if {($Mode == "EM") || ($Mode == "Relay") || ($Mode == "Postal")} {
2806 if {$Mode == "EM"} {
2808 }
elseif {$Mode == "Relay"} {
2810 }
elseif {$Mode == "Postal"} {
2817 .ccWindow.top.resign configure -state disabled
2818 .ccWindow.top.claimDraw configure -state disabled
2819 .ccWindow.top.offerDraw configure -state disabled
2822 $m entryconfigure 8 -state disabled
2823 $m entryconfigure 9 -state disabled
2824 $m entryconfigure 10 -state disabled
2825 $m entryconfigure 11 -state disabled
2827 .ccWindow.top.resign configure -state normal
2828 .ccWindow.top.claimDraw configure -state normal
2829 .ccWindow.top.offerDraw configure -state normal
2833 $m entryconfigure 8 -state normal
2834 $m entryconfigure 9 -state normal
2835 $m entryconfigure 10 -state normal
2836 $m entryconfigure 11 -state normal
2848 global ::CorrespondenceChess::CorrSlot ::CorrespondenceChess::num
2849 set gamecount $::CorrespondenceChess::glgames
2854 if {$CorrSlot > -1} {
2856 set num [
expr {$num - 1}]
2869 global ::CorrespondenceChess::CorrSlot ::CorrespondenceChess::num
2870 set gamecount $::CorrespondenceChess::glgames
2875 if {$CorrSlot > -1} {
2876 if {$num < $gamecount} {
2877 set num [
expr {$num + 1}]
2888 proc FetchGames {} {
2889 global ::CorrespondenceChess::Inbox ::CorrespondenceChess::XfccFetchcmd ::CorrespondenceChess::CorrSlot
2895 if {$CorrSlot > -1} {
2896 if {$::CorrespondenceChess::XfccInternal == 1} {
2902 if {[
file executable "$XfccFetchcmd"]} {
2909 foreach g $::CorrespondenceChess::RelayGames {
2922 proc EmptyInOutbox {} {
2923 global ::CorrespondenceChess::Inbox ::CorrespondenceChess::Outbox
2927 set inpath "$Inbox\\"
2928 set outpath "$Outbox\\"
2930 set inpath "$Inbox/"
2931 set outpath "$Outbox/"
2933 set result [
tk_dialog .roDialog "Scid: [
tr CCDlgDeleteBoxes]" \
2934 $::tr(CCDlgDeleteBoxesText) "" 1 $::tr(Yes) $::tr(No)]
2936 foreach f [glob -nocomplain [
file join $inpath *]] {
2939 foreach f [glob -nocomplain [
file join $outpath *]] {
2943 file delete $filename
2946 set ::Xfcc::xfccstate {}
2958 global ::CorrespondenceChess::Inbox ::CorrespondenceChess::CorrSlot
2959 global ::CorrespondenceChess::glccstart ::CorrespondenceChess::glgames windowsOS
2960 global ::Xfcc::lastupdate ::Xfcc::xfccstate
2967 set inpath "$Inbox\\"
2969 set inpath "$Inbox/"
2976 if {$CorrSlot > -1} {
2982 sc_base switch $::clipbase_db"
2985 foreach f [glob -nocomplain [
file join $inpath *]] {
2987 set game [
expr {$game + 1}]
2990 set number [
sc_pos moveNumber]
2991 set Date [
sc_game tags get Date]
2992 set Extra [
sc_game tags get Extra]
2993 set extraTagsList [
split $Extra "\n"]
2994 foreach i $extraTagsList {
2995 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
2996 set CmailGameName [
string range $i 15 end-1]
2999 lappend gamemoves [list $CmailGameName $number $Date]
3009 set sortmode "-ascii"
3011 foreach xfccextra $::Xfcc::xfccstate {
3012 set CmailGameName [
lindex $xfccextra 0]
3021 set TimeControl "10/50"
3022 set idx [lsearch -exact -index 0 $gamemoves $CmailGameName]
3023 set number [
lindex [
lindex $gamemoves $idx] 1]
3024 set Date [
lindex [
lindex $gamemoves $idx] 2]
3025 regsub -all {\.} $Date "" Date
3027 foreach i $xfccextra {
3028 if { [
string equal -nocase [
lindex $i 0] "myTurn"] } {
3029 set myTurn [
string range $i 7 end]
3031 if { [
string equal -nocase [
lindex $i 0] "mytime"] } {
3032 set mytime [
string range $i 7 end]
3034 if { [
string equal -nocase [
lindex $i 0] "opptime"] } {
3035 set opptime [
string range $i 8 end]
3037 if { [
string equal -nocase [
lindex $i 0] "TimeControl"] } {
3038 set TCstr [
string range $i 13 end]
3041 if { [regexp {/} $TCstr]} {
3042 set TC [
split $TCstr "/"]
3043 set moves [
lindex $TC 0]
3044 set tincrement [
lindex $TC 1]
3045 regsub -all "d.*" $tincrement "" tincrement
3046 set movestoTC [
expr {$moves - ($number % $moves)}]
3053 set mytime [
expr {int($mytime / 60.0 / 24.0)}]
3057 set timepermove1 [
expr {($mytime+$tincrement) / ($movestoTC+$moves)}]
3058 set timepermove2 [
expr {$mytime / $movestoTC}]
3061 set timepermove [
expr min($timepermove1, $timepermove2)]
3065 switch -regexp -- $::CorrespondenceChess::ListOrder \
3066 "$::CorrespondenceChess::CCOrderMyTime" {
3067 set criterion $mytime
3068 set sortmode "-integer"
3070 "$::CorrespondenceChess::CCOrderOppTime" {
3071 set criterion $opptime
3072 set sortmode "-integer"
3074 "$::CorrespondenceChess::CCOrderTimePerMove" {
3075 set criterion $timepermove
3076 set sortmode "-real"
3078 "$::CorrespondenceChess::CCOrderStartDate" {
3080 set sortmode "-integer"
3083 if {($myTurn == "false") && ($::CorrespondenceChess::ListOnlyOwnMove == 1) } {
3084 lappend skiplist [list $CmailGameName $criterion]
3086 lappend filelist [list $CmailGameName $criterion]
3088 lappend xfcclist [list $CmailGameName]
3092 set filelist [lsort -index 1 "$sortmode" $filelist]
3093 set skiplist [lsort -index 1 "$sortmode" $skiplist]
3101 foreach f [glob -nocomplain [
file join $inpath *]] {
3102 set id [
file tail $f]
3103 regsub -all ".pgn" $id "" id
3104 if { [lsearch $xfcclist "$id"] < 0 } {
3105 set filelist [
concat $id $filelist]
3110 foreach f $filelist {
3111 set filename "[
file join $inpath [
lindex $f 0]].pgn"
3112 if {[
catch {
sc_base import [
sc_base current] $filename} result]} {
3116 set games [
expr {$games+1}]
3124 if {$::CorrespondenceChess::ListOrder == $::CorrespondenceChess::CCOrderClassic} {
3125 tk_messageBox -message "oops, 300+ lines functions are not maintainable"
3133 for {
set game $glccstart} {$game < [
expr {$games+1}]} {
incr game} {
3135 set clockW "no update"
set clockB "no update"
3136 set var ""
set noDB ""
3137 set noBK ""
set noTB ""
3138 set noENG ""
set mess ""
3139 set TC ""
set drawoffer "false"
3146 set Event [
sc_game tags get Event]
3147 set Site [
sc_game tags get Site]
3148 set Date [
sc_game tags get Date]
3149 set White [
sc_game tags get White]
3150 set Black [
sc_game tags get Black]
3151 set Result [
sc_game tags get Result]
3152 set Extra [
sc_game tags get Extra]
3154 set extraTagsList [
split $Extra "\n"]
3155 foreach i $extraTagsList {
3156 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
3157 set CmailGameName [
string range $i 15 end-1]
3165 SearchGame $Event $Site $White $Black $CmailGameName $result 0
3167 set Extra [
sc_game tags get Extra]
3168 set extraTagsList [
split $Extra "\n"]
3171 foreach i $extraTagsList {
3172 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
3173 set CmailGameName [
string range $i 15 end-1]
3175 if { [
string equal -nocase [
lindex $i 0] "Mode"] } {
3176 set Mode [
string range $i 6 end-1]
3178 if { [
string equal -nocase [
lindex $i 0] "whiteCountry"] } {
3179 set wc [
string range $i 14 end-1]
3180 set wc [
string tolower $wc]
3183 if { [
string equal -nocase [
lindex $i 0] "blackCountry"] } {
3184 set bc [
string range $i 14 end-1]
3185 set bc [
string tolower $bc]
3188 if { [
string equal -nocase [
lindex $i 0] "WhiteCountry"] } {
3189 set wc [
string range $i 14 end-1]
3190 set wc [
string tolower $wc]
3193 if { [
string equal -nocase [
lindex $i 0] "BlackCountry"] } {
3194 set bc [
string range $i 14 end-1]
3195 set bc [
string tolower $bc]
3198 if { [
string equal -nocase [
lindex $i 0] "TimeControl"] } {
3199 set TC [
string range $i 13 end-1]
3203 set number [
sc_pos moveNumber]
3204 set move [
sc_game info previousMoveNT]
3207 if {$side == "white"} {
3208 set number [
expr {$number-1}]
3209 set lastmove "$number...$move"
3211 set lastmove "$number. $move"
3215 if {$Mode == "EM"} {
3217 $Event $Site $Date $White $Black "" "" "" "" $TC "" "" \
3218 $wc $bc "" "" $lastmove "false"
3219 }
elseif {$Mode == "Relay"} {
3221 $Event $Site $Date $White $Black "" "" "" "" $TC "" "" \
3222 $wc $bc "" "" $lastmove "false"
3223 }
elseif {$Mode == "Postal"} {
3225 $Event $Site $Date $White $Black "" "" "" "" $TC "" "" \
3226 $wc $bc "" "" $lastmove "false"
3231 foreach xfccextra $::Xfcc::xfccstate {
3232 if { [
string equal -nocase [
lindex $xfccextra 0] "$CmailGameName"] } {
3233 foreach i $xfccextra {
3234 if { [
string equal -nocase [
lindex $i 0] "myTurn"] } {
3235 if {[
string range $i 7 end] == "true"} {
3241 if { [
string equal -nocase [
lindex $i 0] "clockW"] } {
3242 set clockW [
string range $i 7 end]
3243 regsub -all "\{" $clockW "" clockW
3244 regsub -all "\}" $clockW "" clockW
3246 if { [
string equal -nocase [
lindex $i 0] "clockB"] } {
3247 set clockB [
string range $i 7 end]
3248 regsub -all "\{" $clockB "" clockB
3249 regsub -all "\}" $clockB "" clockB
3251 if { [
string equal -nocase [
lindex $i 0] "drawOffered"] } {
3252 set drawoffer [
string range $i 12 end]
3254 if { [
string equal -nocase [
lindex $i 0] "variant"] } {
3255 set var [
string range $i 8 end]
3257 if { [
string equal -nocase [
lindex $i 0] "noDatabases"] } {
3258 set noDB [
string range $i 12 end]
3260 if { [
string equal -nocase [
lindex $i 0] "noOpeningBooks"] } {
3261 set noBK [
string range $i 15 end]
3263 if { [
string equal -nocase [
lindex $i 0] "noTablebases"] } {
3264 set noTB [
string range $i 13 end]
3266 if { [
string equal -nocase [
lindex $i 0] "noEngines"] } {
3267 set noENG [
string range $i 10 end]
3269 if { [
string equal -nocase [
lindex $i 0] "TimeControl"] } {
3270 set TC [
string range $i 13 end-1]
3272 if { [
string equal -nocase [
lindex $i 0] "message"] } {
3273 set mess [
string range $i 9 end-1]
3278 if {$Result == "1"} {
3280 }
elseif {$Result == "0"} {
3282 }
elseif {$Result == "="} {
3287 $Event $Site $Date $White $Black $clockW $clockB $var \
3288 $noDB $noBK $noTB $noENG $wc $bc $mess $TC $lastmove $drawoffer
3292 set ::CorrespondenceChess::num 0
3296 set Title [
::tr CCDlgTitNoGames]
3297 set Error [
::tr CCErrInboxDir]
3298 append Error "\n $Inbox\n"
3299 append Error [
::tr CCErrNoGames]
3300 tk_messageBox -icon warning -type ok -parent . \
3301 -title $Title -message $Error
3320 proc eMailMove { } {
3321 global ::CorrespondenceChess::Outbox \
3322 ::CorrespondenceChess::mailer ::CorrespondenceChess::mailermode \
3323 ::CorrespondenceChess::attache ::CorrespondenceChess::subject \
3324 ::CorrespondenceChess::bccaddr ::CorrespondenceChess::CorrSlot
3333 if {$CorrSlot > -1} {
3337 set Event [
sc_game tags get Event]
3338 set Site [
sc_game tags get Site]
3339 set Date [
sc_game tags get Date]
3340 set Round [
sc_game tags get Round]
3341 set Result [
sc_game tags get Result]
3342 set White [
sc_game tags get White]
3343 set Black [
sc_game tags get Black]
3344 set Extra [
sc_game tags get Extra]
3345 set Extra [
sc_game tags get Extra]
3346 set extraTagsList [
split $Extra "\n"]
3348 foreach i $extraTagsList {
3349 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
3350 set CmailGameName [
string range $i 15 end-1]
3352 if { [
string equal -nocase [
lindex $i 0] "WhiteNA"] } {
3353 set WhiteNA [
string range $i 9 end-1]
3355 if { [
string equal -nocase [
lindex $i 0] "BlackNA"] } {
3356 set BlackNA [
string range $i 9 end-1]
3361 set pgnfile "[
file join $Outbox $CmailGameName].pgn"
3363 sc_base export "current" "PGN" $pgnfile -append 0 -comments 0 -variations 0 \
3364 -space 1 -symbols 0 -indentC 0 -indentV 0 -column 0 -noMarkCodes 0 -convertNullMoves 1
3370 while {! [
file exists $pgnfile]} {
3371 after 1500 puts "waiting..."
3376 if {$toMove == "white"} {
3386 catch {
set mailer [
file attributes $mailer -shortname]}
3389 set title "scid mail 1 game ($CmailGameName)"
3390 set body "Final FEN: "
3393 append body "Move List: "
3409 switch -regexp -- $::CorrespondenceChess::mailermode \
3411 set callstring "$mailer $subject \"$title\" -b $bccaddr $attache \"$pgnfile\" $to <\"$pgnfile\""
3415 set callstring "$mailer -compose subject='$title',bcc=$bccaddr,attachment='file:///$pgnfile',to=$to,body=$body"
3417 set callstring "$mailer -compose subject='$title',bcc=$bccaddr,attachment='file://$pgnfile',to='$to',body='$body'"
3421 set callstring "$mailer \'mailto:<$to>?bcc=$bccaddr\&subject=$title\&attach=$pgnfile\&body=$body\'"
3424 set callstring "$mailer --compose \'mailto:$to?subject=$title&cc=$bccaddr&body=$body\' --attach \"$pgnfile\""
3437 foreach dataset $emailData {
3438 if { [
lindex $dataset 0] == $CmailGameName} {
3453 proc SendMove {resign claimDraw offerDraw acceptDraw } {
3454 global ::CorrespondenceChess::Outbox
3455 global ::CorrespondenceChess::XfccSendcmd
3456 global ::CorrespondenceChess::CorrSlot
3457 global ::CorrespondenceChess::XfccConfirm
3458 global ::CorrespondenceChess::num
3463 if {$CorrSlot > -1} {
3466 set Extra [
sc_game tags get Extra]
3467 set extraTagsList [
split $Extra "\n"]
3470 foreach i $extraTagsList {
3471 if { [
string equal -nocase [
lindex $i 0] "CmailGameName"] } {
3472 set CmailGameName [
string range $i 15 end-1]
3474 if { [
string equal -nocase [
lindex $i 0] "WhiteAddress"] } {
3475 set WhiteAdr [
split [
string range $i 14 end-1] ";"]
3476 set WhiteAdr [
split [
string range $i 14 end-1] ";"]
3478 if { [
string equal -nocase [
lindex $i 0] "BlackAddress"] } {
3479 set BlackAdr [
string range $i 14 end-1]
3480 set BlackAdr [
split [
string range $i 14 end-1] ";"]
3484 set pgnfile "[
file join $Outbox $CmailGameName].pgn"
3486 set IdList [
split $CmailGameName "-"]
3487 set name [
lindex $IdList 0]
3488 set gameid [
lindex $IdList 1]
3489 set movecount [
sc_pos moveNumber]
3490 set ply [
sc_pos location]
3491 set move [
sc_game info previousMoveNT]
3492 set comment [
sc_pos getComment]
3493 set Event [
sc_game tags get Event]
3497 regsub -all {\[[^\]]*\]} $comment {} comment
3502 if {[
sc_pos side] == "white"} {
3503 set movecount [
expr {$movecount-1}]
3510 .ccWindow.bottom.id tag add hlsent$CmailGameName $num.0 [
expr {$num+1}].0
3511 .ccWindow.bottom.id tag configure hlsent$CmailGameName -background yellow -font font_Bold
3513 set DlgBoxText "[
::tr CCDlgConfirmMoveText]\n\n$name-$gameid:\n\t$movecount. $move\n\t{$comment}"
3515 set DlgBoxText "$DlgBoxText\n\n[
::tr CCResign]"
3525 if {[
sc_pos side] == "white"} {
3526 set movecount [
expr {$ply / 2 + 1}]
3529 }
elseif {$acceptDraw == 1} {
3530 set DlgBoxText "$DlgBoxText\n\n[
::tr CCAcceptDraw]"
3531 }
elseif {$offerDraw == 1} {
3532 set DlgBoxText "$DlgBoxText\n\n[
::tr CCofferDraw]"
3533 }
elseif {$claimDraw == 1} {
3534 set DlgBoxText "$DlgBoxText\n\n[
::tr CCClaimDraw]"
3538 if {$::CorrespondenceChess::XfccConfirm == 1} {
3539 set result [
tk_dialog .roDialog "Scid: [
tr CCDlgConfirmMove]" \
3540 $DlgBoxText "" 1 $::tr(Yes) $::tr(No)]
3551 if {$Mode == "EM"} {
3553 }
elseif {$Mode == "XFCC"} {
3555 if {$::CorrespondenceChess::XfccInternal == 1} {
3559 $resign $acceptDraw $offerDraw $claimDraw
3561 if {[
file executable "$XfccSendcmd"]} {
3562 set callstring "$XfccSendcmd $Outbox $name $gameid $movecount $move \"$comment\" $resign $claimDraw $offerDraw $acceptDraw &"
3568 }
elseif {$Mode == "Postal"} {
3579 if {!(($Mode == "EM") || ($Mode == "Relay"))} {
3580 sc_base export "current" "PGN" $pgnfile -append 0 -comments 1 -variations 1 \
3581 -space 1 -symbols 1 -indentC 0 -indentV 0 -column 0 -noMarkCodes 0 -convertNullMoves 1
3585 .ccWindow.bottom.id tag configure hlsent$CmailGameName -background green -font font_Bold
3588 .ccWindow.bottom.id tag configure hlsent$CmailGameName -background gray -font font_Small
3599 ::splash::add "Correspondence Chess configuration was found and loaded."
3602 if {[
catch {
package require http}]} {
3603 ::splash::add "http package not found, disabling internal Xfcc support"
3606 ::http::config -useragent $::Xfcc::useragent
3607 if {![
catch {
package require tls}]} {
3608 ::tls::init -ssl3 false -ssl2 false -tls1 true
3609 http::register https 443 ::tls::socket
3613 if {[
catch {
package require tdom}]} {
3614 ::splash::add "tDOM package not found, disabling internal Xfcc support"