1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

fix indentation

This commit is contained in:
Andrey Filipenkov 2022-08-15 16:31:58 +03:00
parent e1c9903a45
commit 031ba967d3
4 changed files with 82 additions and 82 deletions

View File

@ -185,18 +185,18 @@ void CServerHandler::startLocalServerAndConnect()
envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true);
}
#elif defined(VCMI_IOS)
// todo ios: hide keyboard
logNetwork->info("[ios] create server thread");
boost::condition_variable cond;
threadRunLocalServer = std::make_shared<boost::thread>([&cond, this] {
setThreadName("CVCMIServer");
CVCMIServer::create(&cond, uuid);
// todo ios copypaste
threadRunLocalServer.reset();
CSH->campaignServerRestartLock.setn(false);
});
threadRunLocalServer->detach();
logNetwork->info("[ios] detach server thread");
// todo ios: hide keyboard
logNetwork->info("[ios] create server thread");
boost::condition_variable cond;
threadRunLocalServer = std::make_shared<boost::thread>([&cond, this] {
setThreadName("CVCMIServer");
CVCMIServer::create(&cond, uuid);
// todo ios copypaste
threadRunLocalServer.reset();
CSH->campaignServerRestartLock.setn(false);
});
threadRunLocalServer->detach();
logNetwork->info("[ios] detach server thread");
#else
threadRunLocalServer = std::make_shared<boost::thread>(&CServerHandler::threadRunServer, this); //runs server executable;
#endif
@ -215,13 +215,13 @@ void CServerHandler::startLocalServerAndConnect()
androidTestServerReadyFlag = false;
#elif defined(VCMI_IOS)
// todo ios
{
boost::mutex m;
boost::unique_lock<boost::mutex> lock{m};
logNetwork->info("[ios] wait for server");
cond.wait(lock);
logNetwork->info("[ios] server ready");
}
{
boost::mutex m;
boost::unique_lock<boost::mutex> lock{m};
logNetwork->info("waiting for server");
cond.wait(lock);
logNetwork->info("server is ready");
}
#else
if(shm)
shm->sr->waitTillReady();

View File

