Skip to content

Commit

Permalink
remove extras
Browse files Browse the repository at this point in the history
  • Loading branch information
jvnipers committed May 19, 2024
1 parent e9b5e72 commit f18be8d
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 25,825 deletions.
61 changes: 3 additions & 58 deletions AMBuilder
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
import subprocess

MMSPlugin.plugin_name = 'cs2unlockcvars'
MMSPlugin.plugin_alias = 'cs2uc'
Expand All @@ -10,75 +9,21 @@ for sdk_target in MMSPlugin.sdk_targets:
cxx = sdk_target.cxx

binary = MMSPlugin.HL2Library(builder, cxx, MMSPlugin.plugin_name, sdk)

try:
version = subprocess.check_output(['git', 'describe', '--tags', '--long']).decode('ascii').strip()
except subprocess.SubprocessError as e:
version = "0.0.1-dev"
print("git describe failed as there are no tags")

print(f'Setting version to "{version}"')

binary.compiler.defines += ['CS2FIXES_VERSION="' + version + '"']

if binary.compiler.behavior == 'gcc':
binary.compiler.cxxflags += ['-Wno-invalid-offsetof']

binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'src'),
os.path.join(builder.sourcePath, 'src', 'utils'),
os.path.join(builder.sourcePath, 'sdk', 'thirdparty', 'protobuf-3.21.8', 'src'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'include'),
os.path.join(builder.sourcePath, 'sdk'),
]

target_folder = 'Debug' if builder.options.debug else 'Release'

if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += [
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libfunchook.a'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'libdistorm.a'),
os.path.join(builder.sourcePath, 'sdk', 'lib', 'linux64', 'release', 'libprotobuf.a'),
]
binary.sources += ['src/utils/plat_unix.cpp']
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += [
os.path.join('psapi.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'funchook.lib'),
os.path.join(builder.sourcePath, 'vendor', 'funchook', 'lib', target_folder, 'distorm.lib'),
os.path.join(builder.sourcePath, 'sdk', 'lib' ,'public', 'win64', '2015', 'libprotobuf.lib'),
os.path.join(builder.sourcePath, 'sdk', 'lib', 'public', 'win64', 'steam_api64.lib')
]
binary.sources += ['src/utils/plat_win.cpp']


binary.sources += [
'src/cs2uc.cpp',
'src/cvars.cpp',
]

protoc_builder = builder.tools.Protoc(protoc = sdk_target.protoc, sources = [
binary.custom = [builder.tools.Protoc(protoc = sdk_target.protoc, sources = [
os.path.join(sdk['path'], 'common', 'network_connection.proto'),
os.path.join(sdk['path'], 'common', 'networkbasetypes.proto'),
os.path.join(sdk['path'], 'common', 'engine_gcmessages.proto'),
os.path.join(sdk['path'], 'gcsdk', 'steammessages.proto'),
os.path.join(sdk['path'], 'gcsdk', 'gcsdk_gcmessages.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'gameevents.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'te.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'usercmd.proto'),
os.path.join(sdk['path'], 'game', 'shared', 'usermessages.proto'),
os.path.join(builder.sourcePath, 'protobuf', 'cs_gameevents.proto'),
os.path.join(builder.sourcePath, 'protobuf', 'cs_usercmd.proto'),
os.path.join(builder.sourcePath, 'protobuf', 'cstrike15_gcmessages.proto'),
os.path.join(builder.sourcePath, 'protobuf', 'cstrike15_usermessages.proto'),
])
protoc_builder.protoc.includes += [
os.path.join(sdk['path'], 'gcsdk'),
os.path.join(sdk['path'], 'common'),
os.path.join(sdk['path'], 'game', 'shared'),
os.path.join(builder.sourcePath, 'protobuf'),
]
])]

binary.custom = [protoc_builder]

nodes = builder.Add(binary)
MMSPlugin.binaries += [nodes]
41 changes: 18 additions & 23 deletions src/cs2uc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* =============================================================================
* CS2Fixes
* CS2UC
* Copyright (C) 2023-2024 Source2ZE
* =============================================================================
*
Expand All @@ -24,11 +24,6 @@

#include "tier0/memdbgon.h"

double g_flUniversalTime;
float g_flLastTickedTime;
bool g_bHasTicked;
int g_iRoundNum = 0;

void Message(const char *msg, ...)
{
va_list args;
Expand All @@ -55,10 +50,10 @@ void Panic(const char *msg, ...)
va_end(args);
}

CS2Fixes g_CS2Fixes;
CS2UC g_CS2UC;

PLUGIN_EXPOSE(CS2Fixes, g_CS2Fixes);
bool CS2Fixes::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
PLUGIN_EXPOSE(CS2UC, g_CS2UC);
bool CS2UC::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
PLUGIN_SAVEVARS();

Expand All @@ -72,57 +67,57 @@ bool CS2Fixes::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool
return true;
}

bool CS2Fixes::Unload(char *error, size_t maxlen)
bool CS2UC::Unload(char *error, size_t maxlen)
{
return true;
}

bool CS2Fixes::Pause(char *error, size_t maxlen)
bool CS2UC::Pause(char *error, size_t maxlen)
{
return true;
}

bool CS2Fixes::Unpause(char *error, size_t maxlen)
bool CS2UC::Unpause(char *error, size_t maxlen)
{
return true;
}

const char *CS2Fixes::GetLicense()
const char *CS2UC::GetLicense()
{
return "GPL v3 License";
}

const char *CS2Fixes::GetVersion()
const char *CS2UC::GetVersion()
{
return CS2FIXES_VERSION; // defined by the build script
return "v0.0.2";
}

const char *CS2Fixes::GetDate()
const char *CS2UC::GetDate()
{
return __DATE__;
}

const char *CS2Fixes::GetLogTag()
const char *CS2UC::GetLogTag()
{
return "CS2UnlockCvars";
}

const char *CS2Fixes::GetAuthor()
const char *CS2UC::GetAuthor()
{
return "CS2Fixes, (mod by dots)";
return "CS2UC, (mod by dots)";
}

const char *CS2Fixes::GetDescription()
const char *CS2UC::GetDescription()
{
return "Stripped CS2Fixes for Cvar Unlocker";
return "Stripped CS2UC for Cvar Unlocker";
}

const char *CS2Fixes::GetName()
const char *CS2UC::GetName()
{
return "CS2UnlockCvars";
}

const char *CS2Fixes::GetURL()
const char *CS2UC::GetURL()
{
return "https://github.com/jvnipers/CS2UnlockCvars";
}
5 changes: 2 additions & 3 deletions src/cs2uc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
#pragma once

#include <ISmmPlugin.h>
#include <iserver.h>

class CS2Fixes : public ISmmPlugin, public IMetamodListener
class CS2UC : public ISmmPlugin, public IMetamodListener
{
public:
bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
Expand All @@ -41,6 +40,6 @@ class CS2Fixes : public ISmmPlugin, public IMetamodListener
const char *GetLogTag();
};

extern CS2Fixes g_CS2Fixes;
extern CS2UC g_CS2UC;

PLUGIN_GLOBALVARS();
Loading

0 comments on commit f18be8d

Please sign in to comment.