Compare commits

...

26 Commits

Author SHA1 Message Date
s1lentq
95d3e935d8 fixed compat with reunion2015 version
Some checks failed
C/C++ CI / Publish (push) Has been cancelled
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
authdata->steamId should be always hash of full ticket
2025-04-13 00:54:58 +07:00
s1lentq
58e894ef25 fixed compat of steamid generation with reunion2015 version, when authkey was shortest
Some checks failed
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
C/C++ CI / Publish (push) Has been cancelled
2025-04-12 03:31:24 +07:00
Dmitry Novikov
568b1a2b3b
Update build.yml
Some checks failed
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
C/C++ CI / Publish (push) Has been cancelled
2025-03-27 16:26:33 +07:00
Dmitry Novikov
308e010beb
Update reunion.cfg 2025-03-27 16:20:52 +07:00
Dmitry Novikov
5214d418ae
Fix default value for enable query limiter option 2025-03-27 16:11:35 +07:00
s1lentq
232c7ab1df Fix linux build (missing deps)
Some checks failed
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
C/C++ CI / Publish (push) Has been cancelled
2024-11-27 00:40:31 +07:00
s1lentq
bdb3a06efb Fix linux build 2024-11-27 00:36:30 +07:00
s1lentq
16c8b2621b Allow to disable salt for SteamIDs hashing >= reunion2018 (this is always required by default) 2024-11-27 00:29:33 +07:00
s1lentq
ed4d145219 Fixed salt steamid for reunion2015 auth version 2024-11-27 00:04:55 +07:00
c625203188
LICENSE.md -> LICENSE, re -> Re
Some checks failed
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
C/C++ CI / Publish (push) Has been cancelled
2024-11-15 18:02:12 +03:00
1927408f8a
Merge pull request #3 from rehlds/feature/meta-improvements
Some checks failed
C/C++ CI / Windows (push) Has been cancelled
C/C++ CI / Linux (push) Has been cancelled
C/C++ CI / Publish (push) Has been cancelled
added changelog
2024-11-06 13:39:37 +03:00
3eae86647c
added changelog + updated readme 2024-11-03 19:58:01 +03:00
s1lentq
12ea01409b fix build 2024-08-23 04:14:18 +07:00
s1lentq
38eeb46f39 Disable caching of g_ISteamGameServer, listen server may reassign instance after each map change 2024-08-23 03:58:30 +07:00
s1lentq
2370bdaff2 [skip ci] Update config 2024-06-28 00:25:02 +07:00
s1lentq
5fec1febb1 Fixed a steamid collision in some cases due to a short authkey length limit 31 2024-06-27 21:32:38 +07:00
s1lentq
feacae5c3d Fixed uninitialized members 2024-06-26 19:53:54 +07:00
s1lentq
621d775fe0 Add av_reunion2018 prefixes for SteamIDs as auth type 2024-06-23 05:17:34 +07:00
s1lentq
de41ab367f Fixed collisions of SteamIDs issued to non-unique serial numbers "0000_0000_0000_0000_0000_0100_0000_0000".
For these non-steam clients, SteamIDs will now be generated based on IP.
2024-06-21 21:26:22 +07:00
s1lentq
c3dddd0bf4 [skip ci] Update README.md 2024-06-21 00:17:00 +07:00
s1lentq
8ab6ca3077 [skip ci] Update reunion.cfg 2024-06-20 23:50:53 +07:00
s1lentq
d8977f3060 Fix link 2024-06-20 22:47:31 +07:00
s1lentq
38efa68133 Update README.md 2024-06-20 22:34:09 +07:00
s1lentq
8caf39aa83 Update Readme.tpl 2024-06-20 20:52:57 +07:00
s1lentq
87c7fbcc9c Update permission for scripts 2024-06-20 20:47:11 +07:00
s1lentq
ca90638e6c Remove mention of SSE3 emulator 2024-06-20 20:45:39 +07:00
18 changed files with 375 additions and 126 deletions

View File

