Commit Graph

568 Commits

Author SHA1 Message Date
otavepto
53533ee4af don't bypass local_storage in steam_friends class 2024-04-10 11:05:26 +02:00
otavepto
28da5747db const ref args in some places 2024-04-09 19:10:04 +02:00
otavepto
2deda8a2eb disable the overlay by default, and only enable it via the config file enable_experimental_overlay.txt, avoiding many crashes 2024-04-09 15:45:54 +02:00
otavepto
b4d061e949 force add gameserver if always_lan_type was specified, not necessary but just in case 2024-04-09 11:13:36 +02:00
otavepto
c48b5c4a37 note for reference 2024-04-08 00:33:10 +02:00
otavepto
4f0df79940 properly format some debug messages in auth 2024-04-06 22:58:47 +02:00
otavepto
392305c1e3 run the background thread for callbacks earlier inside Steam_Client::ConnectToGlobalUser()
since some games don't call `SteamAPI_RunCallbacks()` or `SteamAPI_ManualDispatch_RunFrame()` or `Steam_BGetCallback()`
hence all run_callbacks() will never run, also networking callbacks won't run
2024-04-06 08:30:08 +02:00
otavepto
0b5d38ae7e * properly implement Steam_Apps::GetAvailableGameLanguages()
* ensure current emu language is inside supported_languages list
2024-04-06 08:30:08 +02:00
otavepto
8576d149d3 remove functions names prefixes in debug logs 2024-04-06 08:30:08 +02:00
otavepto
28cdb2c74e output func name in debug log 2024-04-06 08:30:07 +02:00
otavepto
5ddbfccfdd * load overlay fonts with relative paths from steam_settings\fonts
* remove invalid parameters from `overlay_appearance.txt`
* example funny font!
2024-04-03 20:26:39 +02:00
detiam
bfdca710f4 allow load custom ttf 2024-04-03 12:19:47 +02:00
detiam
ac709e78e6 change overlay builtin font to unifont 2024-04-03 12:19:47 +02:00
otavepto
b5b9dfe437 descriptive var name for these tests 2024-04-02 22:33:04 +02:00
otavepto
3cedf8dbe3 refactor line ending + error string 2024-04-02 02:48:57 +02:00
Detanup01
7e3f2e0900 i hate myself 2024-04-02 01:15:42 +02:00
Detanup01
bfd2235684 Update for 159 2024-04-02 01:15:42 +02:00
otavepto
0672139f46 properly implement Steam_User_Stats::ResetAllStats() 2024-04-01 19:23:55 +02:00
otavepto
51197c5348 allow user_stats to send data immediately via config file 2024-04-01 19:23:55 +02:00
otavepto
0ed6dc6808 prefer udp when sending leaderboards 2024-04-01 19:23:55 +02:00
otavepto
e31f030d55 allow gameserver to send data as soon as possible via immediate_gameserver_stats.txt 2024-04-01 19:23:55 +02:00
otavepto
2f5b0a4bea sanity check in gameserver_stats if the msg source steamid was similar to us! 2024-04-01 19:23:55 +02:00
otavepto
e143a6dd82 * new function in networking to send to all gameservers only
* broadcast user stats with gameservers only
2024-04-01 19:23:55 +02:00
otavepto
04e7a7d476 opt-in sharing leaderboards instead of opt-out 2024-04-01 19:23:55 +02:00
otavepto
93172e642e allow disabling the new options via config files 2024-04-01 19:23:55 +02:00
otavepto
a36cadbf12 allow empty board entries, don't force and entry for current user 2024-04-01 19:23:55 +02:00
otavepto
4d03c5b402 fix a memory leak 2024-04-01 19:23:55 +02:00
otavepto
d8a91edcf5 only accept leaderboards updates from the same appid 2024-04-01 19:23:55 +02:00
otavepto
caa9401369 * for gameserver_stats & user_stats: distinguish between stats update requests from server and client, avoiding a scenario where a client would overwrite another client's stats
* fixed linux compilation error
2024-04-01 19:23:55 +02:00
otavepto
995a296e59 fix that clang warning 2024-04-01 19:23:55 +02:00
otavepto
d2f23fbea5 share leaderboards scores with connected players, adjust players ranks locally, and sort entries as needed by the game 2024-04-01 19:23:55 +02:00
otavepto
c17cb8a4f7 in gameserver_stats: remove & timeout pending requests if the user disconnected 2024-04-01 19:23:55 +02:00
otavepto
f423b07eef * common function to do case insensitive compare
* some const + ref in different places
* some logs, comments & refactoring
2024-04-01 19:23:55 +02:00
otavepto
4809a7565c * separate the config file disable_leaderboards_create_unknown.txt
* some refactoring
2024-03-26 23:48:57 +02:00
otavepto
af77ce4f5a log messages 2024-03-26 21:39:52 +02:00
otavepto
dfbd928311 decrease min server latency to 2ms 2024-03-26 21:39:52 +02:00
otavepto
3c9b327fb5 * cleanup/remove all networking callbacks on object destruction
* reset pointers on client destruction
2024-03-26 21:39:52 +02:00
otavepto
b6c7df40b6 * implemented the missing interface ISteamGameServerStats, allowing game servers to exchange user stats with players
* add rmCallback() to networking
* refactor gameserver_stats into a separate .cpp file
2024-03-26 21:39:52 +02:00
otavepto
75bb4ff03d * missing delete for ubc_bridge in steam_client
* Steam_UserStats: use const ref when getting the stats list/map
* Steam_UserStats: don't fail in `GetStat()`/`GetAchievement()` if output buffer is null
* change datatype for default int stat, should be signed
* some logging & comments
2024-03-26 21:39:52 +02:00
otavepto
2427ee12fd * use const ref for get/set env var
* lock global mutex when generating steam api call id
2024-03-26 21:39:52 +02:00
otavepto
166e7db122 more logging 2024-03-20 00:25:54 +02:00
otavepto
846fd6815e allow overlay invitations to obscure game input to be able to accept/reject the request 2024-03-18 05:57:24 +02:00
otavepto
206732dc8e don't log the periodic callback messages, they fill the log with non-useful events 2024-03-18 01:19:24 +02:00
otavepto
c193a8d4ce more debug messages in matchmaking 2024-03-17 04:29:49 +02:00
otavepto
5417e0e4c2 Steam_Apps::GetCurrentBetaName() make sure the out buffer is null terminated 2024-03-17 01:58:57 +02:00
otavepto
f00fdac3ac update comment + changelog 2024-03-17 01:22:18 +02:00
bitsynth
5a7fa86310 fix Age of Empires 2: Definitive Edition
this game expects the current app to exist as a owned DLC. if not true, the game will only load the "Return of Rome" game mode, if that DLC is owned, or load the base game with most options disabled if it is not
2024-03-17 01:15:08 +02:00
otavepto
db07e4aadf in Steam_Utils::IsAPICallCompleted initialize the pFailed param to false 2024-03-16 07:14:04 +02:00
otavepto
325631e1fd * run SteamAPI_ManualDispatch_Init() only once
* don't run callbacks background thread when calling Steam_BGetCallback()
2024-03-16 05:43:44 +02:00
otavepto
28f097c9c1 log when adding callresult 2024-03-16 05:41:05 +02:00
otavepto
37261bedb8 * don't run callbacks in steam_utils::runframe()
* initialize a param in steam_utils::isapicompleted()
2024-03-16 05:20:40 +02:00
otavepto
09979e8eca add a param to prevent running the callbacks background thread, for manual dispatch 2024-03-16 05:19:04 +02:00
otavepto
7700cd5dda log message 2024-03-15 15:40:33 +02:00
otavepto
3dbfbb76b1 * refactor steam_utils into a separate cpp file
* call RunCallbacks() inside Steam_Utils::RunFrame()
2024-03-15 02:43:59 +02:00
otavepto
af237639d5 * initially attempt to load the icons of all achievements, this will slow things down at startup,
but avoids having to load the achievement icon during gameplay which causes micro-stutter
2024-03-15 00:03:41 +02:00
otavepto
0b86464374 * load the icons of a single achievement each overlay callback invokation, will slow things down during startup
but this avoids having to load the achievement icon during gameplay which causes micro-stutter

