Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 56ef69b
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 15:22:45 2022 +0100

    update release script

commit 2a16f0e
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 15:11:15 2022 +0100

    fix copyright header

commit 677977b
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 14:51:14 2022 +0100

    disable scripting engine tests

commit f92617c
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 14:47:07 2022 +0100

    add more info about /SECTIONLAYOUT

commit 3537806
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 14:40:18 2022 +0100

    drop SerializeOptional

commit b24d4b6
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 14:14:17 2022 +0100

    refactor game sync messages

commit 84a7e12
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 13:15:57 2022 +0100

    add more logs

commit f7b941f
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 12:56:08 2022 +0100

    make sdk register a virtual method

commit 295dee8
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 11:27:40 2022 +0100

    introduce input api

commit d28c79b
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 09:59:39 2022 +0100

    add more rpc helpers

commit b867db6
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 09:47:30 2022 +0100

    improve optionals

commit a6cc1f9
Author: Dominik Madarász <zaklaus@outlook.com>
Date:   Tue Dec 6 08:54:00 2022 +0100

    introduce sdk.emit call + global event invocation
  • Loading branch information
zpl-zak committed Dec 6, 2022
1 parent c5bcc04 commit ca31b4e
Show file tree
Hide file tree
Showing 169 changed files with 1,406 additions and 1,128 deletions.
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
C/C++ Code Form:
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
*/

Text Form:
MafiaHub OSS license
Copyright (c) 2022, MafiaHub. All rights reserved.
Copyright (c) 2021-2022, MafiaHub. All rights reserved.

This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
See LICENSE file in the source repository for information regarding licensing.
185 changes: 94 additions & 91 deletions code/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,153 +3,156 @@ update_git_version(FW "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/version.cpp.in" "${

# List the source files
set(FRAMEWORK_SRC
src/logging/logger.cpp

${CMAKE_CURRENT_BINARY_DIR}/version.cpp
src/utils/delay_scope.cpp
src/utils/config.cpp
src/utils/interpolator.cpp
src/utils/time.cpp
src/utils/job_system.cpp
src/utils/command_listener.cpp
src/utils/command_processor.cpp
src/utils/hashing.cpp
src/utils/states/machine.cpp

src/external/sentry/wrapper.cpp
src/external/firebase/wrapper.cpp
src/external/optick/wrapper.cpp

src/world/engine.cpp
src/world/modules/modules_impl.cpp

src/networking/network_peer.cpp
src/networking/errors.cpp
)
src/logging/logger.cpp

${CMAKE_CURRENT_BINARY_DIR}/version.cpp
src/utils/delay_scope.cpp
src/utils/config.cpp
src/utils/interpolator.cpp
src/utils/time.cpp
src/utils/job_system.cpp
src/utils/command_listener.cpp
src/utils/command_processor.cpp
src/utils/hashing.cpp
src/utils/states/machine.cpp

src/external/sentry/wrapper.cpp
src/external/firebase/wrapper.cpp
src/external/optick/wrapper.cpp

src/world/engine.cpp
src/world/server.cpp
src/world/client.cpp
src/world/modules/modules_impl.cpp

src/networking/network_peer.cpp
src/networking/errors.cpp
)

set(FRAMEWORK_SERVER_SRC
src/scripting/module.cpp
src/scripting/engines/node/engine.cpp
src/scripting/engines/node/resource.cpp
src/scripting/engines/node/sdk.cpp
src/scripting/events.cpp
src/scripting/module.cpp
src/scripting/engines/node/engine.cpp
src/scripting/engines/node/resource.cpp
src/scripting/engines/node/sdk.cpp
src/scripting/events.cpp

src/scripting/engines/node/v8_helpers/v8_try_catch.cpp
src/scripting/engines/node/v8_helpers/v8_try_catch.cpp

src/http/webserver.cpp
src/http/webserver.cpp

src/networking/network_server.cpp
src/networking/network_server.cpp

src/world/server.cpp

src/integrations/server/instance.cpp
src/integrations/server/networking/engine.cpp
src/integrations/server/scripting/server.cpp
)
src/integrations/server/instance.cpp
src/integrations/server/networking/engine.cpp
src/integrations/server/scripting/server.cpp
)

