Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,12 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- g++-8
- zip
env:
ENV_CXX=g++-5
ENV_CC=gcc-5
ENV_CXX=g++-8
ENV_CC=gcc-8
NIGHTLY_UPLOAD=1
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
packages:
- clang-6.0
- zip
env:
ENV_CXX=clang++-6.0
ENV_CC=clang-6.0
NIGHTLY_UPLOAD=0

before_script:
- wget https://mirror.mtasa.com/bdata/premake5-travis -4 -O ./premake5 &&
Expand Down
2 changes: 1 addition & 1 deletion Client/cefweb/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project "Client Webbrowser"

filter "system:windows"
includedirs { "../../vendor/sparsehash/src/windows" }
linkoptions { "/SAFESEH\:NO" }
linkoptions { "/SAFESEH:NO" }
buildoptions { "-Zm130" }

filter {}
Expand Down
1 change: 0 additions & 1 deletion Client/core/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <sys/stat.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <direct.h>
#include <stdio.h>
#include <dbghelp.h>
Expand Down
2 changes: 1 addition & 1 deletion Client/core/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project "Client Core"

filter "system:windows"
includedirs { "../../vendor/sparsehash/src/windows" }
linkoptions { "/SAFESEH\:NO" }
linkoptions { "/SAFESEH:NO" }
buildoptions { "-Zm130" }

filter {}
Expand Down
14 changes: 7 additions & 7 deletions Client/loader/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ project "Loader"
language "C++"
kind "SharedLib"
targetname "loader"
targetdir(buildpath("mta"))
filter "system:windows"
linkoptions { "/SAFESEH\:NO" }
targetdir(buildpath("mta"))

filter "system:windows"
linkoptions { "/SAFESEH:NO" }

includedirs {
"../sdk",
"../../vendor"
}

libdirs {
"../../vendor/detours/lib"
"../../vendor/detours/lib"
}

links {
"unrar", "d3d9",
"../../vendor/nvapi/x86/nvapi.lib"
"../../vendor/nvapi/x86/nvapi.lib"
}

pchheader "StdInc.h"
Expand Down Expand Up @@ -47,4 +47,4 @@ project "Loader"
flags { "ExcludeFromBuild" }

filter "system:not windows"
flags { "ExcludeFromBuild" }
flags { "ExcludeFromBuild" }
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ project "Client Deathmatch"

filter "system:windows"
includedirs { "../../../vendor/sparsehash/src/windows" }
linkoptions { "/SAFESEH\:NO" }
linkoptions { "/SAFESEH:NO" }

filter {}
includedirs {
Expand Down
2 changes: 1 addition & 1 deletion Client/multiplayer_sa/CMultiplayerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4050,7 +4050,7 @@ void GetVehicleDriveType()
}

static CTransmission* pCurTransmission = nullptr;
static byte* pCurGear = nullptr;
static ::byte* pCurGear = nullptr;

