mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
fix indentation
This commit is contained in:
parent
e1c9903a45
commit
031ba967d3
@ -185,18 +185,18 @@ void CServerHandler::startLocalServerAndConnect()
|
|||||||
envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true);
|
envHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "startServer", true);
|
||||||
}
|
}
|
||||||
#elif defined(VCMI_IOS)
|
#elif defined(VCMI_IOS)
|
||||||
// todo ios: hide keyboard
|
// todo ios: hide keyboard
|
||||||
logNetwork->info("[ios] create server thread");
|
logNetwork->info("[ios] create server thread");
|
||||||
boost::condition_variable cond;
|
boost::condition_variable cond;
|
||||||
threadRunLocalServer = std::make_shared<boost::thread>([&cond, this] {
|
threadRunLocalServer = std::make_shared<boost::thread>([&cond, this] {
|
||||||
setThreadName("CVCMIServer");
|
setThreadName("CVCMIServer");
|
||||||
CVCMIServer::create(&cond, uuid);
|
CVCMIServer::create(&cond, uuid);
|
||||||
// todo ios copypaste
|
// todo ios copypaste
|
||||||
threadRunLocalServer.reset();
|
threadRunLocalServer.reset();
|
||||||
CSH->campaignServerRestartLock.setn(false);
|
CSH->campaignServerRestartLock.setn(false);
|
||||||
});
|
});
|
||||||
threadRunLocalServer->detach();
|
threadRunLocalServer->detach();
|
||||||
logNetwork->info("[ios] detach server thread");
|
logNetwork->info("[ios] detach server thread");
|
||||||
#else
|
#else
|
||||||
threadRunLocalServer = std::make_shared<boost::thread>(&CServerHandler::threadRunServer, this); //runs server executable;
|
threadRunLocalServer = std::make_shared<boost::thread>(&CServerHandler::threadRunServer, this); //runs server executable;
|
||||||
#endif
|
#endif
|
||||||
@ -215,13 +215,13 @@ void CServerHandler::startLocalServerAndConnect()
|
|||||||
androidTestServerReadyFlag = false;
|
androidTestServerReadyFlag = false;
|
||||||
#elif defined(VCMI_IOS)
|
#elif defined(VCMI_IOS)
|
||||||
// todo ios
|
// todo ios
|
||||||
{
|
{
|
||||||
boost::mutex m;
|
boost::mutex m;
|
||||||
boost::unique_lock<boost::mutex> lock{m};
|
boost::unique_lock<boost::mutex> lock{m};
|
||||||
logNetwork->info("[ios] wait for server");
|
logNetwork->info("waiting for server");
|
||||||
cond.wait(lock);
|
cond.wait(lock);
|
||||||
logNetwork->info("[ios] server ready");
|
logNetwork->info("server is ready");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(shm)
|
if(shm)
|
||||||
shm->sr->waitTillReady();
|
shm->sr->waitTillReady();
|
||||||
|
@ -370,10 +370,10 @@ bfs::path IVCMIDirsUNIX::serverPath() const { return binaryPath() / "vcmiserver"
|
|||||||
#ifdef VCMI_APPLE
|
#ifdef VCMI_APPLE
|
||||||
class VCMIDirsApple : public IVCMIDirsUNIX
|
class VCMIDirsApple : public IVCMIDirsUNIX
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bfs::path userConfigPath() const override;
|
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"; }
|
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
|
#ifdef VCMI_IOS
|
||||||
class VCMIDirsIOS final : public VCMIDirsApple
|
class VCMIDirsIOS final : public VCMIDirsApple
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bfs::path userDataPath() const override;
|
bfs::path userDataPath() const override;
|
||||||
bfs::path userCachePath() const override;
|
bfs::path userCachePath() const override;
|
||||||
bfs::path userLogsPath() 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 libraryPath() const override;
|
||||||
bfs::path binaryPath() const override;
|
bfs::path binaryPath() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
bfs::path VCMIDirsIOS::userDataPath() const { return {iOS_utils::documentsPath()}; }
|
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> VCMIDirsIOS::dataPaths() const
|
||||||
{
|
{
|
||||||
std::vector<bfs::path> paths;
|
std::vector<bfs::path> paths;
|
||||||
paths.reserve(4);
|
paths.reserve(4);
|
||||||
#ifdef VCMI_IOS_SIM
|
#ifdef VCMI_IOS_SIM
|
||||||
paths.emplace_back(iOS_utils::hostApplicationSupportPath());
|
paths.emplace_back(iOS_utils::hostApplicationSupportPath());
|
||||||
#endif
|
#endif
|
||||||
paths.emplace_back(userDataPath());
|
paths.emplace_back(userDataPath());
|
||||||
paths.emplace_back(iOS_utils::documentsPath());
|
paths.emplace_back(iOS_utils::documentsPath());
|
||||||
paths.emplace_back(binaryPath());
|
paths.emplace_back(binaryPath());
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfs::path VCMIDirsIOS::libraryPath() const { return {iOS_utils::frameworksPath()}; }
|
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)
|
#elif defined(VCMI_MAC)
|
||||||
class VCMIDirsOSX final : public VCMIDirsApple
|
class VCMIDirsOSX final : public VCMIDirsApple
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
boost::filesystem::path userDataPath() const override;
|
boost::filesystem::path userDataPath() const override;
|
||||||
boost::filesystem::path userCachePath() const override;
|
boost::filesystem::path userCachePath() const override;
|
||||||
boost::filesystem::path userLogsPath() 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 libraryPath() const override;
|
||||||
boost::filesystem::path binaryPath() const override;
|
boost::filesystem::path binaryPath() const override;
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
void VCMIDirsOSX::init()
|
void VCMIDirsOSX::init()
|
||||||
|
@ -361,40 +361,40 @@ void CLogConsoleTarget::write(const LogRecord & record)
|
|||||||
#ifdef VCMI_ANDROID
|
#ifdef VCMI_ANDROID
|
||||||
__android_log_write(ELogLevel::toAndroid(record.level), ("VCMI-" + record.domain.getName()).c_str(), message.c_str());
|
__android_log_write(ELogLevel::toAndroid(record.level), ("VCMI-" + record.domain.getName()).c_str(), message.c_str());
|
||||||
#elif defined(VCMI_IOS)
|
#elif defined(VCMI_IOS)
|
||||||
os_log_type_t type;
|
os_log_type_t type;
|
||||||
switch (record.level)
|
switch (record.level)
|
||||||
{
|
{
|
||||||
case ELogLevel::TRACE:
|
case ELogLevel::TRACE:
|
||||||
type = OS_LOG_TYPE_DEBUG;
|
type = OS_LOG_TYPE_DEBUG;
|
||||||
break;
|
break;
|
||||||
case ELogLevel::DEBUG:
|
case ELogLevel::DEBUG:
|
||||||
type = OS_LOG_TYPE_DEFAULT;
|
type = OS_LOG_TYPE_DEFAULT;
|
||||||
break;
|
break;
|
||||||
case ELogLevel::INFO:
|
case ELogLevel::INFO:
|
||||||
type = OS_LOG_TYPE_INFO;
|
type = OS_LOG_TYPE_INFO;
|
||||||
break;
|
break;
|
||||||
case ELogLevel::WARN:
|
case ELogLevel::WARN:
|
||||||
type = OS_LOG_TYPE_ERROR;
|
type = OS_LOG_TYPE_ERROR;
|
||||||
break;
|
break;
|
||||||
case ELogLevel::ERROR:
|
case ELogLevel::ERROR:
|
||||||
type = OS_LOG_TYPE_FAULT;
|
type = OS_LOG_TYPE_FAULT;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os_log_t currentLog;
|
os_log_t currentLog;
|
||||||
static std::unordered_map<std::string, decltype(currentLog)> logs;
|
static std::unordered_map<std::string, decltype(currentLog)> logs;
|
||||||
const auto& domainName = record.domain.getName();
|
const auto& domainName = record.domain.getName();
|
||||||
auto logIt = logs.find(domainName);
|
auto logIt = logs.find(domainName);
|
||||||
if (logIt != logs.end())
|
if (logIt != logs.end())
|
||||||
currentLog = logIt->second;
|
currentLog = logIt->second;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentLog = os_log_create(iOS_utils::bundleIdentifier(), domainName.c_str());
|
currentLog = os_log_create(iOS_utils::bundleIdentifier(), domainName.c_str());
|
||||||
logs.insert({domainName, currentLog});
|
logs.insert({domainName, currentLog});
|
||||||
}
|
}
|
||||||
os_log_with_type(currentLog, type, "%{public}s", message.c_str());
|
os_log_with_type(currentLog, type, "%{public}s", message.c_str());
|
||||||
#else
|
#else
|
||||||
|
|
||||||
const bool printToStdErr = record.level >= ELogLevel::WARN;
|
const bool printToStdErr = record.level >= ELogLevel::WARN;
|
||||||
|
12
vcmibuilder
12
vcmibuilder
@ -116,10 +116,10 @@ if [[ -n "$gog_file" ]]
|
|||||||
then
|
then
|
||||||
currentver="$(innoextract --version | head -n1 | cut -d ' ' -f2)"
|
currentver="$(innoextract --version | head -n1 | cut -d ' ' -f2)"
|
||||||
requiredver="1.6"
|
requiredver="1.6"
|
||||||
if verlt $currentver $requiredver;
|
if verlt $currentver $requiredver;
|
||||||
then
|
then
|
||||||
fail "innoextract version is $currentver, update it to version $requiredver or higher"
|
fail "innoextract version is $currentver, update it to version $requiredver or higher"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$useffmpeg" ]]
|
if [[ -n "$useffmpeg" ]]
|
||||||
@ -182,7 +182,7 @@ then
|
|||||||
|
|
||||||
# innoextract always reports error (iconv 84 error). Just test file for presence
|
# innoextract always reports error (iconv 84 error). Just test file for presence
|
||||||
test -f "$gog_file" || fail "Error: gog.com executable was not found!"
|
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"
|
cd "$data_dir" && innoextract "$gog_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ if [[ -n "$cd1_dir" ]]
|
|||||||
then
|
then
|
||||||
data_dir="$temp_dir"/cddir
|
data_dir="$temp_dir"/cddir
|
||||||
mkdir -p "$data_dir"
|
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
|
# a bit tricky - different releases have different root directory. Move extracted files to data_dir
|
||||||
if [ -d "$data_dir"/Heroes3 ]
|
if [ -d "$data_dir"/Heroes3 ]
|
||||||
|
Loading…
Reference in New Issue
Block a user