set(FRAMEWORK_CLIENT_SRC
src/graphics/renderer.cpp
src/graphics/renderio.cpp

src/networking/network_client.cpp
src/graphics/renderer.cpp
src/graphics/renderio.cpp

src/external/steam/wrapper.cpp
src/external/discord/wrapper.cpp
src/external/imgui/wrapper.cpp
src/external/sdl2/wrapper.cpp
src/networking/network_client.cpp

src/world/client.cpp
src/external/steam/wrapper.cpp
src/external/discord/wrapper.cpp
src/external/imgui/wrapper.cpp
src/external/sdl2/wrapper.cpp

src/external/imgui/widgets/console.cpp
src/external/imgui/widgets/console.cpp

src/integrations/client/instance.cpp
src/integrations/client/networking/engine.cpp
)
src/integrations/client/instance.cpp
src/integrations/client/networking/engine.cpp
)

# Append the platform-dependent files to the related lists
if (WIN32)
if(WIN32)
list(APPEND FRAMEWORK_CLIENT_SRC
src/graphics/backend/d3d9.cpp
src/graphics/backend/d3d11.cpp
src/utils/hooking/hook_function.cpp
src/utils/hooking/hooking_patterns.cpp
src/utils/hooking/hooking.cpp
src/utils/memory.cpp
src/utils/minidump.cpp
)
endif ()
src/graphics/backend/d3d9.cpp
src/graphics/backend/d3d11.cpp
src/utils/hooking/hook_function.cpp
src/utils/hooking/hooking_patterns.cpp
src/utils/hooking/hooking.cpp
src/utils/memory.cpp
src/utils/minidump.cpp
)
endif()

# Additional libraries
find_package(OpenSSL REQUIRED)

# Build depending on the platform
add_library(Framework STATIC ${FRAMEWORK_SRC})
if (WIN32)

if(WIN32)
# Build the loader and it's data
add_library(FrameworkLoader
STATIC
src/utils/hashing.cpp
src/launcher/project.cpp
src/utils/minidump.cpp
src/launcher/loaders/exe_ldr.cpp
src/external/steam/wrapper.cpp
src/utils/hooking/hook_function.cpp
src/utils/hooking/hooking_patterns.cpp
src/utils/hooking/hooking.cpp
src/utils/memory.cpp)
STATIC
src/utils/hashing.cpp
src/launcher/project.cpp
src/utils/minidump.cpp
src/launcher/loaders/exe_ldr.cpp
src/external/steam/wrapper.cpp
src/utils/hooking/hook_function.cpp
src/utils/hooking/hooking_patterns.cpp
src/utils/hooking/hooking.cpp
src/utils/memory.cpp)
target_link_options(FrameworkLoader PUBLIC /IGNORE:4254 /SAFESEH:NO /DYNAMICBASE:NO /LARGEADDRESSAWARE /SUBSYSTEM:windows /SECTIONLAYOUT:@${CMAKE_CURRENT_SOURCE_DIR}/src/launcher/SectionLayout.txt)

if (CMAKE_CL_64)
if(CMAKE_CL_64)
target_link_options(FrameworkLoader PUBLIC /BASE:0x140000000)
else ()
else()
target_link_options(FrameworkLoader PUBLIC /BASE:0x400000)
endif ()
endif()

add_library(FrameworkLoaderData
SHARED
src/launcher/data/tls.cpp
src/launcher/data/seh_win32.cpp)
SHARED
src/launcher/data/tls.cpp
src/launcher/data/seh_win32.cpp)

# Build the client
add_library(FrameworkClient STATIC ${FRAMEWORK_CLIENT_SRC})
endif ()
endif()

add_library(FrameworkServer STATIC ${FRAMEWORK_SERVER_SRC})

# Custom defines
target_compile_definitions(Framework PUBLIC MG_ENABLE_LOG=0)
IF (WIN32)

IF(WIN32)
add_definitions(-D_USE_MATH_DEFINES)
add_definitions(-DNOMINMAX)
ENDIF ()
ENDIF()

# External libraries & other stuff
macro(link_shared_deps target_name)
target_include_directories(${target_name} PUBLIC "src")

# Required libraries for apple systems
if (APPLE)
if(APPLE)
target_link_libraries(${target_name} "-framework CoreFoundation" "-framework Foundation" "-framework GSS" "-framework Security" "-framework CoreText" "-framework CoreGraphics" bsm)
endif ()
endif()

# Global libraries
target_link_libraries(${target_name} slikenet glm spdlog cppfs nlohmann_json Sentry httplib ${OPENSSL_LIBRARIES} Firebase Curl OptickCore flecs_static semver)

# Required libraries for windows
if (WIN32)
if(WIN32)
target_link_libraries(${target_name} StackWalker)
endif ()
endif()
endmacro()

# Link the solutions based on the platform
link_shared_deps(Framework)
if (WIN32)

if(WIN32)
link_shared_deps(FrameworkClient)
endif ()
endif()