* avoid loading and resizing the achievement icon each time it's unlocked

* Local_Storage: avoid allocating buffers unless `stbi_load()` was successfull
2024-03-15 00:03:41 +02:00
otavepto
2020c514d1 prefix a debug message 2024-03-09 13:47:59 +02:00
otavepto
896dfd736f revert the initial delay for the overlay renderer detector back to 0 2024-03-08 21:28:17 +02:00
otavepto
875e3e4859 allow changing the font glyph spacing 2024-03-08 18:13:29 +02:00
otavepto
65edb7081a allow controlling the renderer detector timeout via a config file 2024-03-08 18:13:29 +02:00
otavepto
88203b5c6f * fixed a bug in settings parser where lines with single characters would be completely removed when stripped of spaces
* refactored and moved all helper functions into the relevant helpers source file
2024-03-08 18:13:29 +02:00
otavepto
3f09a4c929 spicify float literal 2024-03-08 18:13:29 +02:00
otavepto
0dd755df84 decrease the default overlay hook delay to 3 sec 2024-03-08 18:13:29 +02:00
otavepto
5df75be04b attempt to load the locked achievement icon from the json key icongray if the normal one failed, adding compatibility with older format 2024-03-08 18:13:29 +02:00
otavepto
4d23a859f3 * new config file overlay_hook_delay_sec.txt to control the initial delay for the overlay's renderer detector
* send the value of the `accept_overlay_invites` to settings_server too!
2024-03-08 18:13:29 +02:00
otavepto
6a5fbf2b7d formatting 2024-03-08 18:13:29 +02:00
otavepto
5c312306d4 use const ref in many places 2024-03-08 18:13:29 +02:00
otavepto
88ab37d78f * proper fix for the window resizing problem, thanks to Nemirtingas
* remove the code which adds custom Windows fonts but keep scaling

