Compare commits

..

85 Commits

Author SHA1 Message Date
alex47exe
56e8e6adfe
Merge branch 'dev' into dev 2024-10-26 02:31:02 +01:00
Detanup01
63552d7584
fixing is_beta_branch in ini 2024-10-25 18:47:18 +02:00
Detanup01
2560c6eb8e
Merge pull request #66 from Detanup01/steamutils001
steamutils001 imp
2024-10-25 14:07:50 +02:00
Detanup01
8556336169
remove the comment in SteamUtils001 2024-10-25 14:07:34 +02:00
Detanup01
6be3ba1963
fix interface getter and steamutils class 2024-10-23 17:00:28 +02:00
alex47exe
20f50d8cb0
Merge branch 'Detanup01:dev' into dev 2024-10-23 00:15:02 +01:00
Detanup01
47c6f8ef3d
steamutils001 imp 2024-10-22 20:23:22 +02:00
Detanup01
3a4d7c4bc1
Merge pull request #64 from universal963/patch-oldsteamuser
Initial implementation of `ISteamUser004` to `ISteamUser008`
2024-10-22 20:17:42 +02:00
universal963
dee5201e61 Fix debug log 2024-10-22 19:55:12 +08:00
universal963
f8bf0ab381 Fix debug build 2024-10-22 19:13:36 +08:00
universal963
2ef54d0fb8 Fix again 2024-10-22 19:00:49 +08:00
universal963
e3527834d7 Fix compilation 2024-10-22 18:53:44 +08:00
universal963
415fd1ca3e Initial implementation of ISteamUser004 to ISteamUser008 2024-10-22 18:41:46 +08:00
alex47exe
68e35c17ee generate_emu_config, fix -rel argument
for better customization, it is now split in two arguments:
- rel_out:  generate complete game config in _OUTPUT/appid folder, relative to the bat, sh or app calling generate_emu_config app
- rel_raw:  generate complete game config in the same folder that contains the bat, sh or app calling generate_emu_config app
2024-10-21 02:42:54 +01:00
alex47exe
493cf75376
Merge branch 'Detanup01:dev' into dev 2024-10-21 00:19:06 +01:00
Detanup01
2b0eefd929
use UGC19 as UGC20 2024-10-20 23:10:22 +02:00
alex47exe
5e6fcc146c
Merge branch 'Detanup01:dev' into dev 2024-10-19 23:17:16 +01:00
alex47exe
169d29e53d fix generate_emu_config
fix two controller config related error when generating for appid 427520 and 1477940
2024-10-19 22:47:56 +01:00
Detanup01
2f81f755b7
Merge pull request #59 from universal963/patch-3
Fix possible memory leaks in `network.cpp`
2024-10-18 16:06:21 +02:00
universal963
ff5ef4f721
One more fix 2024-10-15 23:45:32 +08:00
alex47exe
766b685b62 update top_owners_ids.txt for generate_emu_config
add top owners_ids.txt to Linux build too
2024-10-14 20:10:36 +01:00
alex47exe
0745935be0 is_beta_branch fix, as pointed by wizark952
should now be correctly parsed from 'app::general' instead of 'main::general'
2024-10-14 17:45:32 +01:00
alex47exe
174d2df50a generate_emu_config and migrate_gse:
replaced %outdir% with $outdir for linux build scripts
2024-10-14 15:40:14 +01:00
alex47exe
21c33b3a98 generate_emu_config and migrate_gse:
copy _DEFAULT folders for Linux too
2024-10-14 15:23:21 +01:00
universal963
4823a2be70
Fix possible memory leak 2024-10-14 13:40:21 +08:00
alex47exe
3ccce93a74 fix generate_emu_config login, thanks to Sak32009
replace 'client_id' error with simple 'wrong username and / or password' message, asking for correct username and / or password
add pcgw_page script to download PCGamingWiki page (source code only), not yet enabled in main script
generate steam_emu.ini for CODEX and RUNE versions, update gse_generate_interfaces
2024-10-14 00:24:49 +01:00
alex47exe
9c18c68ce9
Merge branch 'Detanup01:dev' into dev 2024-10-10 23:43:25 +01:00
Detanup01
4250da00c6
Merge pull request #55 from otavepto/dev
implement `ISteamAppDisableUpdate001`
2024-10-10 10:48:59 +02:00
a
2d69eb2164 implement ISteamAppDisableUpdate001 2024-10-09 22:34:03 +03:00
alex47exe
6c5819b3f0 release workflow improvements
- added bat scripts to automatically pack latest steam_api dlss and tools for generate_emu_config and migrate_gse
- removed previous steam_api dlls and 7z archives from generate_emu_config and migrate_gse
- removed previous generate_interfaces and lobby_connect 7z archives from generate_emu_config and migrate_gse
- moved some default required files for generate_emu_config from _DEFAULT\1 to _DEFAULT\0 folder, thus eliminating the need to duplicate them for every other default configuration folder you might create (_DEFAULT\2 - _DEFAULT\5)
2024-10-07 15:56:41 +01:00
alex47exe
398ae35d99 fix steam id for generated codex ini
now using steam id3 (correct) instead of steam id64 (wrong)
2024-10-07 15:55:38 +01:00
alex47exe
1d68c3d58b
Merge branch 'dev' into dev 2024-10-07 00:40:58 +01:00
Detanup01
1460b87e39
update generate interface (more interface discovery) 2024-10-06 14:06:39 +02:00
Detanup01
3a05ef636f
Merge pull request #52 from otavepto/dev
support older bind variants + auto unload on success or timeout
2024-10-06 13:52:51 +02:00
a
ed5b745e09 support older variant + auto unload on success or timeout 2024-10-05 20:11:40 +03:00
alex47exe
8141643978 - manually push latest steam api 7z archives required by gse_debug_switch helper tool
- disable overlay by default for generate_emu_config (seems it crashes a lot of games now after some recent updates to the way achivement icons are loaded)
2024-09-24 00:14:28 +01:00
alex47exe
ea28ed622b
Merge branch 'Detanup01:dev' into dev 2024-09-19 00:50:42 +01:00
Detanup01
d40d306ccd
wizard's change to stubdrm
Indicading using old ubuntu version in readme (check prev change for going 22.04->20.04)
2024-09-18 19:41:02 +02:00
alex47exe
c0b071e78a
Merge branch 'dev' into dev 2024-09-16 15:17:36 +01:00
Detanup01
712482f286
Merge pull request #42 from universal963/patch-2
Correct undocumented api in `ISteamNetworkingSockets010` and `ISteamNetworkingSockets011`
2024-09-16 09:48:24 +02:00
universal963
cbef1d49e9 Correct undocumented api in ISteamNetworkingSockets010 and ISteamNetworkingSockets011 2024-09-16 13:06:42 +08:00
Detanup01
f7fe813310
fix for "inputs" not exists in vdf 2024-09-15 21:46:09 +02:00
Detanup01
0dcafc5cb8
Merge pull request #39 from Detanup01/morestub_ms3
Update stubdrm.cpp
2024-09-15 17:26:38 +02:00
Detanup01
addfd88782
fixing wrong indent (tabs) 2024-09-15 17:14:00 +02:00
Detanup01
febbf32fb9
Update stubdrm.cpp
Adding new detection for Metal Slug 3
2024-09-15 16:46:21 +02:00
Detanup01
ca66c1bf62
Merge pull request #38 from M4RCK5/dev
Lobby Connect Improvements + MBTL Fix
2024-09-15 12:51:15 +02:00
M4RCK5
fcd523796f
Added back active user list but disabled 2024-09-14 05:32:53 -03:00
M4RCK5
a68259d7cd
MELTY BLOOD TYPE LUMINA Fix
[Requested by wizark](https://cs.rin.ru/forum/viewtopic.php?p=3124996#p3124996)
2024-09-14 01:59:57 -03:00
M4RCK5
367234ae64
Lobby Connect Improvements
-Removed active user list to prioritize multiplayer lobbies
-Fixed infinite loop when the user inputs letters instead of numbers
-Clear output when refreshing lobby list
2024-09-13 15:12:27 -03:00
alex47exe
8b2b141770
Merge branch 'Detanup01:dev' into dev 2024-09-07 00:11:12 +01:00
Detanup01
cd8fcaf61f
Merge pull request #36 from Detanup01/ubuntu_20-04
changing all 22.04 to 20.04
2024-09-06 12:54:25 +02:00
Detanup01
d2f990d8e3
changing all 22.04 to 20.04 2024-09-05 19:40:37 +02:00
alex47exe
3fbe0d3ec6
Merge branch 'Detanup01:dev' into dev 2024-09-02 12:19:29 +01:00
Detanup01
dcc1a5c63f
Merge pull request #35 from Sak32009/patch-stb-image-resize2-as-static
compile stb_image_resize2 as static library
2024-09-02 10:46:35 +02:00
Detanup01
1c012c9ac7
Merge pull request #34 from Sak32009/patch-msbuild-warnings-1
fixed msbuild warnings (again and again forever maybe)
2024-09-02 10:46:24 +02:00
Sak32009
b3582bf31c compile stb_image_resize2 as static library 2024-09-01 08:17:23 +02:00
Sak32009
c3d8217629 fixed msbuild warnings 2024-09-01 07:24:16 +02:00
alex47exe
4f0a36f8bb
Merge branch 'Detanup01:dev' into dev 2024-08-27 23:37:28 +01:00
Detanup01
601bb51d46
Merge pull request #32 from universal963/universal963-patch-1
More accurate api behaviors fix
2024-08-27 15:27:32 +02:00
alex47exe
93ba29191c
Merge branch 'dev' into dev 2024-08-26 22:49:44 +01:00
universal963
fd1af0d7ff
More accurate api behaviors 2024-08-27 02:08:13 +08:00
Detanup01
b0d92a48c1
Merge pull request #31 from Sak32009/dev
varied fixes and improvements
2024-08-26 07:39:01 +02:00
Sak32009
91eff290a0 formatted the .yml workflows 2024-08-25 18:08:23 +02:00
alex47exe
71d6aa7fc4 - manually push latest steam api 7z archives required by gse_debug_switch helper tool
- manually psuh latest generate_interafaces and lobby connect 7z archives
- update ini files in _DEFAULT/1 folder to support latest changes
2024-08-25 14:57:09 +01:00
alex47exe
ab40864be7
Merge branch 'dev' into dev 2024-08-25 13:45:22 +01:00
Sak32009
1b68c4bb0e formatted the .yml workflows, updated the python version of migrate_gse to v3.12 and updated softprops/action-gh-release to v2 2024-08-25 12:49:34 +02:00
Sak32009
971e60c85d removed /s option from del command in .bat files 2024-08-25 11:37:01 +02:00
Sak32009
a75ba5c9bd improved generate_credits.bat 2024-08-25 11:36:17 +02:00
Sak32009
c302fa2638 added .editorconfig for compatible IDEs 2024-08-25 11:31:51 +02:00
Sak32009
00ede97f15 updated .gitignore 2024-08-25 11:30:57 +02:00
Sak32009
a506b80131 removed first line of .gitmodules 2024-08-25 11:30:38 +02:00
Sak32009
5700a5f886 improved build_win_premake.bat, package_win.bat, rebuild_win.bat and recreate_venv_win.bat and and fixed a sign_helper error that didn't find the input file 2024-08-25 11:30:19 +02:00
Sak32009
85335e7628 updated sdk readme and added source to CREDITS.md 2024-08-25 09:55:37 +02:00
Detanup01
1503cc43d7
Merge pull request #30 from Sak32009/dev
update commit third-party\build\win + fix msbuild warnings + improved tools\generate_interfaces\generate_interfaces.cpp + fixed finding of "STEAMCONTROLLER_INTERFACE_VERSION" interface
2024-08-25 01:59:31 +02:00
Sak32009
63857ceb4e improved tools\generate_interfaces\generate_interfaces.cpp + fixed finding of "STEAMCONTROLLER_INTERFACE_VERSION" interface 2024-08-24 20:02:04 +02:00
Sak32009
935d3405a9 fix msbuild warnings 2024-08-24 19:57:23 +02:00
Sak32009
00f7e73e98 update third-party\build\win 2024-08-24 17:46:15 +02:00
alex47exe
f73af37c8a
Merge branch 'Detanup01:dev' into dev 2024-08-23 23:32:50 +01:00
Detanup01
0684fa0c72
Merge pull request #24 from Edremon/mingw
Fix building with wine wrapped MSVC
2024-08-23 20:20:33 +02:00
alex47exe
d7f6576c65
Merge branch 'dev' into dev 2024-08-23 00:30:13 +01:00
Detanup01
f981989926
Merge pull request #27 from otavepto/remote_aa/patch-overlay-background-upload
Dramatically decrease the startup locking/halt time when the overlay is enabled
2024-08-22 20:39:06 +02:00
Detanup01
b423759d90
Merge pull request #26 from otavepto/remote_aa/patch-missing-client
implementation for some missing client functions
2024-08-22 16:05:34 +02:00
Edremon
3bc03070aa fix building with wine wrapped MSVC 2024-08-22 12:48:38 +00:00
a
4017266241 * deprecate lazy_load_achievements_icons in favor of paginated_achievements_icons
* new option `upload_achievements_icons_to_gpu` in `configs.main.ini` which controls whether the overlay should upload the achievements icons to the GPU and display them or not
* synchronize overlay proc with the periodic steam callback in a better way to avoid FPS drop
* prevent overlay flickering regression
* upload achievements icons to the GPU in the overlay proc periodically, this dramatically decreased the startup locking/halt time
* fix a potential deadlock scenario in the overlay as a result of synchonizing with 2 mutex objects
2024-08-21 23:56:52 +03:00
a
4b9f88d8ec * change return type of all client functions from bool to steam_bool to avoid inconsistency problem in the client library
* implement missing client functions
  - `Breakpad_SteamSendMiniDump()`
  - `Steam_IsKnownInterface()`
  - `Steam_NotifyMissingInterface()`
2024-08-21 22:45:02 +03:00
189 changed files with 5527 additions and 2562 deletions

20
.editorconfig Normal file
View File

@ -0,0 +1,20 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
[*.py]
indent_size = 4
[*.h]
indent_size = 4
[*.cpp]
indent_size = 4

View File

@ -1,4 +1,4 @@
name: Build emu (Linux)
name: "Build emu (Linux)"
on:
workflow_call:
@ -7,26 +7,26 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
PREMAKE_ACTION: gmake2
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build/deps/linux
PREMAKE_ACTION: "gmake2"
DEPS_CACHE_KEY: "emu-deps-linux"
DEPS_CACHE_DIR: "build/deps/linux"
PACKAGE_BASE_DIR: "build/package/linux"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
deps:
name: Restore or build deps
name: "Restore or build deps"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-linux.yml
uses: "./.github/workflows/emu-deps-linux.yml"
builds-matrix-linux:
name: build
needs: [ deps ]
runs-on: ubuntu-24.04
name: "build"
needs: ["deps"]
runs-on: "ubuntu-20.04"
if: ${{ !cancelled() }}
continue-on-error: true
@ -35,60 +35,62 @@ jobs:
matrix:
prj: [
# regular api
'api_regular', 'steamclient_regular',
"api_regular",
"steamclient_regular",
# api + client (experimental)
'api_experimental', 'steamclient_experimental',
"api_experimental",
"steamclient_experimental",
# tools
'tool_lobby_connect', 'tool_generate_interfaces',
"tool_lobby_connect",
"tool_generate_interfaces",
]
arch: [ 'x64', 'x32', ]
cfg: [ 'debug', 'release', ]
arch: ["x64", "x32"]
cfg: ["debug", "release"]
steps:
### clone branch
- name: Checkout branch
# clone branch
- name: "Checkout branch"
uses: actions/checkout@v4
### deps
- name: Restore deps
id: emu-deps-cache-step
# deps
- name: "Restore deps"
id: "emu-deps-cache-step"
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party build helpers (common/linux)
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party build helpers (common/linux)"
uses: actions/checkout@v4
with:
ref: 'third-party/common/linux'
ref: "third-party/common/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux"
- name: Clone third-party build helpers (build/linux)
- name: "Clone third-party build helpers (build/linux)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/linux'
ref: "third-party/build/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux"
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
### generate project files
- name: Generate project files
shell: bash
working-directory: ${{ github.workspace }}
# generate project files
- name: "Generate project files"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: |
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5
./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5.lua --genproto --emubuild=${{ github.sha }} --os=linux gmake2
## mandatory Linux packages
- name: Install required packages
shell: bash
# mandatory Linux packages
- name: "Install required packages"
shell: "bash"
run: |
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
@ -100,22 +102,22 @@ jobs:
sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h)
# sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
### build target
- name: Build target
shell: bash
working-directory: ${{ github.workspace }}/build/project/gmake2/linux
# build target
- name: "Build target"
shell: "bash"
working-directory: "${{ github.workspace }}/build/project/gmake2/linux"
run: |
echo "dry run..."
make -n -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
echo "actual run..."
make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
### upload artifact/package to github Actions
- name: Upload target package
# upload artifact/package to github Actions
- name: "Upload target package"
uses: actions/upload-artifact@v4
with:
name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "build/linux"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,4 +1,4 @@
name: Build emu (Windows)
name: "Build emu (Windows)"
on:
workflow_call:
@ -7,25 +7,25 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
PREMAKE_ACTION: vs2022
DEPS_CACHE_KEY: emu-deps-win
DEPS_CACHE_DIR: build/deps/win
PREMAKE_ACTION: "vs2022"
DEPS_CACHE_KEY: "emu-deps-win"
DEPS_CACHE_DIR: "build/deps/win"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
deps:
name: Restore or build deps
name: "Restore or build deps"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-win.yml
uses: "./.github/workflows/emu-deps-win.yml"
builds-matrix-win:
name: build
needs: [ deps ]
runs-on: windows-2022
name: "build"
needs: ["deps"]
runs-on: "windows-2022"
if: ${{ !cancelled() }}
continue-on-error: true
@ -34,77 +34,81 @@ jobs:
matrix:
prj: [
# regular api
'api_regular',
"api_regular",
# (experimental) api + client
'api_experimental', 'steamclient_experimental_stub',
"api_experimental",
"steamclient_experimental_stub",
# client (experimental) + loader + extra dll + gameoverlaylib
'steamclient_experimental', 'steamclient_experimental_loader',
'steamclient_experimental_extra', 'lib_game_overlay_renderer',
"steamclient_experimental",
"steamclient_experimental_loader",
"steamclient_experimental_extra",
"lib_game_overlay_renderer",
# tools
'tool_lobby_connect', 'tool_generate_interfaces',
"tool_lobby_connect",
"tool_generate_interfaces",
]
arch: [ 'x64', 'Win32', ]
cfg: [ 'debug', 'release', ]
arch: ["x64", "Win32"]
cfg: ["debug", "release"]
steps:
### on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
# on Windows Git will auto change line ending to CRLF, not preferable
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
### ensure we have msbuild
- name: Add MSBuild to PATH
# ensure we have msbuild
- name: "Add MSBuild to PATH"
uses: microsoft/setup-msbuild@v2
### clone branch
- name: Checkout branch
# clone branch
- name: "Checkout branch"
uses: actions/checkout@v4
### deps
- name: Restore deps
id: emu-deps-cache-step
# deps
- name: "Restore deps"
id: "emu-deps-cache-step"
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party build helpers (common/win)
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party build helpers (common/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/common/win'
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
- name: Clone third-party deps (build/win)
- name: "Clone third-party deps (build/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/win'
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
### generate project files
- name: Generate project files
shell: cmd
working-directory: ${{ github.workspace }}
# generate project files
- name: "Generate project files"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5.lua --genproto --emubuild=${{ github.sha }} --dosstub --winrsrc --winsign --os=windows vs2022
### build target
- name: Build target
shell: cmd
working-directory: ${{ github.workspace }}/build/project/vs2022/win
# build target
- name: "Build target"
shell: "cmd"
working-directory: "${{ github.workspace }}/build/project/vs2022/win"
run: |
msbuild /nologo /target:${{ matrix.prj }} /m:2 /v:n /p:Configuration=${{ matrix.cfg }},Platform=${{ matrix.arch }} gbe.sln
### upload artifact/package to github Actions
- name: Upload target package
# upload artifact/package to github Actions
- name: "Upload target package"
uses: actions/upload-artifact@v4
with:
name: "emu-win-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "build/win"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,4 +1,4 @@
name: Emu third-party dependencies (Linux)
name: "Emu third-party dependencies (Linux)"
on:
workflow_call:
@ -7,66 +7,66 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
PREMAKE_ACTION: gmake2
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build/deps/linux
PREMAKE_ACTION: "gmake2"
DEPS_CACHE_KEY: "emu-deps-linux"
DEPS_CACHE_DIR: "build/deps/linux"
PACKAGE_BASE_DIR: "build/package/linux"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
deps-build:
runs-on: ubuntu-24.04
runs-on: "ubuntu-20.04"
if: ${{ !cancelled() }}
steps:
- name: Lookup cache for deps
id: emu-deps-cache-step
- name: "Lookup cache for deps"
id: "emu-deps-cache-step"
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
# we need branch because it has build scripts
- name: Checkout branch
- name: "Checkout branch"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (common/linux)
- name: "Clone third-party deps (common/linux)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/common/linux'
ref: "third-party/common/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux"
- name: Clone third-party deps (deps/linux)
- name: "Clone third-party deps (deps/linux)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/deps/linux'
ref: "third-party/deps/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux"
- name: Clone third-party deps (deps/common)
- name: "Clone third-party deps (deps/common)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/deps/common'
ref: "third-party/deps/common"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
- name: "Give all permissions to repo folder"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
## mandatory Linux packages
- name: Install required packages
shell: bash
# mandatory Linux packages
- name: "Install required packages"
shell: "bash"
run: |
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
@ -78,10 +78,10 @@ jobs:
sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h)
# sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
- name: Build deps
- name: "Build deps"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}
shell: "bash"
working-directory: "${{ github.workspace }}"
run: |
export CMAKE_GENERATOR="Unix Makefiles"
sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5

View File