link_shared_deps(FrameworkServer)
target_link_libraries(FrameworkServer mongoose NodeJS libsig v8pp)

# Platform-dependent post processing
if (WIN32)
if(WIN32)
target_link_directories(Framework PUBLIC ${CMAKE_SOURCE_DIR}/vendors/openssl/lib)
target_link_libraries(Framework ws2_32 dbghelp crypt32 winmm iphlpapi psapi userenv)

Expand All @@ -163,10 +166,10 @@ if (WIN32)
target_link_libraries(FrameworkLoaderData udis86 minhook)
target_link_options(FrameworkLoaderData PUBLIC /EXPORT:CoreRT_SetupSEHHandler /EXPORT:GetThreadLocalStorage /EXPORT:CoreSetExceptionOverride)

if (NOT CMAKE_CL_64)
if(NOT CMAKE_CL_64)
target_link_options(FrameworkServer PUBLIC "-SAFESEH:NO")
else ()
else()
target_link_libraries(FrameworkClient Ultralight)
target_link_options(FrameworkClient PUBLIC "-SAFESEH:NO")
endif ()
endif ()
endif()
endif()
2 changes: 1 addition & 1 deletion code/framework/src/external/discord/errors.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
7 changes: 3 additions & 4 deletions code/framework/src/external/discord/wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down Expand Up @@ -46,8 +46,7 @@ namespace Framework::External::Discord {
return DiscordError::DISCORD_NONE;
}

DiscordError Wrapper::SetPresence(const std::string &state, const std::string &details, discord::ActivityType activity, const std::string &largeImage,
const std::string &largeText, const std::string &smallImage, const std::string &smallText) {
DiscordError Wrapper::SetPresence(const std::string &state, const std::string &details, discord::ActivityType activity, const std::string &largeImage, const std::string &largeText, const std::string &smallImage, const std::string &smallText) {
if (!_instance) {
return DiscordError::DISCORD_CORE_NULL_INSTANCE;
}
Expand All @@ -74,7 +73,7 @@ namespace Framework::External::Discord {
return SetPresence(state, details, activity, "logo-large", "MafiaHub", "logo-small", "MafiaHub");
}

void Wrapper::SignInWithDiscord(const DiscordLoginProc& proc) {
void Wrapper::SignInWithDiscord(const DiscordLoginProc &proc) {
_instance->ApplicationManager().GetOAuth2Token([proc](discord::Result result, const discord::OAuth2Token &tokenData) {
if (result == discord::Result::Ok) {
proc(tokenData.GetAccessToken());
Expand Down
11 changes: 5 additions & 6 deletions code/framework/src/external/discord/wrapper.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand All @@ -18,8 +18,8 @@ namespace Framework::External::Discord {
class Wrapper final {
private:
bool _initialized = false;
discord::User _user{};
discord::Core *_instance{};
discord::User _user {};
discord::Core *_instance {};

public:
using DiscordLoginProc = fu2::function<void(const std::string &token) const>;
Expand All @@ -32,11 +32,10 @@ namespace Framework::External::Discord {
}

DiscordError Update();
DiscordError SetPresence(const std::string &state, const std::string &details, discord::ActivityType activity, const std::string &largeImage, const std::string &largeText,
const std::string &smallImage, const std::string &smallText);
DiscordError SetPresence(const std::string &state, const std::string &details, discord::ActivityType activity, const std::string &largeImage, const std::string &largeText, const std::string &smallImage, const std::string &smallText);
DiscordError SetPresence(const std::string &state, const std::string &details, discord::ActivityType activity);

void SignInWithDiscord(const DiscordLoginProc& proc);
void SignInWithDiscord(const DiscordLoginProc &proc);

discord::ActivityManager &GetActivityManager();
discord::UserManager &GetUserManager();
Expand Down
2 changes: 1 addition & 1 deletion code/framework/src/external/firebase/errors.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
2 changes: 1 addition & 1 deletion code/framework/src/external/firebase/wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
2 changes: 1 addition & 1 deletion code/framework/src/external/firebase/wrapper.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
2 changes: 1 addition & 1 deletion code/framework/src/external/imgui/errors.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
2 changes: 1 addition & 1 deletion code/framework/src/external/imgui/helpers.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* MafiaHub OSS license
* Copyright (c) 2022, MafiaHub. All rights reserved.
* Copyright (c) 2021-2022, MafiaHub. All rights reserved.
*
* This file comes from MafiaHub, hosted at https://github.com/MafiaHub/Framework.
* See LICENSE file in the source repository for information regarding licensing.
Expand Down
Loading

0 comments on commit ca31b4e

Please sign in to comment.