Commit graph

670 commits

Author SHA1 Message Date
redpolline
fdf5ca8e69 Redo image handling in settings.
Lock the buffers when modifying them.

Notify when callers change a set avatar image.

Create a get function for images.

Allow deletion of previously loaded images, and reuse of their ids.
2025-02-08 11:17:36 -05:00
redpolline
98444c3ead Move most functionality from the macro to template.
Have the users of the macro use common functionality.
2025-02-08 11:17:35 -05:00
redpolline
fb55203797 Add image buffer writing, file copy, avatar save.
Adds functions for saving the user selected avatar image to the global
settings folder. (These also get reused to send the avatar to remote
users.)
2025-02-08 11:17:35 -05:00
redpolline
60c11d1745 Init callback objects first, fix mutex locking
Init callback related objects in Steam_Client before initing anything
else.

Fix missing global_mutex lock in Steam_Client::RegisterCallback() and
Steam_Client::UnregisterCallback().
2025-02-08 11:17:35 -05:00
redpolline
3f4644fabe Change filenames for global settings avatar images...
... and fix the debug messages.

This changes the filenames to be "avatar_*" instead of "profile_*" to
keep things consistent with the proper naming elsewhere.
2025-02-08 11:17:35 -05:00
redpolline
bae54881ef Fix debug message for Steam_Utils::GetImageRGBA(). 2025-02-08 11:17:35 -05:00
redpolline
e2d3b3ecf4 Add protobuf message type Image and Friend_Avatar.
Also adds Friend_Avatar to the Common_Message list of possible
messages.
2025-02-08 11:17:35 -05:00
redpolline
b2c3d3d438 Add try_get_steam_client().
This allows the emulator to attempt to access the global steam_client object
without creating it if it doesn't exist.
2025-02-08 11:17:35 -05:00
redpolline
3d1fdc9392 Create GOLDBERG_CALLBACK_INTERNAL() macro.
This allows the usage of steam callbacks within the emulator itself.
2025-02-08 11:17:35 -05:00
redpolline
d91f82e408 Add fs utility functions for overlay use.
As we need to add a file chooser to the overlay, we need the backend
functions for it to use.

This commit adds:

Local_Storage::get_parent_directory().
Local_Storage::is_directory().
Local_Storage::get_user_pictures_path().
Local_Storage::get_drive_list().
Posix version of DirectoryExists().
2025-02-08 11:17:35 -05:00
redpolline
da0c7b17c6 Add avatar image loading from global ...
... settings directory.

Also adds some additional related debug logging, and a utility function
for converting between std::vector<image_pixel_t> used by Local_Storage::load_image(),
and std::string used by Settings::add_image().
2025-02-08 11:17:35 -05:00
redpolline
308cabe37f Make add_friend_avatars handle local_user avatar
... changes.

Implements STEAM_CALL_RESULT( AvatarImageLoaded_t ).
Adds support for a sending a STEAM_CALL_RESULT( PersonaStateChange_t ) with the k_EPersonaChangeAvatar flag.

Creates a mapping in Settings to hold the avatar image data.

Also adds additional debug logging to indicate which image handle is
returned for each user / image size.
2025-02-08 11:17:34 -05:00
redpolline
2604689181 Enumerate fonts under Windows instead of ...
... hardcoding a path to a font file from the system directory.

Wine doesn't have anything in there, and doing it this way allows
Wine to "just work" without using Winetricks.
2025-02-08 11:17:34 -05:00
redpolline
a91405d20c Overlay: Implement achievement icon display.
Display achievement icons in steam_overlay, and during achievement
notifications.

Add total achievement counts and progress bar to steam_overlay.

Add new global settings for displaying unearned hidden achievements in
the achievement list and displaying achievement descriptions in unlock
notifications. (Both disabled by default.)
2025-02-08 11:17:34 -05:00
redpolline
8a9cf17c31 Win7 / Wine fixes DX11_Hook.cpp.
Don't create image resources if the D3D device isn't inited yet.
(Causes app crash.)

Set quality value on substruct.
2025-02-08 11:17:34 -05:00
redpolline
b037944bab Wine + Enscripten fixes for OpenGL_Hook.cpp. 2025-02-08 11:17:34 -05:00
redpolline
8c2adae67e Extra debugging log functions. 2025-02-08 11:17:33 -05:00
redpolline
aac3c81e7a Implement ISteamUserStats::GetAchievementIcon(). 2025-02-08 11:17:33 -05:00
redpolline
bdbcb62019 Add some achievement display settings. 2025-02-08 11:17:33 -05:00
redpolline
934812ce8c Add functions for global flag settings, ...
return width and height for loaded images.
2025-02-08 11:17:33 -05:00
redpolline
65ea5d2c6c Fix memory leak in resolve_ip. 2025-02-08 11:17:33 -05:00
redpolline
9b56698858 Fix detours not attaching to all threads on startup. 2025-02-08 11:17:33 -05:00
redpolline
ab4740109d Fix compiler warnings. 2025-02-08 11:17:33 -05:00
redpolline
54115a668d Add inttypes defs to common_includes.h 2025-02-08 11:17:32 -05:00
redpolline
d291abb48c Add 32bit registry view editing to ColdClientLoader. 2025-02-08 11:17:31 -05:00
redpolline
599f223800 Set env:SteamAppPath in steamclient_loader. 2025-02-08 11:17:29 -05:00
redpolline
e217bd0a8d Add missing header include guards. 2025-02-08 11:17:27 -05:00
redpolline
611cf69206 Fix CI to use BAT files only for win build.
For consistency have the CI use the same build path as
the end-user builds.

