Compare commits

..
Author SHA1 Message Date
jenz 420a56c8c4 adding extra logging messages as a delay mechanism so nosteamers netaddress have enough time to be ready 2026-08-28 11:07:43 +01:00
jenz 5e262c573a copy pasting the password from the forward back to the connect extension so that the webclient can have it be used 2026-07-24 10:01:37 +01:00
jenz df4b1b0aa7 did not need this any more 2026-07-23 15:00:35 +01:00
jenz dfc25da57a moved webclient name generation over to the connect extension. fixed pending steam ID. name is tracked with cvar value. name also sets the steamID 2026-07-23 14:58:45 +01:00
jenz 4c7ec14d52 finally removed the logging and removed the duplicate case from begin auth session hook. probably fine 2026-06-25 14:32:41 +01:00
jenz 0aab8e0bd6 adding support for switching steamID for the nosteam webclients 2026-06-05 23:54:25 +01:00
jenz 86c714fb1b updated gamedata and updated extension to kick dead left over sessions that would be caused by being blocked by ISP on first connect to to server and then on second connect using a VPN instead. also changes how nosteamers attempting to spoof are handled so that a nosteamer could change IP address on a reconnect and still be allowed in 2026-03-19 15:38:02 +00:00
jenz 3a126db081 re-applying beginauthsession and endauthsession 2026-02-16 14:14:42 +00:00
jenz 0b5306f689 i am still keeping the log messages enabled for now. this extra begin auth session check should still work for nosteamers while being able to re-authenticate steam players with steam 2026-02-15 18:37:52 +00:00
jenz 00c4ee1521 to hell with it, committing the log messages 2026-01-27 23:27:50 +00:00
jenz aa115c645e adding a few infos in readme 2026-01-26 13:42:57 +00:00
jenz 723d6e07b9 actual changes applied 2026-01-26 07:54:21 +00:00
dependabot[bot] 8d83d5ecca Bump actions/cache from 4 to 5 (#59)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 01:55:49 +00:00
dependabot[bot] 58a4c9df84 Bump actions/upload-artifact from 5 to 6 (#58)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 01:55:24 +00:00
dependabot[bot] ddf6e96660 Bump actions/upload-artifact from 4 to 5 (#55) 2025-11-25 10:32:13 +01:00
dependabot[bot] 2711a463a2 Bump actions/checkout from 4 to 6 (#57) 2025-11-25 10:19:08 +01:00
rtldg 736afc5d1f Rework the CI to build inside the valve sniper sdk container thing (#56) 2025-11-22 13:48:24 +01:00
dependabot[bot] 9aa1fb0474 Bump actions/setup-python from 5 to 6 (#54)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-30 23:29:14 +01:00
rtldg 670c7c5b02 fix offset usage for BeginAuthSession from #45 (resolves #49) (#52) 2025-05-23 19:07:06 -04:00
sappho a1fd39932a Update for May 2025 tf2 updates 2025-05-15 23:12:03 -04:00
sappho db47788db9 Update README.md 2025-05-15 22:54:42 -04:00
sappho 1c172cbfc7 Create README.md 2025-05-15 22:51:23 -04:00
12 changed files with 1024 additions and 380 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname $0)/../.."
if [[ $PLATFORM == Linux* ]]; then
$CC --version
$CXX --version
apt install -y python3-pip
# buildbot/generate_header.py is ran by ambuild and we want git to not fail due to user-perms (because docker)
git config --global --add safe.directory $PWD
else
python -m pip install --upgrade pip setuptools wheel
fi
python -m pip install $CACHE_PATH/ambuild
mkdir build
cd build
python ../configure.py --enable-auto-versioning --enable-optimize --sdks="$SDKS" --mms-path="$CACHE_PATH/metamod-source" --hl2sdk-root="$CACHE_PATH" --sm-path="$CACHE_PATH/sourcemod"
ambuild
+37 -42
View File
@@ -11,9 +11,10 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
os: [ubuntu-22.04, windows-2022] python-version: ['3.14']
os: [ubuntu-latest, windows-2022]
include: include:
- os: ubuntu-22.04 - os: ubuntu-latest
cc: clang-11 cc: clang-11
cxx: clang++-11 cxx: clang++-11
- os: windows-2022 - os: windows-2022
@@ -38,32 +39,19 @@ jobs:
# This will be used in our cache key # This will be used in our cache key
echo "SDKS_KEY=${SDKS_VAR//[[:blank:]]/}" >> $GITHUB_ENV echo "SDKS_KEY=${SDKS_VAR//[[:blank:]]/}" >> $GITHUB_ENV
- name: Linux dependencies - uses: actions/setup-python@v6
if: startsWith(runner.os, 'Linux') if: startsWith(matrix.os, 'windows-')
run: | name: Setup Python ${{ matrix.python-version }}
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev ${{ matrix.cc }}
- uses: actions/setup-python@v5
name: Setup Python 3.9
with: with:
python-version: 3.9 python-version: ${{ matrix.python-version }}
- name: Install Python dependencies - uses: actions/checkout@v6
run: |
python -m pip install --upgrade pip setuptools wheel
- uses: actions/checkout@v4
name: Repository checkout name: Repository checkout
with: with:
fetch-depth: 0 fetch-depth: 0
path: extension path: extension
- uses: actions/cache@v4 - uses: actions/cache@v5
name: Cache dependencies name: Cache dependencies
env: env:
cache-name: connect-cache cache-name: connect-cache
@@ -105,31 +93,38 @@ jobs:
# But maybe others aren't (also probably unnecessary because git actions but paranoia) # But maybe others aren't (also probably unnecessary because git actions but paranoia)
git config --global advice.detachedHead true git config --global advice.detachedHead true
- name: Setup AMBuild
shell: bash
run: |
cd "${{ env.CACHE_PATH }}"
python -m pip install ./ambuild
- name: Select clang compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
${{ matrix.cc }} --version
${{ matrix.cxx }} --version
- name: Build - name: Build
shell: bash shell: bash
working-directory: extension working-directory: extension
run: | run: |
mkdir build export PLATFORM="${{ runner.os }}"
cd build
python ../configure.py --enable-auto-versioning --enable-optimize --sdks="${{ env.SDKS }}" --mms-path="${{ env.CACHE_PATH }}/metamod-source" --hl2sdk-root="${{ env.CACHE_PATH }}" --sm-path="${{ env.CACHE_PATH }}/sourcemod"
ambuild
PLATFORM="${{ runner.os }}" if [[ $PLATFORM == Linux* ]]; then
FILENAME="$(cat ./includes/filename_versioning.txt)" # docker instead of podman because:
# - we don't need a job to `sudo apt install podman`
# - `sudo apt install -y python3-pip` didn't work inside podman for me?
docker run \
-e PLATFORM="$PLATFORM" \
-e PROJECT=${{ env.PROJECT }} \
-e SDKS="${{ env.SDKS }}" \
-e MMSOURCE_VERSION=${{ env.MMSOURCE_VERSION }} \
-e SOURCEMOD_VERSION=${{ env.MMSOURCE_SOURCEMOD_VERSION }} \
-e CACHE_PATH=${{ env.CACHE_PATH }} \
-e SDKS_KEY=${{ env.SDKS_KEY }} \
-e CC=${{ matrix.cc }} \
-e CXX=${{ matrix.cxx }} \
--mount type=bind,source=${{ env.CACHE_PATH }},target=${{ env.CACHE_PATH }} \
--mount type=bind,source=$PWD,target=$PWD \
"registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest" \
"$PWD/.github/workflows/build.sh"
# need to fix the owner because docker root-ed stuff?
sudo chown -R $USER .
else
bash ./.github/workflows/build.sh
fi
FILENAME="$(cat build/includes/filename_versioning.txt)"
ZIP_FILENAME="${{ env.PROJECT }}-${FILENAME}-${PLATFORM,}.zip" ZIP_FILENAME="${{ env.PROJECT }}-${FILENAME}-${PLATFORM,}.zip"
echo "ZIP_FILENAME=${ZIP_FILENAME}" >> $GITHUB_ENV echo "ZIP_FILENAME=${ZIP_FILENAME}" >> $GITHUB_ENV
@@ -165,7 +160,7 @@ jobs:
echo "Upload successful!" echo "Upload successful!"
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v6
with: with:
# Artifact name # Artifact name
name: ${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }} name: ${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }}
+2
View File
@@ -2,3 +2,5 @@ build
Containerfile Containerfile
.venv .venv
safetyhook safetyhook
.env
secret.h
+44
View File
@@ -0,0 +1,44 @@
# Connect - A safer OnClientPreConnect forward
This extension provides a OnClientPreConnect forward (similar to CBaseServer's), but does proper checking to prevent malicious people spoofing SteamIDs.
If you are currently using CBaseServer for reserved slots, it's possible for a client to spoof an admin's SteamID and cause someone to be kicked from the server (although they would be later denied, so they couldn't actually join the game).
This extension does these checks before OnClientPreConnect is fired, so this isn't possible.
There are some additional features such as being able to change the password provided before it's checked (see included example plugin) and the ability to reject the client with a reason (like SourceMod's later OnClientConnect forward).
Only the Source 2009 engine is supported, as it's the only one that's been updated to use the new authentication system.
# Provided forwards
```
public bool OnClientPreConnectEx
(
const char[] name,
char password[255],
const char[] ip,
const char[] steamID,
char rejectReason[255]
)
{
// ...
}
```
`return false;` to disallow the client from joining, and change `rejectReason` to what you want them to be shown when denied.
Note that this function is called before the client has a client index on the server.
# [Builds](https://builds.limetech.io/?project=connect)
# helpful commands for building on the unloze machine
## the environment
export PATH=":/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11/bin:/home/gameservers/.local/bin":/sbin:/bin:
export SOURCEMOD=/home/gameservers/automate/sourcemod_1.13.0.7207
export MMSOURCE=/home/gameservers/automate/mmsource-1.13
## building
rm -r -f build; mkdir build; cd build; python ../configure.py --sdks css --targets=x86 --enable-optimize; ambuild; cd ..
+1 -1
View File
@@ -40,7 +40,7 @@ for cxx_task in Extension.extensions:
pdblog.write(cxx_task.debug.path + '\n') pdblog.write(cxx_task.debug.path + '\n')
pdblog.close() pdblog.close()
CopyFiles('connect.games.txt', folders['addons/sourcemod/gamedata']) CopyFiles('connect2.games.txt', folders['addons/sourcemod/gamedata'])
CopyFiles('connect.inc', folders['addons/sourcemod/scripting/include']) CopyFiles('connect.inc', folders['addons/sourcemod/scripting/include'])
CopyFiles('connect.sp', folders['addons/sourcemod/scripting']) CopyFiles('connect.sp', folders['addons/sourcemod/scripting'])
+1 -1
View File
@@ -20,7 +20,7 @@ parser.options.add_argument('--enable-auto-versioning', action='store_false', de
default=True, help='Enables the auto versioning script') default=True, help='Enables the auto versioning script')
parser.options.add_argument('-s', '--sdks', default='all', dest='sdks', parser.options.add_argument('-s', '--sdks', default='all', dest='sdks',
help='Build against specified SDKs; valid args are "all", "present", or ' help='Build against specified SDKs; valid args are "all", "present", or '
'space-delimited list of engine names (default: %default)') 'space-delimited list of engine names (default: %(default)s)')
parser.options.add_argument('--targets', type=str, dest='targets', default=None, parser.options.add_argument('--targets', type=str, dest='targets', default=None,
help="Override the target architecture (use commas to separate multiple targets).") help="Override the target architecture (use commas to separate multiple targets).")
parser.Configure() parser.Configure()
+10
View File
@@ -4,7 +4,17 @@
#define _connect_included #define _connect_included
enum EConnect
{
k_OnClientPreConnectEx_Reject = 0,
k_OnClientPreConnectEx_Accept = 1,
k_OnClientPreConnectEx_Async = -1
};
forward bool OnClientPreConnectEx(const char[] name, char password[255], const char[] ip, const char[] steamID, char rejectReason[255]); forward bool OnClientPreConnectEx(const char[] name, char password[255], const char[] ip, const char[] steamID, char rejectReason[255]);
native bool ClientPreConnectEx(const char[] sSteam32ID, EConnect RetVal, char sRejectReason[255]);
native bool SteamClientAuthenticated(const char[] sSteam32ID);
public Extension __ext_Connect = public Extension __ext_Connect =
{ {
+18 -6
View File
@@ -37,12 +37,12 @@
"Signatures" "Signatures"
{ {
"Steam3Server" "Steam3Server"
{ {
"library" "engine" "library" "engine"
"linux" "@_Z12Steam3Serverv" "linux" "@_Z12Steam3Serverv"
"linux64" "@_Z12Steam3Serverv" "linux64" "@_Z12Steam3Serverv"
} }
"CBaseServer__ConnectClient" "CBaseServer__ConnectClient"
{ {
@@ -68,6 +68,18 @@
"windows" "\x55\x8B\xEC\x83\xEC\x1C\x53\x57\x33\xD2" "windows" "\x55\x8B\xEC\x83\xEC\x1C\x53\x57\x33\xD2"
"windows64" "\x4C\x8B\xDC\x49\x89\x5B\x2A\x49\x89\x6B\x2A\x56\x57\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x60\x48\x8B\x05\x2A\x2A\x2A\x2A\x48\x8D\x1D" "windows64" "\x4C\x8B\xDC\x49\x89\x5B\x2A\x49\x89\x6B\x2A\x56\x57\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x60\x48\x8B\x05\x2A\x2A\x2A\x2A\x48\x8D\x1D"
} }
"CSteam3Server__OnValidateAuthTicketResponse"
{
"library" "engine"
"linux" "@_ZN13CSteam3Server28OnValidateAuthTicketResponseEP28ValidateAuthTicketResponse_t"
}
"CBaseClient__SetSteamID"
{
"library" "engine"
"linux" "@_ZN11CBaseClient10SetSteamIDERK8CSteamID"
}
} }
} }
} }
+802 -259
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -55,6 +55,13 @@ public:
*/ */
//virtual void SDK_OnPauseChange(bool paused); //virtual void SDK_OnPauseChange(bool paused);
/**
* @brief This is called once all known extensions have been loaded.
* Note: It is is a good idea to add natives here, if any are provided.
*/
virtual void SDK_OnAllLoaded();
/** /**
* @brief this is called when Core wants to know if your extension is working. * @brief this is called when Core wants to know if your extension is working.
* *
@@ -110,6 +117,11 @@ public: \
ret (name##Class::* name##Class::name##_Actual)(p1type, p2type, p3type, p4type, p5type, p6type, p7type, p8type, p9type) = NULL; \ ret (name##Class::* name##Class::name##_Actual)(p1type, p2type, p3type, p4type, p5type, p6type, p7type, p8type, p9type) = NULL; \
ret name##Class::name(p1type p1name, p2type p2name, p3type p3name, p4type p4name, p5type p5name, p6type p6name, p7type p7name, p8type p8name, p9type p9name) ret name##Class::name(p1type p1name, p2type p2name, p3type p3name, p4type p4name, p5type p5name, p6type p6name, p7type p7name, p8type p8name, p9type p9name)
#define DETOUR_MEMBER_MCALL_CALLBACK(name, classptr) \
((name##Class *)classptr->*(&name##Class::name))
#define DETOUR_MEMBER_MCALL_ORIGINAL(name, classptr) \
((name##Class *)classptr->*(name##Class::name##_Actual))
struct mfpDetails { struct mfpDetails {
void *addr; void *addr;
intptr_t adjustor; intptr_t adjustor;
+2
View File
@@ -0,0 +1,2 @@
#pragma once
#define NAME_SALT "your-salt-here"
+2 -2
View File
@@ -40,8 +40,8 @@
#define SMEXT_CONF_NAME "Connect" #define SMEXT_CONF_NAME "Connect"
#define SMEXT_CONF_DESCRIPTION "Forward for early connection" #define SMEXT_CONF_DESCRIPTION "Forward for early connection"
#define SMEXT_CONF_VERSION SM_FULL_VERSION #define SMEXT_CONF_VERSION SM_FULL_VERSION
#define SMEXT_CONF_AUTHOR "Asher \"asherkin\" Baker" #define SMEXT_CONF_AUTHOR "Asher \"asherkin\" Baker + jenz + zacade"
#define SMEXT_CONF_URL "http://limetech.org/" #define SMEXT_CONF_URL "https://git.unloze.com/UNLOZE/sm-ext-connect"
#define SMEXT_CONF_LOGTAG "CONNECT" #define SMEXT_CONF_LOGTAG "CONNECT"
#define SMEXT_CONF_LICENSE "GPL" #define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__ #define SMEXT_CONF_DATESTRING __DATE__