@ -1,4 +1,4 @@
name: Emu third-party dependencies (Windows)
name: "Emu third-party dependencies (Windows)"
on:
workflow_call:
@ -7,76 +7,76 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
PREMAKE_ACTION: vs2022
DEPS_CACHE_KEY: emu-deps-win
DEPS_CACHE_DIR: build/deps/win
PREMAKE_ACTION: "vs2022"
DEPS_CACHE_KEY: "emu-deps-win"
DEPS_CACHE_DIR: "build/deps/win"
PACKAGE_BASE_DIR: "build/package/win"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
deps-build:
runs-on: windows-2022
runs-on: "windows-2022"
if: ${{ !cancelled() }}
steps:
# on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: ${{ github.workspace }}
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
- name: Lookup cache for deps
id: emu-deps-cache-step
- name: "Lookup cache for deps"
id: "emu-deps-cache-step"
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}
path: ${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}
key: "${{ env.DEPS_CACHE_KEY }}-${{ env.PREMAKE_ACTION }}"
path: "${{ env.DEPS_CACHE_DIR }}/${{ env.PREMAKE_ACTION }}"
lookup-only: true # don't restore cache if found
# we need branch because it has build scripts
- name: Checkout branch
- name: "Checkout branch"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (common/win)
- name: "Clone third-party deps (common/win)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/common/win'
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
- name: Clone third-party deps (deps/win)
- name: "Clone third-party deps (deps/win)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
- name: Clone third-party deps (deps/common)
- name: "Clone third-party deps (deps/common)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/deps/common'
ref: "third-party/deps/common"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"
- name: Clone third-party deps (common/win)
- name: "Clone third-party deps (common/win)"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: 'third-party/common/win'
ref: "third-party/common/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
- name: Build deps
- name: "Build deps"
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: cmd
working-directory: ${{ github.workspace }}
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
set "CMAKE_GENERATOR=Visual Studio 17 2022"
"${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022

View File

@ -1,30 +1,30 @@
name: Emu PR
name: "Emu PR"
on:
pull_request:
branches: [ "dev" ]
branches: ["dev"]
paths-ignore:
- '**/*.md'
- 'dev.notes/**'
- 'post_build/**'
- 'z_original_repo_files/**'
- 'sdk/*.txt'
- 'LICENSE'
- "**/*.md"
- "dev.notes/**"
- "post_build/**"
- "z_original_repo_files/**"
- "sdk/*.txt"
- "LICENSE"
# tools
- 'tools/generate_emu_config/**'
- 'tools/migrate_gse/**'
- 'tools/steamclient_loader/linux/**' # these are just scripts, not built
- "tools/generate_emu_config/**"
- "tools/migrate_gse/**"
- "tools/steamclient_loader/linux/**" # these are just scripts, not built
permissions:
contents: write
contents: "write"
jobs:
emu-win-all:
name: win
name: "win"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-build-all-win.yml
uses: "./.github/workflows/emu-build-all-win.yml"
emu-linux-all:
name: linux
name: "linux"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-build-all-linux.yml
uses: "./.github/workflows/emu-build-all-linux.yml"

View File

@ -1,4 +1,4 @@
name: Build gen_emu_config script (Linux)
name: "Build gen_emu_config script (Linux)"
on:
workflow_call:
@ -7,7 +7,7 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
ARTIFACT_NAME: "generate_emu_config-linux-${{ github.sha }}"
@ -16,37 +16,37 @@ env:
jobs:
build:
runs-on: ubuntu-24.04
runs-on: "ubuntu-20.04"
steps:
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
# env
- name: Install env
shell: bash
# env
- name: "Install env"
shell: "bash"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
# build
- name: Rebuild
shell: bash
# build
- name: "Rebuild"
shell: "bash"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh
# upload artifact
- name: Upload build package
# upload artifact
- name: "Upload build package"
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,4 +1,4 @@
name: Build gen_emu_config script (Windows)
name: "Build gen_emu_config script (Windows)"
on:
workflow_call:
@ -7,62 +7,77 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
ARTIFACT_NAME: "generate_emu_config-win-${{ github.sha }}"
SCRIPT_BASE_DIR: "tools/generate_emu_config"
PACKAGE_BASE_DIR: "tools/generate_emu_config/bin/win"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
build:
runs-on: windows-2022
runs-on: "windows-2022"
steps:
- name: Set up Python
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
### on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
### on Windows Git will auto change line ending to CRLF, not preferable
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party deps (build/win)
## extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party deps (build/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/win'
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
# env
- name: Install env
shell: cmd
## clone this for 7za.exe
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
# download artifacts
- name: "Download emu build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: "build/win"
pattern: "emu-win-*"
merge-multiple: true
# env
- name: "Install env"
shell: "cmd"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: recreate_venv_win.bat
# build
- name: Rebuild
shell: cmd
# build
- name: "Rebuild"
shell: "cmd"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: rebuild_win.bat
# upload artifact
- name: Upload build package
# upload artifact
- name: "Upload build package"
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,22 +1,22 @@
name: Gen emu cfg PR
name: "Gen emu cfg PR"
on:
pull_request:
branches: [ "dev" ]
branches: ["dev"]
paths:
- '!**/*.md'
- 'tools/generate_emu_config/**'
- "!**/*.md"
- "tools/generate_emu_config/**"
permissions:
contents: write
contents: "write"
jobs:
script-win:
name: Gen emu config win
name: "Gen emu config win"
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-win.yml
uses: "./.github/workflows/gen_emu_config-build-win.yml"
script-linux:
name: Gen emu config linux
name: "Gen emu config linux"
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-linux.yml
uses: "./.github/workflows/gen_emu_config-build-linux.yml"

View File

@ -1,4 +1,4 @@
name: Build migrate_gse script (Linux)
name: "Build migrate_gse script (Linux)"
on:
workflow_call:
@ -7,7 +7,7 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
ARTIFACT_NAME: "migrate_gse-linux-${{ github.sha }}"
@ -16,37 +16,37 @@ env:
jobs:
build:
runs-on: ubuntu-24.04
runs-on: "ubuntu-20.04"
steps:
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
# env
- name: Install env
shell: bash
# env
- name: "Install env"
shell: "bash"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 777 recreate_venv_linux.sh && sudo ./recreate_venv_linux.sh
# build
- name: Rebuild
shell: bash
# build
- name: "Rebuild"
shell: "bash"
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: sudo chmod 777 rebuild_linux.sh && ./rebuild_linux.sh
# upload artifact
- name: Upload build package
# upload artifact
- name: "Upload build package"
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,4 +1,4 @@
name: Build migrate_gse script (Windows)
name: "Build migrate_gse script (Windows)"
on:
workflow_call:
@ -7,62 +7,77 @@ on:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
ARTIFACT_NAME: "migrate_gse-win-${{ github.sha }}"
SCRIPT_BASE_DIR: "tools/migrate_gse"
PACKAGE_BASE_DIR: "tools/migrate_gse/bin/win"
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
build:
runs-on: windows-2022
runs-on: "windows-2022"
steps:
- name: Set up Python 3.12
- name: "Set up Python 3.12"
uses: actions/setup-python@v5
with:
python-version: "3.12"
### on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
# on Windows Git will auto change line ending to CRLF, not preferable
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party deps (build/win)
# extra helpers/tools, these are not built inside the deps build dir
- name: "Clone third-party deps (build/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/build/win'
ref: "third-party/build/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win"
# env
- name: Install env
## clone this for 7za.exe
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
# download artifacts
- name: "Download emu build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: "build/win"
pattern: "emu-win-*"
merge-multiple: true
# env
- name: "Install env"
shell: cmd
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: recreate_venv_win.bat
# build
- name: Rebuild
# build
- name: "Rebuild"
shell: cmd
working-directory: "${{ env.SCRIPT_BASE_DIR }}"
run: rebuild_win.bat
# upload artifact
- name: Upload build package
# upload artifact
- name: "Upload build package"
uses: actions/upload-artifact@v4
with:
name: "${{ env.ARTIFACT_NAME }}"
path: "${{ env.PACKAGE_BASE_DIR }}/"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 1

View File

@ -1,22 +1,22 @@
name: Migrate GSE PR
name: "Migrate GSE PR"
on:
pull_request:
branches: [ "dev" ]
branches: ["dev"]
paths:
- '!**/*.md'
- 'tools/migrate_gse/**'
- "!**/*.md"
- "tools/migrate_gse/**"
permissions:
contents: write
contents: "write"
jobs:
script-win:
name: Migrate GSE win
name: "Migrate GSE win"
if: ${{ !cancelled() }}
uses: ./.github/workflows/migrate_gse-build-win.yml
uses: "./.github/workflows/migrate_gse-build-win.yml"
script-linux:
name: Migrate GSE linux
name: "Migrate GSE linux"
if: ${{ !cancelled() }}
uses: ./.github/workflows/migrate_gse-build-linux.yml
uses: "./.github/workflows/migrate_gse-build-linux.yml"

View File

@ -1,430 +1,415 @@
name: Prepare release
name: "Prepare release"
on:
push:
tags:
- release-*
- "release-*"
workflow_dispatch:
# allows manual trigger
permissions:
contents: write
contents: "write"
env:
THIRD_PARTY_BASE_DIR: 'third-party'
THIRD_PARTY_BASE_DIR: "third-party"
jobs:
emu-win-all:
name: Emu win all
name: "Emu win all"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-build-all-win.yml
uses: "./.github/workflows/emu-build-all-win.yml"
emu-win-prep:
needs: [ emu-win-all ]
runs-on: windows-2022
needs: ["emu-win-all"]
runs-on: "windows-2022"
steps:
# on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
## donwload artifacts
- name: Download emu build artifacts (Win)
# download artifacts
- name: "Download emu build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: build/win
pattern: emu-win-*-${{ github.sha }}
path: "build/win"
pattern: "emu-win-*-${{ github.sha }}"
merge-multiple: true
### print files
- name: Print files
shell: cmd
working-directory: ${{ github.workspace }}
# print files
- name: "Print files"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
dir /s /b /a:-d build\win
### remove linker files
### - name: Remove linker files
### shell: cmd
### working-directory: ${{ github.workspace }}
### run: |
### del /f /s /q build\win\*.exp,build\win\*.lib
### exit /b 0
### package (release mode)
- name: Package build (release)
shell: cmd
working-directory: ${{ github.workspace }}
# package (release mode)
- name: "Package build (release)"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: package_win.bat vs2022\release
### package (debug mode)
- name: Package build (debug)
shell: cmd
working-directory: ${{ github.workspace }}
# package (debug mode)
- name: "Package build (debug)"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: package_win.bat vs2022\debug 1
### release (debug + release modes) if this is a tag push
- name: Release
# release (debug + release modes) if this is a tag push
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "build/package/win/**/*"
### upload artifacts/packages if this is a manual run
- name: Upload release package
# upload artifacts/packages if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-emu-win-release-${{ github.sha }}"
path: "build/package/win/vs2022/*release*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 0
retention-days: 7
- name: Upload debug package
- name: "Upload debug package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-emu-win-debug-${{ github.sha }}"
path: "build/package/win/vs2022/*debug*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 0
retention-days: 7
emu-linux-all:
name: Emu linux all
name: "Emu linux all"
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-build-all-linux.yml
uses: "./.github/workflows/emu-build-all-linux.yml"
emu-linux-prep:
needs: [ emu-linux-all ]
runs-on: ubuntu-24.04
needs: ["emu-linux-all"]
runs-on: "ubuntu-20.04"
steps:
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
- name: Clone third-party deps (deps/linux)
- name: "Clone third-party deps (deps/linux)"
uses: actions/checkout@v4
with:
ref: 'third-party/deps/linux'
ref: "third-party/deps/linux"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux"
## donwload artifacts
- name: Download emu build artifacts (linux)
# download artifacts
- name: "Download emu build artifacts (linux)"
uses: actions/download-artifact@v4
with:
path: build/linux
pattern: emu-linux-*-${{ github.sha }}
path: "build/linux"
pattern: "emu-linux-*-${{ github.sha }}"
merge-multiple: true
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}" && sudo chmod 777 package_linux.sh
### print files
- name: Print files
shell: bash
working-directory: ${{ github.workspace }}
# print files
- name: "Print files"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: |
ls -la build/linux/*/*
### downlaod ubuntu packages
- name: Download required Ubuntu packages
shell: bash
working-directory: ${{ github.workspace }}
# downlaod ubuntu packages
- name: "Download required Ubuntu packages"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: |
sudo apt update || exit 1
sudo apt install tar -y || exit 1
### package (release mode)
- name: Package build (release)
shell: bash
working-directory: ${{ github.workspace }}
# package (release mode)
- name: "Package build (release)"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: ./package_linux.sh gmake2/release
### package (debug mode)
- name: Package build (debug)
shell: bash
working-directory: ${{ github.workspace }}
# package (debug mode)
- name: "Package build (debug)"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: ./package_linux.sh gmake2/debug 1
### release (debug + release modes) if this is a tag push
- name: Release
# release (debug + release modes) if this is a tag push
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "build/package/linux/**/*"
### upload artifacts/packages if this is a manual run
- name: Upload release package
# upload artifacts/packages if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-emu-linux-release-${{ github.sha }}"
path: "build/package/linux/gmake2/*release*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 0
retention-days: 7
- name: Upload debug package
- name: "Upload debug package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-emu-linux-debug-${{ github.sha }}"
path: "build/package/linux/gmake2/*debug*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 0
retention-days: 7
gen_emu_script-win:
name: Gen emu config win
needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in generate_emu_config
name: "Gen emu config win"
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-win.yml
uses: "./.github/workflows/gen_emu_config-build-win.yml"
gen_emu_script-win-prep:
needs: [ gen_emu_script-win ]
runs-on: windows-2022
needs: ["gen_emu_script-win"]
runs-on: "windows-2022"
steps:
# on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
## donwload artifacts
- name: Download script build artifacts (Win)
# download artifacts
- name: "Download script build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: tools/generate_emu_config/bin/win
pattern: generate_emu_config-win-*
path: "tools/generate_emu_config/bin/win"
pattern: "generate_emu_config-win-*"
merge-multiple: true
### package
- name: Package script
shell: cmd
# package
- name: "Package script"
shell: "cmd"
working-directory: "tools/generate_emu_config"
run: package_win.bat
# release tag
- name: Release
# release tag
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "tools/generate_emu_config/bin/package/win/**/*"
### upload artifact/package if this is a manual run
- name: Upload release package
# upload artifact/package if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-generate_emu_config-win-${{ github.sha }}"
path: "tools/generate_emu_config/bin/package/win/**/*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 7
gen_emu_script-linux:
name: Gen emu config linux
needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization)
name: "Gen emu config linux"
if: ${{ !cancelled() }}
uses: ./.github/workflows/gen_emu_config-build-linux.yml
uses: "./.github/workflows/gen_emu_config-build-linux.yml"
gen_emu_script-linux-prep:
needs: [ gen_emu_script-linux ]
runs-on: ubuntu-24.04
needs: ["gen_emu_script-linux"]
runs-on: "ubuntu-20.04"
steps:
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
## donwload artifacts
- name: Download script build artifacts (linux)
# download artifacts
- name: "Download script build artifacts (linux)"
uses: actions/download-artifact@v4
with:
path: tools/generate_emu_config/bin/linux
pattern: generate_emu_config-linux-*
path: "tools/generate_emu_config/bin/linux"
pattern: "generate_emu_config-linux-*"
merge-multiple: true
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
### package
- name: Package script
shell: bash
# package
- name: "Package script"
shell: "bash"
working-directory: "tools/generate_emu_config"
run: sudo chmod 777 package_linux.sh && sudo ./package_linux.sh
# release tag
- name: Release
# release tag
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "tools/generate_emu_config/bin/package/linux/**/*"
### upload artifact/package if this is a manual run
- name: Upload release package
# upload artifact/package if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-generate_emu_config-linux-${{ github.sha }}"
path: "tools/generate_emu_config/bin/package/linux/**/*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 7
migrate_gse_script-win:
name: Migrate GSE win
needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in migrate_gse
name: "Migrate GSE win"
if: ${{ !cancelled() }}
uses: ./.github/workflows/migrate_gse-build-win.yml
uses: "./.github/workflows/migrate_gse-build-win.yml"
migrate_gse_script-win-prep:
needs: [ migrate_gse_script-win ]
runs-on: windows-2022
needs: ["migrate_gse_script-win"]
runs-on: "windows-2022"
steps:
# on Windows Git will auto change line ending to CRLF, not preferable
- name: Ensure LF line ending
shell: cmd
working-directory: ${{ github.workspace }}
- name: "Ensure LF line ending"
shell: "cmd"
working-directory: "${{ github.workspace }}"
run: |
git config --local core.autocrlf false
git config --system core.autocrlf false
git config --global core.autocrlf false
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
- name: "Clone third-party deps (deps/win)"
uses: actions/checkout@v4
with:
ref: 'third-party/deps/win'
ref: "third-party/deps/win"
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
## donwload artifacts
- name: Download script build artifacts (Win)
# download artifacts
- name: "Download script build artifacts (Win)"
uses: actions/download-artifact@v4
with:
path: tools/migrate_gse/bin/win
pattern: migrate_gse-win-*
path: "tools/migrate_gse/bin/win"
pattern: "migrate_gse-win-*"
merge-multiple: true
### package
- name: Package script
shell: cmd
# package
- name: "Package script"
shell: "cmd"
working-directory: "tools/migrate_gse"
run: package_win.bat
# release tag
- name: Release
# release tag
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "tools/migrate_gse/bin/package/win/**/*"
### upload artifact/package if this is a manual run
- name: Upload release package
# upload artifact/package if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-migrate_gse-win-${{ github.sha }}"
path: "tools/migrate_gse/bin/package/win/**/*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 7
migrate_gse_script-linux:
needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization)
name: Migrate GSE linux
if: ${{ !cancelled() }}
uses: ./.github/workflows/migrate_gse-build-linux.yml
uses: "./.github/workflows/migrate_gse-build-linux.yml"
migrate_gse_script-linux-prep:
needs: [ migrate_gse_script-linux ]
runs-on: ubuntu-24.04
needs: ["migrate_gse_script-linux"]
runs-on: "ubuntu-20.04"
steps:
# we need branch because it has package scripts
- name: Checkout branch
- name: "Checkout branch"
uses: actions/checkout@v4
## donwload artifacts
- name: Download script build artifacts (linux)
# download artifacts
- name: "Download script build artifacts (linux)"
uses: actions/download-artifact@v4
with:
path: tools/migrate_gse/bin/linux
pattern: migrate_gse-linux-*
path: "tools/migrate_gse/bin/linux"
pattern: "migrate_gse-linux-*"
merge-multiple: true
### fix folder permissions! not sure why this fails
# fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
- name: "Give all permissions to repo folder"
shell: "bash"
working-directory: "${{ github.workspace }}"
run: sudo chmod -R 777 "${{ github.workspace }}"
### package
- name: Package script
shell: bash
# package
- name: "Package script"
shell: "bash"
working-directory: "tools/migrate_gse"
run: sudo chmod 777 package_linux.sh && sudo ./package_linux.sh
# release tag
- name: Release
# release tag
- name: "Release"
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "tools/migrate_gse/bin/package/linux/**/*"
### upload artifact/package if this is a manual run
- name: Upload release package
# upload artifact/package if this is a manual run
- name: "Upload release package"
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: "release-migrate_gse-linux-${{ github.sha }}"
path: "tools/migrate_gse/bin/package/linux/**/*"
if-no-files-found: 'error'
if-no-files-found: "error"
compression-level: 9
retention-days: 7

73
.gitignore vendored
View File

@ -1,30 +1,67 @@
/.vs/
/.vscode/
# IDE
**/.vs
**/.vscode
/build/
# PYTHON
**/.venv
**/__pycache__
/proto_gen/
# PROTOBUF
/proto_gen
/crash_printer/tests/crash_test/
/resources/win/file_dos_stub/build/
# SPECIFIC
/build
/third-party
# TOOLS
# generate_emu_config
/tools/generate_emu_config/.py*/
/tools/generate_emu_config/.venv*/
/tools/generate_emu_config/.env*/
/tools/generate_emu_config/.vscode/
/tools/generate_emu_config/backup/
/tools/generate_emu_config/bin/
/tools/generate_emu_config/bin
/tools/generate_emu_config/_DEFAULT/0/steam_api.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api.7z
/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z
/tools/generate_emu_config/_DEFAULT/0/steam_api.7z
/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll
/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe
/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe
/tools/generate_emu_config/_OUTPUT/
/tools/generate_emu_config/login_temp/
/tools/generate_emu_config/output/
/tools/generate_emu_config/**/__pycache__/
/tools/generate_emu_config/**/my_login.txt
/tools/generate_emu_config/top_owners_ids.txt
# migrate_gse
/tools/migrate_gse/.py*/
/tools/migrate_gse/.venv*/
/tools/migrate_gse/.env*/
/tools/migrate_gse/.vscode/
/tools/migrate_gse/bin/
/tools/migrate_gse/**/__pycache__/
/tools/migrate_gse/bin
/third-party/
/tools/migrate_gse/_DEFAULT/0/steam_api.dll
/tools/migrate_gse/_DEFAULT/0/steam_api.7z
/tools/migrate_gse/_DEFAULT/0/steam_api64.dll
/tools/migrate_gse/_DEFAULT/0/steam_api64.7z
/tools/migrate_gse/_DEFAULT/0/steam_api.7z
/tools/migrate_gse/_DEFAULT/0/steam_api64.dll
/tools/migrate_gse/_DEFAULT/0/steam_api64.7z
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe
/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe
/tools/migrate_gse/_OUTPUT/

1
.gitmodules vendored
View File

@ -1,4 +1,3 @@
[submodule "third-party/build/win"]
path = third-party/build/win
url = ./

View File

