-
Notifications
You must be signed in to change notification settings - Fork 12
/
SendControlParameterToCps.cpp
115 lines (87 loc) · 2.84 KB
/
SendControlParameterToCps.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include "stdafx.h"
#include "data.h"
#include "chess.h"
#include "Resource.h"
#include "pregen.h"
void
SendControlParameterToCps(ChessProgramState *cps) {
//if(cps->Already_Send_Initinfo == TRUE){ //已发送了初始信息
// return;
//}
//在这儿先设定时间方面的设定
TCHAR buf[MSG_SIZ];
//在这儿设定引擎的相关设置,时间,层数,后台思考等
switch(cps->ucci){
//
case UCCI_UCCI_ms: //象堡协议 *******************************************************
//
SendToProgram(L"setoption usemillisec on\n",cps);
//
if(cps->UCCI_loadbook){
SendToProgram(L"setoption usebook true\n",cps);
}
else{
SendToProgram(L"setoption usebook off\n",cps);
}
//
swprintf_s(buf,sizeof(buf)/sizeof(TCHAR),L"setoption hashsize %d\n",cps->UCCI_hashsize);
SendToProgram(buf,cps);
//............................................
break;
//
case UCCI_UCCI_OLD:
//
SendToProgram(L"setoption usemillisec false\n",cps);
//
if(cps->UCCI_loadbook){
SendToProgram(L"setoption usebook true\n",cps);
}
else{
SendToProgram(L"setoption usebook off\n",cps);
}
swprintf_s(buf, sizeof(buf) / sizeof(TCHAR), L"setoption hashsize %d\n", cps->UCCI_hashsize);
SendToProgram(buf,cps);
//............................................
break;
//
case UCCI_GGchess: //佳佳协议 *******************************************************
if(cps->UCCI_hashsize < 64){
cps->UCCI_hashsize = 64;
}
swprintf_s(buf, sizeof(buf) / sizeof(TCHAR), L"setoption name Hash value %d\n", cps->UCCI_hashsize);
SendToProgram(buf,cps);
swprintf_s(buf, sizeof(buf) / sizeof(TCHAR), L"setoption name Threads value %d\n", cps->UCCI_smpNum);
SendToProgram(buf,cps);
//define_uci_option(FALSE, "Threads", SMP_NUM, UCI_SPIN, 1, 8);
//SMP NUM
swprintf_s(buf, sizeof(buf) / sizeof(TCHAR),
L"\n*******************************\n"
L"引擎 -> %s"
L"线程数(SMP): %6d\n"
L"Hash表: %6dm\n"
L"开局步数: %6d回合\n"
L"********************************\n",
cps->UCCI_name,
cps->UCCI_smpNum,
cps->UCCI_hashsize,
cps->UCCI_Book_Num);
LogOut(buf);
//sprintf_s(buf,sizeof(buf), "
//
break;
case UCCI_QianHong: //浅红协议 *******************************************************
if (wcsstr(cps->UCCI_file, L"keplugin.exe") != NULL){ //killegg特有的
SendToProgram(L"LEVEL 5\n",cps);
}
else{
SendToProgram(L"LEVEL 3\n",cps);
}
//cps->maybeThinking = FALSE;
//cps->offeredDraw = 0;
break;
case UCCI_CYC105:
break;
default: //*******************************************************
break;
}
}