update:更新submodule.
This commit is contained in:
parent
1081f71f2a
commit
72cb2ff4f1
@ -272,7 +272,7 @@ bool CClient::down_one_file(const std::string& id, const std::string& file, cons
|
|||||||
down_->trans_state_ = TRANS_REDAY;
|
down_->trans_state_ = TRANS_REDAY;
|
||||||
cur_down_size_ = 0;
|
cur_down_size_ = 0;
|
||||||
float percent = 0.0;
|
float percent = 0.0;
|
||||||
disable_cur();
|
fc_disable_cur();
|
||||||
while (down_->trans_state_ != TRANS_DONE && down_->trans_state_ != TRANS_FAILED) {
|
while (down_->trans_state_ != TRANS_DONE && down_->trans_state_ != TRANS_FAILED) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(down_check_wait));
|
std::this_thread::sleep_for(std::chrono::milliseconds(down_check_wait));
|
||||||
if (cur_file_size_ > 0) {
|
if (cur_file_size_ > 0) {
|
||||||
@ -289,7 +289,7 @@ bool CClient::down_one_file(const std::string& id, const std::string& file, cons
|
|||||||
percent = (float)cur_down_size_ / cur_file_size_;
|
percent = (float)cur_down_size_ / cur_file_size_;
|
||||||
CTransProtocal::display_progress(percent);
|
CTransProtocal::display_progress(percent);
|
||||||
}
|
}
|
||||||
enable_cur();
|
fc_enable_cur();
|
||||||
if (cur_down_size_ > 0 && cur_file_size_ == cur_down_size_) {
|
if (cur_down_size_ > 0 && cur_file_size_ == cur_down_size_) {
|
||||||
mpwarn("down one file success, total:[{}/{}]", cur_down_size_, cur_file_size_);
|
mpwarn("down one file success, total:[{}/{}]", cur_down_size_, cur_file_size_);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit f6a975b9848e6f2e989befec1681c422df931b28
|
Subproject commit 0c566d0b0a3c9b00d0b22f8e1e3a146a7f1482e0
|
16
util/util.h
16
util/util.h
@ -94,25 +94,25 @@ inline std::string now_str()
|
|||||||
|
|
||||||
template <typename... Args> void mpdebug(const std::string& format, Args&&... args)
|
template <typename... Args> void mpdebug(const std::string& format, Args&&... args)
|
||||||
{
|
{
|
||||||
lock_print();
|
fc_lock_print();
|
||||||
fmt::print(fg(fmt::color::steel_blue), now_str() + format + "\n", std::forward<Args>(args)...);
|
fmt::print(fg(fmt::color::steel_blue), now_str() + format + "\n", std::forward<Args>(args)...);
|
||||||
unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
||||||
template <typename... Args> void mpinfo(const std::string& format, Args&&... args)
|
template <typename... Args> void mpinfo(const std::string& format, Args&&... args)
|
||||||
{
|
{
|
||||||
lock_print();
|
fc_lock_print();
|
||||||
fmt::print(fg(static_cast<fmt::color>(0x0EA113)), now_str() + format + "\n", std::forward<Args>(args)...);
|
fmt::print(fg(static_cast<fmt::color>(0x0EA113)), now_str() + format + "\n", std::forward<Args>(args)...);
|
||||||
unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
||||||
template <typename... Args> void mpwarn(const std::string& format, Args&&... args)
|
template <typename... Args> void mpwarn(const std::string& format, Args&&... args)
|
||||||
{
|
{
|
||||||
lock_print();
|
fc_lock_print();
|
||||||
fmt::print(fg(fmt::color::yellow_green), now_str() + format + "\n", std::forward<Args>(args)...);
|
fmt::print(fg(fmt::color::yellow_green), now_str() + format + "\n", std::forward<Args>(args)...);
|
||||||
unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
||||||
template <typename... Args> void mperror(const std::string& format, Args&&... args)
|
template <typename... Args> void mperror(const std::string& format, Args&&... args)
|
||||||
{
|
{
|
||||||
lock_print();
|
fc_lock_print();
|
||||||
fmt::print(fg(fmt::color::orange_red), now_str() + format + "\n", std::forward<Args>(args)...);
|
fmt::print(fg(fmt::color::orange_red), now_str() + format + "\n", std::forward<Args>(args)...);
|
||||||
unlock_print();
|
fc_unlock_print();
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user