Merge branch 'lobby_connect_relay_daemon_and_game_fix' into 'master'

Add unicast relay daemon mode to lobby_connect and add some game fixes.

See merge request Mr_Goldberg/goldberg_emulator!56
This commit is contained in:
redpolline 2025-01-31 09:57:59 +00:00
commit c6a2b1f967
28 changed files with 775 additions and 179 deletions

13
.gitattributes vendored Normal file
View File

@ -0,0 +1,13 @@
# Set the default behavior.
* text=auto
# Unix shell files should always be LF.
*.sh text eol=lf
# Windows shell files should always be CRLF.
*.bat text eol=crlf
# Binary files.
*.jpg binary
*.png binary

35
.gitignore vendored
View File

@ -1,17 +1,18 @@
.vs/*
.vscode/*
*.bin
*.o
net.pb.*
*steam_api*
release/*
/build*/
*.obj
/dll/net.pb.cc
/dll/net.pb.h
base.exp
base.lib
rtlgenrandom*
steamclient.exp
steamclient.lib
out/*
.vs/*
.vscode/*
*.bin
*.o
net.pb.*
*steam_api*
release/*
debug/*
/build*/
*.obj
/dll/net.pb.cc
/dll/net.pb.h
base.exp
base.lib
rtlgenrandom*
steamclient.exp
steamclient.lib
out/*

View File

@ -69,15 +69,21 @@ build_windows:
- 7za x protobuf_x86-windows-static.7z -oprotobuf_x86-windows-static
- 7za x protobuf_x64-windows-static.7z -oprotobuf_x64-windows-static
- 7za x sdk_standalone.7z -osdk_standalone
- DLL_FILES="$(ls dll/*.cpp | tr "\n" " ")"; sed "s|dll/\*.cpp|$DLL_FILES|g" -i *.bat
- DLL_FILES="$(ls dll/*.proto | tr "\n" " " | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat
- DLL_FILES="$(ls dll/*.cpp | tr "\n" " " | tr "/" "\\\\")"; sed "s|dll/\*.cpp|$DLL_FILES|g" -i *.bat
- DLL_FILES="$(ls dll/*.proto | tr "\n" " " | tr "/" "\\\\" | sed "s/.proto/.pb.cc/g")"; sed "s|dll/\*.cc|$DLL_FILES|g" -i *.bat
- sed "s| /MP12 | /MP4 |g" -i *.bat
# CI can't produce PDBs. Throws a bunch of errors, and skips building the PEs.
- sed "s| /DDEBUG\:FULL | |g" -i *.bat
# Turn on echo.
- sed "s|echo off|echo on|g" -i *.bat
- python generate_build_win_bat.py
- export WINEDEBUG=-all
- wine cmd /c build_win_release_test.bat
- cp build_win_release_test.bat release/build_win_release_test.bat
artifacts:
paths:
- release/
- debug/
expire_in: 1 day
build_cmake_linux:

View File

@ -12,6 +12,8 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Bu
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2022
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2022_bt
if exist ".\sdk_standalone\set_vars64.bat" goto gitlabci
if exist "vsinstallloc.txt" goto readloc
if exist "%VS_Base_Path%\Microsoft Visual Studio\Installer\vswhere.exe" goto wherevs
:vs2022
call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
@ -44,4 +46,14 @@ goto batend
:gitlabci
call ".\sdk_standalone\set_vars64.bat"
goto batend
:wherevs
call "%VS_Base_Path%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath > vsinstallloc.txt
goto readloc
:readloc
set /p VS_LOCAL=<vsinstallloc.txt
call "%VS_LOCAL%\VC\Auxiliary\Build\vcvars64.bat"
goto batend
:batend

View File

@ -12,6 +12,8 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Bu
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2022
if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2022_bt
if exist ".\sdk_standalone\set_vars32.bat" goto gitlabci
if exist "vsinstallloc.txt" goto readloc
if exist "%VS_Base_Path%\Microsoft Visual Studio\Installer\vswhere.exe" goto wherevs
:vs2022
call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"
@ -41,8 +43,17 @@ goto batend
call "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:gitlabci
call ".\sdk_standalone\set_vars32.bat"
goto batend
:wherevs
call "%VS_Base_Path%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath > vsinstallloc.txt
goto readloc
:readloc
set /p VS_LOCAL=<vsinstallloc.txt
call "%VS_LOCAL%\VC\Auxiliary\Build\vcvars32.bat"
goto batend
:batend

View File

@ -1,2 +1,4 @@
protoc -I./dll/ --cpp_out=./dll/ ./dll/*.proto
clang++ -shared -fPIC -o libsteam_api.so dll/*.cpp dll/*.cc -g3 -Wno-return-type -fsanitize=address -lasan -lprotobuf-lite -std=c++14 && echo built
#!/bin/bash
protoc -I"${PWD}/dll/" --cpp_out="${PWD}/dll/" "${PWD}"/dll/*.proto
clang++ -shared -fPIC -o libsteam_api.so dll/*.cpp dll/*.cc -g3 -Wno-return-type -fsanitize=address -lasan -lprotobuf-lite -std=c++14 && echo built libsteam_api.so
clang++ -fPIC -o lobby_connect lobby_connect.cpp dll/*.cpp dll/*.cc -g3 -Wno-return-type -fsanitize=address -lasan -lprotobuf-lite -std=c++14 && echo built lobby_connect

View File

@ -1,14 +1,38 @@
@echo off
cd /d "%~dp0"
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\experimental ( mkdir build\experimental )
IF NOT EXIST build\experimental\debug ( mkdir build\experimental\debug )
IF NOT EXIST build\experimental\debug\x86 ( mkdir build\experimental\debug\x86 )
IF NOT EXIST build\experimental\debug\x64 ( mkdir build\experimental\debug\x64 )
IF EXIST build\experimental\debug\x86\*.* ( DEL /F /S /Q build\experimental\debug\x86\*.* )
IF EXIST build\experimental\debug\x64\*.* ( DEL /F /S /Q build\experimental\debug\x64\*.* )
IF NOT EXIST debug ( mkdir debug )
IF NOT EXIST debug\experimental ( mkdir debug\experimental )
IF EXIST debug\experimental\*.* ( DEL /F /S /Q debug\experimental\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /Z7 /LD /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api.dll
cl /LD steamclient.cpp /EHsc /MP12 /link /OUT:steamclient.dll
SET OLD_DIR=%cd%
cd build\experimental\debug\x86
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental\steam_api.pdb /link /OUT:%OLD_DIR%\debug\experimental\steam_api.dll
cl /LD %OLD_DIR%/steamclient.cpp /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental\steamclient.pdb /link /OUT:%OLD_DIR%\debug\experimental\steamclient.dll
cd %OLD_DIR%
endlocal
setlocal
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /Z7 /LD /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steam_api64.dll
cl /LD steamclient.cpp /EHsc /MP12 /link /OUT:steamclient64.dll
SET OLD_DIR=%cd%
cd build\experimental\debug\x64
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X64_DIRECTORY%\include\ /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental\steam_api64.pdb /link /OUT:%OLD_DIR%\debug\experimental\steam_api64.dll
cl /LD %OLD_DIR%/steamclient.cpp /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental\steamclient64.pdb /link /OUT:%OLD_DIR%\debug\experimental\steamclient64.dll
cd %OLD_DIR%
endlocal

View File

@ -1,9 +1,36 @@
@echo off
cd /d "%~dp0"
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\experimental_steamclient ( mkdir build\experimental_steamclient )
IF NOT EXIST build\experimental_steamclient\debug ( mkdir build\experimental_steamclient\debug )
IF NOT EXIST build\experimental_steamclient\debug\x86 ( mkdir build\experimental_steamclient\debug\x86 )
IF NOT EXIST build\experimental_steamclient\debug\x64 ( mkdir build\experimental_steamclient\debug\x64 )
IF EXIST build\experimental_steamclient\debug\x86\*.* ( DEL /F /S /Q build\experimental_steamclient\debug\x86\*.* )
IF EXIST build\experimental_steamclient\debug\x64\*.* ( DEL /F /S /Q build\experimental_steamclient\debug\x64\*.* )
IF NOT EXIST debug ( mkdir debug )
IF NOT EXIST debug\experimental_steamclient ( mkdir debug\experimental_steamclient )
IF EXIST debug\experimental_steamclient\*.* ( DEL /F /S /Q debug\experimental_steamclient\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steamclient.dll
SET OLD_DIR=%cd%
cd build\experimental_steamclient\debug\x86
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental_steamclient\steamclient.pdb /link /OUT:%OLD_DIR%\debug\experimental_steamclient\steamclient.dll
cl %OLD_DIR%/steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental_steamclient\steamclient_loader_x32.pdb /link /OUT:%OLD_DIR%\debug\experimental_steamclient\steamclient_loader_x32.exe
cd %OLD_DIR%
endlocal
setlocal
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /link /OUT:steamclient64.dll
SET OLD_DIR=%cd%
cd build\experimental_steamclient\debug\x64
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X64_DIRECTORY%\include\ /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_EXPERIMENTAL_BUILD /DEMU_OVERLAY /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental_steamclient\steamclient64.pdb /link /OUT:%OLD_DIR%\debug\experimental_steamclient\steamclient64.dll
cl %OLD_DIR%/steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\experimental_steamclient\steamclient_loader_x64.pdb /link /OUT:%OLD_DIR%\debug\experimental_steamclient\steamclient_loader_x64.exe
cd %OLD_DIR%
endlocal

View File

@ -0,0 +1,25 @@
@echo off
cd /d "%~dp0"
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\debug ( mkdir build\debug )
IF NOT EXIST build\debug\lobby_connect ( mkdir build\debug\lobby_connect )
IF NOT EXIST build\debug\lobby_connect\x86 ( mkdir build\debug\lobby_connect\x86 )
IF EXIST build\debug\lobby_connect\x86\*.* ( DEL /F /S /Q build\debug\lobby_connect\x86\*.* )
IF NOT EXIST debug ( mkdir debug )
IF NOT EXIST debug\lobby_connect ( mkdir debug\lobby_connect )
IF EXIST debug\lobby_connect\*.* ( DEL /F /S /Q debug\lobby_connect\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
SET OLD_DIR=%cd%
cd build\debug\lobby_connect\x86
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /DNO_DISK_WRITES /DLOBBY_CONNECT /DEMU_RELEASE_BUILD /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ %OLD_DIR%/lobby_connect.cpp %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Comdlg32.lib /EHsc /MP12 /Ox /DDEBUG:FULL /Zi /Fd:%OLD_DIR%\debug\lobby_connect\lobby_connect.pdb /link /OUT:%OLD_DIR%\debug\lobby_connect\lobby_connect.exe
cd %OLD_DIR%
copy Readme_lobby_connect.txt debug\lobby_connect\Readme.txt
endlocal

View File

@ -1,9 +1,20 @@
@echo off
cd /d "%~dp0"
mkdir release\tools
del /Q release\tools\*
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\release ( mkdir build\release )
IF NOT EXIST build\release\tools ( mkdir build\release\tools )
IF NOT EXIST build\release\tools\x86 ( mkdir build\release\tools\x86 )
IF EXIST build\release\tools\x86\*.* ( DEL /F /S /Q build\release\tools\x86\*.* )
IF NOT EXIST release\tools ( mkdir release\tools )
IF EXIST release\tools\*.* ( DEL /F /S /Q release\tools\*.* )
setlocal
call build_env_x86.bat
cl generate_interfaces_file.cpp /EHsc /MP12 /Ox /link /debug:none /OUT:release\tools\generate_interfaces_file.exe
del /Q /S release\tools\*.lib
del /Q /S release\tools\*.exp
SET OLD_DIR=%cd%
cd build\release\tools\x86
cl %OLD_DIR%/generate_interfaces_file.cpp /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\tools\generate_interfaces_file.exe
cd %OLD_DIR%
copy Readme_generate_interfaces.txt release\tools\Readme_generate_interfaces.txt
endlocal

View File

@ -1,12 +1,23 @@
@echo off
cd /d "%~dp0"
mkdir release\lobby_connect
del /Q release\lobby_connect\*
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\release ( mkdir build\release )
IF NOT EXIST build\release\lobby_connect ( mkdir build\release\lobby_connect )
IF NOT EXIST build\release\lobby_connect\x86 ( mkdir build\release\lobby_connect\x86 )
IF EXIST build\release\lobby_connect\x86\*.* ( DEL /F /S /Q build\release\lobby_connect\x86\*.* )
IF NOT EXIST release\lobby_connect ( mkdir release\lobby_connect )
IF EXIST release\lobby_connect\*.* ( DEL /F /S /Q release\lobby_connect\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /DNO_DISK_WRITES /DLOBBY_CONNECT /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ lobby_connect.cpp dll/*.cpp dll/*.cc "%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Comdlg32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\lobby_connect\lobby_connect.exe
del /Q /S release\lobby_connect\*.lib
del /Q /S release\lobby_connect\*.exp
SET OLD_DIR=%cd%
cd build\release\lobby_connect\x86
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /DNO_DISK_WRITES /DLOBBY_CONNECT /DEMU_RELEASE_BUILD /DNDEBUG /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ %OLD_DIR%/lobby_connect.cpp %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Comdlg32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\lobby_connect\lobby_connect.exe
cd %OLD_DIR%
copy Readme_lobby_connect.txt release\lobby_connect\Readme.txt
endlocal

View File

@ -1,21 +1,39 @@
@echo off
cd /d "%~dp0"
del /Q /S release\*
rmdir /S /Q release\experimental
rmdir /S /Q release\experimental_steamclient
rmdir /S /Q release\lobby_connect
rmdir /S /Q release
mkdir release
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\release ( mkdir build\release )
IF NOT EXIST build\release\x86 ( mkdir build\release\x86 )
IF NOT EXIST build\release\x64 ( mkdir build\release\x64 )
IF EXIST build\release\x86\*.* ( DEL /F /S /Q build\release\x86\*.* )
IF EXIST build\release\x64\*.* ( DEL /F /S /Q build\release\x64\*.* )
IF NOT EXIST release ( mkdir release )
IF EXIST release\steam_settings.EXAMPLE ( DEL /F /S /Q release\steam_settings.EXAMPLE )
IF EXIST release\*.dll ( DEL /F /Q release\*.dll )
IF EXIST release\*.txt ( DEL /F /Q release\*.txt )
call build_set_protobuf_directories.bat
SET OLD_DIR=%cd%
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ dll/*.cpp dll/*.cc "%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\steam_api.dll
cd build\release\x86
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\steam_api.dll
cd %OLD_DIR%
endlocal
setlocal
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ dll/*.cpp dll/*.cc "%PROTOBUF_X64_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\steam_api64.dll
cd build\release\x64
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DNDEBUG /I%OLD_DIR%/%PROTOBUF_X64_DIRECTORY%\include\ %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc "%OLD_DIR%/%PROTOBUF_X64_LIBRARY%" Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\steam_api64.dll
cd %OLD_DIR%
endlocal
copy Readme_release.txt release\Readme.txt
xcopy /s files_example\* release\
call build_win_release_experimental.bat

View File

@ -1,17 +1,37 @@
@echo off
cd /d "%~dp0"
mkdir release\experimental
del /Q release\experimental\*
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\experimental ( mkdir build\experimental )
IF NOT EXIST build\experimental\release ( mkdir build\experimental\release )
IF NOT EXIST build\experimental\release\x86 ( mkdir build\experimental\release\x86 )
IF NOT EXIST build\experimental\release\x64 ( mkdir build\experimental\release\x64 )
IF EXIST build\experimental\release\x86\*.* ( DEL /F /S /Q build\experimental\release\x86\*.* )
IF EXIST build\experimental\release\x64\*.* ( DEL /F /S /Q build\experimental\release\x64\*.* )
IF NOT EXIST release\experimental ( mkdir release\experimental )
IF EXIST release\experimental\*.* ( DEL /F /S /Q release\experimental\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /I%PROTOBUF_X86_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental\steam_api.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG steamclient.cpp /EHsc /MP4 /Ox /link /OUT:release\experimental\steamclient.dll
SET OLD_DIR=%cd%
cd "build\experimental\release\x86"
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental\steam_api.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG %OLD_DIR%/steamclient.cpp /EHsc /MP4 /Ox /link /OUT:%OLD_DIR%\release\experimental\steamclient.dll
cd %OLD_DIR%
endlocal
setlocal
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /IImGui /I%PROTOBUF_X64_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental\steam_api64.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG steamclient.cpp /EHsc /MP4 /Ox /link /OUT:release\experimental\steamclient64.dll
SET OLD_DIR=%cd%
cd "%OLD_DIR%\build\experimental\release\x64"
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DCONTROLLER_SUPPORT /DEMU_OVERLAY /DNDEBUG /I%OLD_DIR%/ImGui /I%OLD_DIR%/%PROTOBUF_X64_DIRECTORY%\include\ /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental\steam_api64.dll
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DNDEBUG %OLD_DIR%/steamclient.cpp /EHsc /MP4 /Ox /link /OUT:%OLD_DIR%\release\experimental\steamclient64.dll
cd %OLD_DIR%
copy Readme_experimental.txt release\experimental\Readme.txt
endlocal

View File

@ -1,16 +1,38 @@
@echo off
cd /d "%~dp0"
mkdir release\experimental_steamclient
del /Q release\experimental_steamclient\*
IF NOT EXIST build ( mkdir build )
IF NOT EXIST build\experimental ( mkdir build\experimental )
IF NOT EXIST build\experimental\steamclient ( mkdir build\experimental\steamclient )
IF NOT EXIST build\experimental\steamclient\release ( mkdir build\experimental\steamclient\release )
IF NOT EXIST build\experimental\steamclient\release\x86 ( mkdir build\experimental\steamclient\release\x86 )
IF NOT EXIST build\experimental\steamclient\release\x64 ( mkdir build\experimental\steamclient\release\x64 )
IF EXIST build\experimental\steamclient\release\x86\*.* ( DEL /F /S /Q build\experimental\steamclient\release\x86\*.* )
IF EXIST build\experimental\steamclient\release\x64\*.* ( DEL /F /S /Q build\experimental\steamclient\release\x64\*.* )
IF NOT EXIST release\experimental_steamclient ( mkdir release\experimental_steamclient )
IF EXIST release\experimental_steamclient\*.* ( DEL /F /S /Q release\experimental_steamclient\*.* )
call build_set_protobuf_directories.bat
setlocal
"%PROTOC_X86_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x86.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /IImGui /DNDEBUG /I%PROTOBUF_X86_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient.dll
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
cl steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient_loader.exe
SET OLD_DIR=%cd%
cd "build\experimental\steamclient\release\x86"
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /I%OLD_DIR%/ImGui /DNDEBUG /I%OLD_DIR%/%PROTOBUF_X86_DIRECTORY%\include\ /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X86_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental_steamclient\steamclient.dll
cl %OLD_DIR%/steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental_steamclient\steamclient_loader_x32.exe
cd %OLD_DIR%
copy steamclient_loader\ColdClientLoader.ini release\experimental_steamclient\
endlocal
setlocal
"%PROTOC_X64_EXE%" -I.\dll\ --cpp_out=.\dll\ .\dll\net.proto
call build_env_x64.bat
cl dll/rtlgenrandom.c dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /IImGui /DNDEBUG /I%PROTOBUF_X64_DIRECTORY%\include\ /Ioverlay_experimental dll/*.cpp dll/*.cc detours/*.cpp controller/gamepad.c ImGui/*.cpp ImGui/backends/imgui_impl_dx*.cpp ImGui/backends/imgui_impl_win32.cpp ImGui/backends/imgui_impl_vulkan.cpp ImGui/backends/imgui_impl_opengl3.cpp ImGui/backends/imgui_win_shader_blobs.cpp overlay_experimental/*.cpp overlay_experimental/windows/*.cpp overlay_experimental/System/*.cpp "%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:release\experimental_steamclient\steamclient64.dll
SET OLD_DIR=%cd%
cd "build\experimental\steamclient\release\x64"
cl %OLD_DIR%/dll/rtlgenrandom.c %OLD_DIR%/dll/rtlgenrandom.def
cl /LD /DEMU_RELEASE_BUILD /DEMU_EXPERIMENTAL_BUILD /DSTEAMCLIENT_DLL /DCONTROLLER_SUPPORT /DEMU_OVERLAY /I%OLD_DIR%/ImGui /DNDEBUG /I%OLD_DIR%/%PROTOBUF_X64_DIRECTORY%\include\ /I%OLD_DIR%/overlay_experimental %OLD_DIR%/dll/*.cpp %OLD_DIR%/dll/*.cc %OLD_DIR%/detours/*.cpp %OLD_DIR%/controller/gamepad.c %OLD_DIR%/ImGui/*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_dx*.cpp %OLD_DIR%/ImGui/backends/imgui_impl_win32.cpp %OLD_DIR%/ImGui/backends/imgui_impl_vulkan.cpp %OLD_DIR%/ImGui/backends/imgui_impl_opengl3.cpp %OLD_DIR%/ImGui/backends/imgui_win_shader_blobs.cpp %OLD_DIR%/overlay_experimental/*.cpp %OLD_DIR%/overlay_experimental/windows/*.cpp %OLD_DIR%/overlay_experimental/System/*.cpp "%OLD_DIR%/%PROTOBUF_X64_LIBRARY%" opengl32.lib Iphlpapi.lib Ws2_32.lib rtlgenrandom.lib Shell32.lib Winmm.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental_steamclient\steamclient64.dll
cl %OLD_DIR%/steamclient_loader/*.cpp advapi32.lib user32.lib /EHsc /MP12 /Ox /link /debug:none /OUT:%OLD_DIR%\release\experimental_steamclient\steamclient_loader_x64.exe
cd %OLD_DIR%
copy Readme_experimental_steamclient.txt release\experimental_steamclient\Readme.txt
endlocal

View File

@ -112,7 +112,6 @@ inline void reset_LastError()
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/time.h>
@ -205,4 +204,4 @@ inline std::string ascii_to_lowercase(std::string data) {
#define LOBBY_CONNECT_APPID ((uint32)-2)
#endif//__INCLUDED_COMMON_INCLUDES__
#endif//__INCLUDED_COMMON_INCLUDES__

View File

@ -132,6 +132,9 @@ public:
//custom broadcasts
std::set<IP_PORT> custom_broadcasts;
//custom master server
std::set<IP_PORT> custom_master_server;
//stats
std::map<std::string, Stat_config> getStats() { return stats; }
void setStatDefiniton(std::string name, struct Stat_config stat_config) {stats[ascii_to_lowercase(name)] = stat_config; }

View File

@ -211,6 +211,11 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
load_custom_broadcasts(local_storage->get_global_settings_path() + "custom_broadcasts.txt", custom_broadcasts);
load_custom_broadcasts(Local_Storage::get_game_settings_path() + "custom_broadcasts.txt", custom_broadcasts);
// Custom master server
std::set<IP_PORT> custom_master_server;
load_custom_broadcasts(local_storage->get_global_settings_path() + "custom_master_server.txt", custom_master_server);
load_custom_broadcasts(Local_Storage::get_game_settings_path() + "custom_master_server.txt", custom_master_server);
// Acount name
char name[32] = {};
if (local_storage->get_data_settings("account_name.txt", name, sizeof(name) - 1) <= 0) {
@ -359,6 +364,8 @@ uint32 create_localstorage_settings(Settings **settings_client_out, Settings **s
settings_server->set_port(port);
settings_client->custom_broadcasts = custom_broadcasts;
settings_server->custom_broadcasts = custom_broadcasts;
settings_client->custom_master_server = custom_master_server;
settings_server->custom_master_server = custom_master_server;
settings_client->disable_networking = disable_networking;
settings_server->disable_networking = disable_networking;
settings_client->disable_overlay = disable_overlay;

View File

@ -81,6 +81,7 @@ Steam_Client::Steam_Client()
steam_remote_storage = new Steam_Remote_Storage(settings_client, local_storage, callback_results_client);
steam_screenshots = new Steam_Screenshots(local_storage, callbacks_client);
steam_http = new Steam_HTTP(settings_client, network, callback_results_client, callbacks_client);
steam_unified_messages = new Steam_Unified_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_controller = new Steam_Controller(settings_client, callback_results_client, callbacks_client, run_every_runcb);
steam_ugc = new Steam_UGC(settings_client, callback_results_client, callbacks_client);
steam_applist = new Steam_Applist();
@ -95,7 +96,6 @@ Steam_Client::Steam_Client()
steam_networking_messages = new Steam_Networking_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_game_coordinator = new Steam_Game_Coordinator(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_networking_utils = new Steam_Networking_Utils(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_unified_messages = new Steam_Unified_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_game_search = new Steam_Game_Search(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_parties = new Steam_Parties(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_remoteplay = new Steam_RemotePlay(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);

View File

@ -75,6 +75,7 @@ public ISteamClient018,
public ISteamClient019,
public ISteamClient
{
// Some games (SAO:FB) use pointer math to access the class so member order is important.
public:
Networking *network;
SteamCallResults *callback_results_server, *callback_results_client;
@ -94,6 +95,7 @@ public:
Steam_Remote_Storage *steam_remote_storage;
Steam_Screenshots *steam_screenshots;
Steam_HTTP *steam_http;
Steam_Unified_Messages *steam_unified_messages;
Steam_Controller *steam_controller;
Steam_UGC *steam_ugc;
Steam_Applist *steam_applist;
@ -108,7 +110,6 @@ public:
Steam_Networking_Messages *steam_networking_messages;
Steam_Game_Coordinator *steam_game_coordinator;
Steam_Networking_Utils *steam_networking_utils;
Steam_Unified_Messages *steam_unified_messages;
Steam_Game_Search *steam_game_search;
Steam_Parties *steam_parties;
Steam_RemotePlay *steam_remoteplay;

View File

@ -173,12 +173,64 @@ void ForceHeartbeat()
bool AddMasterServer( const char *pServerAddress )
{
PRINT_DEBUG("Steam_Masterserver_Updater::AddMasterServer\n");
IP_PORT addr;
if (pServerAddress)
{
addr.ip = (uint32)*pServerAddress;
if (pServerAddress[(sizeof(uint32))] != 0)
{
addr.port = (uint16)*(pServerAddress + sizeof(uint32));
}
else
{
addr.port = 27016;
}
PRINT_DEBUG("Steam_Masterserver_Updater::AddMasterServer pServerAddress IP: %d, PORT: %d", addr.ip, addr.port);
this->settings->custom_master_server.insert(addr);
}
return true;
}
bool RemoveMasterServer( const char *pServerAddress )
{
PRINT_DEBUG("Steam_Masterserver_Updater::RemoveMasterServer\n");
std::set<IP_PORT>::iterator iter;
IP_PORT addr;
IP_PORT list;
if (pServerAddress)
{
addr.ip = (uint32)*pServerAddress;
if (pServerAddress[(sizeof(uint32))] != 0)
{
addr.port = (uint16)*(pServerAddress + sizeof(uint32));
}
else
{
addr.port = 27016;
}
PRINT_DEBUG("Steam_Masterserver_Updater::RemoveMasterServer pServerAddress IP: %d, PORT: %d", addr.ip, addr.port);
iter = this->settings->custom_master_server.begin();
while (iter != this->settings->custom_master_server.end())
{
list = (*iter);
if (addr.ip == list.ip &&
(addr.port == list.port || (list.port == 0 && addr.port == 27016)))
{
iter = this->settings->custom_master_server.erase(iter);
}
else
{
iter++;
}
}
}
return true;
}
@ -186,7 +238,7 @@ bool RemoveMasterServer( const char *pServerAddress )
int GetNumMasterServers()
{
PRINT_DEBUG("Steam_Masterserver_Updater::GetNumMasterServers\n");
return 0;
return this->settings->custom_master_server.size();
}
@ -194,7 +246,38 @@ int GetNumMasterServers()
int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize )
{
PRINT_DEBUG("Steam_Masterserver_Updater::GetMasterServerAddress\n");
return 0;
size_t written_bytes = 0;
char * byte_cpy = NULL;
std::set<IP_PORT>::iterator iter;
IP_PORT addr;
if (pOut && outBufferSize >= sizeof(uint32) && this->settings->custom_master_server.size() > 0)
{
iter = this->settings->custom_master_server.begin();
while (written_bytes < outBufferSize && iter != this->settings->custom_master_server.end())
{
addr = (*iter);
byte_cpy = (char*)&(addr.ip);
for (size_t x = 0; x < sizeof(addr.ip) && written_bytes < outBufferSize; x++)
{
memcpy(pOut + x, byte_cpy + x, 1);
written_bytes++;
}
if (addr.port != 0 && addr.port != 27016) // Default updater port.
{
byte_cpy = (char*)&(addr.port);
for (size_t x = 0; x < sizeof(addr.port) && written_bytes < outBufferSize; x++)
{
memcpy(pOut + x, byte_cpy + x, 1);
written_bytes++;
}
}
iter++;
}
}
return written_bytes;
}

202
dll/steam_remoteplay.cpp Normal file
View File

@ -0,0 +1,202 @@
/* 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 "steam_remoteplay.h"
#include <string.h>
#include <limits.h>
typedef struct remote_play_session_info_T {
RemotePlaySessionID_t session_id;
CSteamID connected_user;
const char * client_name;
ESteamDeviceFormFactor client_form_factor;
int client_resolution_x;
int client_resolution_y;
} remote_play_session_info;
//TODO: NOT thread safe!!!
static std::vector<remote_play_session_info> remote_play_sessions;
int create_remote_play_session_info( RemotePlaySessionID_t session_id, CSteamID connected_user, const char * client_name, ESteamDeviceFormFactor client_form_factor, int client_resolution_x, int client_resolution_y ) {
remote_play_session_info session_info;
size_t buffer_length = 0;
char * buffer = NULL;
if ((remote_play_sessions.size() < UINT_MAX) && (client_name != NULL)) {
session_info.session_id = session_id;
session_info.connected_user = connected_user;
session_info.client_form_factor = client_form_factor;
session_info.client_resolution_x = client_resolution_x;
session_info.client_resolution_y = client_resolution_y;
buffer_length = strlen( client_name );
if (buffer_length > 0) {
buffer = new char[buffer_length + 1];
if (buffer != NULL) {
memcpy(buffer, client_name, buffer_length);
session_info.client_name = buffer;
remote_play_sessions.push_back( (const remote_play_session_info)session_info );
return 0;
}
}
}
return -1;
}
int destroy_remote_play_session_info( size_t index ) {
if (remote_play_sessions.size() < index) {
delete remote_play_sessions[index].client_name;
remote_play_sessions.erase(remote_play_sessions.begin() + index);
return 0;
}
return -1;
}
uint32 get_number_of_remote_play_sessions() {
return (uint32)remote_play_sessions.size();
}
int get_remote_play_session_id( size_t index, RemotePlaySessionID_t * session_id ) {
if ((session_id != NULL) && (index >= 0) && (remote_play_sessions.size() < index)) {
*session_id = remote_play_sessions[index].session_id;
return 0;
}
return -1;
}
int get_remote_play_session_index( RemotePlaySessionID_t session_id, size_t * index ) {
size_t count = 0;
if ((index != NULL) && (remote_play_sessions.size() > 0)) {
for (std::vector<remote_play_session_info>::iterator iter = remote_play_sessions.begin(); iter != remote_play_sessions.end(); iter++) {
if (iter->session_id == session_id) {
*index = count;
return 0;
}
count++;
}
}
return -1;
}
int get_remote_play_session_connected_user( size_t index, CSteamID * connected_user ) {
if ((connected_user != NULL) && (index >= 0) && (remote_play_sessions.size() < index)) {
*connected_user = remote_play_sessions[index].connected_user;
return 0;
}
return -1;
}
int get_remote_play_session_client_name( size_t index, const char ** client_name ) {
if ((client_name != NULL) && (index >= 0) && (remote_play_sessions.size() < index)) {
*client_name = remote_play_sessions[index].client_name;
return 0;
}
return -1;
}
int get_remote_play_session_client_form_factor( size_t index, ESteamDeviceFormFactor * client_form_factor ) {
if ((client_form_factor != NULL) && (index >= 0) && (remote_play_sessions.size() < index)) {
*client_form_factor = remote_play_sessions[index].client_form_factor;
return 0;
}
return -1;
}
int get_remote_play_session_client_resolutions( size_t index, int * client_resolution_x, int * client_resolution_y ) {
if ((client_resolution_x != NULL) && (client_resolution_y != NULL) && (index >= 0) && (remote_play_sessions.size() < index)) {
*client_resolution_x = remote_play_sessions[index].client_resolution_x;
*client_resolution_y = remote_play_sessions[index].client_resolution_y;
return 0;
}
return -1;
}
uint32 Steam_RemotePlay::GetSessionCount()
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionCount\n");
return get_number_of_remote_play_sessions();
}
uint32 Steam_RemotePlay::GetSessionID( int iSessionIndex )
{
RemotePlaySessionID_t session_id;
PRINT_DEBUG("Steam_RemotePlay::GetSessionID\n");
return ((get_remote_play_session_id( iSessionIndex, &session_id ) == 0) ? (session_id) : (0));
}
CSteamID Steam_RemotePlay::GetSessionSteamID( uint32 unSessionID )
{
CSteamID steam_id = k_steamIDNil;
size_t index = 0;
PRINT_DEBUG("Steam_RemotePlay::GetSessionSteamID\n");
if (get_remote_play_session_index( unSessionID, &index ) == 0) {
if (get_remote_play_session_connected_user( index, &steam_id ) == 0) {
return steam_id;
}
}
return k_steamIDNil;
}
const char * Steam_RemotePlay::GetSessionClientName( uint32 unSessionID )
{
const char * client_name = NULL;
size_t index = 0;
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientName\n");
if (get_remote_play_session_index( unSessionID, &index ) == 0) {
if (get_remote_play_session_client_name( index, &client_name ) == 0) {
return client_name;
}
}
return NULL;
}
ESteamDeviceFormFactor Steam_RemotePlay::GetSessionClientFormFactor( uint32 unSessionID )
{
ESteamDeviceFormFactor form_factor = k_ESteamDeviceFormFactorUnknown;
size_t index = 0;
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientFormFactor\n");
if (get_remote_play_session_index( unSessionID, &index ) == 0) {
if (get_remote_play_session_client_form_factor( index, &form_factor ) == 0) {
return form_factor;
}
}
return k_ESteamDeviceFormFactorUnknown;
}
bool Steam_RemotePlay::BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY )
{
int x = 0;
int y = 0;
size_t index = 0;
PRINT_DEBUG("Steam_RemotePlay::BGetSessionClientResolution\n");
if ((pnResolutionX != NULL) && (pnResolutionY != NULL)) {
if (get_remote_play_session_index( unSessionID, &index ) == 0) {
if (get_remote_play_session_client_resolutions( index, &x, &y ) == 0) {
*pnResolutionX = x;
*pnResolutionY = y;
return true;
}
}
}
return false;
}

View File

@ -62,48 +62,24 @@ Steam_RemotePlay(class Settings *settings, class Networking *network, class Stea
}
// Get the number of currently connected Steam Remote Play sessions
uint32 GetSessionCount()
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionCount\n");
return 0;
}
uint32 GetSessionCount();
// Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.
uint32 GetSessionID( int iSessionIndex )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionID\n");
return 0;
}
uint32 GetSessionID( int iSessionIndex );
// Get the SteamID of the connected user
CSteamID GetSessionSteamID( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionSteamID\n");
return k_steamIDNil;
}
CSteamID GetSessionSteamID( uint32 unSessionID );
// Get the name of the session client device
// This returns NULL if the sessionID is not valid
const char *GetSessionClientName( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientName\n");
return NULL;
}
const char *GetSessionClientName( uint32 unSessionID );
// Get the form factor of the session client device
ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID )
{
PRINT_DEBUG("Steam_RemotePlay::GetSessionClientFormFactor\n");
return k_ESteamDeviceFormFactorUnknown;
}
ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID );
// Get the resolution, in pixels, of the session client device
// This is set to 0x0 if the resolution is not available
bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY )
{
PRINT_DEBUG("Steam_RemotePlay::BGetSessionClientResolution\n");
return false;
}
bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY );
// Invite a friend to Remote Play Together
// This returns false if the invite can't be sent

View File

@ -600,13 +600,13 @@ bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index )
bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
PRINT_DEBUG("Steam_UGC::AddContentDescriptor %llu %u\n", handle, index);
PRINT_DEBUG("Steam_UGC::AddContentDescriptor %llu %u\n", handle, descid);
return false;
}
bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
PRINT_DEBUG("Steam_UGC::RemoveContentDescriptor %llu %u\n", handle, index);
PRINT_DEBUG("Steam_UGC::RemoveContentDescriptor %llu %u\n", handle, descid);
return false;
}

View File

@ -25,6 +25,7 @@
// Nothing to be done here
#else
#define STEAM_API_FUNCTIONS_IMPL
#include "base.h"
#include "dll.h"
@ -34,6 +35,26 @@
const char *STEAM_PATH;
size_t STEAM_PATH_SIZE;
#ifndef __x86_64__
# define _STAT_VER_LINUX_OLD 1
# define _STAT_VER_KERNEL 1
# define _STAT_VER_SVR4 2
# define _STAT_VER_LINUX 3
# define _MKNOD_VER_LINUX 1
# define _MKNOD_VER_SVR4 2
#else
# define _STAT_VER_KERNEL 0
# define _STAT_VER_LINUX 1
# define _MKNOD_VER_LINUX 0
#endif
#define _STAT_VER _STAT_VER_LINUX
#define _MKNOD_VER _MKNOD_VER_LINUX
/* From kernel_stat.h It help me save some condition */
#define XSTAT_IS_XSTAT64 1
#define STATFS_IS_STATFS64 __STATFS_MATCHES_STATFS64
#define STAT_IS_KERNEL_STAT 1
// Returns a '/' terminated absolute path to the steam folder in user's home,
// root is returned if env home is not set
const char *get_steam_path()
@ -290,7 +311,16 @@ STEAMAPI_API int __wrap_access(const char *path, int mode)
STEAMAPI_API int __wrap___xstat(int ver, const char * path, struct stat * stat_buf)
{
const char *path_lowercased = lowercase_path(path, false, false);
int result = __xstat(ver, path_lowercased, stat_buf);
int result;
switch (ver) {
case _STAT_VER_KERNEL:
result = stat(path_lowercased, stat_buf);
break;
default:
result = EINVAL;
}
if (path_lowercased != path) {
free((void *)path_lowercased);
}
@ -305,7 +335,16 @@ STEAMAPI_API int __wrap_stat(const char * path, struct stat * stat_buf)
STEAMAPI_API int __wrap___lxstat(int ver, const char * path, struct stat * stat_buf)
{
const char *path_lowercased = lowercase_path(path, false, false);
int result = __lxstat(ver, path_lowercased, stat_buf);
int result;
switch (ver) {
case _STAT_VER_KERNEL:
result = lstat(path_lowercased, stat_buf);
break;
default:
result = EINVAL;
}
if (path_lowercased != path) {
free((void *)path_lowercased);
}
@ -350,7 +389,16 @@ STEAMAPI_API DIR *__wrap_opendir(const char *path)
STEAMAPI_API int __wrap___xstat64(int ver, const char *path, struct stat64 *stat_buf)
{
const char *path_lowercased = lowercase_path(path, false, false);
int result = __xstat64(ver, path_lowercased, stat_buf);
int result;
switch (ver) {
case _STAT_VER_KERNEL:
result = stat64(path_lowercased, stat_buf);
break;
default:
result = EINVAL;
}
if (path_lowercased != path) {
free((void *)path_lowercased);
}
@ -360,7 +408,16 @@ STEAMAPI_API int __wrap___xstat64(int ver, const char *path, struct stat64 *stat
STEAMAPI_API int __wrap___lxstat64(int ver, const char *path, struct stat64 *stat_buf)
{
const char *path_lowercased = lowercase_path(path, false, false);
int result = __lxstat64(ver, path_lowercased, stat_buf);
int result;
switch (ver) {
case _STAT_VER_KERNEL:
result = lstat64(path_lowercased, stat_buf);
break;
default:
result = EINVAL;
}
if (path_lowercased != path) {
free((void *)path_lowercased);
}
@ -448,7 +505,7 @@ STEAMAPI_API int __wrap_link(const char *path1, const char *path2)
STEAMAPI_API int __wrap_mknod(const char *path, mode_t mode, dev_t dev)
{
const char *path_lowercased = lowercase_path(path, true, true);
int result = __xmknod(1, path_lowercased, mode, &dev);
int result = mknod(path_lowercased, mode, dev);
if (path_lowercased != path) {
free((void *)path_lowercased);
}

View File

@ -0,0 +1,2 @@
192.168.7.99
removethis.test.domain.com

View File

@ -32,6 +32,7 @@ includes_64 = list(map(lambda a: '/I{}'.format(a), ["%PROTOBUF_X64_DIRECTORY%\\i
debug_build_args = []
release_build_args = ["/DEMU_RELEASE_BUILD", "/DNDEBUG"]
steamclient_build_args = ["/DSTEAMCLIENT_DLL"]
lobby_connect_args = ["/DNO_DISK_WRITES", "/DLOBBY_CONNECT"]
experimental_build_args = ["/DEMU_EXPERIMENTAL_BUILD", "/DCONTROLLER_SUPPORT", "/DEMU_OVERLAY"]
steamclient_experimental_build_args = experimental_build_args + steamclient_build_args
@ -62,6 +63,7 @@ mkdir release\experimental
mkdir release\experimental_steamclient
mkdir release\debug_experimental
mkdir release\debug_experimental_steamclient
mkdir release\lobby_connect
call build_set_protobuf_directories.bat
"""
@ -81,7 +83,8 @@ xcopy /s files_example\* release\\
copy Readme_experimental.txt release\experimental\Readme.txt
copy Readme_debug.txt release\debug_experimental\Readme.txt
copy steamclient_loader\ColdClientLoader.ini release\experimental_steamclient\\
call build_win_lobby_connect.bat
REM call build_win_lobby_connect.bat
copy Readme_lobby_connect.txt release\lobby_connect\Readme.txt
call build_win_find_interfaces.bat
"""
@ -114,6 +117,8 @@ def generate_common(include_arch, linker_arch, steam_api_name, steamclient_name)
out += generate_common(includes_32, linker_32, "steam_api.dll", "steamclient.dll")
out += cl_line_exe(files_from_dir("./", "lobby_connect.cpp") + files_from_dir("dll", "flat.cpp") + files_from_dir("dll", "dll.cpp") + lobby_connect_args + normal_build_args + release_build_args + includes_32 + proto_deps + steam_deps + normal_linker_libs + ["Comdlg32.lib", "user32.lib"], linker_32 + ["/debug:none", "/OUT:release\lobby_connect\lobby_connect.exe"])
out += cl_line_exe(files_from_dir("steamclient_loader", ".cpp") + ["advapi32.lib", "user32.lib"] + normal_build_args, ["/debug:none", "/OUT:release\experimental_steamclient\steamclient_loader.exe"])
out += head_64bit

View File

@ -32,93 +32,113 @@
#else
#endif
int main() {
int main(int argc, char ** argv) {
bool broadcast_relay_daemon = false;
if (argc > 1) {
for (int x = 1; x < argc; x++) {
if (strcmp(argv[x], "-d") == 0) {
broadcast_relay_daemon = true;
}
}
}
if (SteamAPI_Init()) {
//Set appid to: LOBBY_CONNECT_APPID
SteamAPI_RestartAppIfNecessary(LOBBY_CONNECT_APPID);
std::cout << "This is a program to find lobbies and run the game with lobby connect parameters" << std::endl;
std::cout << "Api initialized, ";
if (broadcast_relay_daemon) {
std::cout << "Running in relay daemon mode. Press Ctrl+C to exit...." << std::endl;
std::cout.flush();
while (1) {
SteamAPI_RunCallbacks();
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
} else {
std::cout << "This is a program to find lobbies and run the game with lobby connect parameters" << std::endl;
std::cout << "Api initialized, ";
top:
std::cout << "waiting a few seconds for connections:" << std::endl;
for (int i = 0; i < 10; ++i) {
SteamAPI_RunCallbacks();
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
std::cout << "waiting a few seconds for connections:" << std::endl;
for (int i = 0; i < 10; ++i) {
SteamAPI_RunCallbacks();
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}
int friend_count = SteamFriends()->GetFriendCount(k_EFriendFlagAll);
std::cout << "People on the network: " << friend_count << std::endl;
for (int i = 0; i < friend_count; ++i) {
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
const char *name = SteamFriends()->GetFriendPersonaName(id);
int friend_count = SteamFriends()->GetFriendCount(k_EFriendFlagAll);
std::cout << "People on the network: " << friend_count << std::endl;
for (int i = 0; i < friend_count; ++i) {
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
const char *name = SteamFriends()->GetFriendPersonaName(id);
FriendGameInfo_t friend_info = {};
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
std::cout << name << " is playing: " << friend_info.m_gameID.AppID() << std::endl;
}
FriendGameInfo_t friend_info = {};
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
std::cout << name << " is playing: " << friend_info.m_gameID.AppID() << std::endl;
}
std::cout << std::endl << "--------------Menu-------------" << std::endl << "\tappid\tname\tcommand line" << std::endl;
std::cout << std::endl << "--------------Menu-------------" << std::endl << "\tappid\tname\tcommand line" << std::endl;
std::vector<std::string> arguments;
for (int i = 0; i < friend_count; ++i) {
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
const char *name = SteamFriends()->GetFriendPersonaName(id);
const char *connect = SteamFriends()->GetFriendRichPresence( id, "connect");
FriendGameInfo_t friend_info = {};
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
std::vector<std::string> arguments;
for (int i = 0; i < friend_count; ++i) {
CSteamID id = SteamFriends()->GetFriendByIndex(i, k_EFriendFlagAll);
const char *name = SteamFriends()->GetFriendPersonaName(id);
const char *connect = SteamFriends()->GetFriendRichPresence( id, "connect");
FriendGameInfo_t friend_info = {};
SteamFriends()->GetFriendGamePlayed(id, &friend_info);
if (strlen(connect) > 0) {
std::cout << arguments.size() << "\t" << friend_info.m_gameID.AppID() << "\t" << name << "\t" << connect << std::endl;
arguments.push_back(connect);
} else {
if (friend_info.m_steamIDLobby != k_steamIDNil) {
std::string connect = "+connect_lobby " + std::to_string(friend_info.m_steamIDLobby.ConvertToUint64());
if (strlen(connect) > 0) {
std::cout << arguments.size() << "\t" << friend_info.m_gameID.AppID() << "\t" << name << "\t" << connect << std::endl;
arguments.push_back(connect);
} else {
if (friend_info.m_steamIDLobby != k_steamIDNil) {
std::string connect = "+connect_lobby " + std::to_string(friend_info.m_steamIDLobby.ConvertToUint64());
std::cout << arguments.size() << "\t" << friend_info.m_gameID.AppID() << "\t" << name << "\t" << connect << std::endl;
arguments.push_back(connect);
}
}
}
}
std::cout << arguments.size() << ": Retry." << std::endl;
std::cout << std::endl << "Enter the number corresponding to your choice then press Enter." << std::endl;
unsigned int choice;
std::cin >> choice;
std::cout << arguments.size() << ": Retry." << std::endl;
std::cout << std::endl << "Enter the number corresponding to your choice then press Enter." << std::endl;
unsigned int choice;
std::cin >> choice;
if (choice >= arguments.size()) goto top;
if (choice >= arguments.size()) goto top;
#ifdef _WIN32
std::cout << "starting the game with: " << arguments[choice] << std::endl << "Please select the game exe" << std::endl;
std::cout << "starting the game with: " << arguments[choice] << std::endl << "Please select the game exe" << std::endl;
OPENFILENAMEA ofn;
char szFileName[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = 0;
ofn.lpstrFilter = "Exe Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "txt";
if(GetOpenFileNameA(&ofn))
{
std::string filename = szFileName;
filename = "\"" + filename + "\" " + arguments[choice];
std::cout << filename << std::endl;
STARTUPINFOA lpStartupInfo;
PROCESS_INFORMATION lpProcessInfo;
OPENFILENAMEA ofn;
char szFileName[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = 0;
ofn.lpstrFilter = "Exe Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "txt";
if(GetOpenFileNameA(&ofn))
{
std::string filename = szFileName;
filename = "\"" + filename + "\" " + arguments[choice];
std::cout << filename << std::endl;
STARTUPINFOA lpStartupInfo;
PROCESS_INFORMATION lpProcessInfo;
ZeroMemory( &lpStartupInfo, sizeof( lpStartupInfo ) );
lpStartupInfo.cb = sizeof( lpStartupInfo );
ZeroMemory( &lpProcessInfo, sizeof( lpProcessInfo ) );
ZeroMemory( &lpStartupInfo, sizeof( lpStartupInfo ) );
lpStartupInfo.cb = sizeof( lpStartupInfo );
ZeroMemory( &lpProcessInfo, sizeof( lpProcessInfo ) );
CreateProcessA( NULL,
const_cast<char *>(filename.c_str()), NULL, NULL,
NULL, NULL, NULL, NULL,
&lpStartupInfo,
&lpProcessInfo
);
}
CreateProcessA( NULL,
const_cast<char *>(filename.c_str()), NULL, NULL,
NULL, NULL, NULL, NULL,
&lpStartupInfo,
&lpProcessInfo
);
}
#else
std::cout << "Please launch the game with these arguments: " << arguments[choice] << std::endl;
std::cout << "Please launch the game with these arguments: " << arguments[choice] << std::endl;
#endif
}
}
}

View File

@ -32,6 +32,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
WCHAR ExeRunDir[MAX_PATH] = { 0 };
WCHAR ExeCommandLine[4096] = { 0 };
WCHAR AppId[128] = { 0 };
HANDLE SharedMemFileMap = 0;
HANDLE SharedMemFileView = 0;
HANDLE SharedMemFileLock = 0;
STARTUPINFOW info = { sizeof(info) };
PROCESS_INFORMATION processInfo;
@ -100,11 +103,38 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
return 0;
}
// Create shared mem map.
SharedMemFileMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 1024, L"Local\\SteamStart_SharedMemFile");
if (!SharedMemFileMap)
{
MessageBoxA(NULL, "Unable to create shared memory mapping.", "ColdClientLoader", MB_ICONERROR);
return 0;
}
SharedMemFileView = MapViewOfFile(SharedMemFileMap, SECTION_ALL_ACCESS, 0, 0, 0);
if (!SharedMemFileView)
{
MessageBoxA(NULL, "Unable to create view of shared memory mapping.", "ColdClientLoader", MB_ICONERROR);
CloseHandle(SharedMemFileMap);
return 0;
}
SharedMemFileLock = CreateEventW(NULL, FALSE, FALSE, L"Local\\SteamStart_SharedMemLock");
if (!SharedMemFileLock)
{
MessageBoxA(NULL, "Unable to create lock for shared memory mapping.", "ColdClientLoader", MB_ICONERROR);
CloseHandle(SharedMemFileView);
CloseHandle(SharedMemFileMap);
return 0;
}
SetEvent(SharedMemFileLock);
WCHAR CommandLine[8192];
_snwprintf(CommandLine, _countof(CommandLine), L"\"%ls\" %ls", ExeFile, ExeCommandLine);
if (!ExeFile[0] || !CreateProcessW(ExeFile, CommandLine, NULL, NULL, TRUE, CREATE_SUSPENDED, NULL, ExeRunDir, &info, &processInfo))
{
MessageBoxA(NULL, "Unable to load the requested EXE file.", "ColdClientLoader", MB_ICONERROR);
CloseHandle(SharedMemFileLock);
CloseHandle(SharedMemFileView);
CloseHandle(SharedMemFileMap);
return 0;
}
HKEY Registrykey;
@ -130,6 +160,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
{
MessageBoxA(NULL, "Unable to patch Steam process informations on the Windows registry.", "ColdClientLoader", MB_ICONERROR);
TerminateProcess(processInfo.hProcess, NULL);
CloseHandle(SharedMemFileLock);
CloseHandle(SharedMemFileView);
CloseHandle(SharedMemFileMap);
return 0;
}
}
@ -175,5 +208,10 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
}
}
// Close the SharedMem handles.
CloseHandle(SharedMemFileLock);
CloseHandle(SharedMemFileView);
CloseHandle(SharedMemFileMap);
return 0;
}