void CheckVehicleMaxGear()
{
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update && \

# Install latest gcc and libs
RUN dpkg --add-architecture i386 && apt-get update && \
apt-get install -y ca-certificates git build-essential gcc-multilib g++-multilib gcc-6-multilib g++-6-multilib curl subversion ncftp \
apt-get install -y ca-certificates git build-essential gcc-multilib g++-multilib gcc-8-multilib g++-8-multilib curl subversion ncftp \
libncursesw5-dev libmysqlclient-dev \
lib32ncursesw5-dev libncursesw5-dev:i386

Expand Down
6 changes: 3 additions & 3 deletions Server/core/CCrashHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

// clang-format off
#ifndef WIN32
#ifdef __APPLE__
#include <ncurses.h>
#else
#if __has_include(<ncursesw/curses.h>)
#include <ncursesw/curses.h>
#else
#include <ncurses.h>
#endif

extern "C" WINDOW* m_wndMenu;
Expand Down
8 changes: 0 additions & 8 deletions Server/core/CServerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class CServerImpl;
#include <xml/CXML.h>
#include "CThreadCommandQueue.h"

#ifndef WIN32
#ifdef __APPLE__
#include <ncurses.h>
#else
#include <ncursesw/curses.h>
#endif
#endif

#define SERVER_RESET_RETURN 500

typedef CXML* (*InitXMLInterface)(const char* szSaveFlagDirectory);
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CHTTPD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ResponseCode CHTTPD::HandleRequest(HttpRequest* ipoHttpRequest, HttpResponse* ip
RSAES_OAEP_SHA_Encryptor encryptor(publicKey);
SecByteBlock cipherText(encryptor.CiphertextLength(challenge.size()));
AutoSeededRandomPool rng;
encryptor.Encrypt(rng, (const byte*)challenge.data(), challenge.size(), cipherText.begin());
encryptor.Encrypt(rng, (const CryptoPP::byte*)challenge.data(), challenge.size(), cipherText.begin());

if (!cipherText.empty())
{
Expand Down
4 changes: 3 additions & 1 deletion Server/sdk/MTAPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ typedef int socklen_t;

#if defined(__APPLE__)
#include <ncurses.h>
#else
#elif __has_include(<ncursesw/curses.h>)
#include <ncursesw/curses.h>
#else
#include <ncurses.h>
#endif

#define MAX_PATH 255
Expand Down
7 changes: 3 additions & 4 deletions Shared/sdk/SharedUtil.SysInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#ifdef MTA_CLIENT

#define _WIN32_DCOM
using namespace std;
#include <comdef.h>
#include <Wbemidl.h>

Expand Down Expand Up @@ -234,10 +233,10 @@ bool SharedUtil::QueryWMI(SQueryWMIResult& outResult, const SString& strQuery, c
// Fill each cell
for (unsigned int i = 0; i < vecKeys.size(); i++)
{
string strKey = vecKeys[i];
string strValue;
std::string strKey = vecKeys[i];
std::string strValue;

wstring wstrKey(strKey.begin(), strKey.end());
std::wstring wstrKey(strKey.begin(), strKey.end());
hr = pclsObj->Get(wstrKey.c_str(), 0, &vtProp, 0, 0);

if (hr == WBEM_S_NO_ERROR)
Expand Down
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ workspace "MTASA"
location "Build"
startproject "Client Launcher"

cppdialect "C++14"
cppdialect "C++17"
characterset "MBCS"
pic "On"
symbols "On"
Expand Down
2 changes: 1 addition & 1 deletion utils/buildactions/install_cef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ newaction {

-- Check md5
local archive_path = CEF_PATH.."temp.tar.bz2"
if os.md5_file(archive_path) == correct_checksum then
if os.isfile(archive_path) and os.md5_file(archive_path) == correct_checksum then
print("CEF consistency checks succeeded")
return
end
Expand Down
2 changes: 1 addition & 1 deletion utils/buildactions/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ end

function os.md5_file(path)
if os.host() == "windows" then
local s = os.outputof(string.format("CertUtil -hashfile \"%s\" MD5", path))
local s, errc = os.outputof(string.format("CertUtil -hashfile \"%s\" MD5", path))
return (s:match("\n(.*)\n(.*)") or ""):gsub(" ", "")
else
return os.outputof(string.format("md5sum \"%s\" | awk '{ print $1 }'", path))
Expand Down
Binary file modified utils/premake5
Binary file not shown.
Binary file modified utils/premake5.exe
Binary file not shown.
4 changes: 4 additions & 0 deletions vendor/cryptopp/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ project "cryptopp"

defines {
"_WINSOCK_DEPRECATED_NO_WARNINGS",
"CRYPTOPP_DISABLE_CLMUL",
"CRYPTOPP_DISABLE_AESNI",
"CRYPTOPP_DISABLE_SSE4",
"CRYPTOPP_DISABLE_SSSE3",
"_LIB"
}

Expand Down
4 changes: 1 addition & 3 deletions vendor/ehs/httprequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,7 @@ RequestMethod GetRequestMethodFromString ( const std::string & isRequestMethod
std::string & mytolower (std::string & s ///< string to make lowercase
)
{

// had to remove the std:: from std::tolower because vc++ 6 complained
std::transform ( s.begin(), s.end(), s.begin(), std::ptr_fun<int, int>(tolower));
std::transform ( s.begin(), s.end(), s.begin(), [](char c) { return std::tolower(c); });
return s;

}
Expand Down
1 change: 0 additions & 1 deletion vendor/google-breakpad/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,5 @@ src/Makefile
# Ignore directories gclient syncs.
src/testing
src/third_party/glog
src/third_party/lss
src/third_party/protobuf
src/tools/gyp
2 changes: 1 addition & 1 deletion vendor/google-breakpad/src/build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
],
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
'msvs_disabled_warnings': [
4100, 4127, 4396, 4503, 4512, 4819, 4995, 4702
4091, 4100, 4127, 4366, 4396, 4503, 4512, 4819, 4995, 4702
],
'msvs_settings': {
'VCCLCompilerTool': {
Expand Down
47 changes: 28 additions & 19 deletions vendor/google-breakpad/src/client/ios/Breakpad.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,23 @@
#include <pthread.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <TargetConditionals.h>

#include <string>

#import "client/ios/handler/ios_exception_minidump_generator.h"
#import "client/mac/crash_generation/ConfigFile.h"
#import "client/mac/handler/exception_handler.h"
#import "client/mac/handler/minidump_generator.h"
#import "client/mac/sender/uploader.h"
#import "client/mac/handler/protected_memory_allocator.h"
#import "common/simple_string_dictionary.h"
#import "client/mac/sender/uploader.h"
#import "common/long_string_dictionary.h"

#if !TARGET_OS_TV && !TARGET_OS_WATCH
#import "client/mac/handler/exception_handler.h"
#else
#import "client/ios/handler/exception_handler_no_mach.h"
#endif // !TARGET_OS_TV && !TARGET_OS_WATCH

#if !defined(__EXCEPTIONS) || (__clang__ && !__has_feature(cxx_exceptions))
// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
Expand All @@ -59,7 +68,7 @@

using google_breakpad::ConfigFile;
using google_breakpad::EnsureDirectoryPathExists;
using google_breakpad::SimpleStringDictionary;
using google_breakpad::LongStringDictionary;

//=============================================================================
// We want any memory allocations which are used by breakpad during the
Expand Down Expand Up @@ -190,7 +199,7 @@ bool HandleMinidump(const char *dump_dir,
// MachineExceptions.h, we have to explicitly name the handler.
google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)

SimpleStringDictionary *config_params_; // Create parameters (STRONG)
LongStringDictionary *config_params_; // Create parameters (STRONG)

ConfigFile config_file_;

Expand Down Expand Up @@ -306,7 +315,7 @@ static BOOL IsDebuggerActive() {
// since they were allocated by ProtectedMemoryAllocator objects.
//
if (config_params_) {
config_params_->~SimpleStringDictionary();
config_params_->~LongStringDictionary();
}

if (handler_)
Expand Down Expand Up @@ -374,10 +383,10 @@ static BOOL IsDebuggerActive() {
}

config_params_ =
new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
SimpleStringDictionary();
new (gKeyValueAllocator->Allocate(sizeof(LongStringDictionary)))
LongStringDictionary();

SimpleStringDictionary &dictionary = *config_params_;
LongStringDictionary &dictionary = *config_params_;

dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
Expand Down Expand Up @@ -420,8 +429,8 @@ static BOOL IsDebuggerActive() {
if (!config_params_ || !key)
return nil;

const char *value = config_params_->GetValueForKey([key UTF8String]);
return value ? [NSString stringWithUTF8String:value] : nil;
const std::string value = config_params_->GetValueForKey([key UTF8String]);
return value.empty() ? nil : [NSString stringWithUTF8String:value.c_str()];
}

//=============================================================================
Expand Down Expand Up @@ -495,8 +504,8 @@ static BOOL IsDebuggerActive() {
NSDictionary *server_parameters) {
NSMutableDictionary *config = [NSMutableDictionary dictionary];

SimpleStringDictionary::Iterator it(*config_params_);
while (const SimpleStringDictionary::Entry *next = it.Next()) {
LongStringDictionary::Iterator it(*config_params_);
while (const LongStringDictionary::Entry *next = it.Next()) {
[config setValue:[NSString stringWithUTF8String:next->value]
forKey:[NSString stringWithUTF8String:next->key]];
}
Expand Down Expand Up @@ -525,7 +534,7 @@ static BOOL IsDebuggerActive() {
if (!success)
return nil;

SimpleStringDictionary params = *config_params_;
LongStringDictionary params = *config_params_;
for (NSString *key in server_parameters) {
params.SetKeyValue([key UTF8String],
[[server_parameters objectForKey:key] UTF8String]);
Expand Down Expand Up @@ -560,7 +569,7 @@ static BOOL IsDebuggerActive() {
void Breakpad::HandleUncaughtException(NSException *exception) {
// Generate the minidump.
google_breakpad::IosExceptionMinidumpGenerator generator(exception);
const char *minidump_path =
const std::string minidump_path =
config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
std::string minidump_id;
std::string minidump_filename = generator.UniqueNameInDirectory(minidump_path,
Expand All @@ -573,7 +582,7 @@ static BOOL IsDebuggerActive() {
// 2- If the application crash while trying to handle this exception, a usual
// report will be generated. This report must not contain these special
// keys.
SimpleStringDictionary params = *config_params_;
LongStringDictionary params = *config_params_;
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "type", "exception");
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "exceptionName",
[[exception name] UTF8String]);
Expand All @@ -582,9 +591,9 @@ static BOOL IsDebuggerActive() {

// And finally write the config file.
ConfigFile config_file;
config_file.WriteFile(minidump_path,
config_file.WriteFile(minidump_path.c_str(),
&params,
minidump_path,
minidump_path.c_str(),
minidump_id.c_str());
}

Expand Down Expand Up @@ -612,9 +621,9 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {

gKeyValueAllocator =
new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
ProtectedMemoryAllocator(sizeof(SimpleStringDictionary));
ProtectedMemoryAllocator(sizeof(LongStringDictionary));

// Create a mutex for use in accessing the SimpleStringDictionary
// Create a mutex for use in accessing the LongStringDictionary
int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
if (mutexResult == 0) {

Expand Down
Loading