| @@ -17,7 +17,7 @@ extern const std::array<THUAI6::StudentType, 4> studentType = { | |||||
| extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::Assassin; | extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::Assassin; | ||||
| //可以在AI.cpp内部声明变量与函数 | |||||
| // 可以在AI.cpp内部声明变量与函数 | |||||
| void AI::play(IStudentAPI& api) | void AI::play(IStudentAPI& api) | ||||
| { | { | ||||
| @@ -38,8 +38,8 @@ void AI::play(IStudentAPI& api) | |||||
| { | { | ||||
| // 玩家3执行操作 | // 玩家3执行操作 | ||||
| } | } | ||||
| //当然可以写成if (this->playerID == 2||this->playerID == 3)之类的操作 | |||||
| // 公共操作 | |||||
| // 当然可以写成if (this->playerID == 2||this->playerID == 3)之类的操作 | |||||
| // 公共操作 | |||||
| } | } | ||||
| void AI::play(ITrickerAPI& api) | void AI::play(ITrickerAPI& api) | ||||
| @@ -39,7 +39,8 @@ COPY ./CAPI /usr/local/PlayerCode/CAPI | |||||
| COPY ./dependency /usr/local/PlayerCode/dependency | COPY ./dependency /usr/local/PlayerCode/dependency | ||||
| WORKDIR /usr/local/PlayerCode/dependency/proto | WORKDIR /usr/local/PlayerCode/dependency/proto | ||||
| RUN ./cpp_output.sh | RUN ./cpp_output.sh | ||||
| WORKDIR /usr/local/PlayerCode/dependency/shell | |||||
| WORKDIR /usr/local/PlayerCode/CAPI/cpp | |||||
| COPY ./dependency/shell/compile.sh . | |||||
| ENTRYPOINT ["bash","./compile.sh"] | ENTRYPOINT ["bash","./compile.sh"] | ||||
| #WORKDIR /usr/local/PlayerCode/CAPI/cpp | #WORKDIR /usr/local/PlayerCode/CAPI/cpp | ||||
| #RUN cmake ./CMakeLists.txt | #RUN cmake ./CMakeLists.txt | ||||
| @@ -0,0 +1,23 @@ | |||||
| #! /bin/bash | |||||
| # WORKDIR /usr/local/PlayerCode/CAPI/cpp | |||||
| i=1 | |||||
| flag=1 | |||||
| bind=/usr/local/mnt | |||||
| while (( $i <= 4 )) | |||||
| do | |||||
| cp -f $bind/player$i.cpp ./API/src | |||||
| mv ./API/src/player$i.cpp ./API/src/AI.cpp | |||||
| cmake ./CMakeLists.txt && make >compile_log$i.txt 2>&1 | |||||
| mv ./capi $bind/capi$i # executable file | |||||
| if [ $? -ne 0 ]; then | |||||
| flag=0 | |||||
| fi | |||||
| mv ./compile_log$i.txt $bind/compile_log$i.txt | |||||
| let "i++" | |||||
| done | |||||
| # HTML request to update status. | |||||
| if [ $flag -eq 1 ]; then | |||||
| curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"compiled"}' > ../mnt/curl_log.txt | |||||
| else | |||||
| curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"failed"}' > ../mnt/curl_log.txt | |||||
| fi | |||||
| @@ -447,8 +447,8 @@ namespace Downloader | |||||
| .Build(); // 创建 CosXmlConfig 对象 | .Build(); // 创建 CosXmlConfig 对象 | ||||
| // 永久密钥访问凭证 | // 永久密钥访问凭证 | ||||
| string secretId = "AKIDvhEVXN4cv0ugIlFYiniV6Wk1McfkplYA"; //"云 API 密钥 SecretId"; | |||||
| string secretKey = "YyGLGCJG4f5VsEUddnz9JSRPSSK8sYBo"; //"云 API 密钥 SecretKey"; | |||||
| string secretId = "***"; //"云 API 密钥 SecretId"; | |||||
| string secretKey = "***"; //"云 API 密钥 SecretKey"; | |||||
| long durationSecond = 1000; // 每次请求签名有效时长,单位为秒 | long durationSecond = 1000; // 每次请求签名有效时长,单位为秒 | ||||