aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix the broken broken addon check fixGravatar Michael Smith 6 days1-31/+24
| | | | | | | | | | Sorry Hayden. My next project for SST is a testing system. Because I *royally* screwed up this release cycle. Anyway I just inlined that function because it was evidently a sufficient source of confusion that I managed to totally screw up basically every part of call boundary. Truly catastrophically bungled the thing. I must have been really tired...
* Fix a stupid typoGravatar Michael Smith 7 days1-1/+1
| | | | Inconsequential at the moment, but still worth fixing.
* Fix L4D1 crash for yet another immediate bugfix releasev0.10-BETAGravatar Michael Smith 8 days3-20/+6
| | | | | Every. Single. Time. And having screwed up the zip dates was just a bonus I suppose.
* Improve the memcpy/memcmp functions a bitGravatar Michael Smith 13 days1-8/+21
| | | | | | I think memcpy might have been returning the wrong thing before, actually, but I guess it didn't matter in practice. Who the hell uses the return value from memcpy?
* Add some useful info printouts to debug buildsGravatar Michael Smith 2025-04-306-50/+240
| | | | | | | | | | | | | | | | | | | | Specifically when building in debug mode, we now: * Display all features on load, including skipped and internal ones, sorted by internal name instead of display name. * Print the names of all matched gametype tags after the feature list. * Add an sst_dbg_getcmdcb command to get the address of a command callback for quick breakpoint insertion or Ghidra lookup. * Add an sst_dbg_sendtables command to dump out the full ServerClass tree to help get names for entprops.txt. Note: this output is very long so you'll likely need to log console output to a file to be able to read it all. There's a bunch of developer experience and debug help stuff I want to get done eventually. This is just a very small piece, but it's a start.
* Fix all the brokenness I introduced to l4daddonGravatar Michael Smith 2025-04-301-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | With apologies to Hayden, whose code was mostly fine until my quest to make it neater ended up bungling stuff. I wanted it reviewed and tested before pushing it anywhere public but people have limited free time - how dare they!!!! - and at some point I kind of impatiently just sent it because I had a pile of unrelated changes I didn't want to untangle. I didn't really know how to reproduce the bad performance myself to test the fix here properly, so I was kind of unfairly relying on him to do it, even though he'd already tested his own code and made sure it worked *before* I decided to break it. My bad. Don't worry though, I was never actually going actually release SST in such a broken state. I mean, I have released it in worse states before, but I wasn't gonna do it on this occasion. :^) Now this is definitely done correctly, I think, and I've done yet another pass over the comments, I'm pretty confident that 0.9 is around the corner. Just a few more commits of entirely non-user facing stuff to get out of the way first...
* Add type-safety to virtual calls and accessorsGravatar Michael Smith 2025-04-1727-256/+267
| | | | | | | | | | | | This probably should have been the design from the start. It's still possible to use void pointers, and this is done in a couple of places for simplicity, but wherever possible, we have actual structs for things now. Additionally, in places where vtables are fiddled with, e.g. vtable hooks, we have actual struct definitions with vtable pointers so there's need for pointer-casting horror.
* Add missing REQUIRE_GAMEDATA things to demorecGravatar Michael Smith 2025-04-162-3/+8
| | | | | | These gamedata entries are always available, but there's no reason not to check for them in case that changes in future. As-is now, the checks will be trivial for the compiler to optimise out.
* Remove iflush() from inline hooking codeGravatar Michael Smith 2025-04-161-21/+0
| | | | | | | | | | | | | I had this hunch that Intel's strong memory model wouldn't actually require anything like this, and some cursory research suggests this is correct even across threads, or at least definitely within the same thread which is what we care about. I kind of don't know why FlushInstructionCache() even exists in that case. Maybe it's for other architectures or maybe it's just for the benefit of debuggers. Microsoft's documentation helpfully asserts that it is necessary to call it even though it isn't, and doesn't elaborate further. Of course.
* Rework API for inline hookingGravatar Michael Smith 2025-04-1611-129/+216
| | | | | | | | | | | | | This both simplifies and complicates things, but probably hopefully maybe simplifies things overall. Certainly in cases like the L4D1 demo thing where there's 3 inline hooks at once, it seems simpler to be able to batch the fallible stuff to avoid rollbacks. In cases where you only need one hook, it's a bit more verbose, but what can you do. Thanks bill for discussing this with me pretty exhaustively and giving a lot of good input. I think both of us still kind of hate it actually.
* Refrigerate one more errorGravatar Michael Smith 2025-04-161-1/+1
|
* Fix major idiocy in inputhud (and hud kinda)Gravatar Michael Smith 2025-04-162-2/+5
| | | | Also pointed out by bill. D'oh, guess I'm fired.
* Fix minor idiocy in msg.cGravatar Michael Smith 2025-04-161-2/+2
| | | | | | | | | | I had at one point tried to macrofy the repetitive functions. After being talked down from that madness, I LSP-expanded all the macros out and went through rewriting the crazy expressions into constants. Except those two for some reason, because I'm blind I guess. Thanks bill for pointing this out.
* Update info in the readme and a few commentsGravatar Michael Smith 2025-04-124-4/+4
|
* Fix mistakes I made integrating Hayden's old codeGravatar Michael Smith 2025-04-092-9/+9
| | | | | Doesn't matter how many history rewrites I do before pushing my local branch, there will always be something I still got wrong.
* Put some error paths in the fridgeGravatar Michael Smith 2025-04-084-104/+115
|
* Fix the infamous Swamp Fever "god mode glitch"Gravatar Hayden K 2025-04-072-0/+17
| | | | | | | | | | | | | | | | | | Turns out this was fixed in version 2112 (October 2012), so it was fairly easy to isolate in Ghidra (I had previously thought this was fixed by TLS). The CDirector::FinaleEscapeState member is used in CDirector::IsFinaleWon (and maybe another function, I don't remember). Prior to Valve's fix, the value was never reset to 0 after finishing a campaign, so when the Swamp (or Crash Course) "minifinale" events ran, the game would behave as though the player was entering the end-of-finale cutscene and block votes, make players invincible etc. 2112 fixed this bug by setting the member back to 0 in CDirector::Reset, so here we just set it to 0 when quickreset is used, since that is essentially the recommended way to start a run at this point. Now co-op hosts won't need to restart their game after finishing a campaign anymore!
* Remove years from copyright headersGravatar Michael Smith 2025-04-0785-114/+114
| | | | | | | | They're legally unnecessary as far as I know, and kind of annoying to maintain on a long-term basis. This was done with the consent of all 3 other contributors, in case anyone was wondering.
* Fix quickreset not working on L4D1 ApartmentsGravatar Hayden K 2025-04-072-1/+3
| | | | | | Confusingly, the old matchmaking interface refers to No Mercy as apartments (plural), but refers to the first level as apartment (singular). Good meme.
* Write the update notes for 0.9Gravatar Michael Smith 2025-04-061-1/+12
|
* Make Steam L4D1 demos backwards-compatibleGravatar Hayden K 2025-04-061-0/+186
|
* Add portable unreachable macro, just for funGravatar Michael Smith 2025-04-061-2/+3
| | | | | | This isn't useful to us at all, but might be useful to someone else. I always try to write code for multiple compilers for this reason, even if SST ultimately still requires Clang.
* Tweak a couple of bits of whitespaceGravatar Michael Smith 2025-04-062-2/+2
|
* Add feature to remove the chat rate limitGravatar Hayden K 2025-04-061-0/+88
| | | | | This probably works for basically every game, but it was only tested for L4D/L4D2/L4D:S/Portal 2.
* Add L4D1_1015plus and L4D1_1022plus gametype tagsGravatar Hayden K 2025-04-062-2/+16
| | | | | | | | | | 1022 is the update that adds Mac support and introduces some of the already known vtable changes (this update is similar to 2040 for L4D2 in that regard), the tag will also see some use in some upcoming features. The 1015 tag is questionably necessary, but will be used for at least one feature (it's also the update that adds the newer matchmaking interfaces used in l4dreset.c, but having the tag available doesn't help anything there).
* Rename L4D2_2147plus gametype tag to L4D2_2125plusGravatar Hayden K 2025-04-064-4/+7
| | | | | | | Turns out the cvar we use to detect 2147 was actually added in 2125. Since renaming it doesn't currently break anything (and 2125 was a fairly notable code shuffling update, given it was the first update with a native Linux build of the game), it makes most sense to just do this.
* Reload inputhud fonts on resolution changeGravatar Michael Smith 2025-04-061-7/+14
| | | | | | | | | | | This checks off another bug that we knew about for ages and I never had time to fix. Note that I've since learned that font handles don't work the way I assumed they did; things get cached and reused so there's no need to worry about leaks. As such, we could probably revisit how fonts are done here. However, the current implementation does work so that's potentially a job for some future release after 0.9.
* Pass screen width and height into HudPaint eventsGravatar Michael Smith 2025-04-064-12/+7
| | | | | This makes it unnecessary to call hud_screensize in basically every handler.
* Inform users of incorrect usage of plugin_unloadGravatar Michael Smith 2025-04-061-1/+20
|
* Remove Wer* calls that crash under Wine/ProtonGravatar Michael Smith 2025-04-061-18/+10
| | | | | | | | | | | | Wine doesn't implement these it seems. Not sure why this crashed as opposed to just failing to load sst.dll but I guess it doesn't matter. This also improves compat with very old Windows 10 builds, to the extent that we really care about those which I guess we don't really, but still, it can't hurt. I did also try dynamically loading the symbols but at that point it just started crashing on unload on Windows as well. No idea what's going on there, but whatever, it's not that important, just get rid of it.
* Fix broken behaviour in the L4D2 addon systemGravatar Hayden K 2025-04-061-0/+264
| | | | | | | | | | | | | | | | | | | | | | | | | This should greatly improve the experience of running newest/TLS as well as custom campaigns. The bugginess in question is quite a lot to explain so there's some rather substantial exposition via code comments. The actual fixes are comparatively simple, although still a little subtle to get exactly right and took a few iterations to nail down the edge cases. Thanks to bill for helping me with the RE & assistance on writing the hooks/code and so on. I tracked down a lot of this myself, but the end result wouldn't have been possible without his help. Committers' note: I ended up wrangling this change a fair bit, as I am apparently just always wont to do, and also fixed a bug in the process, hence adding my copyright notice as well. Nonetheless, big thanks to aciidz (and bill) for doing the bulk of the *actual* hard work of figuring out how to do any of this! The actual code changes I made to the original submitted patch were relatively minor; a lot of my effort honestly went into attempting to shorten the massive wall of comment text. At the end of the day, there's still a really long comment, but it's just a lot to explain really so it is what it is. I hope it's at least somewhat understandable to a reader, anyway.
* Fix very stupid, very old mistake in fixes.cGravatar Michael Smith 2025-04-061-2/+6
| | | | Thanks, months-ago Hayden! Finally remembered to do this.
* Fix a couple of dumb typos in the fastspin libraryGravatar Michael Smith 2025-04-061-5/+3
|
* Develop the msg chunklet furtherGravatar Michael Smith 2025-04-062-166/+638
| | | | | | | | - Add reverse-put functions for stack-based and/or left-pad-inspired use cases. - Fix an incorrect return value. - Clean up the doc comments, fixing a few errors and omissions. - Make some trivial functions static inline.
* Use C23 void-argument-free prototypesGravatar Michael Smith 2025-04-0635-104/+104
| | | | | | | In the future we can also consider moving to {} instead of {0} for initialisers, but my old Clang (16) doesn't support this, so it might be wise to wait longer on that one so people don't need too bleeding-edge of a compiler just to build this thing.
* Rewrite and redesign codegen and feature systemGravatar Michael Smith 2025-04-0646-1548/+1614
| | | | | | | | | | | | | | | | | | | | | | | | | Also switch to somewhat proper C23 flags while we're at it. This is a huge change. It took me forever, in between being really busy. Sorry about that. But the good news is I'm now free to start integrating the various patches that have accumulated since last release. Well, at least in between still being really busy. Gotta manage expectations. The main benefit of introducing GAMESPECIFIC() is that features that don't apply to a particular game no longer show up *at all*, and less time is wasted on init. It also enables a cool optimisation wherein unnecessary REQUIRE_GAMEDATA() checks can elided at compile time whenever the gamedata is known up-front to always exist in supported games. The DEF_FEAT_CVAR macro family meanwhile makes it easier to manage the lifecycle of cvars/ccmds, with less manual registering, unhiding and such. Originally I was going to try and just hack these features into the existing codegen abomination, but it just got too terrible. This rewrite should make it easier to continue tweaking codegen behaviour in future. It also has slightly better error messages.
* Lowercase the stupid file, Windows. ARGH.Gravatar Michael Smith 2024-10-011-0/+0
| | | | Actually kind of Neovim's fault, I think. Whatever.
* Refine input HUD layoutsGravatar Michael Smith 2024-09-291-63/+77
| | | | | | | | | - Get rid of +left/+right things, as they were deemed unnecessary. - Add missing reload button in L4D games - Put a vertical gap between the group of directional buttons and attacks, and all the other buttons. While we're at it, add a few branch hints and fix up the includes.
* Add missing newlines to clientcon messagesGravatar Michael Smith 2024-09-281-3/+3
| | | | | | Just had a brain fart when writing this code initially, woops. Just as well I have people pointing these things out to me before I end up making releases with such mistakes. At least, usually. :^)
* Fix crash on exit when our raw input is usedGravatar Michael Smith 2024-09-281-2/+3
| | | | | | | | | | | | Turns out window messages still get generated after the plugin is unloaded, causing now-unloaded SST code to get called. In some edge cases some Windows appCompat logic will also then start suppressing FreeLibrary calls for that game, which breaks plugin hot reloading. Very dumb and very confusing. I didn't notice the crashing before due to lack of minidumps from the relevant games, so thanks aciidz for pointing this issue out.
* Create and use macros to define accessor functionsGravatar Michael Smith 2024-09-285-21/+116
| | | | | | | Avoids the need to manually mess around with mem_offset() and gamedata off_ and sz_ values as often, because that's kind of annoying. Should also make the codebase a little less confusing for new players.
* Use single-precision trig functions in testwarpGravatar Michael Smith 2024-09-251-3/+3
| | | | | There was never a need to calculate more precision and then throw it away again. This was just an oversight.
* Address some minor L4D warp testing oversightsGravatar Michael Smith 2024-09-161-4/+12
| | | | | | | - Check the player's team before attempting any form of warp prediction (as per the code bill wrote before) - Avoid overlapping boxes and an unnecessary line draw in the case where the player is never actually stuck.
* Increase mouse factor limit to 100Gravatar Michael Smith 2024-09-151-1/+1
| | | | | | Requested repeatedly by Portal people, and I don't see why not. We were conservative at first but I've yet to come up with a real reason why slowing mouse input further would be a problem.
* Add basic button input HUDGravatar Matthew Wozniak 2024-09-145-15/+490
| | | | | | | | | | | | Committer's note: this is heavily modified from the original code contributed by woz (and somewhat improved by bill and aciidz). Copyright notices reflect joint authorship accordingly. woz still gets commit authorship though because it feels wrong to yoink that from someone. :^) And yes, the original code was written in 2022. Time flies. A lot of the code is still kind of hacky and ugly and I'd like to improve it later but there's other things to do so that can wait.
* Fix an include-what-you-use omissionGravatar Michael Smith 2024-09-081-0/+1
|
* Improve the HUD API slightlyGravatar Michael Smith 2024-09-082-6/+23
| | | | | | | - Add text size measurement (for centring etc.). - Add a wchar_t equivalent since ushort would be wrong on Linux. Avoid actually using wchar.h because it's a big bloaty header, particularly on Windows.
* Fix a Linux woopsy in os.c I spotted the other dayGravatar Michael Smith 2024-09-081-1/+0
| | | | | | Note: for all I know Linux isn't even compiling right now - I rarely actually test that. But still, might as well fix this since it's an obvious mistake.
* Un-break and re-fix x86Gravatar Michael Smith 2024-09-072-8/+13
| | | | | | The last fix was, uh, not good. With any luck this is actually correct now. Certainly, running many millions of test cases fails to find any mismatch with udis, so it's at least a lot less wrong than it was.
* Fix more broken x86 casesGravatar Michael Smith 2024-09-062-3/+4
| | | | Thanks Evan Lin for reporting.