* only attempt to load achievements images when hook is ready

* cleanup overlay images on unhook

* free the detector when we get a renderer hook instance

* lock everywhere!

* prefix the debug messages for a cleaner debug log
2024-03-08 18:13:29 +02:00
otavepto
b137cf0f38 prefix these debug messages in networking 2024-03-08 18:13:29 +02:00
otavepto
2cbc786430 revert the workaround for the usage of private/hidden glibc exports on linux, and fix it by directly calling the corresponding functions without the ver parameter: stat, lstat, stat64, lstat64, mknod.
might break stuff!
reverts 3b6663ca99
2024-03-01 13:35:39 +02:00
otavepto
46424f43bc fix this debug message in steam_networking 2024-02-29 21:06:50 +02:00
otavepto
9eceff7792 Visual Studio has dubious language extensions! 2024-02-29 19:59:53 +02:00
otavepto
dfc8be4a7c change the server type parameter of the request before continuing the code, since it's used multiple times and also being set in the request object 2024-02-29 19:59:53 +02:00
otavepto
3d836d694d added 2 new options which enable the new behavior for Steam Matchmaking Servers 2024-02-29 19:59:53 +02:00
otavepto
6a7bd6c063 grab players list for Steam_Matchmaking_Servers from Steam_GameServers , probably broken! 2024-02-29 19:59:53 +02:00
otavepto
8393261473 * partially revert matchmaking code
* request all server lists as LAN servers
2024-02-29 19:59:53 +02:00
otavepto
c38601fdcd Restore networking, source query, avatar, friends changes/additions from: 75e6d7c8ab, 4399c0b12b 2024-02-29 19:59:53 +02:00
otavepto
001e74aafa revert all networking, source query, avatar, friends changes/additions from: 75e6d7c8ab, 4399c0b12b 2024-02-29 19:59:53 +02:00
otavepto
4dd152911d * more accurately handle and download steamhttp requests in multi-threaded manner
* allow forcing the API `Steam_HTTP::SendHTTPRequest()` to succeed via a config file