@ -41,15 +41,14 @@ jobs:
move msvc\${{ env.buildRelease }}\reunion_mm.dll publish\bin\Windows\reunion_mm.dll
- name: Deploy artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: win32
path: publish/*
linux:
name: 'Linux'
runs-on: ubuntu-latest
container: s1lentq/linux86buildtools:latest
runs-on: ubuntu-20.04
outputs:
app-version: ${{ steps.app-version.outputs.version }}
@ -59,9 +58,15 @@ jobs:
with:
fetch-depth: 0
- name: Build using Intel C++ Compiler 19.0
- name: Check dependencies
run: |
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
- name: Build
run: |
rm -rf build && CC=gcc CXX=g++ cmake -B build && cmake --build build -j8
- name: Reading appversion.h
id: app-version
@ -98,7 +103,7 @@ jobs:
shell: bash
- name: Deploy artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
id: upload-job
with:
name: linux32
@ -111,12 +116,12 @@ jobs:
steps:
- name: Deploying linux artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: linux32
- name: Deploying windows artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: win32
@ -126,7 +131,7 @@ jobs:
7z a -tzip reunion-${{ needs.linux.outputs.app-version }}.zip .
- name: Publish artifacts
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4
with:
name: reunion-${{ needs.linux.outputs.app-version }}
path: |

132
CHANGELOG.md Normal file
View File

@ -0,0 +1,132 @@
# [ReUnion](https://github.com/rehlds/reUnion) Changelog
---
## [`0.2.0.13`](https://github.com/rehlds/ReUnion/releases/tag/0.2.0.13) - 2024-06-30
### Added
- Added `reunion2018` prefixes for SteamID as an authkey type for compatibility with dev version of Reunion `AuthVersion >= 3`
### Fixed
* Fixed collisions of `SteamIDs` with `AuthVersion >= 3`, due to truncation of authkey to 31 chars (Thanks for report, Alexs)
* Fixed collisions of `SteamIDs` issued to non-unique serial numbers `0000_0000_0000_0000_0000_0100_0000_0000`
(for clients with bad `HDDsn`, SteamID will be based on VALVE_ by IP)
> [!WARNING]
> CONFIG UPDATED
**Full Changelog**: [0.2.0.6...0.2.0.13](https://github.com/rehlds/ReUnion/compare/0.2.0.6...0.2.0.13)
## [`0.2.0.6`](https://github.com/rehlds/ReUnion/releases/tag/0.2.0.6) - 2014-06-21
### Added
- Added game tags using CVar `sv_tags`.
- Added new option `IDClientsLimit` for sets max number of clients from single steamid (Useful for debugging with multiple instances clients).
### Fixed
- Fixed `*sid` from userinfo.
- Fixed can't connect to game server when server is paused.
> [!WARNING]
> CONFIG UPDATED
> DO NOT UPDATE `.SO` WITHOUT CONFIG UPDATE
> [!CAUTION]
> IN THIS VERSION THE LENGTH OF `SteamIdHashSalt` MUST EXCEED `31` CHARACTERS
**Full Changelog**: [0.2.0.6](https://github.com/rehlds/ReUnion/compare/legacy-archive...0.2.0.6)
---
# Legacy Beta-releases
## [`0.1.0.137`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2023-01-20
### Changed
- Major refactoring of `QueryLimiter`
## [`0.1.0.135`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2019-10-26
### Changed
- `API` expanded.
### Added
- Added IP Whitelist for `QueryLimiterExceptIP` setting.
## [`0.1.0.133`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Changed
- Improved protection against attacks. Requires latest `ReHlds`.
### Fixed
- Fixed buggy client freeze fix not working.
## [`0.1.0.130`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Fixed
- Fixed display of avatars
## [`0.1.0.129`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Fixed
- Fixed a bug in processing `query requests` (thx `BombermaG`). Most likely it has nothing to do with the `TAB problem`, but just in case.
## [`0.1.0.127`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Fixed
- Fixed beta errors.
### Added
- Now it runs HLTV and can separately filter requests from several ports of one IP (the number is specified in the config).
> [!WARNING]
> Don't forget to install hash salt.
## [`0.1.0.125`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Added
- Backported old `API` support.
## [`0.1.0.123`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-05
### Added
- New auth
## [`0.1.0.113`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-04
### Fixed
- Fixed bug with sending empty list of players when `QueryFloodBanTime` = `0` (thanks to `HUNTERsp4x`). Those who don't have `0` can stay on `112`.
## [`0.1.0.112`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-11-04
### Changed
- Some code refactoring
## [`0.1.0.92d`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2021-01-04
### Added
- Added config option QueryFloodBanLevel
### Fixed
- Fixed SmartSteamEmu authorization on linux servers
## [`0.1.0.92c`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2019-10-26
### Added
- Added some security checks.
### Changed
- Extended `API`.
## [`0.1.0.92`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-02-11
### Added
- Added `EnableQueryLimiter` option
### Changed
- `QueryFloodBanTime` can be set to 0 to block flood without ban
## [`0.1.0.89`](https://github.com/rehlds/ReUnion/releases/tag/legacy-archive) - 2018-01-07
### Fixed
- `Hotfix`: Requires `ReHLDS API` not lower than `3.4.X.X`.

151
README.md
View File

@ -1,2 +1,149 @@
# Reunion
Metamod plugin that allows protocol 47 and 48 no-steam clients to join the ReHLDS server
# ReUnion [![C/C++ CI](https://github.com/rehlds/ReUnion/actions/workflows/build.yml/badge.svg)](https://github.com/rehlds/ReUnion/actions/workflows/build.yml) [![GitHub release (by tag)](https://img.shields.io/github/downloads/rehlds/ReUnion/latest/total)](https://github.com/rehlds/ReUnion/releases/latest) ![GitHub all releases](https://img.shields.io/github/downloads/rehlds/ReUnion/total) [![Percentage of issues still open](http://isitmaintained.com/badge/open/rehlds/reunion.svg)](http://isitmaintained.com/project/rehlds/reunion "Percentage of issues still open") [![GitHub license](https://img.shields.io/github/license/rehlds/reunion.svg?longCache=true&style=flat-square)](https://github.com/rehlds/ReUnion/blob/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/rehlds/reunion.svg?longCache=true&style=flat-square)](https://github.com/rehlds/ReUnion/issues) [![GitHub forks](https://img.shields.io/github/forks/rehlds/reunion.svg?longCache=true&style=flat-square)](https://github.com/rehlds/ReUnion/network) [![GitHub stars](https://img.shields.io/github/stars/rehlds/reunion.svg?longCache=true&style=flat-square)](https://github.com/rehlds/ReUnion/stargazers)
Metamod plugin that allows protocol 47 and 48 non-steam clients to connect to ReHLDS servers.<br/>
Reunion is a continuation of the DProto project adapted for ReHLDS.<br/>
You can try playing on one of many servers that are using Reunion: [Game Tracker](http://www.gametracker.com/search/?search_by=server_variable&search_by2=reu_version)
## Downloads
* [Release builds](https://github.com/rehlds/ReUnion/releases)
* [Dev builds](https://github.com/rehlds/ReUnion/actions/workflows/build.yml)
## Environment requirement
* ReHLDS API >= `3.10`
## Installation
<details>
<summary>Click to expand</summary>
1. Go to `<gamedir>/addons/` and make new directory named `reunion`<br/>
`<gamedir>` - its a game directory (cstrike for Counter-Strike, valve for Half-Life, etc)
2. Copy `reunion_mm.dll` or `reunion_mm_i386.so` to `<gamedir>/addons/reunion/`
3. Go to metamod installation directory (usually its `<gamedir>/addons/metamod/`) and edit `plugins.ini`:<br/>
add this line at the beginning of the file<br/>
for windows<br/>
`win32 addons\reunion\reunion_mm.dll`<br/>
for linux<br/>
`linux addons/reunion/reunion_mm_i386.so`<br/>
4. Copy `reunion.cfg` to server root or gamedir.
5. Start the server. When server loads, type `meta list` in console. You'll see something like this:
```
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] Reunion RUN - reunion_mm_i386. v0.1.58 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.8.1.3 ini Start ANY
2 plugins, 2 running
```
6. Ready to use
If reunion doesn't work, meta list says this:<br/>
```
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] Reunion fail load reunion_mm_i386. v0.1.65 ini Start Never
```
Start server with `-console +log on +mp_logecho 1` parameters and look through console output.<br/>
You'll find the reason there.
</details>
## FAQ
<details>
<summary>Click to expand</summary>
* `Q` I configured `SteamIdHashSalt` as well as in the dproto, but players get a different steamids. Why?<br/>
`A` Reunion uses an another hashing algorythm with improved security. Knowing of someones's steamid before enabling `SteamIdHashSalt` doesn't help to get same id after hashing.
* `Q` Is it possible to do something against steamid changers?<br/>
`A` No, idchangers generates a correct authorization tickets and it's impossible on serverside identify that steamid was changed. You can only set a `SteamIdHashSalt` option to prevent a substitution to specific steamid of another player.
* `Q` Why some server monitorings can't receive the players list from server?<br/>
`A` They use an incorrect query format and must be rewritten using latest <a href="https://github.com/xPaw/PHP-Source-Query">PHP-Source-Query</a> script or equivalent.
* `Q` In dproto was option Game_Name, but in reunion it has not. How to change the game name?<br/>
`A` Use plugin.
* `Q` Why has `SmartSteamEmu3` support been removed?<br/>
`A` To open-source the Reunion project, we had to remove some sensitive components.<br/>
This includes the `SmartSteamEmu3` emulator's authorization code.
Removing it won't significantly affect server online activity since this emulator is rare among non-steam clients.
</details>
## Build instructions
### Checking requirements
There are several software requirements for building reunion:
#### Windows
<pre>
Visual Studio 2015 (C++14 standard) and later
</pre>
#### Linux
<pre>
cmake >= 3.10
GCC >= 4.9.2 (Optional)
ICC >= 15.0.1 20141023 (Optional)
LLVM (Clang) >= 6.0 (Optional)
</pre>
### Building
#### Windows
Use `Visual Studio` to build, open `msvc/Reunion.sln` and just select from the solution configurations list `Release` or `Debug`
#### Linux
* Optional options using `build.sh --compiler=[gcc] --jobs=[N] -D[option]=[ON or OFF]` (without square brackets)
<pre>
-c=|--compiler=[icc|gcc|clang] - Select preferred C/C++ compiler to build
-j=|--jobs=[N] - Specifies the number of jobs (commands) to run simultaneously (For faster building)
<sub>Definitions (-D)</sub>
DEBUG - Enables debugging mode
USE_STATIC_LIBSTDC - Enables static linking library libstdc++
</pre>
* ICC <pre>./build.sh --compiler=intel</pre>
* LLVM (Clang) <pre>./build.sh --compiler=clang</pre>
* GCC <pre>./build.sh --compiler=gcc</pre>
##### Checking build environment (Debian / Ubuntu)
<details>
<summary>Click to expand</summary>
<ul>
<li>
Installing required packages
<pre>
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
sudo apt-get install -y build-essential
sudo apt-get install -y libc6-dev libc6-dev-i386
</pre>
</li>
<li>
Select the preferred C/C++ Compiler installation
<pre>
1) sudo apt-get install -y gcc g++
2) sudo apt-get install -y clang
</pre>
</li>
</ul>
</details>
### Credits
* [@Crock](https://github.com/theCrock), [@Lev](https://github.com/LevShisterov), and other people such as [@PRoSToTeM@](https://github.com/WPMGPRoSToTeMa) who participated or helped with the development of [DProto](https://cs.rin.ru/forum/viewtopic.php?f=29&t=55986)
* [@Asmodai](https://github.com/theAsmodai) for contributions as Reunion project former maintainer
* [@dreamstalker](https://github.com/dreamstalker) for the rehlds project, as well as the contributors involved in this project
* [@NordicWarrior](https://github.com/Nord1cWarr1or) for testing and feedback
* [@kazakh758](https://github.com/kazakh758) for testing a fix of issue related to the client hanging on connect

0
build.sh Normal file → Executable file
View File

View File

@ -1,7 +1,7 @@
Reunion is a plugin for metamod that allows p.47 and 48 no-steam clients to join the rehlds-based server.
CURRENT VERSION: ${APP_VERSION_STRD}
For more information and updates please check http://cs.rin.ru/forum/viewtopic.php?f=29&t=69235
For more information and updates please check https://github.com/s1lentq/reunion
ARCHIVE CONTAINS:
amxx directory - some samples of AmxModX plugins that uses reunion functionality.
@ -59,7 +59,6 @@ HOW TO CHANGE REJECT MESSAGES WHEN CLIENTID IS 5 (DEPRECATED)
dp_rejmsg_revemu_sc2009 for revEmu (> 9.82) and SteamClient2009 clients
dp_rejmsg_sxei for clients with sXe Injected if EnableSXEIdGeneration is set to 1
dp_rejmsg_revemu2013 for revEmu 2013 clients
dp_rejmsg_sse3 for SmartSteamEmu3 clients
Just put message to them and it will be displayed for rejected clients.

View File

@ -1,76 +0,0 @@
Reunion is a plugin for metamod that allows p.47 and 48 no-steam clients to join the rehlds-based server.
CURRENT VERSION: 0.2.0.13
For more information and updates please check http://cs.rin.ru/forum/viewtopic.php?f=29&t=69235
ARCHIVE CONTAINS:
amxx directory - some samples of AmxModX plugins that uses reunion functionality.
bin directory - binaries (libraries) for linux and windows.
public - C++ API for modders
Readme.txt - this file.
reunion.cfg - reunion configuration file.
REQUIREMENTS:
- ReHLDS-based server
- metamod 1.20 or higher
INSTALLATION:
1. Go to <gamedir>/addons/ and make new directory named reunion
<gamedir> - it is a game directory; cstrike for Counter-Strike, valve for Half-Life, etc
2. Copy reunion_mm.dll or reunion_mm_i386.so to <gamedir>/addons/reunion/
3. Go to metamod installation directory (usually its <gamedir>/addons/metamod/) and edit plugins.ini:
add this line for windows
win32 addons\reunion\reunion_mm.dll
or this for linux
linux addons/reunion/reunion_mm_i386.so
at the beginning of the file
4. Copy reunion.cfg to server root or gamedir.
5. Start the server. When server loads, type "meta list" in console. You'll see something like this:
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] Reunion RUN - reunion_mm_i386. v0.2.0.13 ini Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.8.1.3 ini Start ANY
2 plugins, 2 running
6. If status is not "RUN", start server with "+log on +mp_logecho 1" parameters and look through console output. In 99% cases you'll find reason there.
7. Installation of AmxModX plugins from amxx directory is not necessary.
HOW TO CHANGE STEAMIDS OF CLIENTS
Use cid* options in AUTHID MANAGEMENT section of reunion.cfg
For example, if you want to assign steamids generated by IP for p47 clients that not support unique id generation, you should set:
cid_NoSteam47 = 3 for assigning STEAM_x:y:z steamid to these clients
cid_NoSteam47 = 4 for assigning VALVE_x:y:z steamid to these clients
If you want to drop these clients, just set clientid to 5:
cid_NoSteam47 = 5
And all p47 clients without emulators will be dropped with message that you can customize (see next section).
HOW TO CHANGE REJECT MESSAGES WHEN CLIENTID IS 5 (DEPRECATED)
This could be done using these cvars:
dp_rejmsg_steam for legit steam (cid_Steam) clients
dp_rejmsg_nosteam47 for no-steam p47 (cid_NoSteam47) clients
dp_rejmsg_nosteam48 for no-steam p48 (cid_NoSteam48) clients
dp_rejmsg_hltv for HLTV (cid_HLTV) clients
dp_rejmsg_pending for unathorized (cid_cid_SteamPending) clients
dp_rejmsg_revemu for revEmu (>= 9.74 && <= 9.82) clients
dp_rejmsg_steamemu for steamEmu clients
dp_rejmsg_oldrevemu for old revEmu clients (< 9.74)
dp_rejmsg_avsmp for AVSMP clients
dp_rejmsg_revemu_sc2009 for revEmu (> 9.82) and SteamClient2009 clients
dp_rejmsg_sxei for clients with sXe Injected if EnableSXEIdGeneration is set to 1
dp_rejmsg_revemu2013 for revEmu 2013 clients
Just put message to them and it will be displayed for rejected clients.
Example, a part of server.cfg:
dp_rejmsg_nosteam47 "Sorry, you're using old client, download a new one and come back ;)"
HOW TO GET CLIENT PROTOCOL IN AMXX:
check the amxx/reu_test.sma. This is sample plugin that outputs protocol number when client connecting.
NOTE: this is _sample_ plugin and its installation is not necessary.
THANKS TO:
dreamstalker for ReHLDS project;
all people who helped with development of dproto.
kazakh758 for testing a fix of issue related to the client hanging on connect.
BombermaG for finding a bug in query emulator

View File

@ -79,10 +79,6 @@ cid_Setti = 3
# default is real STEAM_xx:xx:xx [1]
cid_SXEI = 1
# For players having SmartSteamEmu > 1.2.4 on client-side:
# default is real STEAM_xx:xx:xx [1]
cid_SSE3 = 1
### AUTH SETTINGS ###
@ -94,8 +90,12 @@ AuthVersion = 3
# SteamIdHashSalt (string)
# Salt string for SteamIDs hashing. Irreversibly changes SteamIDs. Prevents SteamID stealing.
# Should be more than 31 chars length. If string is empty, hashing is not applied (AuthVersion < 3) or Reunion init will be failed (AuthVersion >= 3).
SteamIdHashSalt =
# Should be more than or equal to 16 chars length.
# AuthVersion < 3: If string is empty, hashing is not applied
# AuthVersion >= 3: If string is empty, init will be failed
# Recommended length is 32 chars or more
# Specify 0 to explicitly disable hashing (not recommended)
SteamIdHashSalt =
# SC2009_RevCompatMode (0 / 1)
# Enable fix to make steamids generated for SC2009 compatible with revEmu. Can't be disabled with AuthVersion >= 3.
@ -177,11 +177,6 @@ Setti_Prefix1 = 5;
# first prefix (a) for authids assigned for sXeI clients
SXEI_Prefix1 = 6;
# SSE3_Prefix1 (int)
# STEAM_a:b:c
# first prefix (a) for authids assigned for SSE3
SSE3_Prefix1 = 7;
# Note that banid will use steamid WITHOUT any prefixes!

View File

@ -64,7 +64,7 @@ void SaltSteamId(authdata_t* authdata) {
if (g_ReunionConfig->getAuthVersion() < av_reunion2018)
szbuf.WriteLong(authdata->steamId);
if (g_ReunionConfig->getAuthVersion() > av_dproto)
szbuf.Write(authdata->authKey, authdata->authKeyLen);
szbuf.Write(authdata->authKey, Reunion_AuthKeyMaxLen(authdata));
szbuf.Write(g_ReunionConfig->getSteamIdSalt(), g_ReunionConfig->getSteamIdSaltLen());
@ -97,6 +97,7 @@ uint64_t SteamByIp(uint32_t ip)
bool Reunion_FinishClientAuth(CReunionPlayer* reunionPlr, USERID_t* userid, client_auth_context_t* ctx)
{
client_auth_kind authkind;
client_id_kind idkind = CI_UNKNOWN;
if (!ctx->authentificatedInSteam) {
// native auth failed, try authorize by emulators
@ -125,6 +126,10 @@ bool Reunion_FinishClientAuth(CReunionPlayer* reunionPlr, USERID_t* userid, clie
authkind = CA_STEAM_PENDING;
}
else {
// check for bad authkey
if (!IsValidHddsnNumber(authdata.authKey, authdata.authKeyLen))
idkind = CI_VALVE_BY_IP;
// salt steamid
if (g_ReunionConfig->getSteamIdSaltLen()) {
SaltSteamId(&authdata);
@ -162,7 +167,9 @@ bool Reunion_FinishClientAuth(CReunionPlayer* reunionPlr, USERID_t* userid, clie
}
// add prefix
client_id_kind idkind = g_ReunionConfig->getIdGenOptions(authkind)->id_kind;
if (idkind == CI_UNKNOWN)
idkind = g_ReunionConfig->getIdGenOptions(authkind)->id_kind;
switch (idkind) {
// check for deprecation
case CI_DEPRECATED:
@ -249,11 +256,9 @@ void SV_ConnectClient_hook(IRehldsHook_SV_ConnectClient* chain) {
}
#endif
g_ISteamGameServer = g_RehldsApi->GetServerData()->GetSteamGameServer();
client_auth_context_t ctx;
if (!g_ISteamGameServer)
g_ISteamGameServer = g_RehldsApi->GetServerData()->GetSteamGameServer();
g_CurrentAuthContext = &ctx;
chain->callNext();
g_CurrentAuthContext = nullptr;

View File

@ -8,6 +8,7 @@ CQueryLimiter::CQueryLimiter()
m_uniqueQueries = 0;
m_useGlobalRateLimit = false;
m_lastAdded = -1;
m_lastFloodLog = 0;
memset(m_lastQueries, 0, sizeof m_lastQueries);
if ((MAX_STORED_QUERIES & (MAX_STORED_QUERIES - 1)) != 0)

View File

@ -37,35 +37,45 @@ int g_NumClientAuthorizers = 0;
const char *g_RevEmuCryptKey = "_YOU_SERIOUSLY_NEED_TO_GET_LAID_";
const uint32_t g_SteamEmuHashKey = 0xC9710266;
static uint32_t revHash(const char* str)
static uint32_t revHash(const char* str, int n = -1)
{
uint32_t hash = 0x4E67C6A7;
for (int cc = *str; cc; cc = *++str) {
for (int cc = *str; cc && n != 0; cc = *++str, --n) {
hash ^= (hash >> 2) + cc + 32 * hash;
}
return hash;
}
void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, bool stripSpecialChars)
// deprecated auth version reunion2015 has a truncated ticket buffer
size_t Reunion_AuthKeyMaxLen(authdata_t* authdata)
{
const uint32_t MAX_RAWAUTHDATA_TRUNCATED = 16;
uint32_t authKeyMaxLen = (g_ReunionConfig->getAuthVersion() == av_reunion2015)
? min(authdata->authKeyLen, MAX_RAWAUTHDATA_TRUNCATED) : authdata->authKeyLen;
return authKeyMaxLen;
}
void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, size_t authKeyMaxLen, bool stripSpecialChars)
{
size_t authKeyMaxLen = g_ReunionConfig->getAuthVersion() >= av_reunion2018 ? MAX_AUTHKEY_LEN : MAX_AUTHKEY_LEN_OLD;
uint32_t volumeId;
char hddsn[256];
bool authVolumeId = false;
if (IsHddsnNumber(authStr)) {
authdata->authKeyKind = AK_HDDSN;
LCPrintf(false, "RevEmu raw auth string: '%s' (HDDSN)\n", authStr);
if (stripSpecialChars) {
authdata->authKeyLen = strecpy(hddsn, authStr, authKeyMaxLen, " \\/-");
authStr = hddsn;
}
else
authdata->authKeyLen = min(strlen(authStr), authKeyMaxLen);
LCPrintf(false, "RevEmu raw auth string: '%s' (HDDSN)%s\n", authStr,
IsValidHddsnNumber(authStr, authdata->authKeyLen) ? "" : " (INVALID)"
);
}
else {
authdata->authKeyKind = AK_VOLUMEID;
@ -75,7 +85,6 @@ void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, bool s
volumeId = strtoul(authStr, nullptr, 10) & 0x7FFFFFFF;
authdata->authKeyLen = volumeId ? sizeof(volumeId) : 0; // can't be zero
authStr = (char *)&volumeId;
authVolumeId = true;
}
else
authdata->authKeyLen = min(strlen(authStr), authKeyMaxLen);
@ -89,7 +98,7 @@ void RevEmuFinishAuthorization(authdata_t* authdata, const char* authStr, bool s
authdata->steamId = revHash(authdata->authKey) << 1;
if (authVolumeId)
if (authStr == (char *)&volumeId)
LCPrintf(false, "RevEmu auth key: '%u' steamid: %u\n", (uint32_t)authStr, authdata->steamId);
else
LCPrintf(false, "RevEmu auth key: '%s' steamid: %u\n", authStr, authdata->steamId);
@ -145,7 +154,7 @@ bool RevEmu2009to2013Authorize(ticket_t* ticket, authdata_t* authdata)
return false;
}
RevEmuFinishAuthorization(authdata, DecryptedAuthData, g_ReunionConfig->isSC2009RevEmuCompat() || g_ReunionConfig->getAuthVersion() >= av_reunion2018);
RevEmuFinishAuthorization(authdata, DecryptedAuthData, sizeof DecryptedAuthData - 1, g_ReunionConfig->isSC2009RevEmuCompat() || g_ReunionConfig->getAuthVersion() >= av_reunion2018);
return true;
}
@ -237,7 +246,7 @@ client_auth_kind CRevEmuAuthorizer::authorize(authdata_t* authdata)
return CA_UNKNOWN;
}
RevEmuFinishAuthorization(authdata, ticket->TicketBuf, g_ReunionConfig->getAuthVersion() >= av_reunion2018);
RevEmuFinishAuthorization(authdata, ticket->TicketBuf, sizeof ticket->TicketBuf - 1, g_ReunionConfig->getAuthVersion() >= av_reunion2018);
return CA_REVEMU;
}

View File

@ -85,3 +85,4 @@ class CNoSteam48Authorizer : public IClientAuthorizer {
extern void Reunion_Init_Authorizers();
extern client_auth_kind Reunion_Authorize_Client(authdata_t* authdata);
extern const char* Reunion_GetAuthorizerName(client_auth_kind authKind);
extern size_t Reunion_AuthKeyMaxLen(authdata_t* authdata);

View File

@ -138,6 +138,7 @@ CReunionConfig* CReunionConfig::createDefault()
cfg->m_bFixBuggedQuery = true;
cfg->m_HLTVExceptIP = 0;
cfg->m_bEnableQueryLimiter = true;
cfg->m_queriesBanLevel = 400;
cfg->m_floodBanTime = QUERY_FLOOD_DEFAULT_BANTIME;
cfg->m_allowSplitPackets = false;
@ -319,8 +320,15 @@ bool CReunionConfig::parseCfgParam()
if (m_AuthVersion == av_dproto)
m_bEnableGenPrefix2 = false;
if (m_AuthVersion >= av_reunion2018) {
if (m_SteamIdHashSaltLen < 16) {
if (m_AuthVersion >= av_reunion2018)
{
// check logical negation value to disable salt hashing
bool bSteamIdNoHashSalt = (m_SteamIdHashSalt[0] == '0'
|| !Q_stricmp(m_SteamIdHashSalt, "no")
|| !Q_stricmp(m_SteamIdHashSalt, "false"));
if (!bSteamIdNoHashSalt && m_SteamIdHashSaltLen < 16)
{
LCPrintf(true, "SteamIdHashSalt is not set or too short\n");
return false;
}

View File

@ -11,6 +11,8 @@ CReunionPlayer::CReunionPlayer(IGameClient* cl) {
void CReunionPlayer::clear() {
m_IdKind = CI_UNKNOWN;
m_AuthKind = CA_UNKNOWN;
m_authKeyKind = AK_OTHER;
m_idString[0] = 0;
m_Protocol = 0;
m_ConnectionTime = 0.0;
m_UnauthenticatedSteamId = 0;
@ -49,21 +51,30 @@ void CReunionPlayer::authenticated(int proto, client_id_kind idkind, client_auth
const client_id_gen_opts_t* idGenOpts = g_ReunionConfig->getIdGenOptions(m_AuthKind);
const client_id_gen_opts_t* idByIpGenOpts = g_ReunionConfig->getIdByIpGenOpts();
// use auth key type prefixes
bool akPrefixes = g_ReunionConfig->getAuthVersion() == av_reunion2018;
switch (m_IdKind) {
case CI_REAL_STEAM:
sprintf(m_idString, "STEAM_%u:%u:%u", idGenOpts->prefix1, accId & 1, accId >> 1);
sprintf(m_idString, "STEAM_%u:%u:%u", akPrefixes ? m_authKeyKind : idGenOpts->prefix1, accId & 1, accId >> 1);
break;
case CI_REAL_VALVE:
sprintf(m_idString, "VALVE_%u:%u:%u", idGenOpts->prefix1, accId & 1, accId >> 1);
sprintf(m_idString, "VALVE_%u:%u:%u", akPrefixes ? m_authKeyKind : idGenOpts->prefix1, accId & 1, accId >> 1);
break;
case CI_STEAM_BY_IP:
sprintf(m_idString, "STEAM_%u:%u:%u", idByIpGenOpts->prefix1, idByIpGenOpts->prefix2, accId >> 1);
if (akPrefixes)
sprintf(m_idString, "STEAM_%u:%u:%u", AK_MAX, accId & 1, accId >> 1);
else
sprintf(m_idString, "STEAM_%u:%u:%u", idByIpGenOpts->prefix1, idByIpGenOpts->prefix2, accId >> 1);
break;
case CI_VALVE_BY_IP:
sprintf(m_idString, "VALVE_%u:%u:%u", idByIpGenOpts->prefix1, idByIpGenOpts->prefix2, accId >> 1);
if (akPrefixes)
sprintf(m_idString, "VALVE_%u:%u:%u", AK_MAX, accId & 1, accId >> 1);
else
sprintf(m_idString, "VALVE_%u:%u:%u", idByIpGenOpts->prefix1, idByIpGenOpts->prefix2, accId >> 1);
break;
case CI_HLTV:

View File

@ -9,10 +9,8 @@
#define STEAM_ID_LAN 0
#define STEAM_ID_PENDING 1
#define MAX_STEAMIDSALTLEN 64
#define MAX_AUTHKEY_LEN 31
#define MAX_AUTHKEY_LEN_OLD 16
#define MAX_AUTHKEY_LEN 128
#define MAX_HASHDATA_LEN (4 + MAX_STEAMIDSALTLEN + MAX_AUTHKEY_LEN)
//#define MAX_HASHDATA_LEN_OLD (4 + MAX_STEAMIDSALTLEN + MAX_AUTHKEY_LEN_OLD)
#define IPGEN_KEY 0xA95CE2B9
#define LOG_PREFIX "[REUNION]: "

View File

@ -145,6 +145,19 @@ bool IsHddsnNumber(const char* authstring)
return strtoull(authstring, nullptr, 10) >= UINT32_MAX; // SSD
}
// This serial number is actually not a valid serial number
// it is a system bug that provides an incorrect serial number for NVMe solid-state drives (Netac NVMe SSD),
// retrieved from the Storage Descriptor instead of reading it from the driver.
// Therefore, obtaining the serial number from the Storage Descriptor means we should not generate a SteamID based on such serial numbers,
// as it increases the risk of SteamID collisions.
// Instead, it is better to generate a SteamID based on the client's IP.
const char *BadHddsnNumber = "0000_0000_0000_0000_0000_0100_0";
bool IsValidHddsnNumber(const void* data, size_t maxlen)
{
return memcmp(data, BadHddsnNumber, min(strlen(BadHddsnNumber), maxlen)) != 0;
}
void util_console_print(const char* fmt, ...)
{
char buf[1024];

View File

@ -16,6 +16,7 @@ extern bool IsUniqueIdKind(client_id_kind idkind);
extern bool IsValidId(uint32 authId);
extern bool IsValidSteamTicket(const uint8 *pvSteam2Key, size_t ucbSteam2Key);
extern bool IsHddsnNumber(const char* authstring);
extern bool IsValidHddsnNumber(const void* data, size_t maxlen);
extern void util_console_print(const char* fmt, ...);
extern void util_syserror(const char* fmt, ...);

0
reunion/version/appversion.sh Normal file → Executable file
View File

0
reunion/version/glibc_test.sh Normal file → Executable file
View File