Use where.exe from wine-10.0.

CI's version is a stub. Use one that actually works, until the CI gets
updated.
2025-02-08 11:14:59 -05:00
redpolline
abd8300d47 Update .gitlab-ci.yml file to skip building the PDBs.
(CI throws errors and skips building the PE files.)
2025-02-08 05:30:25 -05:00
redpolline
b75f324100 Fix build scripts.
Fix list:
 - Make cmd not choke on recursive calls to build_env_x*.bat.
 - Create build directories and move build output there instead of
   polluting the root of the source tree.
 - Make proper debug builds with pdb output.
 - Make proper x64 builds of lobby_connect, and steamclient_loader. (lobby_connect_x64.exe, and steamclient_loader_x64.exe)
 - Rename x86 build of lobby_connect.exe to lobby_connect_x86.exe.
 - Rename x86 build of steamclient_loader.exe to steamclient_loader_x86.exe.
 - Make proper distrib directories. (I.e. <release,debug>/<build type>/<arch>/<binaries>.)
2024-12-21 07:28:48 -05:00
ayaka
ef5c4731b4 dll/wrap: fix build for glibc 2.33
I don't think I need the step that converting to legacy struct.

Signed-off-by: ayaka <ayaka@soulik.info>
2024-01-10 05:17:17 -05:00
redpolline
a2c9f9230f Improve steam_masterserver_updater stub.
This creates a new "custom_master_server.txt" file that can be used to pre-seed a master server list.

This also allows for steam apps to manipulate the master server list in memory.
I.e. This implements:
  Steam_Masterserver_Updater::AddMasterServer()
  Steam_Masterserver_Updater::RemoveMasterServer()
  Steam_Masterserver_Updater::GetNumMasterServers()
  Steam_Masterserver_Updater::GetMasterServerAddress()

Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 05:13:22 -05:00
redpolline
8f212b82ca Generate PDB files for the debug builds.
Allows for better debugging with Windows debuggers.

Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 05:00:43 -05:00
redpolline
d78ab8e8a5 Add missing echo off to build_win_debug_experimental_steamclient.bat.
Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:45:37 -05:00
redpolline
d1a0a68d4f Add relay daemon mode to lobby_connect.
This (along with the existing custom_broadcasts support) allows for users on different read: _routed_ subnets to see and connect to each other's games.

To use this mode:

Build lobby_connect and run it with the "-d" argument.

Create the custom_broadcasts.txt file in the steam_settings folder next to steam_api.dll / steam_api64.dll and put the IP address of the host running lobby_connect in it.

Run games.

Note: This should even work with existing installations, _provided_ that at least one of them creates the custom_broadcasts.txt file as described above.
(This is because existing installations use broadcast packets to establish new connections, forwarding all of their knowledge to each other.
 Thus having at least one host on the current subnet configured in this new way turns it into a "proxy" for the other hosts.)

Caveat: This will _NOT_ work if NAT is involved. This is due to the lack of NAT traversal support in the emu.
(I.e. The lobby_connect daemon will get the info from the NAT'ed hosts and forward it to the others, but hosts outside the NAT won't be able to connect.)

Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:30:17 -05:00
redpolline
98488d6570 Create windows lobby_connect debug build script.
Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:29:06 -05:00
redpolline
92623f586d Fix too many env vars causing build failures, and put debug builds in their own folder like release builds.
Cannot call the vc vars batch too many times. Fix it by calling set/end local.

See also: https://developercommunity.visualstudio.com/t/vcvarsallbat-reports-the-input-line-is-too-long-if/257260

Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:27:41 -05:00
redpolline
2e3f14e7bd Fix copy-paste syntax error in steam_ugc.h.
Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:20:50 -05:00
redpolline
b079607634 Fix linux build script, and add lobby_connect to it.
Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:19:06 -05:00
redpolline
4042974100 Add gitattributes file so shell scripts don't get mangled and break builds.
Signed-off-by: redpolline <11156324-redpolline@users.noreply.gitlab.com>
2024-01-10 04:17:51 -05:00
redpolline
0d0ec28ecb Make a better stub for Steam_RemotePlay functionality.
Note for googler's, this doesn't mean RemotePlay works / is being implemented.

Put the main stuff into its own .cpp.

Set up storage for holding descriptions. (*NOT* thread safe!)

Clears up a crash on init in SAO:FB.
2023-11-28 05:51:00 -05:00
redpolline
d29103bf79 Create shared mem mapping in steamclient_loader.
The mapping and it's event object are needed by some games.
2023-11-28 05:34:38 -05:00
redpolline
9cee5004d7 Fix ISteamClient class member ordering for Steam_Unified_Messages.
Some games, like SAO:FB, require a specific class member order.
2023-11-28 05:34:26 -05:00
Mr_Goldberg
475342f0d8
SDK 1.56 and 1.57 2023-05-08 22:36:51 -04:00
Mr_Goldberg
802d8bcc8f
More accurate SetLobbyData. 2022-09-06 13:30:20 -04:00
Mr_Goldberg
7e1824290a
disable_lan_only.txt can now be put inside the steam_settings folder. 2022-09-06 13:29:39 -04:00
Mr_Goldberg
647e894d62
Add prints for debugging. 2022-09-06 13:29:02 -04:00
Mr_Goldberg
c231c87312
Allow message sending on not yet connected networking sockets. 2022-09-03 04:29:08 -04:00
Mr_Goldberg
373801b3a4
Fix some UDP packet size issues 2022-09-03 04:21:08 -04:00
Mr_Goldberg
05e2c3bef0
Implement TCP_NODELAY, thanks #209 2022-09-03 04:20:03 -04:00