Skip to content

Commit

Permalink
hey it works :)
Browse files Browse the repository at this point in the history
  • Loading branch information
WtzLAS committed May 21, 2024
1 parent 46416eb commit 34d2499
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 29 deletions.
5 changes: 5 additions & 0 deletions primedev/Northstar.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ target_link_libraries(
version.lib
)

target_compile_options(
NorthstarDLL
PRIVATE -mavx
)

target_precompile_headers(
NorthstarDLL
PRIVATE
Expand Down
2 changes: 2 additions & 0 deletions primedev/client/debugoverlay.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "core/math/vector.h"

// Render Line
inline void (*RenderLine)(const Vector3& v1, const Vector3& v2, Color c, bool bZBuffer);

Expand Down
1 change: 1 addition & 0 deletions primedev/engine/r2engine.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "shared/keyvalues.h"
#include "core/convar/concommand.h"

// Cbuf
enum class ECommandTarget_t
Expand Down
1 change: 0 additions & 1 deletion primedev/logging/logging.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "spdlog/sinks/base_sink.h"
#include "spdlog/logger.h"
#include "squirrel/squirrel.h"
#include "core/math/color.h"

namespace fmt_lib = spdlog::fmt_lib;
Expand Down
2 changes: 1 addition & 1 deletion primedev/logging/sourceconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CConsoleDialog
class CGameConsole
{
public:
virtual ~CGameConsole() = 0;
virtual void CGameConsoleDestructor() = 0;

// activates the console, makes it visible and brings it to the foreground
virtual void Activate() = 0;
Expand Down
2 changes: 2 additions & 0 deletions primedev/mods/autodownload/moddownloader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "moddownloader.h"
#include "util/utils.h"
#include "mods/modmanager.h"
#include "squirrel/squirrel.h"
#include <rapidjson/fwd.h>
#include <mz_strm_mem.h>
#include <mz.h>
Expand Down
1 change: 1 addition & 0 deletions primedev/mods/modmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "core/filesystem/filesystem.h"
#include "core/filesystem/rpakfilesystem.h"
#include "config/profile.h"
#include "squirrel/squirrel.h"

#include "rapidjson/error/en.h"
#include "rapidjson/document.h"
Expand Down
2 changes: 1 addition & 1 deletion primedev/mods/modmanager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "core/convar/convar.h"
#include "core/memalloc.h"
#include "squirrel/squirrel.h"
#include "squirrel/squirrelclasstypes.h"

#include "rapidjson/document.h"
#include <string>
Expand Down
7 changes: 3 additions & 4 deletions primedev/plugins/interfaces/interface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#pragma once

#include "core/sourceinterface.h"

typedef void* (*InstantiateInterfaceFn)();

Expand Down Expand Up @@ -35,5 +36,3 @@ class InterfaceReg
EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, __g_##className##_singleton)

EXPORT void* CreateInterface(const char* pName, InterfaceStatus* pReturnCode);

#endif
7 changes: 2 additions & 5 deletions primedev/plugins/pluginmanager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef PLUGIN_MANAGER_H
#define PLUGIN_MANAGER_H
#pragma once

#include <windows.h>
#include "squirrel/squirreldatatypes.h"

class Plugin;

Expand Down Expand Up @@ -29,5 +28,3 @@ class PluginManager
};

extern PluginManager* g_pPluginManager;

#endif
2 changes: 2 additions & 0 deletions primedev/server/ai_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#include "engine/hoststate.h"

#include "core/math/vplane.h"
#include "core/convar/convar.h"

#include <fstream>
#include <unordered_set>

const int AINET_VERSION_NUMBER = 57;
const int AINET_SCRIPT_VERSION_NUMBER = 21;
Expand Down
5 changes: 3 additions & 2 deletions primedev/shared/exploit_fixes/exploitfixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10
auto msg = (NET_SetConVar*)pMsg;
bool bIsServerFrame = ThreadInServerFrameThread();

std::string BLOCK_PREFIX =
std::string {"NET_SetConVar ("} + (bIsServerFrame ? "server" : "client") + "): Blocked dangerous/invalid msg: ";
std::string BLOCK_PREFIX = "NET_SetConVar (";
BLOCK_PREFIX += (bIsServerFrame ? "server" : "client");
BLOCK_PREFIX += "): Blocked dangerous/invalid msg: ";

if (bIsServerFrame)
{
Expand Down
13 changes: 0 additions & 13 deletions primedev/squirrel/squirrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ std::shared_ptr<ColoredLogger> getSquirrelLoggerByContext(ScriptContext context)
}
}

namespace NS::log
{
template <ScriptContext context> std::shared_ptr<spdlog::logger> squirrel_logger()
{
// Switch statements can't be constexpr afaik
// clang-format off
if constexpr (context == ScriptContext::UI) { return SCRIPT_UI; }
if constexpr (context == ScriptContext::CLIENT) { return SCRIPT_CL; }
if constexpr (context == ScriptContext::SERVER) { return SCRIPT_SV; }
// clang-format on
}
}; // namespace NS::log

const char* GetContextName(ScriptContext context)
{
switch (context)
Expand Down
10 changes: 9 additions & 1 deletion primedev/squirrel/squirrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ ScriptContext ScriptContextFromString(std::string string);

namespace NS::log
{
template <ScriptContext context> std::shared_ptr<spdlog::logger> squirrel_logger();
template <ScriptContext context> inline std::shared_ptr<spdlog::logger> squirrel_logger()
{
// Switch statements can't be constexpr afaik
// clang-format off
if constexpr (context == ScriptContext::UI) { return SCRIPT_UI; }
if constexpr (context == ScriptContext::CLIENT) { return SCRIPT_CL; }
if constexpr (context == ScriptContext::SERVER) { return SCRIPT_SV; }
// clang-format on
}
}; // namespace NS::log

// This base class means that only the templated functions have to be rebuilt for each template instance
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/silver-bun

0 comments on commit 34d2499

Please sign in to comment.