summaryrefslogtreecommitdiffhomepage
path: root/compile.bat
AgeCommit message (Collapse)Author
2024-08-29Add very basic client console messaging for L4D2Michael Smith
This isn't totally ideal - it'd be nice to have a way to get colours working, at least for errors/warnings. But it might not really be possible to do that without custom networking stuff, so this will do for the forseeable future. The main goal is just to be able to have CON_SERVERSIDE commands actually give output to the relevant player.
2024-08-29Add basic server-side tracing functionalityWillian Henrique
Restricted to L4D for now due to known ABI compatibility issues on other branches. This should be easy to fix later when needed elsewhere. Committer's note: I've counted myself as a joint author and added a copyright notice to the .c file since this code is reasonably modified from the code bill originally wrote last year. but June of this year and , so I've gone ahead and corrected his copyright notice too, with permission.
2024-08-23Rewrite the gamedata and entprops systems entirelyMichael Smith
This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters.
2024-08-22Prevent errorlevel weirdness in compile.batMichael Smith
This is an issue I've known about for a little while and kept forgetting to fix here. It's not been a huge issue for anyone, but still, improving correctness is always a good thing. Essentially, if you run a batch file straight through cmd /c, rather than interactively, exit /b with no number doesn't actually propagate the errorlevel value correctly, which is obviously bad. To fix this, just jump to the end on error and then explicitly return the errorlevel. If everything succeeds, this will of course still return 0, as expected. Special thanks go to Microsoft for writing this bug decades ago and never fixing it, probably in the name of backwards compatibility.
2024-08-22Rework OS abstractionsMichael Smith
- As much as possible avoid dragging system headers into translation units. This should avoid namespace pollution and, hopefully, speed up builds a little bit. - Avoid leaning on the UCRT so much on Windows - prefer native win32 calls and native file handles except where doing so is inconvenient (in particular, for stat(), which we might try and replace later). - Also, switch from SystemFunction036 to ProcessPrng on Windows. This requires us to generate a stub for bcryptprimitives.dll because Microsoft haven't bothered to provide a link library, but the function is better-documented and seems to be a more direct under-the-hood call as well. Apparently it's what's used by the major web browsers these days, which seems like a good indication it's stable and trusted. - Lastly, remove a bunch of functions and macros and stuff that weren't actually being used. It seems good to try and keep the scope of OS-dependent stuff relatively contained and only add to it when actually required.
2024-01-21Add a half-decent custom crosshairMichael Smith
2023-12-19Add VGUI HUD overlay drawing featureMatthew Wozniak
Currently only supports Orange Box and Left 4 Dead branches. There's quite a large amount of gamedata involved in making this work, and figuring it out for the likes of Portal 2 doesn't seem like a major priority at the moment.
2023-12-17Don't compile kv.c as part of SST itselfMichael Smith
Of course, this has only been used at build time for quite a while now. Silly oversight! The linker would have dropped it anyway so this will just avoid some wasted effort.
2023-12-17Cancel fast-forward after the player disconnectsMichael Smith
Avoids spurious and confusing fast-forward behaviour in the event of resetting a run, then disconnecting early and deciding to load some other map. Also fixes a stupid typo (s/propand/propane/).
2023-12-04Add cutscene skipping to L4D quick resetMichael Smith
Also done with quite a lot of RE help from bill - thanks again!
2023-11-26Add a way to fast-forward game timeMatthew Wozniak
This will be mostly useful for skipping cutscenes in Left 4 Dead games. It may work in other games, but probably won't really be as useful. Committer's note: this was adapted a fair bit from woz's original code, hence the joint copyright, but he did most the hard work of figuring out how to get this deep into the engine's call stack. Thanks! bill also provided a fair bit of help figuring out missing gamedata and fixing compatibility with L4D2 2147 and later. Also thanks!
2023-08-30Perform minor build script tidyingMichael Smith
- Add a couple of overdue -Werrors that make life easier - Reshuffle cc/ld flags a bit, mainly around -fuse-ld=lld
2023-08-27Fix editorial mishapMichael Smith
2023-08-27Remove vcruntime140.dll dependencyMichael Smith
This will save users having to install the VS runtime in order to load the plugin. Turns out there was very little to implement to make this work. Turning off stack probing might cause spooky outcomes further down the line but we'll burn that bridge when we get there.
2023-08-02Make various preparations for upcoming featuresMichael Smith
A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful
2023-08-02Fix another x86 case and add regression testsMichael Smith
2023-06-14Fix spuriously-included test case in compile.batMichael Smith
This was clumsily added in 1c4318331663b152b0b298bd2c9e5c971506a86b as a test case for code I was writing at some point but has not been included in the repository yet. This means the 0.6 tag is broken for anyone trying to build from source unless this change is cherry-picked on top. Lesson learned: keep the working tree clean!
2023-06-10Prune some comments and tidy up other minor thingsMichael Smith
2023-06-03Adapt vote reset code into fast campaign resettingMichael Smith
This is kind of a breaking change but the other code was obviously never released or relied on by anyone - it will be pushed at the same time as this in fact. It still seems worth having the original committed separately to show the progression of development of the feature, however. Technically the standalone vote cooldown resetting could also be added back if ever desired however there doesn't seem to be that much of a use case for that at the moment. This feature ought to be a lot more convenient now as it allows for resetting back to a set starting point no matter where the player is in a run. It isn't universally useful as All Campaigns Legacy solo runs require switching to a different type of server and Main Campaigns co-op runs require restarting the game after Swamp Fever to work around the god mode bug, however it is still useful in a good few situations. Unfortunately this turned out to be pretty complex to implement, first requiring a bunch of interop with valve's rather wacky KeyValues stuff, and then requiring a bunch of especially difficult reverse engineering of L4D1 v1.0.0.5 because it doesn't use said KeyValues stuff and does something else completely different instead. A side effect of all this work is that the nag removal hack is now part of the KeyValues stuff in kvsys.c, which is kind of a comfier place for it than just kind of dumped in the middle of sst.c.
2023-05-21Add command to reset L4D2 vote cooldownsWillian Henrique
In most versions of L4D2, players cannot call a vote (e.g. switch campaign, change difficulty, restart campaign) more than once every 3 minutes. This makes resetting on a first map a pain, usually requiring reloading the map to reset the vote state. This new sst_l4d_vote_cooldown_reset command empties the list of structures tracking vote callers, allowing all players to vote again immediately. This should make resetting runs a lot easier on versions without unlimited votes.
2023-05-17Add snd_mute_losefocus backportWillian Henrique
2022-09-13Move towards C23, improve events and vcall macrosMichael Smith
Another big one. Here's a list of things: - Since the upcoming C23 standardises typeof(), use it as an extension for the time being in order to allow passing arbitrary types as macro/codegen parameters. It wouldn't have been a big leap to do this even without standardisation since it's apparently an easy extension to implement - and also, to be honest, this project is essentially glued to Clang anyway so who cares. - Likewise, bool, true and false are becoming pre-defined, so pre-pre-define them now in order to get the benefit of not having to remember one header everywhere. - Really ungodly/amazing vcall macro stuff now allows us to call C++ virtual functions like regular C functions. It's pretty cool! - Events can now take arbitrary parameters and come in two types: regular events and predicates. All this makes the base code even uglier but makes the feature implementation nicer. In other words, it places more of the cognitive burden on myself and less on other people who might want to contribute. This is a good tradeoff, because I'm a genius.
2022-08-16Import Monocypher 3.1.3 + monocypher-rng moduleMichael Smith
This is for somewhat later. I'd always planned to use it - it existed already in earlier private repos, in fact. I just didn't bother to import it here in case it wouldn't actually be needed, but with the way current plans are going, it's definitely going to be needed, so here it is.
2022-07-23Add event systemMichael Smith
2022-07-23Split custom demo data into its own file/featureMichael Smith
Copyright note: the stuff Bill wrote is all still in the other file.
2022-07-23Add keybind lookup codeMichael Smith
Also centralise NEXT_INSN macro, into its own header at least for now.
2022-07-23Add alias management plus input filtering skeletonMichael Smith
Some of the alias stuff was kind of stolen from earlier figuring-out Bill did. More Bill code is also on the way. :^)
2022-06-27Add update detection, clean up minor stuffMichael Smith
2022-06-02Solve the error logging situationMichael Smith
2022-05-30Add basic Portal crosshair colour customisationMichael Smith
Currently only works in 3420 and 5135 and uses hardcoded offsets with a byte pattern sanity check. Future work includes making it more widely compatible, and also doing the crazy thing I wanted to do but gave up on wherein the actual textures and stuff get patched in memory to sync up all the colours. Oh also, a couple of vtables were erroneously made executable, so I went ahead and fixed that while I was at it.
2022-05-03Add entity property finding and L4D warp testingMichael Smith
This was a lot more code than expected, but it might be finally close to time to release the next beta... We'll see if any more rabbit holes present themselves to jump into, though.
2022-04-30Centralise engine access, add Portal FOV changerMichael Smith
- A bunch of stuff is now defined in one header, engineapi.h - engineapi.c is responsible for setting up any interfaces/stuff that's used in more than one place - mkgamedata is pretty much rewritten and now supports nested conditionals - gamedata variables no longer have the gamedata_ prefix because it was just annoyingly long all the time - vcall macros are somewhat revamped and support dynamic (gamedata) indices - Portal 1 FOV can be set anywhere from 75-120 using fov_desired - tested in both the main versions currently used by runners - A few typos were also fixed ("intput," "writeable," "indexes")
2022-04-25Add engine_no_focus_sleep backport, fix codegenMichael Smith
Default gamedata values actually work the way they're supposed to now.
2022-04-25Fix dark L4D2 rendering on Intel integrated GPUsMichael Smith
Thanks Aciidz for helping test this.
2022-04-24Move WIN32_LEAN_AND_MEAN and NOMINMAX into flagsMichael Smith
They're literally always defined thusfar, and it's always possible to include specific headers for other stuff. So, rather than litter the source with defines (which might not even work in the likes of os.h if some other system header already decided to define/include stuff), let's just define it at the build script level.
2022-04-24Dynamically link the Windows C runtimeMichael Smith
This brings the DLL size down to a quarter of what it was. Dunno why Clang doesn't do this by default, but apparently it doesn't!
2022-04-24Replace udis86 with a very small x86 decoderMichael Smith
hook_inline() uses the new x86_len() function to get instruction lengths instead of doing full-blown disassembly, which should be a tiny bit quicker, and also removes the next for about 90KiB of lookup tables and such in the final binary. The code-digging logic in demorecord is also rewritten to be opcode-based rather than mnenmonic based. In general, going forward the plan is to always rely on opcodes and thus avoid a bunch of disassembly work every plugin load. udis86 is still in the tree for now to provide dbg_asmdump(), but it's only compiled into debug builds and left out of releases completely. As such, the whole BSD licence statement is also gone from the distribution LICENCE files. There's now also a dbg_toghidra() which spits out a rebased address to look stuff up for proper reverse engineering, which might be more useful than dbg_asmdump() anyway. If nobody ends up using the latter ever again, udis86 could get chucked completely. We'll see. Also shoehorned into this commit are a couple more forgotten copyright year bumps and some general minor cleanup here and there, because I couldn't be bothered wading through all the diff hunks. Oh, and makebindist.bat now makes an effort to make the zip file timestamps predictable/reproducible. That should be a different commit for sure, but oh well too bad.
2022-03-30Make build scripts *slightly* more flexibleMichael Smith
They're still temporary, I promise, but this will make tweaking the toolchain or turning debug builds on and off a lot simpler.
2022-03-23Work around plugin unloading bug in old branchesMichael Smith
This also introduces some stuff for interacting with the current plugin list. Other plugin management utilies are Coming Soon...
2022-03-21Add m_rawinput reimplementation to replace RInputMichael Smith
It's archive so you can set m_rawinput 1, load SST via VDF and then never think about it again.
2022-01-06Tidy up stubs, make vstdlib a stub, build on LinuxMichael Smith
Important note: it doesn't WORK on Linux, and there's tons of warnings and stuff, but it's easier to work on when all the compiler output and whatnot is there.
2021-12-30Split up os.h, inline functions and fix some typosMichael Smith
2021-12-27Reintroduce autojump codeMichael Smith
2021-12-26Unhide useful commands and allow cheats in lobbiesMichael Smith
This is done through a new "fixes" file which will probably become one of those silly dumping grounds that every project has to have somewhere to put random miscellaneous crap in. These are mainly hidden in L4D2 but they just get unilaterally unhidden if they exist, just to be sure they're accessible. As a bonus, it turns out that unhiding a single cvar also allows us to set sv_cheats 1 in Left 4 Dead 2, bringing an end to the need to port- forward a listen server for co-op practice.
2021-11-20Initial public snapshotMichael Smith
With code from Bill. Thanks Bill!