Merge branch 'master' into 'develop'
Master
This commit is contained in:
commit
d6c33f7df8
@ -291,7 +291,6 @@ workspace "iw4x"
|
||||
saneCopyToPath = string.gsub(_OPTIONS["copy-to"] .. "\\", "\\\\", "\\")
|
||||
postbuildcommands {
|
||||
"if not exist \"" .. saneCopyToPath .. "\" mkdir \"" .. saneCopyToPath .. "\"",
|
||||
"copy /y \"$(TargetDir)*.dll\" \"" .. saneCopyToPath .. "\"",
|
||||
}
|
||||
|
||||
if _OPTIONS["copy-pdb"] then
|
||||
@ -299,6 +298,11 @@ workspace "iw4x"
|
||||
"copy /y \"$(TargetDir)*.pdb\" \"" .. saneCopyToPath .. "\"",
|
||||
}
|
||||
end
|
||||
|
||||
-- This has to be the last one, as otherwise VisualStudio will succeed building even if copying fails
|
||||
postbuildcommands {
|
||||
"copy /y \"$(TargetDir)*.dll\" \"" .. saneCopyToPath .. "\"",
|
||||
}
|
||||
end
|
||||
|
||||
-- Specific configurations
|
||||
|
@ -1,3 +1,8 @@
|
||||
#ifndef DEBUG
|
||||
// Hide AntiCheat in embeded symbol names
|
||||
#define AntiCheat SubComponent
|
||||
#endif
|
||||
|
||||
namespace Components
|
||||
{
|
||||
class AntiCheat : public Component
|
||||
|
@ -136,7 +136,16 @@ namespace Components
|
||||
if (Dvar::Var("sv_mapRotation").Get<std::string>().empty())
|
||||
{
|
||||
Logger::Print("No rotation defined, restarting map.\n");
|
||||
Command::Execute(fmt::sprintf("map %s", Dvar::Var("mapname").Get<const char*>()), true);
|
||||
|
||||
if (!Dvar::Var("sv_cheats").Get<bool>())
|
||||
{
|
||||
Command::Execute(fmt::sprintf("map %s", Dvar::Var("mapname").Get<const char*>()), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Command::Execute(fmt::sprintf("devmap %s", Dvar::Var("mapname").Get<const char*>()), true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,12 @@ namespace Components
|
||||
{
|
||||
bool Exception::UploadMinidump(std::string filename)
|
||||
{
|
||||
Utils::WebIO webio("Firefucks", UPLOAD_URL);
|
||||
|
||||
if (Utils::IO::FileExists(filename))
|
||||
{
|
||||
Utils::WebIO webio("Firefucks", "https://reich.io/upload.php");
|
||||
|
||||
std::string buffer = Utils::IO::ReadFile(filename);
|
||||
std::string result = webio.PostFile(buffer);
|
||||
std::string result = webio.PostFile("minidump.dmp", "files[]", buffer);
|
||||
|
||||
std::string errors;
|
||||
json11::Json object = json11::Json::parse(result, errors);
|
||||
|
@ -1,5 +1,3 @@
|
||||
#define UPLOAD_URL "https://reich.io/upload.php"
|
||||
|
||||
namespace Components
|
||||
{
|
||||
class Exception : public Component
|
||||
|
@ -12,10 +12,15 @@ namespace Utils
|
||||
static int g_vaNextBufferIndex = 0;
|
||||
|
||||
char* buffer = g_vaBuffer[g_vaNextBufferIndex];
|
||||
std::string str = fmt::sprintf(message, std::forward<Args>(args)...);
|
||||
strncpy_s(g_vaBuffer[g_vaNextBufferIndex], str.data(), VA_BUFFER_SIZE);
|
||||
g_vaNextBufferIndex = (g_vaNextBufferIndex + 1) % VA_BUFFER_COUNT;
|
||||
|
||||
std::string str = fmt::sprintf(message, std::forward<Args>(args)...);
|
||||
|
||||
if (memmove_s(buffer, VA_BUFFER_SIZE, str.data(), str.size() + 1))
|
||||
{
|
||||
*buffer = 0; // Error
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
@ -134,24 +134,25 @@ namespace Utils
|
||||
return body;
|
||||
}
|
||||
|
||||
std::string WebIO::PostFile(std::string url, std::string data)
|
||||
std::string WebIO::PostFile(std::string url, std::string filename, std::string fieldname, std::string data)
|
||||
{
|
||||
WebIO::SetURL(url);
|
||||
return WebIO::PostFile(data);
|
||||
return WebIO::PostFile(filename, fieldname, data);
|
||||
}
|
||||
|
||||
std::string WebIO::PostFile(std::string data)
|
||||
std::string WebIO::PostFile(std::string filename, std::string fieldname, std::string data)
|
||||
{
|
||||
WebIO::Params headers;
|
||||
|
||||
std::string boundary = "----WebKitFormBoundaryHoLVocRsBxs71fU6";
|
||||
std::string boundary = "----FormBoundary" + Utils::Cryptography::SHA256::Compute(fmt::sprintf("%d", timeGetTime()));
|
||||
headers["Content-Type"] = "multipart/form-data, boundary=" + boundary;
|
||||
|
||||
std::string body = "--" + boundary + "\r\n";
|
||||
body += "Content-Disposition: form-data; name=\"files[]\"; filename=\"minidump.dmp\"\r\n";
|
||||
body += "Content-Type: application/octet-stream\r\n\r\n";
|
||||
body += data + "\r\n";
|
||||
body += "--" + boundary + "--\r\n";
|
||||
std::string body;
|
||||
body.append("--" + boundary + "\r\n");
|
||||
body.append("Content-Disposition: form-data; name=\"" + fieldname + "\"; filename=\"" + filename + "\"\r\n");
|
||||
body.append("Content-Type: application/octet-stream\r\n\r\n");
|
||||
body.append(data + "\r\n");
|
||||
body.append("--" + boundary + "--\r\n");
|
||||
|
||||
headers["Content-Length"] = fmt::sprintf("%u", body.size());
|
||||
|
||||
|
@ -26,8 +26,8 @@ namespace Utils
|
||||
void SetURL(std::string url);
|
||||
void SetCredentials(std::string username, std::string password);
|
||||
|
||||
std::string PostFile(std::string url, std::string data);
|
||||
std::string PostFile(std::string data);
|
||||
std::string PostFile(std::string url, std::string filename, std::string fieldname, std::string data);
|
||||
std::string PostFile(std::string filename, std::string fieldname, std::string data);
|
||||
|
||||
std::string Post(std::string url, WebIO::Params params);
|
||||
std::string Post(std::string url, std::string body);
|
||||
|
Loading…
Reference in New Issue
Block a user