@ -370,10 +370,10 @@ bfs::path IVCMIDirsUNIX::serverPath() const { return binaryPath() / "vcmiserver"
#ifdef VCMI_APPLE
class VCMIDirsApple : public IVCMIDirsUNIX
{
public:
bfs::path userConfigPath() const override;
public:
bfs::path userConfigPath() const override;
std::string libraryName(const std::string& basename) const override;
std::string libraryName(const std::string& basename) const override;
};
bfs::path VCMIDirsApple::userConfigPath() const { return userDataPath() / "config"; }
@ -383,15 +383,15 @@ std::string VCMIDirsApple::libraryName(const std::string& basename) const { retu
#ifdef VCMI_IOS
class VCMIDirsIOS final : public VCMIDirsApple
{
public:
bfs::path userDataPath() const override;
bfs::path userCachePath() const override;
bfs::path userLogsPath() const override;
public:
bfs::path userDataPath() const override;
bfs::path userCachePath() const override;
bfs::path userLogsPath() const override;
std::vector<bfs::path> dataPaths() const override;
std::vector<bfs::path> dataPaths() const override;
bfs::path libraryPath() const override;
bfs::path binaryPath() const override;
bfs::path libraryPath() const override;
bfs::path binaryPath() const override;
};
bfs::path VCMIDirsIOS::userDataPath() const { return {iOS_utils::documentsPath()}; }
@ -400,15 +400,15 @@ bfs::path VCMIDirsIOS::userLogsPath() const { return {iOS_utils::documentsPath()
std::vector<bfs::path> VCMIDirsIOS::dataPaths() const
{
std::vector<bfs::path> paths;
paths.reserve(4);
std::vector<bfs::path> paths;
paths.reserve(4);
#ifdef VCMI_IOS_SIM
paths.emplace_back(iOS_utils::hostApplicationSupportPath());
paths.emplace_back(iOS_utils::hostApplicationSupportPath());
#endif
paths.emplace_back(userDataPath());
paths.emplace_back(iOS_utils::documentsPath());
paths.emplace_back(binaryPath());
return paths;
paths.emplace_back(userDataPath());
paths.emplace_back(iOS_utils::documentsPath());
paths.emplace_back(binaryPath());
return paths;
}
bfs::path VCMIDirsIOS::libraryPath() const { return {iOS_utils::frameworksPath()}; }
@ -416,17 +416,17 @@ bfs::path VCMIDirsIOS::binaryPath() const { return {iOS_utils::bundlePath()}; }
#elif defined(VCMI_MAC)
class VCMIDirsOSX final : public VCMIDirsApple
{
public:
boost::filesystem::path userDataPath() const override;
boost::filesystem::path userCachePath() const override;
boost::filesystem::path userLogsPath() const override;
public:
boost::filesystem::path userDataPath() const override;
boost::filesystem::path userCachePath() const override;
boost::filesystem::path userLogsPath() const override;
std::vector<boost::filesystem::path> dataPaths() const override;
std::vector<boost::filesystem::path> dataPaths() const override;
boost::filesystem::path libraryPath() const override;
boost::filesystem::path binaryPath() const override;
boost::filesystem::path libraryPath() const override;
boost::filesystem::path binaryPath() const override;
void init() override;
void init() override;
};
void VCMIDirsOSX::init()

View File

@ -361,40 +361,40 @@ void CLogConsoleTarget::write(const LogRecord & record)
#ifdef VCMI_ANDROID
__android_log_write(ELogLevel::toAndroid(record.level), ("VCMI-" + record.domain.getName()).c_str(), message.c_str());
#elif defined(VCMI_IOS)
os_log_type_t type;
switch (record.level)
{
case ELogLevel::TRACE:
type = OS_LOG_TYPE_DEBUG;
break;
case ELogLevel::DEBUG:
type = OS_LOG_TYPE_DEFAULT;
break;
case ELogLevel::INFO:
type = OS_LOG_TYPE_INFO;
break;
case ELogLevel::WARN:
type = OS_LOG_TYPE_ERROR;
break;
case ELogLevel::ERROR:
type = OS_LOG_TYPE_FAULT;
break;
default:
return;
}
os_log_type_t type;
switch (record.level)
{
case ELogLevel::TRACE:
type = OS_LOG_TYPE_DEBUG;
break;
case ELogLevel::DEBUG:
type = OS_LOG_TYPE_DEFAULT;
break;
case ELogLevel::INFO:
type = OS_LOG_TYPE_INFO;
break;
case ELogLevel::WARN:
type = OS_LOG_TYPE_ERROR;
break;
case ELogLevel::ERROR:
type = OS_LOG_TYPE_FAULT;
break;
default:
return;
}
os_log_t currentLog;
static std::unordered_map<std::string, decltype(currentLog)> logs;
const auto& domainName = record.domain.getName();
auto logIt = logs.find(domainName);
if (logIt != logs.end())
currentLog = logIt->second;
else
{
os_log_t currentLog;
static std::unordered_map<std::string, decltype(currentLog)> logs;
const auto& domainName = record.domain.getName();
auto logIt = logs.find(domainName);
if (logIt != logs.end())
currentLog = logIt->second;
else
{
currentLog = os_log_create(iOS_utils::bundleIdentifier(), domainName.c_str());
logs.insert({domainName, currentLog});
}
os_log_with_type(currentLog, type, "%{public}s", message.c_str());
logs.insert({domainName, currentLog});
}
os_log_with_type(currentLog, type, "%{public}s", message.c_str());
#else
const bool printToStdErr = record.level >= ELogLevel::WARN;

View File

@ -116,10 +116,10 @@ if [[ -n "$gog_file" ]]
then
currentver="$(innoextract --version | head -n1 | cut -d ' ' -f2)"
requiredver="1.6"
if verlt $currentver $requiredver;
then
fail "innoextract version is $currentver, update it to version $requiredver or higher"
fi
if verlt $currentver $requiredver;
then
fail "innoextract version is $currentver, update it to version $requiredver or higher"
fi
fi
if [[ -n "$useffmpeg" ]]
@ -182,7 +182,7 @@ then
# innoextract always reports error (iconv 84 error). Just test file for presence
test -f "$gog_file" || fail "Error: gog.com executable was not found!"
gog_file="$(cd "$(dirname "$gog_file")"; pwd)/$(basename "$gog_file")"
gog_file="$(cd "$(dirname "$gog_file")"; pwd)/$(basename "$gog_file")"
cd "$data_dir" && innoextract "$gog_file"
fi
@ -190,7 +190,7 @@ if [[ -n "$cd1_dir" ]]
then
data_dir="$temp_dir"/cddir
mkdir -p "$data_dir"
unshield -d "$data_dir" x "$cd1_dir"/_setup/data1.cab || fail "Error: failed to extract from Install Shield installer!" "rm -rf $data_dir"
unshield -d "$data_dir" x "$cd1_dir"/_setup/data1.cab || fail "Error: failed to extract from Install Shield installer!" "rm -rf $data_dir"
# a bit tricky - different releases have different root directory. Move extracted files to data_dir
if [ -d "$data_dir"/Heroes3 ]