@ -24,6 +24,7 @@
- [libs\stb](#libsstb)
- [libs\utfcpp](#libsutfcpp)
- [tools\steamclient_loader](#toolssteamclient_loader)
- [sdk](#sdk)
### third-party\build\win\cert\openssl
@ -2547,3 +2548,9 @@ DEALINGS IN THE SOFTWARE.
https://github.com/Rat431/ColdAPI_Steam
Original version of ColdClientLoader by Rat431.
### sdk
#### INFO
https://partner.steamgames.com/doc/sdk

View File

@ -106,7 +106,7 @@ You can also find instructions here in [README.release.md](./post_build/README.r
### For Linux:
* Ubuntu 22.04 LTS: https://ubuntu.com/download/desktop
* Ubuntu 20.04 LTS: https://ubuntu.com/download/desktop
* Ubuntu required packages:
```shell
sudo apt update -y

View File

@ -21,7 +21,7 @@ set /a "BUILD_DEPS=0"
) else if "%~1" equ "--help" (
goto :help_page
) else (
1>&2 echo: invalid arg %~1
1>&2 echo:invalid arg %~1
goto :end_script_with_err
)
@ -32,15 +32,14 @@ set /a "BUILD_DEPS=0"
:: check premake
set "PREMAKE_EXE=third-party\common\win\premake\premake5.exe"
if not exist "%PREMAKE_EXE%" (
1>&2 echo: premake wasn't found
1>&2 echo:premake wasn't found
goto :end_script_with_err
)
:: build deps
if %BUILD_DEPS% equ 1 (
set "CMAKE_GENERATOR=Visual Studio 17 2022"
call "%PREMAKE_EXE%" --file="premake5-deps.lua" --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022
if !errorlevel! neq 0 (
call "%PREMAKE_EXE%" --file="premake5-deps.lua" --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022 || (
goto :end_script_with_err
)
goto :end_script
@ -49,7 +48,7 @@ set /a "BUILD_DEPS=0"
:: check vswhere
set "VSWHERE_EXE=third-party\common\win\vswhere\vswhere.exe"
if not exist "%VSWHERE_EXE%" (
1>&2 echo: vswhere wasn't found
1>&2 echo:vswhere wasn't found
goto :end_script_with_err
)
@ -59,20 +58,19 @@ set /a "BUILD_DEPS=0"
set "MSBUILD_EXE=%%~A\MSBuild\Current\Bin\MSBuild.exe"
)
if not exist "%MSBUILD_EXE%" (
1>&2 echo: MSBuild wasn't found
1>&2 echo:MSBuild wasn't found
goto :end_script_with_err
)
:: create .sln
call "%PREMAKE_EXE%" --file="premake5.lua" --genproto --dosstub --winrsrc --winsign --os=windows vs2022
if %errorlevel% neq 0 (
call "%PREMAKE_EXE%" --file="premake5.lua" --genproto --dosstub --winrsrc --winsign --os=windows vs2022 || (
goto :end_script_with_err
)
:: check .sln
set "SLN_FILE=build\project\vs2022\win\gbe.sln"
if not exist "%SLN_FILE%" (
1>&2 echo: .sln file wasn't found
1>&2 echo:.sln file wasn't found
goto :end_script_with_err
)
@ -87,9 +85,8 @@ set /a "BUILD_DEPS=0"
set "BUILD_PLATFORM=%%B"
for %%C in (%BUILD_TARGETS%) do (
set "BUILD_TARGET=%%C"
echo. & echo: building !BUILD_TARGET! !BUILD_TYPE! !BUILD_PLATFORM!
call "%MSBUILD_EXE%" /nologo -m:%MAX_THREADS% -v:n /p:Configuration=!BUILD_TYPE!,Platform=!BUILD_PLATFORM! /target:!BUILD_TARGET! "%SLN_FILE%"
if !errorlevel! neq 0 (
echo. & echo:building !BUILD_TARGET! !BUILD_TYPE! !BUILD_PLATFORM!
call "%MSBUILD_EXE%" /nologo -m:%MAX_THREADS% -v:n /p:Configuration=!BUILD_TYPE!,Platform=!BUILD_PLATFORM! /target:!BUILD_TARGET! "%SLN_FILE%" || (
goto :end_script_with_err
)
)
@ -98,20 +95,18 @@ set /a "BUILD_DEPS=0"
goto :end_script
:: exit without error
:end_script
endlocal
exit /b 0
:: exit with error
:end_script_with_err
endlocal
exit /b 1
:: show help page
:help_page
echo: "%~nx0" [switches]
echo: switches:
echo:"%~nx0" [switches]
echo:switches:
echo: --deps: rebuild third-party dependencies
echo: --help: show this page
goto :end_script

View File

@ -0,0 +1,3 @@
@echo off
call "build_win_premake.bat"

View File

@ -0,0 +1,228 @@
#include "dll/client_known_interfaces.h"
/*
the client function Steam_IsKnownInterface() accesses a structure which has this layout:
typedef struct struct_known_interfaces {
void *unknown_function_ptr;
const char *name; // ex: "STEAMAPPLIST_INTERFACE_VERSION001"
const char *family; // ex: "AppList"
struct_known_interfaces *previous_node;
};
this is a dump of the `name` field when running this function from a debugger
*/
extern const std::unordered_set<std::string> client_known_interfaces = {
"SteamAppDisableUpdate001",
"STEAMAPPLIST_INTERFACE_VERSION001",
"SteamApps001",
"STEAMAPPS_INTERFACE_VERSION001",
"STEAMAPPS_INTERFACE_VERSION002",
"STEAMAPPS_INTERFACE_VERSION003",
"STEAMAPPS_INTERFACE_VERSION004",
"STEAMAPPS_INTERFACE_VERSION005",
"STEAMAPPS_INTERFACE_VERSION006",
"STEAMAPPS_INTERFACE_VERSION007",
"STEAMAPPS_INTERFACE_VERSION008",
"STEAMAPPTICKET_INTERFACE_VERSION001",
"SteamBilling002",
"STEAMCHAT_INTERFACE_VERSION003",
"SteamController003",
"SteamController004",
"SteamController005",
"SteamController006",
"SteamController007",
"SteamController008",
"STEAMCONTROLLER_INTERFACE_VERSION",
"SteamFriends001",
"SteamFriends002",
"SteamFriends003",
"SteamFriends004",
"SteamFriends005",
"SteamFriends006",
"SteamFriends007",
"SteamFriends008",
"SteamFriends009",
"SteamFriends010",
"SteamFriends011",
"SteamFriends012",
"SteamFriends013",
"SteamFriends014",
"SteamFriends015",
"SteamFriends016",
"SteamFriends017",
"SteamGameCoordinator001",
"SteamGameServer002",
"SteamGameServer003",
"SteamGameServer004",
"SteamGameServer005",
"SteamGameServer006",
"SteamGameServer007",
"SteamGameServer008",
"SteamGameServer009",
"SteamGameServer010",
"SteamGameServer011",
"SteamGameServer012",
"SteamGameServer013",
"SteamGameServer014",
"SteamGameServer015",
"SteamGameServerStats001",
"SteamGameStats001",
"STEAMHTMLSURFACE_INTERFACE_VERSION_001",
"STEAMHTMLSURFACE_INTERFACE_VERSION_002",
"STEAMHTMLSURFACE_INTERFACE_VERSION_003",
"STEAMHTMLSURFACE_INTERFACE_VERSION_004",
"STEAMHTMLSURFACE_INTERFACE_VERSION_005",
"STEAMHTTP_INTERFACE_VERSION001",
"STEAMHTTP_INTERFACE_VERSION002",
"STEAMHTTP_INTERFACE_VERSION003",
"SteamInput001",
"SteamInput002",
"SteamInput003",
"SteamInput004",
"SteamInput005",
"SteamInput006",
"STEAMINVENTORY_INTERFACE_V001",
"STEAMINVENTORY_INTERFACE_V002",
"STEAMINVENTORY_INTERFACE_V003",
"SteamMasterServerUpdater001",
"SteamMatchGameSearch001",
"SteamMatchMaking001",
"SteamMatchMaking002",
"SteamMatchMaking003",
"SteamMatchMaking004",
"SteamMatchMaking005",
"SteamMatchMaking006",
"SteamMatchMaking007",
"SteamMatchMaking008",
"SteamMatchMaking009",
"SteamMatchMakingServers001",
"SteamMatchMakingServers002",
"STEAMMUSIC_INTERFACE_VERSION001",
"STEAMMUSICREMOTE_INTERFACE_VERSION001",
"SteamNetworking001",
"SteamNetworking002",
"SteamNetworking003",
"SteamNetworking004",
"SteamNetworking005",
"SteamNetworking006",
"SteamNetworkingMessages002",
"SteamNetworkingSockets002",
"SteamNetworkingSockets003",
"SteamNetworkingSockets004",
"SteamNetworkingSockets005",
"SteamNetworkingSockets006",
"SteamNetworkingSockets008",
"SteamNetworkingSockets009",
"SteamNetworkingSockets010",
"SteamNetworkingSockets011",
"SteamNetworkingSockets012",
"SteamNetworkingSocketsSerialized001",
"SteamNetworkingSocketsSerialized002",
"SteamNetworkingSocketsSerialized003",
"SteamNetworkingSocketsSerialized004",
"SteamNetworkingSocketsSerialized005",
"SteamNetworkingUtils001",
"SteamNetworkingUtils002",
"SteamNetworkingUtils003",
"SteamNetworkingUtils004",
"STEAMPARENTALSETTINGS_INTERFACE_VERSION001",
"SteamParties001",
"SteamParties002",
"STEAMREMOTEPLAY_INTERFACE_VERSION001",
"STEAMREMOTEPLAY_INTERFACE_VERSION002",
"STEAMREMOTESTORAGE_INTERFACE_VERSION001",
"STEAMREMOTESTORAGE_INTERFACE_VERSION002",
"STEAMREMOTESTORAGE_INTERFACE_VERSION003",
"STEAMREMOTESTORAGE_INTERFACE_VERSION004",
"STEAMREMOTESTORAGE_INTERFACE_VERSION005",
"STEAMREMOTESTORAGE_INTERFACE_VERSION006",
"STEAMREMOTESTORAGE_INTERFACE_VERSION007",
"STEAMREMOTESTORAGE_INTERFACE_VERSION008",
"STEAMREMOTESTORAGE_INTERFACE_VERSION009",
"STEAMREMOTESTORAGE_INTERFACE_VERSION010",
"STEAMREMOTESTORAGE_INTERFACE_VERSION011",
"STEAMREMOTESTORAGE_INTERFACE_VERSION012",
"STEAMREMOTESTORAGE_INTERFACE_VERSION013",
"STEAMREMOTESTORAGE_INTERFACE_VERSION014",
"STEAMREMOTESTORAGE_INTERFACE_VERSION015",
"STEAMREMOTESTORAGE_INTERFACE_VERSION016",
"STEAMSCREENSHOTS_INTERFACE_VERSION001",
"STEAMSCREENSHOTS_INTERFACE_VERSION002",
"STEAMSCREENSHOTS_INTERFACE_VERSION003",
"SteamStreamLauncher001",
"STEAMTIMELINE_INTERFACE_V001",
"STEAMTV_INTERFACE_V001",
"STEAMTV_INTERFACE_V002",
"STEAMUGC_INTERFACE_VERSION001",
"STEAMUGC_INTERFACE_VERSION002",
"STEAMUGC_INTERFACE_VERSION003",
"STEAMUGC_INTERFACE_VERSION004",
"STEAMUGC_INTERFACE_VERSION005",
"STEAMUGC_INTERFACE_VERSION006",
"STEAMUGC_INTERFACE_VERSION007",
"STEAMUGC_INTERFACE_VERSION008",
"STEAMUGC_INTERFACE_VERSION009",
"STEAMUGC_INTERFACE_VERSION010",
"STEAMUGC_INTERFACE_VERSION011",
"STEAMUGC_INTERFACE_VERSION012",
"STEAMUGC_INTERFACE_VERSION013",
"STEAMUGC_INTERFACE_VERSION014",
"STEAMUGC_INTERFACE_VERSION015",
"STEAMUGC_INTERFACE_VERSION016",
"STEAMUGC_INTERFACE_VERSION017",
"STEAMUGC_INTERFACE_VERSION018",
"STEAMUGC_INTERFACE_VERSION019",
"STEAMUGC_INTERFACE_VERSION020",
"STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001",
"SteamUser004",
"SteamUser005",
"SteamUser006",
"SteamUser007",
"SteamUser008",
"SteamUser009",
"SteamUser010",
"SteamUser011",
"SteamUser012",
"SteamUser013",
"SteamUser014",
"SteamUser015",
"SteamUser016",
"SteamUser017",
"SteamUser018",
"SteamUser019",
"SteamUser020",
"SteamUser021",
"SteamUser022",
"SteamUser023",
"STEAMUSERSTATS_INTERFACE_VERSION001",
"STEAMUSERSTATS_INTERFACE_VERSION002",
"STEAMUSERSTATS_INTERFACE_VERSION003",
"STEAMUSERSTATS_INTERFACE_VERSION004",
"STEAMUSERSTATS_INTERFACE_VERSION005",
"STEAMUSERSTATS_INTERFACE_VERSION006",
"STEAMUSERSTATS_INTERFACE_VERSION007",
"STEAMUSERSTATS_INTERFACE_VERSION008",
"STEAMUSERSTATS_INTERFACE_VERSION009",
"STEAMUSERSTATS_INTERFACE_VERSION010",
"STEAMUSERSTATS_INTERFACE_VERSION011",
"STEAMUSERSTATS_INTERFACE_VERSION012",
"SteamUtils001",
"SteamUtils002",
"SteamUtils003",
"SteamUtils004",
"SteamUtils005",
"SteamUtils006",
"SteamUtils007",
"SteamUtils008",
"SteamUtils009",
"SteamUtils010",
"STEAMVIDEO_INTERFACE_V001",
"STEAMVIDEO_INTERFACE_V002",
"STEAMVIDEO_INTERFACE_V003",
"STEAMVIDEO_INTERFACE_V004",
"STEAMVIDEO_INTERFACE_V005",
"STEAMVIDEO_INTERFACE_V006",
"STEAMVIDEO_INTERFACE_V007",
};

View File

@ -18,6 +18,7 @@
#define STEAM_API_FUNCTIONS_IMPL
#include "dll/dll.h"
#include "dll/settings_parser.h"
#include "dll/client_known_interfaces.h"
static char old_client[128] = STEAMCLIENT_INTERFACE_VERSION; //"SteamClient017";
@ -1320,7 +1321,7 @@ STEAMCLIENT_API steam_bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMs
STEAMCLIENT_API void Steam_FreeLastCallback( HSteamPipe hSteamPipe )
{
PRINT_DEBUG("Steam_FreeLastCallback %i", hSteamPipe);
PRINT_DEBUG("%i", hSteamPipe);
SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe );
}
@ -1330,7 +1331,7 @@ STEAMCLIENT_API steam_bool Steam_GetAPICallResult( HSteamPipe hSteamPipe, SteamA
return SteamAPI_ManualDispatch_GetAPICallResult(hSteamPipe, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
}
STEAMCLIENT_API void *CreateInterface( const char *pName, int *pReturnCode )
STEAMCLIENT_API void* CreateInterface( const char *pName, int *pReturnCode )
{
PRINT_DEBUG("%s %p", pName, pReturnCode);
auto ptr = create_client_interface(pName);
@ -1347,6 +1348,11 @@ STEAMCLIENT_API void Breakpad_SteamMiniDumpInit( uint32 a, const char *b, const
PRINT_DEBUG_TODO();
}
STEAMCLIENT_API void Breakpad_SteamSendMiniDump( void *a, uint32 b )
{
PRINT_DEBUG_TODO();
}
STEAMCLIENT_API void Breakpad_SteamSetAppID( uint32 unAppID )
{
PRINT_DEBUG_TODO();
@ -1369,19 +1375,19 @@ STEAMCLIENT_API void Breakpad_SteamWriteMiniDumpUsingExceptionInfoWithBuildId( i
PRINT_DEBUG(" app is writing a crash dump! [XXXXXXXXXXXXXXXXXXXXXXXXXXX]");
}
STEAMCLIENT_API bool Steam_BConnected( HSteamUser hUser, HSteamPipe hSteamPipe )
STEAMCLIENT_API steam_bool Steam_BConnected( HSteamUser hUser, HSteamPipe hSteamPipe )
{
PRINT_DEBUG_ENTRY();
return true;
}
STEAMCLIENT_API bool Steam_BLoggedOn( HSteamUser hUser, HSteamPipe hSteamPipe )
STEAMCLIENT_API steam_bool Steam_BLoggedOn( HSteamUser hUser, HSteamPipe hSteamPipe )
{
PRINT_DEBUG_ENTRY();
return true;
}
STEAMCLIENT_API bool Steam_BReleaseSteamPipe( HSteamPipe hSteamPipe )
STEAMCLIENT_API steam_bool Steam_BReleaseSteamPipe( HSteamPipe hSteamPipe )
{
PRINT_DEBUG_TODO();
return false;
@ -1411,19 +1417,19 @@ STEAMCLIENT_API HSteamPipe Steam_CreateSteamPipe()
return 0;
}
STEAMCLIENT_API bool Steam_GSBLoggedOn( void *phSteamHandle )
STEAMCLIENT_API steam_bool Steam_GSBLoggedOn( void *phSteamHandle )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSBSecure( void *phSteamHandle)
STEAMCLIENT_API steam_bool Steam_GSBSecure( void *phSteamHandle)
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSGetSteam2GetEncryptionKeyToSendToNewClient( void *phSteamHandle, void *pvEncryptionKey, uint32 *pcbEncryptionKey, uint32 cbMaxEncryptionKey )
STEAMCLIENT_API steam_bool Steam_GSGetSteam2GetEncryptionKeyToSendToNewClient( void *phSteamHandle, void *pvEncryptionKey, uint32 *pcbEncryptionKey, uint32 cbMaxEncryptionKey )
{
PRINT_DEBUG_TODO();
return false;
@ -1445,37 +1451,37 @@ STEAMCLIENT_API void Steam_GSLogOn( void *phSteamHandle )
PRINT_DEBUG_TODO();
}
STEAMCLIENT_API bool Steam_GSRemoveUserConnect( void *phSteamHandle, uint32 unUserID )
STEAMCLIENT_API steam_bool Steam_GSRemoveUserConnect( void *phSteamHandle, uint32 unUserID )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSSendSteam2UserConnect( void *phSteamHandle, uint32 unUserID, const void *pvRawKey, uint32 unKeyLen, uint32 unIPPublic, uint16 usPort, const void *pvCookie, uint32 cubCookie )
STEAMCLIENT_API steam_bool Steam_GSSendSteam2UserConnect( void *phSteamHandle, uint32 unUserID, const void *pvRawKey, uint32 unKeyLen, uint32 unIPPublic, uint16 usPort, const void *pvCookie, uint32 cubCookie )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSSendSteam3UserConnect( void *phSteamHandle, uint64 steamID, uint32 unIPPublic, const void *pvCookie, uint32 cubCookie )
STEAMCLIENT_API steam_bool Steam_GSSendSteam3UserConnect( void *phSteamHandle, uint64 steamID, uint32 unIPPublic, const void *pvCookie, uint32 cubCookie )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSSendUserDisconnect( void *phSteamHandle, uint64 ulSteamID, uint32 unUserID )
STEAMCLIENT_API steam_bool Steam_GSSendUserDisconnect( void *phSteamHandle, uint64 ulSteamID, uint32 unUserID )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSSendUserStatusResponse( void *phSteamHandle, uint64 ulSteamID, int nSecondsConnected, int nSecondsSinceLast )
STEAMCLIENT_API steam_bool Steam_GSSendUserStatusResponse( void *phSteamHandle, uint64 ulSteamID, int nSecondsConnected, int nSecondsSinceLast )
{
PRINT_DEBUG_TODO();
return false;
}
STEAMCLIENT_API bool Steam_GSSetServerType( void *phSteamHandle, int32 nAppIdServed, uint32 unServerFlags, uint32 unGameIP, uint32 unGamePort, const char *pchGameDir, const char *pchVersion )
STEAMCLIENT_API steam_bool Steam_GSSetServerType( void *phSteamHandle, int32 nAppIdServed, uint32 unServerFlags, uint32 unGameIP, uint32 unGamePort, const char *pchGameDir, const char *pchVersion )
{
PRINT_DEBUG_TODO();
return false;
@ -1486,7 +1492,7 @@ STEAMCLIENT_API void Steam_GSSetSpawnCount( void *phSteamHandle, uint32 ucSpawn
PRINT_DEBUG_TODO();
}
STEAMCLIENT_API bool Steam_GSUpdateStatus( void *phSteamHandle, int cPlayers, int cPlayersMax, int cBotPlayers, const char *pchServerName, const char *pchMapName )
STEAMCLIENT_API steam_bool Steam_GSUpdateStatus( void *phSteamHandle, int cPlayers, int cPlayersMax, int cBotPlayers, const char *pchServerName, const char *pchMapName )
{
PRINT_DEBUG_TODO();
return false;
@ -1495,7 +1501,7 @@ STEAMCLIENT_API bool Steam_GSUpdateStatus( void *phSteamHandle, int cPlayers, in
STEAMCLIENT_API void* Steam_GetGSHandle( HSteamUser hUser, HSteamPipe hSteamPipe )
{
PRINT_DEBUG_TODO();
return NULL;
return nullptr;
}
STEAMCLIENT_API int Steam_InitiateGameConnection( HSteamUser hUser, HSteamPipe hSteamPipe, void *pBlob, int cbMaxBlob, uint64 steamID, int nGameAppID, uint32 unIPServer, uint16 usPortServer, bool bSecure )
@ -1504,6 +1510,24 @@ STEAMCLIENT_API int Steam_InitiateGameConnection( HSteamUser hUser, HSteamPipe h
return 0;
}
// https://github.com/ValveSoftware/Proton/blob/962bbc4e74dde0643a6edab7c845bc628601f23f/lsteamclient/steamclient_main.c#L579-L586
STEAMCLIENT_API steam_bool Steam_IsKnownInterface( const char *pchVersion )
{
PRINT_DEBUG("'%s'", pchVersion);
// real client doesn't validate if the arg was null
if (!pchVersion) return false;
bool found = client_known_interfaces.count(pchVersion);
PRINT_DEBUG(" result=%i", (int)found);
if (!found) {
get_steam_client()->report_missing_impl(pchVersion, EMU_FUNC_NAME);
}
return found;
}
STEAMCLIENT_API void Steam_LogOff( HSteamUser hUser, HSteamPipe hSteamPipe )
{
PRINT_DEBUG_TODO();
@ -1514,6 +1538,13 @@ STEAMCLIENT_API void Steam_LogOn( HSteamUser hUser, HSteamPipe hSteamPipe, uint6
PRINT_DEBUG_TODO();
}
// https://github.com/ValveSoftware/Proton/blob/962bbc4e74dde0643a6edab7c845bc628601f23f/lsteamclient/steamclient_main.c#L588-L594
STEAMCLIENT_API void Steam_NotifyMissingInterface(HSteamPipe hSteamPipe, const char *pchVersion )
{
PRINT_DEBUG("XXXXXXXXXXXXX '%s' %i", pchVersion, hSteamPipe);
get_steam_client()->report_missing_impl(pchVersion, EMU_FUNC_NAME);
}
STEAMCLIENT_API void Steam_ReleaseThreadLocalMemory(bool thread_exit)
{
PRINT_DEBUG_TODO();

View File

@ -0,0 +1,9 @@
#ifndef _CLIENT_KNOWN_INTERFACES_H_
#define _CLIENT_KNOWN_INTERFACES_H_
#include <unordered_set>
#include <string>
extern const std::unordered_set<std::string> client_known_interfaces;
#endif // _CLIENT_KNOWN_INTERFACES_H_

View File

@ -216,6 +216,7 @@ private:
public:
constexpr const static int INVALID_IMAGE_HANDLE = 0;
constexpr const static int UNLOADED_IMAGE_HANDLE = -1;
//Depots
std::vector<DepotId_t> depots{};
@ -258,8 +259,12 @@ public:
// the stat itself is always saved regardless of that flag, only affects the achievement progress
bool save_only_higher_stat_achievement_progress = true;
// the emulator loads the achievements icons is memory mainly for `ISteamUserStats::GetAchievementIcon()`
// true means load icons lazily when they are requested, otherwise load icons as soon as the interface ISteamUserStats is initialized
bool lazy_load_achievements_icons = true;
// this defines how many icons to load each iteration when the periodic callback in `Steam_User_Stats` is triggered
// or when the app calls `SteamAPI_RunCallbacks()`
// -1 == functionality disabled
// 0 == load icons only when they're requested
// >0 == load icons in the background as mentioned above
int paginated_achievements_icons = 10;
// bypass to make SetAchievement() always return true, prevent some games from breaking
bool achievement_bypass = false;
@ -314,6 +319,8 @@ public:
bool overlay_warn_local_save = false;
//disable overlay warning for local save
bool disable_overlay_warning_local_save = false;
// should the overlay upload icons to the GPU and display them
bool overlay_upload_achs_icons_to_gpu = true;
//disable overlay warning for bad app ID (= 0)
bool disable_overlay_warning_bad_appid = false;
// disable all overlay warnings
@ -354,6 +361,7 @@ public:
CSteamID get_lobby();
bool is_offline();
void set_offline(bool offline);
uint16 get_port();
void set_port(uint16 port);

View File

@ -0,0 +1,47 @@
/* Copyright (C) 2019 Mr Goldberg
This file is part of the Goldberg Emulator
The Goldberg Emulator is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
The Goldberg Emulator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the Goldberg Emulator; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef __INCLUDED_STEAM_APP_DISABLE_UPDATE_H__
#define __INCLUDED_STEAM_APP_DISABLE_UPDATE_H__
#include "base.h"
class Steam_App_Disable_Update:
public ISteamAppDisableUpdate
{
class Settings *settings{};
class Networking *network{};
class SteamCallResults *callback_results{};
class SteamCallBacks *callbacks{};
class RunEveryRunCB *run_every_runcb{};
static void steam_network_callback(void *object, Common_Message *msg);
static void steam_run_every_runcb(void *object);
void steam_run_callback();
void network_callback(Common_Message *msg);
public:
Steam_App_Disable_Update(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb);
~Steam_App_Disable_Update();
// probably means how many seconds to keep the updates disabled
void SetAppUpdateDisabledSecondsRemaining(int32 nSeconds);
};
#endif // __INCLUDED_STEAM_APP_DISABLE_UPDATE_H__

View File

@ -56,6 +56,7 @@
#include "steam_gameserverstats.h"
#include "steam_gamestats.h"
#include "steam_timeline.h"
#include "steam_app_disable_update.h"
#include "steam_masterserver_updater.h"
#include "overlay/steam_overlay.h"
@ -140,6 +141,7 @@ public:
Steam_TV *steam_tv{};
Steam_GameStats *steam_gamestats{};
Steam_Timeline *steam_timeline{};
Steam_App_Disable_Update *steam_app_disable_update{};
Steam_GameServer *steam_gameserver{};
Steam_Utils *steam_gameserver_utils{};
@ -243,6 +245,9 @@ public:
// steam timeline
ISteamTimeline *GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// steam appp disable update
ISteamAppDisableUpdate *GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
STEAM_PRIVATE_API( void RunFrame() );
@ -338,6 +343,7 @@ public:
void DestroyAllInterfaces();
void report_missing_impl(std::string_view itf, std::string_view caller);
[[noreturn]] void report_missing_impl_and_exit(std::string_view itf, std::string_view caller);
};

View File

@ -490,9 +490,6 @@ public:
/// - k_EResultInvalidParam - nLanes is bad
EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus, int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes );
// based on reversing the vftable returned from original steamclient64.dll
bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus );
/// Fetch the next available message(s) from the socket, if any.
/// Returns the number of messages returned into your array, up to nMaxMessages.
/// If the connection handle is invalid, -1 is returned.

View File

@ -22,6 +22,11 @@
#include "auth.h"
class Steam_User :
public ISteamUser004,
public ISteamUser005,
public ISteamUser006,
public ISteamUser007,
public ISteamUser008,
public ISteamUser009,
public ISteamUser010,
public ISteamUser011,
@ -48,6 +53,8 @@ public ISteamUser
std::chrono::high_resolution_clock::time_point last_get_voice{};
std::string encrypted_app_ticket{};
Auth_Manager *auth_manager{};
std::map<std::string, std::string> registry{};
std::string registry_nullptr{};
public:
Steam_User(Settings *settings, Local_Storage *local_storage, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks);
@ -57,15 +64,41 @@ public:
// this is only used internally by the API, and by a few select interfaces that support multi-user
HSteamUser GetHSteamUser();
void LogOn( CSteamID steamID );
void LogOff();
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
bool BLoggedOn();
ELogonState GetLogonState();
bool BConnected();
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
CSteamID GetSteamID();
bool IsVACBanned( int nGameID );
bool RequireShowVACBannedMessage( int nGameID );
void AcknowledgeVACBanning( int nGameID );
// These are dead.
int NClientGameIDAdd( int nGameID );
void RemoveClientGame( int nClientGameID );
void SetClientGameServer( int nClientGameID, uint32 unIPServer, uint16 usPortServer );
void SetSteam2Ticket( uint8 *pubTicket, int cubTicket );
void AddServerNetAddress( uint32 unIP, uint16 unPort );
bool SetEmail( const char *pchEmail );
// logon cookie - this is obsolete and never used
int GetSteamGameConnectToken( void *pBlob, int cbMaxBlob );
bool SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue );
bool GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue );
bool SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue );
bool GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue );
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
@ -86,15 +119,40 @@ public:
int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure );
int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure, void *pvSteam2GetEncryptionKey, int cbSteam2GetEncryptionKey );
int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, int nGameAppID, uint32 unIPServer, uint16 usPortServer, bool bSecure );
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer );
// Legacy functions
void SetSelfAsPrimaryChatDestination();
bool IsPrimaryChatDestination();
void RequestLegacyCDKey( uint32 nAppID );
bool SendGuestPassByEmail( const char *pchEmailAccount, GID_t gidGuestPassID, bool bResending );
bool SendGuestPassByAccountID( uint32 uAccountID, GID_t gidGuestPassID, bool bResending );
bool AckGuestPass(const char *pchGuestPassCode);
bool RedeemGuestPass(const char *pchGuestPassCode);
uint32 GetGuestPassToGiveCount();
uint32 GetGuestPassToRedeemCount();
RTime32 GetGuestPassLastUpdateTime();
bool GetGuestPassToGiveInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed, char *pchRecipientAddress, int cRecipientAddressSize );
bool GetGuestPassToRedeemInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed);
bool GetGuestPassToRedeemSenderAddress( uint32 nPassIndex, char* pchSenderAddress, int cSenderAddressSize );
bool GetGuestPassToRedeemSenderName( uint32 nPassIndex, char* pchSenderName, int cSenderNameSize );
void AcknowledgeMessageByGID( const char *pchMessageGID );
bool SetLanguage( const char *pchLanguage );
// used by only a few games to track usage events
void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo);
void SetAccountName( const char *pchAccountName );
void SetPassword( const char *pchPassword );
void SetAccountCreationTime( RTime32 rt );
void RefreshSteam2Login();
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.

View File

@ -70,8 +70,7 @@ public ISteamUserStats011,
public ISteamUserStats
{
public:
static constexpr auto achievements_user_file = "achievements.json";
static constexpr int UNLOADED_ACH_ICON = -1;
static constexpr const auto achievements_user_file = "achievements.json";
private:
template<typename T>
@ -95,7 +94,7 @@ private:
nlohmann::json defined_achievements{};
nlohmann::json user_achievements{};
std::vector<std::string> sorted_achievement_names{};
bool achievements_icons_loaded = false;
size_t last_loaded_ach_icon{};
std::map<std::string, int32> stats_cache_int{};
std::map<std::string, float> stats_cache_float{};
@ -213,7 +212,7 @@ public:
// specified achievement.
int GetAchievementIcon( const char *pchName );
int get_achievement_icon_handle( const std::string &ach_name, bool pbAchieved );
int get_achievement_icon_handle( const std::string &ach_name, bool pbAchieved, bool force_load = false );
std::string get_achievement_icon_name( const char *pchName, bool achieved );

View File

@ -25,6 +25,7 @@
class Steam_Utils :
public ISteamUtils001,
public ISteamUtils002,
public ISteamUtils003,
public ISteamUtils004,

View File

@ -17,14 +17,17 @@
#include "dll/local_storage.h"
#if defined(__WINDOWS__)
// NOTE: stb_image_write
#define STBIW_WINDOWS_UTF8
// NOTE: stb_image
#define STBI_WINDOWS_UTF8
#endif
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_STATIC
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#if defined(__WINDOWS__)
#define STBI_WINDOWS_UTF8
#define STBIW_WINDOWS_UTF8
#endif
#include "stb/stb_image.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
@ -32,6 +35,7 @@
#include "stb/stb_image_write.h"
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#define STB_IMAGE_RESIZE_STATIC
#include "stb/stb_image_resize2.h"
struct File_Data {
@ -578,7 +582,7 @@ int Local_Storage::store_file_data(std::string folder, std::string file, const c
myfile.open(std::filesystem::u8path(folder + file), std::ios::binary | std::ios::out);
if (!myfile.is_open()) return -1;
myfile.write(data, length);
int position = myfile.tellp();
int position = static_cast<int>(myfile.tellp());
myfile.close();
return position;
}
@ -666,7 +670,8 @@ int Local_Storage::get_file_data(const std::string &full_path, char *data, unsig
myfile.read (data, max_length);
myfile.close();
reset_LastError();
return myfile.gcount();
return static_cast<int>(myfile.gcount());
}
int Local_Storage::get_data(std::string folder, std::string file, char *data, unsigned int max_length, unsigned int offset)
@ -700,7 +705,7 @@ int Local_Storage::count_files(std::string folder)
folder.append(PATH_SEPARATOR);
}
return get_filenames_recursive(save_directory + appid + folder).size();
return static_cast<int>(get_filenames_recursive(save_directory + appid + folder).size());
}
bool Local_Storage::file_exists(std::string folder, std::string file)
@ -812,7 +817,8 @@ bool Local_Storage::load_json(const std::string &full_path, nlohmann::json& json
PRINT_DEBUG("Loaded json '%s' (%zu items)", full_path.c_str(), json.size());
return true;
} catch (const std::exception& e) {
PRINT_DEBUG("Error while parsing '%s' json error: %s", full_path.c_str(), e.what());
const char *errorMessage = e.what();
PRINT_DEBUG("Error while parsing '%s' json error: %s", full_path.c_str(), errorMessage);
}
} else {
PRINT_DEBUG("Couldn't open file '%s' to read json", full_path.c_str());

View File

@ -110,7 +110,7 @@ static void get_broadcast_info(uint16 port)
number_broadcasts++;
if (number_broadcasts >= MAX_BROADCASTS) {
return;
break;
}
}
@ -542,6 +542,8 @@ std::set<IP_PORT> Networking::resolve_ip(std::string dns)
}
}
if (result)
freeaddrinfo(result);
return ips;
}

View File

@ -161,6 +161,11 @@ bool Settings::is_offline()
return offline;
}
void Settings::set_offline(bool offline)
{
this->offline = offline;
}
uint16 Settings::get_port()
{
return port;
@ -375,7 +380,7 @@ int Settings::add_image(const std::string &data, uint32 width, uint32 height)
Image_Data* Settings::get_image(int handle)
{
if (INVALID_IMAGE_HANDLE == handle) {
if (INVALID_IMAGE_HANDLE == handle || UNLOADED_IMAGE_HANDLE == handle) {
return nullptr;
}

View File

@ -1053,7 +1053,8 @@ static void try_parse_mods_file(class Settings *settings_client, Settings *setti
PRINT_DEBUG(" workshop_item_url: '%s'", newMod.workshopItemURL.c_str());
PRINT_DEBUG(" preview_url: '%s'", newMod.previewURL.c_str());
} catch (std::exception& e) {
PRINT_DEBUG("MODLOADER ERROR: %s", e.what());
const char *errorMessage = e.what();
PRINT_DEBUG("MODLOADER ERROR: %s", errorMessage);
}
}
}
@ -1206,6 +1207,10 @@ static bool parse_branches_file(
return false;
}
// app::general::is_beta_branch
settings_client->is_beta_branch = ini.GetBoolValue("app::general", "is_beta_branch", settings_client->is_beta_branch);
settings_server->is_beta_branch = ini.GetBoolValue("app::general", "is_beta_branch", settings_server->is_beta_branch);
// app::general::branch_name
std::string selected_branch = common_helpers::string_strip(ini.GetValue("app::general", "branch_name", ""));
if (selected_branch.empty()) {
@ -1343,6 +1348,9 @@ static void parse_overlay_general_config(class Settings *settings_client, class
settings_client->disable_overlay_warning_local_save = ini.GetBoolValue("overlay::general", "disable_warning_local_save", settings_client->disable_overlay_warning_local_save);
settings_server->disable_overlay_warning_local_save = ini.GetBoolValue("overlay::general", "disable_warning_local_save", settings_server->disable_overlay_warning_local_save);
settings_client->overlay_upload_achs_icons_to_gpu = ini.GetBoolValue("overlay::general", "upload_achievements_icons_to_gpu", settings_client->overlay_upload_achs_icons_to_gpu);
settings_server->overlay_upload_achs_icons_to_gpu = ini.GetBoolValue("overlay::general", "upload_achievements_icons_to_gpu", settings_server->overlay_upload_achs_icons_to_gpu);
}
// main::misc::steam_game_stats_reports_dir
@ -1372,9 +1380,6 @@ static void parse_simple_features(class Settings *settings_client, class Setting
settings_client->disable_account_avatar = !ini.GetBoolValue("main::general", "enable_account_avatar", !settings_client->disable_account_avatar);
settings_server->disable_account_avatar = !ini.GetBoolValue("main::general", "enable_account_avatar", !settings_server->disable_account_avatar);
settings_client->is_beta_branch = ini.GetBoolValue("main::general", "is_beta_branch", settings_client->is_beta_branch);
settings_server->is_beta_branch = ini.GetBoolValue("main::general", "is_beta_branch", settings_server->is_beta_branch);
settings_client->steam_deck = ini.GetBoolValue("main::general", "steam_deck", settings_client->steam_deck);
settings_server->steam_deck = ini.GetBoolValue("main::general", "steam_deck", settings_server->steam_deck);
@ -1437,8 +1442,13 @@ static void parse_stats_features(class Settings *settings_client, class Settings
settings_client->save_only_higher_stat_achievement_progress = ini.GetBoolValue("main::stats", "save_only_higher_stat_achievement_progress", settings_client->save_only_higher_stat_achievement_progress);
settings_server->save_only_higher_stat_achievement_progress = ini.GetBoolValue("main::stats", "save_only_higher_stat_achievement_progress", settings_server->save_only_higher_stat_achievement_progress);
settings_client->lazy_load_achievements_icons = ini.GetBoolValue("main::stats", "lazy_load_achievements_icons", settings_client->lazy_load_achievements_icons);
settings_server->lazy_load_achievements_icons = ini.GetBoolValue("main::stats", "lazy_load_achievements_icons", settings_server->lazy_load_achievements_icons);
{
long val_client = ini.GetLongValue("main::stats", "paginated_achievements_icons", settings_client->paginated_achievements_icons);
settings_client->paginated_achievements_icons = static_cast<int>(val_client);
long val_server = ini.GetLongValue("main::stats", "paginated_achievements_icons", settings_server->paginated_achievements_icons);
settings_server->paginated_achievements_icons = static_cast<int>(val_server);
}
}

View File

@ -0,0 +1,88 @@
/* Copyright (C) 2019 Mr Goldberg
This file is part of the Goldberg Emulator
The Goldberg Emulator is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
The Goldberg Emulator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the Goldberg Emulator; if not, see
<http://www.gnu.org/licenses/>. */
#include "dll/steam_app_disable_update.h"
void Steam_App_Disable_Update::steam_run_every_runcb(void *object)
{
// PRINT_DEBUG_ENTRY();
auto inst = (Steam_App_Disable_Update *)object;
inst->steam_run_callback();
}
void Steam_App_Disable_Update::steam_network_callback(void *object, Common_Message *msg)
{
// PRINT_DEBUG_ENTRY();
auto inst = (Steam_App_Disable_Update *)object;
inst->network_callback(msg);
}
Steam_App_Disable_Update::Steam_App_Disable_Update(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb)
{
this->settings = settings;
this->network = network;
this->callback_results = callback_results;
this->callbacks = callbacks;
this->run_every_runcb = run_every_runcb;
// this->network->setCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_App_Disable_Update::steam_network_callback, this);
// this->run_every_runcb->add(&Steam_App_Disable_Update::steam_run_every_runcb, this);
}
Steam_App_Disable_Update::~Steam_App_Disable_Update()
{
// this->network->rmCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_App_Disable_Update::steam_network_callback, this);
// this->run_every_runcb->remove(&Steam_App_Disable_Update::steam_run_every_runcb, this);
}
void Steam_App_Disable_Update::SetAppUpdateDisabledSecondsRemaining(int32 nSeconds)
{
PRINT_DEBUG_TODO();
std::lock_guard lock(global_mutex);
}
void Steam_App_Disable_Update::steam_run_callback()
{
}
void Steam_App_Disable_Update::network_callback(Common_Message *msg)
{
if (msg->has_low_level()) {
if (msg->low_level().type() == Low_Level::CONNECT) {
}
if (msg->low_level().type() == Low_Level::DISCONNECT) {
}
}
if (msg->has_networking_sockets()) {
}
}

View File

@ -3,7 +3,7 @@
// https://developer.valvesoftware.com/wiki/Steam_Application_IDs
// https://developer.valvesoftware.com/wiki/Dedicated_Servers_List
// they're not really accurate
const std::map<uint32, std::string> steam_preowned_app_ids = {
extern const std::map<uint32, std::string> steam_preowned_app_ids = {
// { 0, "Base Goldsource Shared Binaries" },
// { 1, "Base Goldsource Shared Content" },

View File

@ -84,8 +84,12 @@ bool Steam_Apps::BIsSubscribedApp( AppId_t appID )
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (appID == 0) return false; // steam returns false
if (appID == UINT32_MAX) return true; // steam returns true
if (appID == settings->get_local_game_id().AppID()) return true; // steam returns true
return settings->hasDLC(appID);
if (appID == settings->get_local_game_id().AppID() || settings->hasDLC(appID)) return true; // steam returns true
for (auto &d : settings->depots) {
if (d == appID)
return true;
}
return false;
}
@ -112,12 +116,16 @@ uint32 Steam_Apps::GetEarliestPurchaseUnixTime( AppId_t nAppID )
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (nAppID == 0) return 0; // steam returns 0
if (nAppID == UINT32_MAX) return 0; // steam returns 0
if (nAppID == settings->get_local_game_id().AppID() || settings->hasDLC(nAppID)) {
auto t =
// 4 days ago
startup_time
- std::chrono::hours(24 * 4);
auto duration = std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch());
if (nAppID == settings->get_local_game_id().AppID() || settings->hasDLC(nAppID)) {
return (uint32)duration.count();
}
for (auto &d : settings->depots) {
if (d == nAppID)
return (uint32)duration.count();
}

View File

@ -124,6 +124,7 @@ Steam_Client::Steam_Client()
steam_tv = new Steam_TV(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_gamestats = new Steam_GameStats(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_timeline = new Steam_Timeline(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_app_disable_update = new Steam_App_Disable_Update(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
// server
PRINT_DEBUG("init gameserver");
@ -205,6 +206,7 @@ Steam_Client::~Steam_Client()
DEL_INST(steam_tv);
DEL_INST(steam_gamestats);
DEL_INST(steam_timeline);
DEL_INST(steam_app_disable_update);
DEL_INST(steam_utils);
DEL_INST(steam_friends);

View File

@ -18,6 +18,19 @@
#include "dll/steam_client.h"
// retrieves the ISteamAppDisableUpdate interface associated with the handle
ISteamAppDisableUpdate *Steam_Client::GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{
PRINT_DEBUG("%s", pchVersion);
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return nullptr;
if (strcmp(pchVersion, STEAMAPPDISABLEUPDATE_INTERFACE_VERSION) == 0) {
return reinterpret_cast<ISteamAppDisableUpdate *>(static_cast<ISteamAppDisableUpdate *>(steam_app_disable_update));
}
report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME);
}
// retrieves the ISteamTimeline interface associated with the handle
ISteamTimeline *Steam_Client::GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{
@ -58,7 +71,17 @@ ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hStea
PRINT_DEBUG("%s", pchVersion);
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL;
if (strcmp(pchVersion, "SteamUser009") == 0) {
if (strcmp(pchVersion, "SteamUser004") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser004 *>(steam_user)); // sdk 0.99u
} else if (strcmp(pchVersion, "SteamUser005") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser005 *>(steam_user)); // sdk 0.99v
} else if (strcmp(pchVersion, "SteamUser006") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser006 *>(steam_user)); // sdk 0.99w
} else if (strcmp(pchVersion, "SteamUser007") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser007 *>(steam_user)); // sdk 0.99x
} else if (strcmp(pchVersion, "SteamUser008") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser008 *>(steam_user)); // sdk 0.99y
} else if (strcmp(pchVersion, "SteamUser009") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser009 *>(steam_user));
} else if (strcmp(pchVersion, "SteamUser010") == 0) {
return reinterpret_cast<ISteamUser *>(static_cast<ISteamUser010 *>(steam_user));
@ -186,7 +209,10 @@ ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pc
steam_utils_temp = steam_utils;
}
if (strcmp(pchVersion, "SteamUtils002") == 0) {
if (strcmp(pchVersion, "SteamUtils001") == 0) {
return reinterpret_cast<ISteamUtils *>(static_cast<ISteamUtils001 *>(steam_utils_temp));
} else if (strcmp(pchVersion, "SteamUtils002") == 0) {
return reinterpret_cast<ISteamUtils *>(static_cast<ISteamUtils002 *>(steam_utils_temp));
} else if (strcmp(pchVersion, "SteamUtils003") == 0) {
return reinterpret_cast<ISteamUtils *>(static_cast<ISteamUtils003 *>(steam_utils_temp)); // ISteamUtils003 Not found in public Archive, must be between 1.02-1.03
@ -422,6 +448,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
return GetAppTicket(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "STEAMTIMELINE_INTERFACE") == pchVersion) {
return GetISteamTimeline(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "SteamAppDisableUpdate") == pchVersion) {
return GetISteamAppDisableUpdate(hSteamUser, hSteamPipe, pchVersion);
}
PRINT_DEBUG("No interface: %s", pchVersion);
@ -725,6 +753,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
return reinterpret_cast<ISteamUGC *>(static_cast<ISteamUGC017 *>(steam_ugc_temp));
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION018") == 0) {
return reinterpret_cast<ISteamUGC *>(static_cast<ISteamUGC018 *>(steam_ugc_temp));
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION019") == 0) {
return reinterpret_cast<ISteamUGC *>(static_cast<ISteamUGC *>(steam_ugc_temp));
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
return reinterpret_cast<ISteamUGC *>(static_cast<ISteamUGC *>(steam_ugc_temp));
}
@ -938,7 +968,7 @@ ISteamAppTicket *Steam_Client::GetAppTicket( HSteamUser hSteamUser, HSteamPipe h
report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME);
}
void Steam_Client::report_missing_impl_and_exit(std::string_view itf, std::string_view caller)
void Steam_Client::report_missing_impl(std::string_view itf, std::string_view caller)
{
PRINT_DEBUG("'%s' '%s'", itf.data(), caller.data());
std::lock_guard lck(global_mutex);
@ -947,18 +977,27 @@ void Steam_Client::report_missing_impl_and_exit(std::string_view itf, std::strin
try {
ss << "INTERFACE=" << itf << "\n";
ss << "CALLER FN=" << caller << "\n";
}
catch(...) { }
try {
if (settings_client) {
ss << "APPID=" << settings_client->get_local_game_id().AppID() << "\n";
}
}
catch(...) { }
try {
std::string time(common_helpers::get_utc_time());
if (time.size()) {
ss << "TIME=" << time << "\n";
}
ss << "--------------------\n" << std::endl;
}
catch(...) { }
try {
std::ofstream report(std::filesystem::u8path(get_full_program_path() + "EMU_MISSING_INTERFACE.txt"), std::ios::out | std::ios::app);
if (report.is_open()) {
report << ss.str();
@ -969,6 +1008,10 @@ void Steam_Client::report_missing_impl_and_exit(std::string_view itf, std::strin
#if defined(__WINDOWS__)
MessageBoxA(nullptr, ss.str().c_str(), "Missing interface", MB_OK);
#endif
}
void Steam_Client::report_missing_impl_and_exit(std::string_view itf, std::string_view caller)
{
report_missing_impl(itf, caller);
std::exit(0x4155149); // MISSING :)
}

View File

@ -1384,7 +1384,7 @@ void Steam_Matchmaking::RunCallbacks()
PRINT_DEBUG("Lobby " "%" PRIu64 " use %u", l.room_id(), use);
if (use) PUSH_BACK_IF_NOT_IN(filtered_lobbies, (uint64)l.room_id());
if (filtered_lobbies.size() >= filter_max_results_copy) {
if (filtered_lobbies.size() >= static_cast<size_t>(filter_max_results_copy)) {
PRINT_DEBUG("returning lobby search results, count=%zu", filtered_lobbies.size());
searching = false;
LobbyMatchList_t data{};

View File

@ -950,24 +950,6 @@ EResult Steam_Networking_Sockets::GetConnectionRealTimeStatus( HSteamNetConnecti
return k_EResultOK;
}
// based on reversing the vftable returned from original steamclient64.dll
bool Steam_Networking_Sockets::GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus )
{
PRINT_DEBUG("undocumented API, interface v10-11");
/*
...
xor r9d, r9d // int nLanes = 0
mov qword ptr ss:[rsp+0x20], 0x0 // SteamNetConnectionRealTimeLaneStatus_t *pLanes = nullptr
...
call qword ptr ds:[rax+0x80] // call GetConnectionRealTimeStatus(hConn, pStatus, nLanes, pLanes)
test eax, eax
setne al if (eax !=0) { al=1 } else { al=0 }
...
ret
*/
return GetConnectionRealTimeStatus(hConn, pStatus, 0, nullptr) != EResult::k_EResultNone;
}
/// Fetch the next available message(s) from the socket, if any.
/// Returns the number of messages returned into your array, up to nMaxMessages.
/// If the connection handle is invalid, -1 is returned.
@ -1022,10 +1004,19 @@ bool Steam_Networking_Sockets::GetConnectionInfo( HSteamNetConnection hConn, Ste
bool Steam_Networking_Sockets::GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats )
{
PRINT_DEBUG_ENTRY();
if (!pStats)
return false;
return GetConnectionRealTimeStatus(hConn, pStats, 0, NULL) == k_EResultOK;
// based on reversing the vftable returned from original steamclient64.dll
/*
...
xor r9d, r9d // int nLanes = 0
mov qword ptr ss:[rsp+0x20], 0x0 // SteamNetConnectionRealTimeLaneStatus_t *pLanes = nullptr
...
call qword ptr ds:[rax+0x80] // call GetConnectionRealTimeStatus(hConn, pStatus, nLanes, pLanes)
test eax, eax
setne al if (eax !=0) { al=1 } else { al=0 }
...
ret
*/
return GetConnectionRealTimeStatus(hConn, pStats, 0, NULL) != k_EResultNone;
}

View File

@ -44,6 +44,18 @@ HSteamUser Steam_User::GetHSteamUser()
return CLIENT_HSTEAMUSER;
}
void Steam_User::LogOn( CSteamID steamID )
{
PRINT_DEBUG_ENTRY();
settings->set_offline(false);
}
void Steam_User::LogOff()
{
PRINT_DEBUG_ENTRY();
settings->set_offline(true);
}
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
@ -53,6 +65,21 @@ bool Steam_User::BLoggedOn()
return !settings->is_offline();
}
ELogonState Steam_User::GetLogonState()
{
PRINT_DEBUG_ENTRY();
if(settings->is_offline())
return (ELogonState)0;
else
return (ELogonState)4; // tested on real steam, undocumented return value
}
bool Steam_User::BConnected()
{
PRINT_DEBUG_ENTRY();
return !settings->is_offline();
}
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
CSteamID Steam_User::GetSteamID()
@ -63,6 +90,160 @@ CSteamID Steam_User::GetSteamID()
return id;
}
bool Steam_User::IsVACBanned( int nGameID )
{
PRINT_DEBUG_ENTRY();
return false;
}
bool Steam_User::RequireShowVACBannedMessage( int nGameID )
{
PRINT_DEBUG_ENTRY();
return false;
}
void Steam_User::AcknowledgeVACBanning( int nGameID )
{
PRINT_DEBUG_ENTRY();
}
// according to comments in sdk, "these are dead."
int Steam_User::NClientGameIDAdd( int nGameID )
{
PRINT_DEBUG_ENTRY();
return 0;
}
// according to comments in sdk, "these are dead."
void Steam_User::RemoveClientGame( int nClientGameID )
{
PRINT_DEBUG_ENTRY();
}
// according to comments in sdk, "these are dead."
void Steam_User::SetClientGameServer( int nClientGameID, uint32 unIPServer, uint16 usPortServer )
{
PRINT_DEBUG_ENTRY();
}
void Steam_User::SetSteam2Ticket( uint8 *pubTicket, int cubTicket )
{
PRINT_DEBUG_ENTRY();
}
void Steam_User::AddServerNetAddress( uint32 unIP, uint16 unPort )
{
PRINT_DEBUG_ENTRY();
}
bool Steam_User::SetEmail( const char *pchEmail )
{
PRINT_DEBUG_ENTRY();
return false;
}
// according to comments in sdk, "logon cookie - this is obsolete and never used"
int Steam_User::GetSteamGameConnectToken( void *pBlob, int cbMaxBlob )
{
PRINT_DEBUG_ENTRY();
return 0;
}
bool Steam_User::SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue )
{
PRINT_DEBUG_TODO();
if (!pchValue)
return false; // real steam crashes, so return value is assumed
if (!pchKey) // tested on real steam
{
registry.clear();
registry_nullptr = std::string(pchValue);
}
else
{
registry[std::string(pchKey)] = std::string(pchValue);
// TODO: save it to disk, because real steam can get the string when app restarts
}
return true;
}
bool Steam_User::GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue )
{
PRINT_DEBUG_TODO();
// TODO: read data on disk, because real steam can get the string when app restarts
if (pchValue && cbValue > 0)
memset(pchValue, 0, cbValue);
std::string value{};
if(!pchKey)
{
value = registry_nullptr;
}
else
{
auto it = registry.find(std::string(pchKey));
if (it == registry.end())
return false;
value = it->second;
}
if (pchValue && cbValue > 0)
value.copy(pchValue, cbValue - 1);
return true;
}
bool Steam_User::SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue )
{
PRINT_DEBUG_TODO();
if (!pchKey) // tested on real steam
{
registry.clear();
registry_nullptr = std::to_string(iValue);
}
else
{
registry[std::string(pchKey)] = std::to_string(iValue);
// TODO: save it to disk, because real steam can get the string when app restarts
}
return true;
}
bool Steam_User::GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue )
{
PRINT_DEBUG_TODO();
// TODO: read data on disk, because real steam can get the string when app restarts
if (piValue)
*piValue = 0;
std::string value{};
if(!pchKey)
{
value = registry_nullptr;
}
else
{
auto it = registry.find(std::string(pchKey));
if (it == registry.end())
return false;
value = it->second;
}
try
{
if (piValue)
*piValue = std::stoi(value);
}
catch(...)
{
PRINT_DEBUG("not a number"); // TODO: real steam returns a value other than 0 under this condition
}
return true;
}
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
@ -101,6 +282,18 @@ int Steam_User::InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSte
return InitiateGameConnection(pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure);
}
int Steam_User::InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure, void *pvSteam2GetEncryptionKey, int cbSteam2GetEncryptionKey )
{
PRINT_DEBUG("sdk 0.99x, 0.99y");
return InitiateGameConnection(pBlob, cbMaxBlob, steamID, unIPServer, usPortServer, bSecure);
}
int Steam_User::InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, int nGameAppID, uint32 unIPServer, uint16 usPortServer, bool bSecure )
{
PRINT_DEBUG("sdk 0.99u");
return InitiateGameConnection(pBlob, cbMaxBlob, steamID, unIPServer, usPortServer, bSecure);
}
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
void Steam_User::TerminateGameConnection( uint32 unIPServer, uint16 usPortServer )
@ -110,12 +303,147 @@ void Steam_User::TerminateGameConnection( uint32 unIPServer, uint16 usPortServer
// Legacy functions
void Steam_User::SetSelfAsPrimaryChatDestination()
{
PRINT_DEBUG_TODO();
}
bool Steam_User::IsPrimaryChatDestination()
{
PRINT_DEBUG_ENTRY();
return false;
}
void Steam_User::RequestLegacyCDKey( uint32 iAppID )
{
PRINT_DEBUG_TODO();
}
bool Steam_User::SendGuestPassByEmail( const char *pchEmailAccount, GID_t gidGuestPassID, bool bResending )
{
PRINT_DEBUG_TODO();
return false;
}
bool Steam_User::SendGuestPassByAccountID( uint32 uAccountID, GID_t gidGuestPassID, bool bResending )
{
PRINT_DEBUG_TODO();
return false;
}
bool Steam_User::AckGuestPass(const char *pchGuestPassCode)
{
PRINT_DEBUG_TODO();
return false;
}
bool Steam_User::RedeemGuestPass(const char *pchGuestPassCode)
{
PRINT_DEBUG_TODO();
return false;
}
uint32 Steam_User::GetGuestPassToGiveCount()
{
PRINT_DEBUG_TODO();
return 0;
}
uint32 Steam_User::GetGuestPassToRedeemCount()
{
PRINT_DEBUG_TODO();
return 0;
}
RTime32 Steam_User::GetGuestPassLastUpdateTime()
{
PRINT_DEBUG_TODO();
return 0;
}
bool Steam_User::GetGuestPassToGiveInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed, char *pchRecipientAddress, int cRecipientAddressSize )
{
PRINT_DEBUG_TODO();
// TODO: pgidGuestPassID
if (pnPackageID)
*pnPackageID = 0;
if (pRTime32Created)
*pRTime32Created = 0;
if (pRTime32Expiration)
*pRTime32Expiration = 0;
if (pRTime32Sent)
*pRTime32Sent = 0;
if (pRTime32Redeemed)
*pRTime32Redeemed = 0;
if (pchRecipientAddress && cRecipientAddressSize > 0)
memset(pchRecipientAddress, 0, cRecipientAddressSize);
return false;
}
bool Steam_User::GetGuestPassToRedeemInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed)
{
PRINT_DEBUG_TODO();
// TODO: pgidGuestPassID
if (pnPackageID)
*pnPackageID = 0;
if (pRTime32Created)
*pRTime32Created = 0;
if (pRTime32Expiration)
*pRTime32Expiration = 0;
if (pRTime32Sent)
*pRTime32Sent = 0;
if (pRTime32Redeemed)
*pRTime32Redeemed = 0;
return false;
}
bool Steam_User::GetGuestPassToRedeemSenderAddress( uint32 nPassIndex, char* pchSenderAddress, int cSenderAddressSize )
{
PRINT_DEBUG_TODO();
return false;
}
bool Steam_User::GetGuestPassToRedeemSenderName( uint32 nPassIndex, char* pchSenderName, int cSenderNameSize )
{
PRINT_DEBUG_TODO();
if (pchSenderName && cSenderNameSize > 0)
memset(pchSenderName, 0, cSenderNameSize);
return false;
}
void Steam_User::AcknowledgeMessageByGID( const char *pchMessageGID )
{
PRINT_DEBUG_TODO();
}
bool Steam_User::SetLanguage( const char *pchLanguage )
{
PRINT_DEBUG_TODO();
// TODO: don't know what this api actually does other than returning true
return true;
}
// used by only a few games to track usage events
void Steam_User::TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo)
{
PRINT_DEBUG_TODO();
}
void Steam_User::SetAccountName( const char *pchAccountName )
{
PRINT_DEBUG_TODO();
}
void Steam_User::SetPassword( const char *pchPassword )
{
PRINT_DEBUG_TODO();
}
void Steam_User::SetAccountCreationTime( RTime32 rt )
{
PRINT_DEBUG_TODO();
}
void Steam_User::RefreshSteam2Login()
{
PRINT_DEBUG_TODO();

View File

@ -96,8 +96,8 @@ Steam_User_Stats::Steam_User_Stats(Settings *settings, class Networking *network
it["displayName"] = get_value_for_language(it, "displayName", settings->get_language());
it["description"] = get_value_for_language(it, "description", settings->get_language());
it["icon_handle"] = UNLOADED_ACH_ICON;
it["icon_gray_handle"] = UNLOADED_ACH_ICON;
it["icon_handle"] = Settings::UNLOADED_IMAGE_HANDLE;
it["icon_gray_handle"] = Settings::UNLOADED_IMAGE_HANDLE;
}
//TODO: not sure if the sort is actually case insensitive, ach names seem to be treated by steam as case insensitive so I assume they are.

View File

@ -80,8 +80,8 @@ void Steam_User_Stats::save_achievements()
int Steam_User_Stats::load_ach_icon(nlohmann::json &defined_ach, bool achieved)
{
const char *icon_handle_key = achieved ? "icon_handle" : "icon_gray_handle";
int current_handle = defined_ach.value(icon_handle_key, UNLOADED_ACH_ICON);
if (UNLOADED_ACH_ICON != current_handle) { // already loaded
int current_handle = defined_ach.value(icon_handle_key, Settings::UNLOADED_IMAGE_HANDLE);
if (Settings::UNLOADED_IMAGE_HANDLE != current_handle) { // already loaded
return current_handle;
}
@ -394,7 +394,12 @@ int Steam_User_Stats::GetAchievementIcon( const char *pchName )
GetAchievement(pchName, &achieved);
std::string ach_name(pchName);
int handle = get_achievement_icon_handle(ach_name, achieved);
// here we force load in case the game has a lot of achievements, because otherwise some games might timeout
// this somewhat defeats the purpose of background loading but a timeout is worse
int handle = get_achievement_icon_handle(ach_name, achieved, true);
if (Settings::UNLOADED_IMAGE_HANDLE == handle) { // if the background callback didn't get a chance to load this one yet
handle = Settings::INVALID_IMAGE_HANDLE;
}
UserAchievementIconFetched_t data{};
data.m_bAchieved = achieved ;
@ -406,11 +411,10 @@ int Steam_User_Stats::GetAchievementIcon( const char *pchName )
return handle;
}
int Steam_User_Stats::get_achievement_icon_handle( const std::string &ach_name, bool achieved )
int Steam_User_Stats::get_achievement_icon_handle( const std::string &ach_name, bool achieved, bool force_load )
{
PRINT_DEBUG("'%s', %i", ach_name.c_str(), (int)achieved);
PRINT_DEBUG("'%s', achieved=%i, force=%i", ach_name.c_str(), (int)achieved, (int)force_load);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (ach_name.empty()) return Settings::INVALID_IMAGE_HANDLE;
nlohmann::detail::iter_impl<nlohmann::json> it = defined_achievements.end();
try {
@ -418,7 +422,20 @@ int Steam_User_Stats::get_achievement_icon_handle( const std::string &ach_name,
} catch(...) { }
if (defined_achievements.end() == it) return Settings::INVALID_IMAGE_HANDLE;
int handle = load_ach_icon(*it, achieved);
int handle = Settings::INVALID_IMAGE_HANDLE;
if (settings->paginated_achievements_icons < 0) { // disabled functionality
handle = Settings::INVALID_IMAGE_HANDLE;
} else if (settings->paginated_achievements_icons == 0) { // load the icon only when requested
handle = load_ach_icon(*it, achieved);
} else { // depend on the periodic callback to load the icon
if (force_load) {
handle = load_ach_icon(*it, achieved);
} else {
const char *icon_handle_key = achieved ? "icon_handle" : "icon_gray_handle";
handle = it->value(icon_handle_key, Settings::UNLOADED_IMAGE_HANDLE);
}
}
PRINT_DEBUG("returned handle = %i", handle);
return handle;
}
@ -784,16 +801,25 @@ bool Steam_User_Stats::GetAchievementProgressLimits( const char *pchName, float
void Steam_User_Stats::load_achievements_icons()
{
if (achievements_icons_loaded) return;
if (settings->lazy_load_achievements_icons) {
achievements_icons_loaded = true;
return;
if (last_loaded_ach_icon >= defined_achievements.size() || settings->paginated_achievements_icons <= 0) return;
#ifndef EMU_RELEASE_BUILD
auto now1 = std::chrono::high_resolution_clock::now();
#endif
int idx = 0;
for (;
idx < settings->paginated_achievements_icons && last_loaded_ach_icon < defined_achievements.size();
++idx, ++last_loaded_ach_icon) {
auto &ach = defined_achievements.at(last_loaded_ach_icon);
load_ach_icon(ach, true);
load_ach_icon(ach, false);
}
for (auto & defined_ach : defined_achievements) {
load_ach_icon(defined_ach, true);
load_ach_icon(defined_ach, false);
}
#ifndef EMU_RELEASE_BUILD
auto now2 = std::chrono::high_resolution_clock::now();
auto dd = (unsigned)std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
PRINT_DEBUG("attempted to load %d achievements icons in %u ms", idx * 2, dd);
#endif
achievements_icons_loaded = true;
}

View File

@ -186,7 +186,7 @@ unsigned int Steam_User_Stats::cache_leaderboard_ifneeded(const std::string &nam
// create a new entry in-memory and try reading the entries from disk
struct Steam_Leaderboard new_board{};
new_board.name = common_helpers::ascii_to_lowercase(name);
new_board.name = name;
new_board.sort_method = eLeaderboardSortMethod;
new_board.display_type = eLeaderboardDisplayType;
new_board.entries = load_leaderboard_entries(name);

View File

@ -582,7 +582,8 @@ bool Steam_User_Stats::ResetAllStats( bool bAchievementsToo )
// this won't actually trigger a notification, just updates the data
overlay->AddAchievementNotification(name, item, false);
} catch(const std::exception& e) {
PRINT_DEBUG("ERROR: %s", e.what());
const char *errorMessage = e.what();
PRINT_DEBUG("ERROR: %s", errorMessage);
}
}
if (needs_disk_write) save_achievements();

View File

@ -2,13 +2,14 @@
setlocal EnableDelayedExpansion
cd /d "%~dp0"
set "CREDITS_FILE=CREDITS.md"
set "ROOT=%cd%"
set "CREDITS_FILE=%ROOT%\CREDITS.md"
if exist "%CREDITS_FILE%" (
del /f /s /q "%CREDITS_FILE%"
del /f /q "%CREDITS_FILE%"
)
set "GLOB=third-party libs tools\steamclient_loader"
set "GLOB=third-party libs tools\steamclient_loader sdk"
set "FILTER=SOURCE.txt"
echo:# Many thanks for these sources>> "%CREDITS_FILE%"

View File

@ -71,8 +71,10 @@ struct Overlay_Achievement
bool hidden{};
bool achieved{};
uint32 unlock_time{};
std::pair< std::weak_ptr<uint64_t>, bool > icon{};
std::pair< std::weak_ptr<uint64_t>, bool > icon_gray{};
std::weak_ptr<uint64_t> icon{};
std::weak_ptr<uint64_t> icon_gray{};
int icon_handle = Settings::UNLOADED_IMAGE_HANDLE;
int icon_gray_handle = Settings::UNLOADED_IMAGE_HANDLE;
};
struct Notification
@ -99,7 +101,6 @@ struct NotificationsCoords
class Steam_Overlay
{
constexpr static const char ACH_SOUNDS_FOLDER[] = "sounds";
constexpr static const int renderer_detector_polling_ms = 100;
class Settings* settings;
@ -120,6 +121,7 @@ class Steam_Overlay
std::string show_url{};
std::vector<Overlay_Achievement> achievements{};
size_t last_loaded_ach_icon{};
bool show_overlay = false;
bool show_user_info = false;
@ -184,12 +186,6 @@ class Steam_Overlay
Steam_Overlay& operator=(Steam_Overlay const&) = delete;
Steam_Overlay& operator=(Steam_Overlay&&) = delete;
static void overlay_run_callback(void* object);
static void overlay_networking_callback(void* object, Common_Message* msg);
bool is_friend_joinable(std::pair<const Friend, friend_window_state> &f);
bool got_lobby();
bool submit_notification(
notification_type type,
const std::string &msg,
@ -213,8 +209,6 @@ class Steam_Overlay
void add_ach_progressbar(const Overlay_Achievement &ach);
ImVec4 get_notification_bg_rgba_safe();
void build_notifications(float width, float height);
// invite a single friend
void invite_friend(uint64 friend_id, class Steam_Friends* steamFriends, class Steam_Matchmaking* steamMatchmaking);
void request_renderer_detector();
void set_renderer_hook_timeout();
@ -238,14 +232,27 @@ class Steam_Overlay
bool open_overlay_hook(bool toggle);
bool try_load_ach_icon(Overlay_Achievement &ach, bool achieved);
bool try_load_ach_icon(Overlay_Achievement &ach, bool achieved, bool upload_new_icon_to_gpu);
void overlay_render_proc();
void load_next_ach_icon();
uint32 apply_global_style_color();
void render_main_window();
void networking_msg_received(Common_Message* msg);
void steam_run_callback_update_my_lobby();
bool is_friend_joinable(std::pair<const Friend, friend_window_state> &f);
// invite a single friend
void invite_friend(uint64 friend_id, class Steam_Friends* steamFriends, class Steam_Matchmaking* steamMatchmaking);
void steam_run_callback_friends_actions();
void steam_run_callback();
void networking_msg_received(Common_Message* msg);
static void overlay_run_callback(void* object);
static void overlay_networking_callback(void* object, Common_Message* msg);
public:
Steam_Overlay(Settings* settings, Local_Storage *local_storage, SteamCallResults* callback_results, SteamCallBacks* callbacks, RunEveryRunCB* run_every_runcb, Networking *network);

View File

@ -85,23 +85,7 @@ void Steam_Overlay::overlay_run_callback(void* object)
{
// PRINT_DEBUG_ENTRY();
Steam_Overlay* _this = reinterpret_cast<Steam_Overlay*>(object);
// bail immediately if we can't lock the overlay mutex, deadlock scenario:
// 1. ** the background thread locks the global mutex
// 2. -- the user opens the overlay
// 3. -- the overlay proc is triggered the next frame, locking the overlay mutex
// 4. ** the background thread locks the global mutex and runs this callback
// 5. ** this callback (already having the global mutex) attempts to lock the overlay mutex (already locked before)
// 6. ** this callback, and the background thread, are now blocked, note that the global mutex is still locked
// 7. -- in the same frame, some code in the overlay proc attempts to call a steam API which usually locks the global mutex
// sice the global mutex is still locked, the overlay proc is also blocked,
// and now both the background thread and the overlay proc and locked
// even worse, the global mutex is locked forever now
if (!_this->overlay_mutex.try_lock()) return;
_this->steam_run_callback();
_this->overlay_mutex.unlock();
}
void Steam_Overlay::overlay_networking_callback(void* object, Common_Message* msg)
@ -422,7 +406,6 @@ void Steam_Overlay::overlay_state_hook(bool ready)
// called when the user presses SHIFT + TAB
bool Steam_Overlay::open_overlay_hook(bool toggle)
{
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
if (toggle) {
ShowOverlay(!show_overlay);
}
@ -639,16 +622,19 @@ void Steam_Overlay::show_test_achievement()
ach.description = "~~~ " + ach.title + " ~~~";
ach.achieved = true;
// random add icon
if (achievements.size()) {
size_t rand_idx = common_helpers::rand_number(achievements.size() - 1);
auto &rand_ach = achievements[rand_idx];
bool achieved = rand_idx < (achievements.size() / 2);
try_load_ach_icon(rand_ach, achieved);
ach.icon = achieved ? rand_ach.icon : rand_ach.icon_gray;
// force upload to GPU if the pagination is request-based
try_load_ach_icon(rand_ach, achieved, settings->paginated_achievements_icons == 0);
ach.icon = rand_ach.icon;
ach.icon_gray = rand_ach.icon_gray;
}
bool for_progress = false;
// randomly add progress
bool for_progress = false;
if (common_helpers::rand_number(1000) % 2) {
for_progress = true;
uint32 progress = (uint32)(common_helpers::rand_number(500) / 10 + 50); // [50, 100]
@ -662,41 +648,6 @@ void Steam_Overlay::show_test_achievement()
notify_sound_user_achievement();
}
bool Steam_Overlay::is_friend_joinable(std::pair<const Friend, friend_window_state> &f)
{
PRINT_DEBUG("%" PRIu64 "", f.first.id());
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
if (std::string(steamFriends->get_friend_rich_presence_silent((uint64)f.first.id(), "connect")).length() > 0 ) {
PRINT_DEBUG("%" PRIu64 " true (connect string)", f.first.id());
return true;
}
FriendGameInfo_t friend_game_info{};
steamFriends->GetFriendGamePlayed((uint64)f.first.id(), &friend_game_info);
if (friend_game_info.m_steamIDLobby.IsValid() && (f.second.window_state & window_state_lobby_invite)) {
PRINT_DEBUG("%" PRIu64 " true (friend in a game)", f.first.id());
return true;
}
PRINT_DEBUG("%" PRIu64 " false", f.first.id());
return false;
}
bool Steam_Overlay::got_lobby()
{
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
if (std::string(steamFriends->get_friend_rich_presence_silent(settings->get_local_steam_id(), "connect")).length() > 0)
return true;
if (settings->get_lobby().IsValid())
return true;
return false;
}
void Steam_Overlay::build_friend_context_menu(Friend const& frd, friend_window_state& state)
{
if (ImGui::BeginPopupContextItem("Friends_ContextMenu", 1)) {
@ -768,24 +719,21 @@ void Steam_Overlay::build_friend_window(Friend const& frd, friend_window_state&
// Window id is after the ###, the window title is the friend name
std::string friend_window_id = std::move("###" + std::to_string(state.id));
if (ImGui::Begin((state.window_title + friend_window_id).c_str(), &show)) {
if (state.window_state & window_state_need_attention && ImGui::IsWindowFocused())
{
if (state.window_state & window_state_need_attention && ImGui::IsWindowFocused()) {
state.window_state &= ~window_state_need_attention;
}
// Fill this with the chat box and maybe the invitation
if (state.window_state & (window_state_lobby_invite | window_state_rich_invite))
{
if (state.window_state & (window_state_lobby_invite | window_state_rich_invite)) {
ImGui::LabelText("##label", translationInvitedYouToJoinTheGame[current_language], frd.name().c_str(), frd.appid());
ImGui::SameLine();
if (ImGui::Button(translationAccept[current_language]))
{
if (ImGui::Button(translationAccept[current_language])) {
state.window_state |= window_state_join;
this->has_friend_action.push(frd);
}
ImGui::SameLine();
if (ImGui::Button(translationRefuse[current_language]))
{
if (ImGui::Button(translationRefuse[current_language])) {
state.window_state &= ~(window_state_lobby_invite | window_state_rich_invite);
}
}
@ -829,15 +777,12 @@ void Steam_Overlay::build_friend_window(Friend const& frd, friend_window_state&
ImGui::SameLine();
if (ImGui::Button(translationSend[current_language]))
{
if (ImGui::Button(translationSend[current_language])) {
send_chat_msg = true;
}
if (send_chat_msg)
{
if (!(state.window_state & window_state_send_message))
{
if (send_chat_msg) {
if (!(state.window_state & window_state_send_message)) {
has_friend_action.push(frd);
state.window_state |= window_state_send_message;
}
@ -845,8 +790,9 @@ void Steam_Overlay::build_friend_window(Friend const& frd, friend_window_state&
}
// User closed the friend window
if (!show)
if (!show) {
state.window_state &= ~window_state_show;
}
ImGui::End();
}
@ -1108,7 +1054,7 @@ void Steam_Overlay::build_notifications(float width, float height)
case notification_type::achievement_progress:
case notification_type::achievement: {
const auto &ach = it->ach.value();
auto& [icon_rsrc, _] = (notification_type)it->type == notification_type::achievement
auto &icon_rsrc = (notification_type)it->type == notification_type::achievement
? ach.icon
: ach.icon_gray;
if (!icon_rsrc.expired() && ImGui::BeginTable("imgui_table", 2)) {
@ -1244,7 +1190,9 @@ void Steam_Overlay::post_achievement_notification(Overlay_Achievement &ach, bool
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
if (!Ready()) return;
try_load_ach_icon(ach, !for_progress); // for progress notifications we want to load the gray icon
bool achieved = !for_progress; // for progress notifications we want to load the gray icon
// force upload to GPU if the pagination is request-based
try_load_ach_icon(ach, achieved, settings->paginated_achievements_icons == 0);
submit_notification(
for_progress ? notification_type::achievement_progress : notification_type::achievement,
ach.title + "\n" + ach.description,
@ -1253,26 +1201,22 @@ void Steam_Overlay::post_achievement_notification(Overlay_Achievement &ach, bool
);
}
void Steam_Overlay::invite_friend(uint64 friend_id, class Steam_Friends* steamFriends, class Steam_Matchmaking* steamMatchmaking)
{
std::string connect_str = steamFriends->get_friend_rich_presence_silent(settings->get_local_steam_id(), "connect");
if (connect_str.length() > 0) {
steamFriends->InviteUserToGame(friend_id, connect_str.c_str());
PRINT_DEBUG("sent game invitation to friend with id = %llu", friend_id);
} else if (settings->get_lobby().IsValid()) {
steamMatchmaking->InviteUserToLobby(settings->get_lobby(), friend_id);
PRINT_DEBUG("sent lobby invitation to friend with id = %llu", friend_id);
}
}
bool Steam_Overlay::try_load_ach_icon(Overlay_Achievement &ach, bool achieved)
bool Steam_Overlay::try_load_ach_icon(Overlay_Achievement &ach, bool achieved, bool upload_new_icon_to_gpu)
{
if (!_renderer) return false;
if (settings->paginated_achievements_icons < 0) return false; // no icons are loaded anyway
if (!settings->overlay_upload_achs_icons_to_gpu) return false; // don't upload anything to the GPU
auto& [icon_rsrc, attempted] = achieved ? ach.icon : ach.icon_gray;
if (attempted || !icon_rsrc.expired()) return true;
auto &icon_rsrc = achieved ? ach.icon : ach.icon_gray;
if (!icon_rsrc.expired()) return true;
const int icon_handle = get_steam_client()->steam_user_stats->get_achievement_icon_handle(ach.name, achieved);
// icons needs to be loaded, but we're not allowed
if (!upload_new_icon_to_gpu) return false;
int &icon_handle = achieved ? ach.icon_handle : ach.icon_gray_handle;
if (Settings::UNLOADED_IMAGE_HANDLE == icon_handle) { // not loaded yet
icon_handle = get_steam_client()->steam_user_stats->get_achievement_icon_handle(ach.name, achieved);
}
auto image_info = settings->get_image(icon_handle);
if (image_info) {
int icon_size = static_cast<int>(settings->overlay_appearance.icon_size);
@ -1283,14 +1227,14 @@ bool Steam_Overlay::try_load_ach_icon(Overlay_Achievement &ach, bool achieved)
PRINT_DEBUG("'%s' (result=%i)", ach.name.c_str(), (int)!icon_rsrc.expired());
}
attempted = true;
return !icon_rsrc.expired();
}
// Try to make this function as short as possible or it might affect game's fps.
void Steam_Overlay::overlay_render_proc()
{
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
std::lock_guard lock(overlay_mutex);
if (!Ready()) return;
if (show_overlay) {
@ -1302,6 +1246,7 @@ void Steam_Overlay::overlay_render_proc()
build_notifications(io.DisplaySize.x, io.DisplaySize.y);
}
load_next_ach_icon();
}
uint32 Steam_Overlay::apply_global_style_color()
@ -1480,13 +1425,14 @@ void Steam_Overlay::render_main_window()
bool achieved = x.achieved;
bool hidden = x.hidden && !achieved;
try_load_ach_icon(x, true);
try_load_ach_icon(x, false);
// force upload to GPU if the pagination is request-based
try_load_ach_icon(x, true, settings->paginated_achievements_icons == 0);
try_load_ach_icon(x, false, settings->paginated_achievements_icons == 0);
ImGui::Separator();
bool could_create_ach_table_entry = false;
if (!x.icon.first.expired() || !x.icon_gray.first.expired()) {
if (!x.icon.expired() || !x.icon_gray.expired()) {
if (ImGui::BeginTable(x.title.c_str(), 2)) {
could_create_ach_table_entry = true;
@ -1495,7 +1441,7 @@ void Steam_Overlay::render_main_window()
ImGui::TableNextRow(ImGuiTableRowFlags_None, settings->overlay_appearance.icon_size);
ImGui::TableSetColumnIndex(0);
auto& [icon_rsrc, _] = achieved ? x.icon : x.icon_gray;
auto &icon_rsrc = achieved ? x.icon : x.icon_gray;
if (!icon_rsrc.expired()) {
ImGui::Image(
(ImTextureID)*icon_rsrc.lock().get(),
@ -1633,162 +1579,45 @@ void Steam_Overlay::render_main_window()
if (style_color_stack) ImGui::PopStyleColor(style_color_stack);
ImGui::PopFont();
if (!show) ShowOverlay(false);
if (!show) {
ShowOverlay(false);
}
}
void Steam_Overlay::networking_msg_received(Common_Message *msg)
void Steam_Overlay::load_next_ach_icon()
{
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
// this function only works when icons pagination is active, request-based loading is not supported too (pagination=0)
if (!settings->overlay_upload_achs_icons_to_gpu || settings->paginated_achievements_icons <= 0 || achievements.empty()) return;
if (msg->has_steam_messages()) {
Friend frd;
frd.set_id(msg->source_id());
auto friend_info = friends.find(frd);
if (friend_info != friends.end()) {
Steam_Messages const& steam_message = msg->steam_messages();
// Change color to cyan for friend
friend_info->second.chat_history.append(friend_info->first.name() + ": " + steam_message.message()).append("\n", 1);
if (!(friend_info->second.window_state & window_state_show)) {
friend_info->second.window_state |= window_state_need_attention;
size_t linear_idx = last_loaded_ach_icon / 2; // 2 icons per achievement, 1 achieved, 1 unachieved
if (linear_idx >= achievements.size()) {
last_loaded_ach_icon = 0;
linear_idx = 0;
}
add_chat_message_notification(friend_info->first.name() + ": " + steam_message.message());
notify_sound_user_invite(friend_info->second);
}
#ifndef EMU_RELEASE_BUILD
auto now1 = std::chrono::high_resolution_clock::now();
#endif
auto &ach = achievements.at(linear_idx);
++last_loaded_ach_icon;
bool achieved = last_loaded_ach_icon % 2 != 0;
auto &icon_rsrc = achieved ? ach.icon : ach.icon_gray;
// always force upload to GPU in background-loading mode (pagination > 0)
bool loaded = try_load_ach_icon(ach, achieved, true);
#ifndef EMU_RELEASE_BUILD
if (loaded) {
auto now2 = std::chrono::high_resolution_clock::now();
auto dd = (unsigned)std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
PRINT_DEBUG("uploaded an achievement icon to GPU in %u ms", dd);
}
#endif
}
void Steam_Overlay::steam_run_callback()
{
if (!Ready()) return;
if (overlay_state_changed) {
overlay_state_changed = false;
GameOverlayActivated_t data{};
data.m_bActive = show_overlay;
data.m_bUserInitiated = true;
data.m_dwOverlayPID = 123;
data.m_nAppID = settings->get_local_game_id().AppID();
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
Steam_Matchmaking* steamMatchmaking = get_steam_client()->steam_matchmaking;
if (save_settings) {
save_settings = false;
const char *language_text = valid_languages[current_language];
save_global_settings(get_steam_client()->local_storage, username_text, language_text);
get_steam_client()->settings_client->set_local_name(username_text);
get_steam_client()->settings_server->set_local_name(username_text);
get_steam_client()->settings_client->set_language(language_text);
get_steam_client()->settings_server->set_language(language_text);
steamFriends->resend_friend_data();
}
i_have_lobby = got_lobby();
std::for_each(friends.begin(), friends.end(), [this](std::pair<Friend const, friend_window_state> &i)
{
i.second.joinable = is_friend_joinable(i);
});
while (!has_friend_action.empty()) {
auto friend_info = friends.find(has_friend_action.front());
if (friend_info != friends.end()) {
uint64 friend_id = (uint64)friend_info->first.id();
// The user clicked on "Send"
if (friend_info->second.window_state & window_state_send_message) {
char* input = friend_info->second.chat_input;
char* end_input = input + strlen(input);
char* printable_char = std::find_if(input, end_input, [](char c) { return std::isgraph(c); });
// Check if the message contains something else than blanks
if (printable_char != end_input) {
// Handle chat send
Common_Message msg;
Steam_Messages* steam_messages = new Steam_Messages;
steam_messages->set_type(Steam_Messages::FRIEND_CHAT);
steam_messages->set_message(friend_info->second.chat_input);
msg.set_allocated_steam_messages(steam_messages);
msg.set_source_id(settings->get_local_steam_id().ConvertToUint64());
msg.set_dest_id(friend_id);
network->sendTo(&msg, true);
friend_info->second.chat_history.append(get_steam_client()->settings_client->get_local_name()).append(": ").append(input).append("\n", 1);
}
*input = 0; // Reset the input field
friend_info->second.window_state &= ~window_state_send_message;
}
// The user clicked on "Invite" (but invite all wasn't clicked)
if (friend_info->second.window_state & window_state_invite) {
invite_friend(friend_id, steamFriends, steamMatchmaking);
friend_info->second.window_state &= ~window_state_invite;
}
// The user clicked on "Join"
if (friend_info->second.window_state & window_state_join) {
std::string connect = steamFriends->get_friend_rich_presence_silent(friend_id, "connect");
// The user got a lobby invite and accepted it
if (friend_info->second.window_state & window_state_lobby_invite) {
GameLobbyJoinRequested_t data;
data.m_steamIDLobby.SetFromUint64(friend_info->second.lobbyId);
data.m_steamIDFriend.SetFromUint64(friend_id);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
friend_info->second.window_state &= ~window_state_lobby_invite;
} else {
// The user got a rich presence invite and accepted it
if (friend_info->second.window_state & window_state_rich_invite) {
GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend.SetFromUint64(friend_id);
strncpy(data.m_rgchConnect, friend_info->second.connect, k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
friend_info->second.window_state &= ~window_state_rich_invite;
} else if (connect.length() > 0) {
GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend.SetFromUint64(friend_id);
strncpy(data.m_rgchConnect, connect.c_str(), k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
//Not sure about this but it fixes sonic racing transformed invites
FriendGameInfo_t friend_game_info = {};
steamFriends->GetFriendGamePlayed(friend_id, &friend_game_info);
uint64 lobby_id = friend_game_info.m_steamIDLobby.ConvertToUint64();
if (lobby_id) {
GameLobbyJoinRequested_t data;
data.m_steamIDLobby.SetFromUint64(lobby_id);
data.m_steamIDFriend.SetFromUint64(friend_id);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
}
friend_info->second.window_state &= ~window_state_join;
}
}
has_friend_action.pop();
}
// if variable == true, then set it to false and return true (because state was changed) in that case
bool yes_clicked = true;
if (invite_all_friends_clicked.compare_exchange_weak(yes_clicked, false)) {
PRINT_DEBUG("Steam_Overlay will send invitations to [%zu] friends if they're using the same app", friends.size());
uint32 current_appid = settings->get_local_game_id().AppID();
for (auto &fr : friends) {
if (fr.first.appid() == current_appid) { // friend is playing the same game
uint64 friend_id = (uint64)fr.first.id();
invite_friend(friend_id, steamFriends, steamMatchmaking);
}
}
}
}
void Steam_Overlay::SetupOverlay()
{
if (settings->disable_overlay) return;
@ -1838,14 +1667,14 @@ void Steam_Overlay::UnSetupOverlay()
PRINT_DEBUG("releasing any images resources");
for (auto &ach : achievements) {
if (!ach.icon.first.expired()) {
_renderer->ReleaseImageResource(ach.icon.first);
ach.icon.first.reset();
if (!ach.icon.expired()) {
_renderer->ReleaseImageResource(ach.icon);
ach.icon.reset();
}
if (!ach.icon_gray.first.expired()) {
_renderer->ReleaseImageResource(ach.icon_gray.first);
ach.icon_gray.first.reset();
if (!ach.icon_gray.expired()) {
_renderer->ReleaseImageResource(ach.icon_gray);
ach.icon_gray.reset();
}
}
@ -2062,4 +1891,232 @@ void Steam_Overlay::AddAchievementNotification(const std::string &ach_name, nloh
}
}
// -- steam run callbacks --
void Steam_Overlay::steam_run_callback_update_my_lobby()
{
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
if (std::string(steamFriends->get_friend_rich_presence_silent(settings->get_local_steam_id(), "connect")).length() > 0) {
i_have_lobby = true;
} else if (settings->get_lobby().IsValid()) {
i_have_lobby = true;
} else {
i_have_lobby = false;
}
}
bool Steam_Overlay::is_friend_joinable(std::pair<const Friend, friend_window_state> &f)
{
PRINT_DEBUG("%" PRIu64 "", f.first.id());
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
if (std::string(steamFriends->get_friend_rich_presence_silent((uint64)f.first.id(), "connect")).length() > 0 ) {
PRINT_DEBUG("%" PRIu64 " true (connect string)", f.first.id());
return true;
}
FriendGameInfo_t friend_game_info{};
steamFriends->GetFriendGamePlayed((uint64)f.first.id(), &friend_game_info);
if (friend_game_info.m_steamIDLobby.IsValid() && (f.second.window_state & window_state_lobby_invite)) {
PRINT_DEBUG("%" PRIu64 " true (friend in a game)", f.first.id());
return true;
}
PRINT_DEBUG("%" PRIu64 " false", f.first.id());
return false;
}
void Steam_Overlay::invite_friend(uint64 friend_id, class Steam_Friends* steamFriends, class Steam_Matchmaking* steamMatchmaking)
{
std::string connect_str = steamFriends->get_friend_rich_presence_silent(settings->get_local_steam_id(), "connect");
if (connect_str.length() > 0) {
steamFriends->InviteUserToGame(friend_id, connect_str.c_str());
PRINT_DEBUG("sent game invitation to friend with id = %llu", friend_id);
} else if (settings->get_lobby().IsValid()) {
steamMatchmaking->InviteUserToLobby(settings->get_lobby(), friend_id);
PRINT_DEBUG("sent lobby invitation to friend with id = %llu", friend_id);
}
}
void Steam_Overlay::steam_run_callback_friends_actions()
{
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
Steam_Matchmaking* steamMatchmaking = get_steam_client()->steam_matchmaking;
std::for_each(friends.begin(), friends.end(), [this](std::pair<Friend const, friend_window_state> &i) {
i.second.joinable = is_friend_joinable(i);
});
while (!has_friend_action.empty()) {
auto friend_info = friends.find(has_friend_action.front());
if (friend_info != friends.end()) {
uint64 friend_id = (uint64)friend_info->first.id();
// The user clicked on "Send"
if (friend_info->second.window_state & window_state_send_message) {
char* input = friend_info->second.chat_input;
char* end_input = input + strlen(input);
char* printable_char = std::find_if(input, end_input, [](char c) { return std::isgraph(c); });
// Check if the message contains something else than blanks
if (printable_char != end_input) {
// Handle chat send
Common_Message msg;
Steam_Messages* steam_messages = new Steam_Messages;
steam_messages->set_type(Steam_Messages::FRIEND_CHAT);
steam_messages->set_message(friend_info->second.chat_input);
msg.set_allocated_steam_messages(steam_messages);
msg.set_source_id(settings->get_local_steam_id().ConvertToUint64());
msg.set_dest_id(friend_id);
network->sendTo(&msg, true);
friend_info->second.chat_history.append(get_steam_client()->settings_client->get_local_name()).append(": ").append(input).append("\n", 1);
}
*input = 0; // Reset the input field
friend_info->second.window_state &= ~window_state_send_message;
}
// The user clicked on "Invite" (but invite all wasn't clicked)
if (friend_info->second.window_state & window_state_invite) {
invite_friend(friend_id, steamFriends, steamMatchmaking);
friend_info->second.window_state &= ~window_state_invite;
}
// The user clicked on "Join"
if (friend_info->second.window_state & window_state_join) {
std::string connect = steamFriends->get_friend_rich_presence_silent(friend_id, "connect");
// The user got a lobby invite and accepted it
if (friend_info->second.window_state & window_state_lobby_invite) {
GameLobbyJoinRequested_t data;
data.m_steamIDLobby.SetFromUint64(friend_info->second.lobbyId);
data.m_steamIDFriend.SetFromUint64(friend_id);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
friend_info->second.window_state &= ~window_state_lobby_invite;
} else {
// The user got a rich presence invite and accepted it
if (friend_info->second.window_state & window_state_rich_invite) {
GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend.SetFromUint64(friend_id);
strncpy(data.m_rgchConnect, friend_info->second.connect, k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
friend_info->second.window_state &= ~window_state_rich_invite;
} else if (connect.length() > 0) {
GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend.SetFromUint64(friend_id);
strncpy(data.m_rgchConnect, connect.c_str(), k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
//Not sure about this but it fixes sonic racing transformed invites
FriendGameInfo_t friend_game_info = {};
steamFriends->GetFriendGamePlayed(friend_id, &friend_game_info);
uint64 lobby_id = friend_game_info.m_steamIDLobby.ConvertToUint64();
if (lobby_id) {
GameLobbyJoinRequested_t data;
data.m_steamIDLobby.SetFromUint64(lobby_id);
data.m_steamIDFriend.SetFromUint64(friend_id);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
}
friend_info->second.window_state &= ~window_state_join;
}
}
has_friend_action.pop();
}
}
void Steam_Overlay::steam_run_callback()
{
if (!Ready()) return;
if (overlay_state_changed) {
overlay_state_changed = false;
GameOverlayActivated_t data{};
data.m_bActive = show_overlay;
data.m_bUserInitiated = true;
data.m_dwOverlayPID = 123;
data.m_nAppID = settings->get_local_game_id().AppID();
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
Steam_Matchmaking* steamMatchmaking = get_steam_client()->steam_matchmaking;
if (save_settings) {
save_settings = false;
const char *language_text = valid_languages[current_language];
save_global_settings(get_steam_client()->local_storage, username_text, language_text);
get_steam_client()->settings_client->set_local_name(username_text);
get_steam_client()->settings_server->set_local_name(username_text);
get_steam_client()->settings_client->set_language(language_text);
get_steam_client()->settings_server->set_language(language_text);
steamFriends->resend_friend_data();
}
steam_run_callback_update_my_lobby();
// if variable == true, then set it to false and return true (because state was changed) in that case
bool yes_clicked = true;
if (invite_all_friends_clicked.compare_exchange_weak(yes_clicked, false)) {
PRINT_DEBUG("Steam_Overlay will send invitations to [%zu] friends if they're using the same app", friends.size());
uint32 current_appid = settings->get_local_game_id().AppID();
for (auto &fr : friends) {
if (fr.first.appid() == current_appid) { // friend is playing the same game
uint64 friend_id = (uint64)fr.first.id();
invite_friend(friend_id, steamFriends, steamMatchmaking);
}
}
}
// don't wait to lock the overlay mutex
// * the overlay proc might be active and holding the overlay mutex
// * this steam callback will be blocked, but it has the global mutex locked
// * the overlay proc tries to lock the global mutex, but since we have it, it will be blocked forever
if (overlay_mutex.try_lock()) {
if (Ready()) {
// ==============================================================
// call steam callbacks that has to change the overlay state here
// ==============================================================
steam_run_callback_friends_actions();
}
overlay_mutex.unlock();
}
}
// -- steam networking callbacks --
void Steam_Overlay::networking_msg_received(Common_Message *msg)
{
if (msg->has_steam_messages()) {
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
Friend frd;
frd.set_id(msg->source_id());
auto friend_info = friends.find(frd);
if (friend_info != friends.end()) {
Steam_Messages const& steam_message = msg->steam_messages();
// Change color to cyan for friend
friend_info->second.chat_history.append(friend_info->first.name() + ": " + steam_message.message()).append("\n", 1);
if (!(friend_info->second.window_state & window_state_show)) {
friend_info->second.window_state |= window_state_need_attention;
}
add_chat_message_notification(friend_info->first.name() + ": " + steam_message.message());
notify_sound_user_invite(friend_info->second);
}
}
}
#endif

View File

@ -11,17 +11,18 @@ if defined NUMBER_OF_PROCESSORS (
)
)
set "BUILD_DIR=build\win"
set "OUT_DIR=build\package\win"
set "ROOT=%cd%"
set "BUILD_DIR=%ROOT%\build\win"
set "OUT_DIR=%ROOT%\build\package\win"
if "%~1" equ "" (
1>&2 echo: missing build target folder arg
1>&2 echo:missing build target folder arg
goto :end_script_with_err
)
set "TARGET_DIR=%BUILD_DIR%\%~1"
if not exist "%TARGET_DIR%\" (
1>&2 echo: build target folder wasn't found
1>&2 echo:build target folder wasn't found
goto :end_script_with_err
)
@ -34,39 +35,39 @@ set /a "PKG_EXE_MEM_PERCENT=90"
set /a "PKG_EXE_DICT_SIZE_MB=384"
set "PKG_EXE=third-party\deps\win\7za\7za.exe"
if not exist "%PKG_EXE%" (
1>&2 echo: packager wasn't found
1>&2 echo:packager wasn't found
goto :end_script_with_err
)
::::::::::::::::::::::::::::::::::::::::::
echo: // copying readmes + example files
echo:// copying readmes + example files
xcopy /y /s /e /r "post_build\steam_settings.EXAMPLE\" "%TARGET_DIR%\steam_settings.EXAMPLE\"
xcopy /y /s /e /r "%ROOT%\post_build\steam_settings.EXAMPLE\" "%TARGET_DIR%\steam_settings.EXAMPLE\"
copy /y "post_build\README.release.md" "%TARGET_DIR%\"
copy /y "CHANGELOG.md" "%TARGET_DIR%\"
copy /y "CREDITS.md" "%TARGET_DIR%\"
copy /y "%ROOT%\post_build\README.release.md" "%TARGET_DIR%\"
copy /y "%ROOT%\CHANGELOG.md" "%TARGET_DIR%\"
copy /y "%ROOT%\CREDITS.md" "%TARGET_DIR%\"
if %BUILD_DEBUG% equ 1 (
copy /y "post_build\README.debug.md" "%TARGET_DIR%\"
copy /y "%ROOT%\post_build\README.debug.md" "%TARGET_DIR%\"
)
if exist "%TARGET_DIR%\experimental\" (
copy /y "post_build\README.experimental.md" "%TARGET_DIR%\experimental\"
copy /y "%ROOT%\post_build\README.experimental.md" "%TARGET_DIR%\experimental\"
)
if exist "%TARGET_DIR%\steamclient_experimental\" (
xcopy /y /s /e /r "post_build\win\ColdClientLoader.EXAMPLE\" "%TARGET_DIR%\steamclient_experimental\dll_injection.EXAMPLE\"
copy /y "post_build\README.experimental_steamclient.md" "%TARGET_DIR%\steamclient_experimental\"
copy /y "tools\steamclient_loader\win\ColdClientLoader.ini" "%TARGET_DIR%\steamclient_experimental\"
xcopy /y /s /e /r "%ROOT%\post_build\win\ColdClientLoader.EXAMPLE\" "%TARGET_DIR%\steamclient_experimental\dll_injection.EXAMPLE\"
copy /y "%ROOT%\post_build\README.experimental_steamclient.md" "%TARGET_DIR%\steamclient_experimental\"
copy /y "%ROOT%\tools\steamclient_loader\win\ColdClientLoader.ini" "%TARGET_DIR%\steamclient_experimental\"
)
if exist "%TARGET_DIR%\tools\generate_interfaces\" (
copy /y "post_build\README.generate_interfaces.md" "%TARGET_DIR%\tools\generate_interfaces\"
copy /y "%ROOT%\post_build\README.generate_interfaces.md" "%TARGET_DIR%\tools\generate_interfaces\"
)
if exist "%TARGET_DIR%\tools\lobby_connect\" (
copy /y "post_build\README.lobby_connect.md" "%TARGET_DIR%\tools\lobby_connect\"
copy /y "%ROOT%\post_build\README.lobby_connect.md" "%TARGET_DIR%\tools\lobby_connect\"
)
::::::::::::::::::::::::::::::::::::::::::
@ -85,22 +86,19 @@ for %%A in ("%ACHIVE_DIR%") do (
)
if exist "%ACHIVE_FILE%" (
del /f /s /q "%ACHIVE_FILE%"
del /f /q "%ACHIVE_FILE%"
)
call "%PKG_EXE%" a "%ACHIVE_FILE%" ".\%TARGET_DIR%" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+
if %errorlevel% neq 0 (
call "%PKG_EXE%" a "%ACHIVE_FILE%" "%TARGET_DIR%" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || (
goto :end_script_with_err
)
goto :end_script
:: exit without error
:end_script
endlocal
exit /b 0
:: exit with error
:end_script_with_err
endlocal
exit /b 1

View File

@ -3,7 +3,7 @@
# ################################################################################ #
[app::general]
# by default the emu will report a 'non-beta' branch when the game calls 'Steam_Apps::GetCurrentBetaName()'
# by default the emu will report a 'non-beta' branch when the game calls `Steam_Apps::GetCurrentBetaName()`
# 1=make the game/app think we're playing on a beta branch
# default=0
is_beta_branch=0

View File

@ -20,7 +20,7 @@ enable_account_avatar=0
# default=0
immediate_gameserver_stats=0
# 1=use the proper type of the server list (internet, friends, etc...) when requested by the game
# 0=always return the type of the server list as "LAN server"
# 0=always return the type of the server list as 'LAN server'
# not recommended to enable this
# default=0
matchmaking_server_list_actual_type=0
@ -35,7 +35,7 @@ matchmaking_server_details_via_source_query=0
crash_printer_location=./path/relative/to/dll/crashes.txt
[main::stats]
# 1=prevent 'Steam_User_Stats::FindLeaderboard()' from always succeeding and creating the unknown leaderboard
# 1=prevent `Steam_User_Stats::FindLeaderboard()` from always succeeding and creating the unknown leaderboard
# not recommended to enable this
# default=0
disable_leaderboards_create_unknown=0
@ -59,12 +59,16 @@ stat_achievement_progress_functionality=1
# also has no impact on the functions which directly change stats, achievements, or achievements progress
# default=1
save_only_higher_stat_achievement_progress=1
# the emulator loads the achievements icons is memory, this is needed for APIs like `ISteamUserStats::GetAchievementIcon()`
# the loaded icon size is controlled by [overlay::appearance] -> Icon_Size, in configs.overlay.ini
# 1=load icons lazily when they are requested
# 0=load icons as soon as the interface 'ISteamUserStats' is initialized
# default=1
lazy_load_achievements_icons=1
# the emulator loads the achievements icons is memory, this is needed for APIs like `ISteamUserStats::GetAchievementIcon()` and the overlay
# the loaded icon size is controlled by [overlay::appearance] -> Icon_Size, in the file configs.overlay.ini
# this value controls how many icons to load each iteration when the periodic callback of the emu is triggered
# or when the app/game calls `SteamAPI_RunCallbacks()`
# each achievement has 2 icons, one when it's locked and another when it's unlocked, so a value of 10 means loading 20 icons
# increasing this value will cause a huge startup delay
# -1=disable this functionality (`ISteamUserStats::GetAchievementIcon()` and the overlay won't be able to use icons)
# 0=load the icon in memory only when it's requested
# default=10
paginated_achievements_icons=10
[main::connectivity]
# 1=prevent hooking OS networking APIs and allow any external requests
@ -79,11 +83,11 @@ disable_networking=0
# change the UDP/TCP port the emulator listens on, you should probably not change this because everyone needs to use the same port or you won't find yourselves on the network
# default=47584
listen_port=47584
# 1=pretend Steam is running in offline mode, mainly affects the function 'ISteamUser::BLoggedOn()'
# 1=pretend Steam is running in offline mode, mainly affects the function `ISteamUser::BLoggedOn()`
# Some games that connect to online servers might only work if the Steam emu behaves like Steam is in offline mode
# default=0
offline=0
# 1=prevent sharing stats and achievements with any game server, this also disables the interface 'ISteamGameServerStats'
# 1=prevent sharing stats and achievements with any game server, this also disables the interface `ISteamGameServerStats`
# default=0
disable_sharing_stats_with_gameserver=0
# 1=do not send server details to the server browser, only works for game servers
@ -96,7 +100,7 @@ share_leaderboards_over_network=0
# 1=prevent lobby creation in the Steam matchmaking interface
# default=0
disable_lobby_creation=0
# 1=attempt to download external HTTP(S) requests made via 'Steam_HTTP::SendHTTPRequest()' inside 'steam_settings/http/' folder
# 1=attempt to download external HTTP(S) requests made via `Steam_HTTP::SendHTTPRequest()` inside 'steam_settings/http/' folder
# make sure to:
# * set disable_lan_only=1
# * set disable_networking=0
@ -109,11 +113,11 @@ download_steamhttp_requests=0
############################################
[main::misc]
# 1=force 'ISteamUserStats::SetAchievement()' to always return true
# 1=force `ISteamUserStats::SetAchievement()` to always return true
# this is a workaround for some games that otherwise won't work
# default=0
achievements_bypass=0
# force the function 'Steam_HTTP::SendHTTPRequest()' to always succeed
# force the function `Steam_HTTP::SendHTTPRequest()` to always succeed
# default=0
force_steamhttp_success=0
# env var 'SteamOverlayGameId' breaks Steam Input when the game is added to Steam as a non-steam game

View File

@ -33,6 +33,12 @@ disable_warning_bad_appid=0
# 1=disable the local_save warning in the overlay
# default=0
disable_warning_local_save=0
# by default the overlay will attempt to upload the achievements icons to the GPU
# so that they are displayed, in rare cases this might keep failing and cause FPS drop
# 0=prevent the overlay from attempting to upload the icons periodically,
# in that case achievements icons won't be displayed
# default=1
upload_achievements_icons_to_gpu=1
[overlay::appearance]
# load custom TrueType font from a path, it could be absolute, or relative

View File

@ -40,6 +40,22 @@ newoption {
default = nil
}
newoption {
category = "tools",
trigger = "cmake-toolchain",
description = "Use cmake toolchain",
value = 'path/to/toolchain.cmake',
default = nil
}
newoption {
category = "tools",
trigger = "custom-extractor",
description = "Use custom extractor",
value = 'path/to/7z.exe',
default = nil
}
-- deps extraction
newoption {
category = "extract",
@ -177,11 +193,16 @@ if not third_party_dir or not os.isdir(third_party_dir) then
error('third-party dir is missing')
end
if os.host() == 'windows' then
if _OPTIONS["custom-extractor"] then
extractor = _OPTIONS["custom-extractor"]
print('using custom extractor: ' .. _OPTIONS["custom-extractor"])
else
if os.host() == 'windows' then
extractor = extractor .. '.exe'
end
if not extractor or not os.isfile(extractor) then
end
if not extractor or not os.isfile(extractor) then
error('extractor is missing from third-party dir. extractor: ' .. extractor)
end
end
@ -242,11 +263,14 @@ local function cmake_build(dep_folder, is_32, extra_cmd_defs, c_flags_init, cxx_
table.insert(all_cxxflags_init, '/MT')
table.insert(all_cxxflags_init, '/D_MT')
local cmake_generator = os.getenv("CMAKE_GENERATOR") or ""
if cmake_generator == "" and os.host() == 'windows' or cmake_generator:find("Visual Studio") then
if is_32 then
cmd_gen = cmd_gen .. ' -A Win32'
else
cmd_gen = cmd_gen .. ' -A x64'
end
end
else
error("unsupported action for cmake build: " .. _ACTION)
return
@ -283,6 +307,9 @@ local function cmake_build(dep_folder, is_32, extra_cmd_defs, c_flags_init, cxx_
-- write toolchain file
local toolchain_file_content = ''
if _OPTIONS["cmake-toolchain"] then
toolchain_file_content='include(' .. _OPTIONS["cmake-toolchain"] .. ')\n\n'
end
if #cflags_init_str > 0 then
toolchain_file_content = toolchain_file_content .. 'set(CMAKE_C_FLAGS_INIT "' .. cflags_init_str .. '" )\n'
end
@ -361,11 +388,13 @@ end
-- chmod tools
if os.host() == "linux" then
if not _OPTIONS["custom-extractor"] then
local ok_chmod, err_chmod = os.chmod(extractor, "777")
if not ok_chmod then
error("cannot chmod: " .. err_chmod)
return
end
end
if not _OPTIONS["custom-cmake"] then
local ok_chmod, err_chmod = os.chmod(mycmake, "777")

View File

@ -99,7 +99,7 @@ local function genproto()
local out_dir = 'proto_gen/' .. os_iden
if os.host() == "windows" then
if os.target() == "windows" then
protoc_exe = protoc_exe .. '.exe'
end
@ -115,7 +115,7 @@ local function genproto()
return
end
if os.host() == "linux" then
if os.target() == "linux" then
local ok_chmod, err_chmod = os.chmod(protoc_exe, "777")
if not ok_chmod then
error("Error: " .. err_chmod)
@ -123,6 +123,10 @@ local function genproto()
end
end
if (os.host() == "linux" and os.target() == "windows") then
protoc_exe = 'wine ' .. protoc_exe
end
return os.execute(protoc_exe .. ' dll/net.proto -I./dll/ --cpp_out=' .. out_dir)
end
@ -406,7 +410,9 @@ local overlay_link = {
---------
local x32_ssq_libdir = path.join(deps_dir, "libssq/build32")
local x64_ssq_libdir = path.join(deps_dir, "libssq/build64")
if _ACTION and string.match(_ACTION, 'vs.+') then
local cmake_generator = os.getenv("CMAKE_GENERATOR") or ""
if cmake_generator == "" and os.host() == 'windows' or cmake_generator:find("Visual Studio") then
x32_ssq_libdir = x32_ssq_libdir .. "/Release"
x64_ssq_libdir = x64_ssq_libdir .. "/Release"
end

View File

@ -1,6 +1,6 @@
================================================================
Copyright © 1996-2022, Valve Corporation, All rights reserved.
Copyright © 1996-2024, Valve Corporation, All rights reserved.
================================================================
@ -8,6 +8,26 @@ Copyright © 1996-2022, Valve Corporation, All rights reserved.
Welcome to the Steamworks SDK. For documentation please see our partner
website at: http://partner.steamgames.com
----------------------------------------------------------------
v1.60 19th June 2024
----------------------------------------------------------------
General
* CSteamAPIContext has been removed. Please switch to using the Steam<interface> accessors where appropriate.
ISteamTimeline
* Added this new interface to allow games to provide information that supports the new Game Recording feature. See the [url=https://partner.steamgames.com/doc/features/timeline]Timeline[/url] documentation for more information.
ISteamUGC
* Added 64 bit m_ulTotalFilesSize to SteamUGCDetails_t which is the correct size of the content for Workshop items are larger than 2,147,483,647 bytes.
* Added GetNumSupportedGameVersions() and GetSupportedGameVersionData() which can be used to determine what game beta branches a Workshop item supports/is valid for.
* Added SetAdminQuery() to allow ISteamUGC to be used in a tools like environment for users who have the appropriate privileges for the calling appid.
ISteamApps
* Added API to allow the game to manage active beta branches.
----------------------------------------------------------------
v1.59 9th February 2024
----------------------------------------------------------------

View File

@ -1 +1,3 @@
#### INFO
https://partner.steamgames.com/doc/sdk

View File

@ -0,0 +1,19 @@
#ifndef ISTEAMAPPDISABLEUPDATE_H
#define ISTEAMAPPDISABLEUPDATE_H
// this interface is not found in public SDK archives, it is based on reversing the returned vftable from steamclient64.dll
// requested by appid 730
class ISteamAppDisableUpdate
{
public:
// probably means how many seconds to keep the updates disabled
virtual void SetAppUpdateDisabledSecondsRemaining(int32 nSeconds) = 0;
};
#define STEAMAPPDISABLEUPDATE_INTERFACE_VERSION "SteamAppDisableUpdate001"
#endif // ISTEAMAPPDISABLEUPDATE_H

View File

@ -301,8 +301,9 @@ public:
/// Returns basic information about the high-level state of the connection.
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
// based on reversing the vftable returned from original steamclient64.dll
virtual bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus ) = 0;
/// Returns a small set of information about the real-time state of the connection
/// Returns false if the connection handle is invalid, or the connection has ended.
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
/// Returns detailed connection stats in text format. Useful
/// for dumping to a log, etc.

View File

@ -301,8 +301,9 @@ public:
/// Returns basic information about the high-level state of the connection.
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
// based on reversing the vftable returned from original steamclient64.dll
virtual bool GetConnectionRealTimeStatus_old( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus ) = 0;
/// Returns a small set of information about the real-time state of the connection
/// Returns false if the connection handle is invalid, or the connection has ended.
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
/// Returns detailed connection stats in text format. Useful
/// for dumping to a log, etc.

53
sdk/steam/isteamuser004.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef ISTEAMUSER004_H
#define ISTEAMUSER004_H
#ifdef STEAM_WIN32
#pragma once
#endif
enum EConfigSubTree {
EConfigSubTree_stub
};
enum ELogonState {
ELogonState_stub
};
class ISteamUser004
{
public:
virtual HSteamUser GetHSteamUser() = 0;
virtual void LogOn( CSteamID steamID ) = 0;
virtual void LogOff() = 0;
virtual bool BLoggedOn() = 0;
virtual ELogonState GetLogonState() = 0;
virtual bool BConnected() = 0;
virtual CSteamID GetSteamID() = 0;
virtual bool IsVACBanned( int nGameID ) = 0;
virtual bool RequireShowVACBannedMessage( int nGameID ) = 0;
virtual void AcknowledgeVACBanning( int nGameID ) = 0;
// These are dead.
virtual int NClientGameIDAdd( int nGameID ) = 0;
virtual void RemoveClientGame( int nClientGameID ) = 0;
virtual void SetClientGameServer( int nClientGameID, uint32 unIPServer, uint16 usPortServer ) = 0;
virtual void SetSteam2Ticket( uint8 *pubTicket, int cubTicket ) = 0;
virtual void AddServerNetAddress( uint32 unIP, uint16 unPort ) = 0;
virtual bool SetEmail( const char *pchEmail ) = 0;
// logon cookie - this is obsolete and never used
virtual int GetSteamGameConnectToken( void *pBlob, int cbMaxBlob ) = 0;
virtual bool SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue ) = 0;
virtual bool GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue ) = 0;
virtual bool SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue ) = 0;
virtual bool GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue ) = 0;
virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, int nGameAppID, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
virtual void SetSelfAsPrimaryChatDestination() = 0;
virtual bool IsPrimaryChatDestination() = 0;
virtual void RequestLegacyCDKey( uint32 iAppID ) = 0;
};
#endif // ISTEAMUSER004_H

57
sdk/steam/isteamuser005.h Normal file
View File

@ -0,0 +1,57 @@
#ifndef ISTEAMUSER005_H
#define ISTEAMUSER005_H
#ifdef STEAM_WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
class ISteamUser005
{
public:
virtual HSteamUser GetHSteamUser() = 0;
virtual void LogOn( CSteamID steamID ) = 0;
virtual void LogOff() = 0;
virtual bool BLoggedOn() = 0;
virtual ELogonState GetLogonState() = 0;
virtual bool BConnected() = 0;
virtual CSteamID GetSteamID() = 0;
virtual bool IsVACBanned( int nGameID ) = 0;
virtual bool RequireShowVACBannedMessage( int nAppID ) = 0;
virtual void AcknowledgeVACBanning( int nAppID ) = 0;
virtual void SetSteam2Ticket( uint8 *pubTicket, int cubTicket ) = 0;
virtual void AddServerNetAddress( uint32 unIP, uint16 unPort ) = 0;
virtual bool SetEmail( const char *pchEmail ) = 0;
virtual bool SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue ) = 0;
virtual bool GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue ) = 0;
virtual bool SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue ) = 0;
virtual bool GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue ) = 0;
virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
virtual void SetSelfAsPrimaryChatDestination() = 0;
virtual bool IsPrimaryChatDestination() = 0;
virtual void RequestLegacyCDKey( uint32 nAppID ) = 0;
virtual bool SendGuestPassByEmail( const char *pchEmailAccount, GID_t gidGuestPassID, bool bResending ) = 0;
virtual bool SendGuestPassByAccountID( uint32 uAccountID, GID_t gidGuestPassID, bool bResending ) = 0;
virtual bool AckGuestPass(const char *pchGuestPassCode) = 0;
virtual bool RedeemGuestPass(const char *pchGuestPassCode) = 0;
virtual uint32 GetGuestPassToGiveCount() = 0;
virtual uint32 GetGuestPassToRedeemCount() = 0;
virtual RTime32 GetGuestPassLastUpdateTime() = 0;
virtual bool GetGuestPassToGiveInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed, char *pchRecipientAddress, int cRecipientAddressSize ) = 0;
virtual bool GetGuestPassToRedeemInfo( uint32 nPassIndex, GID_t *pgidGuestPassID, PackageId_t *pnPackageID, RTime32 *pRTime32Created, RTime32 *pRTime32Expiration, RTime32 *pRTime32Sent, RTime32 *pRTime32Redeemed) = 0;
virtual bool GetGuestPassToRedeemSenderAddress( uint32 nPassIndex, char* pchSenderAddress, int cSenderAddressSize ) = 0;
virtual bool GetGuestPassToRedeemSenderName( uint32 nPassIndex, char* pchSenderName, int cSenderNameSize ) = 0;
virtual void AcknowledgeMessageByGID( const char *pchMessageGID ) = 0;
virtual bool SetLanguage( const char *pchLanguage ) = 0;
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
virtual void SetAccountName( const char *pchAccountName ) = 0;
virtual void SetPassword( const char *pchPassword ) = 0;
virtual void SetAccountCreationTime( RTime32 rt ) = 0;
};
#endif // ISTEAMUSER005_H

64
sdk/steam/isteamuser006.h Normal file
View File

@ -0,0 +1,64 @@
#ifndef ISTEAMUSER006_H
#define ISTEAMUSER006_H
#ifdef STEAM_WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
class ISteamUser006
{
public:
// returns the HSteamUser this interface represents
// this is only used internally by the API, and by a few select interfaces that support multi-user
virtual HSteamUser GetHSteamUser() = 0;
virtual void LogOn( CSteamID steamID ) = 0;
virtual void LogOff() = 0;
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
virtual bool BLoggedOn() = 0;
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
virtual CSteamID GetSteamID() = 0;
virtual bool SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue ) = 0;
virtual bool GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue ) = 0;
virtual bool SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue ) = 0;
virtual bool GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue ) = 0;
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
//
// Parameters:
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
//
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
// Legacy functions
// used by only a few games to track usage events
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
};
#endif // ISTEAMUSER006_H

68
sdk/steam/isteamuser007.h Normal file
View File

@ -0,0 +1,68 @@
#ifndef ISTEAMUSER007_H
#define ISTEAMUSER007_H
#ifdef STEAM_WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
class ISteamUser007
{
public:
// returns the HSteamUser this interface represents
// this is only used internally by the API, and by a few select interfaces that support multi-user
virtual HSteamUser GetHSteamUser() = 0;
virtual void LogOn( CSteamID steamID ) = 0;
virtual void LogOff() = 0;
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
virtual bool BLoggedOn() = 0;
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
virtual CSteamID GetSteamID() = 0;
virtual bool SetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, const char *pchValue ) = 0;
virtual bool GetRegistryString( EConfigSubTree eRegistrySubTree, const char *pchKey, char *pchValue, int cbValue ) = 0;
virtual bool SetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int iValue ) = 0;
virtual bool GetRegistryInt( EConfigSubTree eRegistrySubTree, const char *pchKey, int *piValue ) = 0;
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
//
// Parameters:
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
//
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure, void *pvSteam2GetEncryptionKey, int cbSteam2GetEncryptionKey ) = 0;
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
// Legacy functions
// used by only a few games to track usage events
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
// legacy authentication support - need to be called if the game server rejects the user with a 'bad ticket' error
// this is only needed under very specific circumstances
virtual void RefreshSteam2Login() = 0;
};
#endif // ISTEAMUSER007_H

60
sdk/steam/isteamuser008.h Normal file
View File

@ -0,0 +1,60 @@
#ifndef ISTEAMUSER008_H
#define ISTEAMUSER008_H
#ifdef STEAM_WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
class ISteamUser008
{
public:
// returns the HSteamUser this interface represents
// this is only used internally by the API, and by a few select interfaces that support multi-user
virtual HSteamUser GetHSteamUser() = 0;
// returns true if the Steam client current has a live connection to the Steam servers.
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
// The Steam client will automatically be trying to recreate the connection as often as possible.
virtual bool BLoggedOn() = 0;
// returns the CSteamID of the account currently logged into the Steam client
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
virtual CSteamID GetSteamID() = 0;
// Multiplayer Authentication functions
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
//
// Parameters:
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
//
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
virtual int InitiateGameConnection( void *pBlob, int cbMaxBlob, CSteamID steamID, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure, void *pvSteam2GetEncryptionKey, int cbSteam2GetEncryptionKey ) = 0;
// notify of disconnect
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
// Legacy functions
// used by only a few games to track usage events
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
// legacy authentication support - need to be called if the game server rejects the user with a 'bad ticket' error
// this is only needed under very specific circumstances
virtual void RefreshSteam2Login() = 0;
};
#endif // ISTEAMUSER008_H

View File

@ -0,0 +1,34 @@
#ifndef ISTEAMUTILS001_H
#define ISTEAMUTILS001_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamUtils001
{
public:
// return the number of seconds since the user
virtual uint32 GetSecondsSinceAppActive() = 0;
virtual uint32 GetSecondsSinceComputerActive() = 0;
// the universe this client is connecting to
virtual EUniverse GetConnectedUniverse() = 0;
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
virtual uint32 GetServerRealTime() = 0;
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
// e.g "US" or "UK".
virtual const char *GetIPCountry() = 0;
// returns true if the image exists, and valid sizes were filled out
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
// returns true if the image exists, and the buffer was successfully filled out
// results are returned in RGBA format
// the destination buffer size should be 4 * height * width * sizeof(char)
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
};
#endif // ISTEAMUTILS001_H

View File

@ -21,6 +21,7 @@
#include "steam_api_common.h"
// All of the interfaces
#include "isteamappdisableupdate.h"
#include "isteamclient.h"
#include "isteamclient007.h"
#include "isteamclient008.h"
@ -37,6 +38,11 @@
#include "isteamclient019.h"
#include "isteamclient020.h"
#include "isteamuser.h"
#include "isteamuser004.h"
#include "isteamuser005.h"
#include "isteamuser006.h"
#include "isteamuser007.h"
#include "isteamuser008.h"
#include "isteamuser009.h"
#include "isteamuser010.h"
#include "isteamuser011.h"
@ -67,6 +73,7 @@
#include "isteamfriends015.h"
#include "isteamfriends016.h"
#include "isteamutils.h"
#include "isteamutils001.h"
#include "isteamutils002.h"
#include "isteamutils003.h"
#include "isteamutils004.h"

View File

@ -1,18 +1,21 @@
//#include "dll.h"
#define WIN32_LEAN_AND_MEAN
// #include "dll.h"
#include "Windows.h"
#ifdef _WIN64
#define DLL_NAME "steam_api64.dll"
#else
#define DLL_NAME "steam_api.dll"
#endif
extern "C" __declspec( dllexport ) void *CreateInterface( const char *pName, int *pReturnCode )
extern "C" __declspec(dllexport) void *CreateInterface(const char *pName, int *pReturnCode)
{
//PRINT_DEBUG("%s", pName);
// PRINT_DEBUG("%s", pName);
HMODULE steam_api = LoadLibraryA(DLL_NAME);
void *(__stdcall* create_interface)(const char*) = (void * (__stdcall *)(const char*))GetProcAddress(steam_api, "SteamInternal_CreateInterface");
void *(__stdcall * create_interface)(const char *) = reinterpret_cast<void *(__stdcall *)(const char *)>(GetProcAddress(steam_api, "SteamInternal_CreateInterface"));
return create_interface(pName);
}

@ -1 +1 @@
Subproject commit c8c5f528a1a90e7ba786990aa5176a389aae0ec9
Subproject commit 6cf0418a1973e43abc7a34bdf447e4305f4a235f

View File

@ -0,0 +1,211 @@
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
; ARC_NAME
$arc_generate_interfaces = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "generate_interfaces", "generate_interfaces.7z")
; EXE_PATH
$generate_interfaces_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces_release", "generate_interfaces.exe")
$generate_interfaces64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces64_release", "generate_interfaces64.exe")
$generate_interfaces_7z = @ScriptDir & '\steam_misc\tools\generate_interfaces\' & $arc_generate_interfaces
$generate_interfaces_dst = @ScriptDir & '\steam_misc\tools\generate_interfaces'
$generate_interfaces_exe = ''
Switch @OSArch
Case 'X64'
$generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then
ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE)
EndIf
Case 'X86'
$generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) ; generate_interfaces.exe
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then
ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE)
EndIf
Case Else
$generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then
ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE)
EndIf
EndSwitch
If Not FileExists(@ScriptDir & '\steam_api.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)))
If Not FileExists(@ScriptDir & '\steam_api64.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)))
Switch @OSArch
Case 'X64'
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then
$generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))
EndIf
Case 'X86'
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then
$generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))
EndIf
Case Else
If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then
$generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))
EndIf
EndSwitch
If FileExists(@ScriptDir & '\valve_api.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api.dll.bak' & '"', @ScriptDir, @SW_HIDE)
EndIf
If FileExists(@ScriptDir & '\steam_api.dll.bak') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.bak' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api.dll.org') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.org' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api.bak') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.bak' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api.org') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.org' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api_orig.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_orig.dll' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api_legit.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_legit.dll' & '"', @ScriptDir, @SW_HIDE)
#ElseIf FileExists(@ScriptDir & '\steam_api.dll') Then
#RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll' & '"', @ScriptDir, @SW_HIDE)
EndIf
If FileExists(@ScriptDir & '\valve_api64.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE)
EndIf
If FileExists(@ScriptDir & '\steam_api64.dll.bak') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api64.dll.org') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.org' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api64.bak') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.bak' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api64.org') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.org' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api64_orig.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_orig.dll' & '"', @ScriptDir, @SW_HIDE)
ElseIf FileExists(@ScriptDir & '\steam_api64_legit.dll') Then
RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_legit.dll' & '"', @ScriptDir, @SW_HIDE)
#ElseIf FileExists(@ScriptDir & '\steam_api64.dll') Then
#RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll' & '"', @ScriptDir, @SW_HIDE)
EndIf
FileMove(@ScriptDir & '\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.txt', 9)
FileCopy(@ScriptDir & '\steam_settings\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.ini', 9)
$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',0)
$sOld=FileRead($hFile)
FileClose($hFile)
$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',2)
$sNew='[steam_interfaces]' & @CRLF & $sOld
FileWrite($hFile,$sNew)
FileClose($hFile)
$interfaces_ini = @ScriptDir & '\steam_settings\steam_interfaces.ini'
$codex_ini = @ScriptDir & '\steam_misc\extra_crk\CODEX\steam_emu.ini'
_AddInterfaces($codex_ini)
$rune_ini = @ScriptDir & '\steam_misc\extra_crk\RUNE\steam_emu.ini'
_AddInterfaces($rune_ini)
FileDelete($interfaces_ini)
Func _AddInterfaces($crack_ini)
If FileExists($crack_ini) Then
_ReplaceStringInFile($interfaces_ini, 'SteamAppDisableUpdate', 'SteamAppDisableUpdate=SteamAppDisableUpdate', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMAPPLIST_', 'SteamAppList=STEAMAPPLIST_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMAPPS_', 'SteamApps=STEAMAPPS_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMAPPTICKET_', 'SteamAppTicket=STEAMAPPTICKET_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamClient', 'SteamClient=SteamClient', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamController', 'SteamController=SteamController', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamFriends', 'SteamFriends=SteamFriends', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamGameCoordinator', 'SteamGameCoordinator=SteamGameCoordinator', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamGameServerStats', 'Steam_Game_Server_Stats=Steam_Game_Server_Stats', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamGameServer', 'SteamGameServer=SteamGameServer', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Game_Server_Stats', 'SteamGameServerStats', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamGameStats', 'SteamGameStats=SteamGameStats', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMHTMLSURFACE_', 'SteamHTMLSurface=STEAMHTMLSURFACE_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMHTTP_', 'SteamHTTP=STEAMHTTP_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamInput', 'SteamInput=SteamInput', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMINVENTORY_', 'SteamInventory=STEAMINVENTORY_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamMasterServerUpdater', 'SteamMasterServerUpdater=SteamMasterServerUpdater', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamMatchGameSearch', 'SteamMatchGameSearch=SteamMatchGameSearch', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamMatchMakingServers', 'Steam_Match_Making_Servers=Steam_Match_Making_Servers', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamMatchMaking', 'SteamMatchMaking=SteamMatchMaking', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Match_Making_Servers', 'SteamMatchMakingServers', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMMUSIC_', 'SteamMusic=STEAMMUSIC_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMMUSICREMOTE_', 'SteamMusicRemote=STEAMMUSICREMOTE_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamNetworkingMessages', 'Steam_Networking_Messages=Steam_Networking_Messages', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSocketsSerialized', 'Steam_Networking_Sockets_Serialized=Steam_Networking_Sockets_Serialized', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSockets', 'Steam_Networking_Sockets=Steam_Networking_Sockets', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamNetworkingUtils', 'Steam_Networking_Utils=Steam_Networking_Utils', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamNetworking', 'SteamNetworking=SteamNetworking', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Messages', 'SteamNetworkingMessages', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets_Serialized', 'SteamNetworkingSocketsSerialized', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets', 'SteamNetworkingSockets', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Utils', 'SteamNetworkingUtils', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMPARENTALSETTINGS_', 'SteamParentalSettings=STEAMPARENTALSETTINGS_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamParties', 'SteamParties=SteamParties', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMREMOTEPLAY_', 'SteamRemotePlay=STEAMREMOTEPLAY_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMREMOTESTORAGE_', 'SteamRemoteStorage=STEAMREMOTESTORAGE_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMSCREENSHOTS_', 'SteamScreenshots=STEAMSCREENSHOTS_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMTIMELINE_', 'SteamTimeline=STEAMTIMELINE_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMTV_', 'SteamTV=STEAMTV_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMUGC_', 'SteamUGC=STEAMUGC_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMUNIFIEDMESSAGES_', 'SteamUnifiedMessages=STEAMUNIFIEDMESSAGES_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMUSERSTATS_', 'Steam_User_Stats=STEAMUSERSTATS_', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamUser', 'SteamUser=SteamUser', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'Steam_User_Stats', 'SteamUserStats', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'SteamUtils', 'SteamUtils=SteamUtils', 1, 1)
_ReplaceStringInFile($interfaces_ini, 'STEAMVIDEO_', 'SteamVideo=STEAMVIDEO_', 1, 1)
IniWrite($crack_ini, 'Interfaces', 'SteamAppDisableUpdate', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppDisableUpdate', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamAppList', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppList', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamApps', IniRead($interfaces_ini, 'steam_interfaces', 'SteamApps', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamAppTicket', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppTicket', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamClient', IniRead($interfaces_ini, 'steam_interfaces', 'SteamClient', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamController', IniRead($interfaces_ini, 'steam_interfaces', 'SteamController', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamFriends', IniRead($interfaces_ini, 'steam_interfaces', 'SteamFriends', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamGameCoordinator', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameCoordinator', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamGameServerStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServerStats', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamGameServer', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServer', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamGameStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameStats', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamHTMLSurface', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTMLSurface', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamHTTP', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTTP', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamInput', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInput', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamInventory', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInventory', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMasterServerUpdater', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMasterServerUpdater', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMatchGameSearch', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchGameSearch', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMatchMakingServers', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMakingServers', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMatchMaking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMaking', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMusic', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusic', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamMusicRemote', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusicRemote', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamNetworkingMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingMessages', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamNetworkingSocketsSerialized', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSocketsSerialized', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamNetworkingSockets', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSockets', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamNetworkingUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingUtils', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamNetworking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworking', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamParentalSettings', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParentalSettings', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamParties', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParties', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamRemotePlay', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemotePlay', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamRemoteStorage', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemoteStorage', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamScreenshots', IniRead($interfaces_ini, 'steam_interfaces', 'SteamScreenshots', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamTimeline', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTimeline', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamTV', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTV', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamUGC', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUGC', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamUnifiedMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUnifiedMessages', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamUserStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUserStats', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamUser', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUser', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUtils', ''))
IniWrite($crack_ini, 'Interfaces', 'SteamVideo', IniRead($interfaces_ini, 'steam_interfaces', 'SteamVideo', ''))
EndIf
EndFunc

Some files were not shown because too many files have changed in this diff Show More