* change http_online.txt to download_steamhttp_requests.txt
2024-02-23 20:41:30 +02:00
otavepto
505bec9896 some logging for networking 2024-02-17 22:36:24 +02:00
otavepto
b92a70e9ac a hacky fix for the overlay on dx12 2024-02-09 20:39:01 +02:00
otavepto
e4af4f2b00 allow setting the ip country reported to the game via a file 2024-02-07 04:22:33 +02:00
otavepto
1bba2c09b0 * allow setting the achievements notifications via config file
* fixed a mistake when discarding ut8 bom marker
2024-01-26 14:37:17 +02:00
otavepto
b016f3dafa refactor user_stats
* use const str as a param for defined_achievements_find

* GetStat()/SetStat(): return false if given name is not defined by stats.txt

* according to docs:
GetAchievement()/SetAchievement()/ClearAchievement()/GetAchievementAndUnlockTime()/IndicateAchievementProgress()
will always return true if the name was not null and exists in Admin page (achievements.json)

* ClearAchievement(): don't write user data unless json object doesn't exist, or key "earned" is true

* reduce the code in GetAchievementDisplayAttribute()

* according to docs IndicateAchievementProgress() returns false if the achievement is already unlocked

* many logging
2024-01-25 23:24:16 +02:00
otavepto
374b9a8029 forgot that! 2024-01-25 23:24:16 +02:00
otavepto
a09bc24437 refactor steam_apps 2024-01-25 23:24:16 +02:00
otavepto
8c012f7101 lots of todo notes 2024-01-25 23:24:16 +02:00
otavepto
2c428e071a make sure mod path, if relative, would be relative to the lib itself + return utf8 string 2024-01-25 17:06:45 +02:00
otavepto
d73faeff38 use the new functions to check for friend ID in the auto accept list 2024-01-24 22:57:32 +02:00
otavepto
245e1414fc allow accepting any invitation by using an empty file 2024-01-24 22:57:32 +02:00
otavepto
6864aafc12 restored missing files! why! 2024-01-24 22:57:32 +02:00
otavepto
2fa2a9229c parse the new disable_overlay_warning_*.txt settings + fixed or condition of warn_forced_setting 2024-01-24 22:57:32 +02:00
otavepto
3a64b604a0 debug message 2024-01-22 19:43:56 +02:00
otavepto
9e84f4abec forgot that while debugging! 2024-01-22 19:26:51 +02:00
otavepto
371d50b62e make sure buffer is nulled in ugc::GetItemInstallInfo() + a bunch of params check & stub code 2024-01-20 23:01:29 +02:00
otavepto
2800264040 make sure mod path is absolute and normalized for current OS 2024-01-20 22:51:40 +02:00
otavepto
6249d7ca4d * attempt to auto detect mods with the same behavior as if they were defined in mods.json, for an easier config
* new function in local storage to get list of folders at root level, given some path

* use last week epoch as the default time for mods dates (created, added, etc...)

* UGC: some params checks according to SDK docs for CreateQueryXXX() functions

* fixed some mistakes
2024-01-20 18:46:43 +02:00
otavepto
45d76fbc31 bunch of scoped debug messages 2024-01-20 18:46:43 +02:00
otavepto
43debcbaf8 * local storage: allow files in root of user data
* common mods subscription state between ugc and remote storage

* ugc: implement SetUserItemVote(), GetUserItemVote(), AddItemToFavorites(), RemoveItemFromFavorites(), favorite mods list is now save in `favorites.txt` in the user data folder

* ugc: make sure returned mod folder from GetItemInstallInfo() is null terminated & validate arg
2024-01-20 18:46:43 +02:00
otavepto
0d1e54e9a2 * a working impl to bridge ugc/remote_storage as suggested by Detanup01
* edits by Kola124 + other changes in the settings parser

* random ugc mod handle at object creation

* file size using std::filesystem + fix warnings + some print + arg validation
2024-01-20 18:46:43 +02:00