174 Commits

Author SHA1 Message Date
Amos
c187bed4c5 RCON implementation (see description)
* Fully rewritten protocol agnostic CNetAdr class
* Fully rebuilded legacy CNetAdr class
* Fully rebuilded dual-stack CSocketCreator class
* New project "netconsole" added (lightweight netconsole for RCON)

RCON is still work in progress
2022-02-06 16:48:52 +01:00
Amos
f488b7e75e Load 'server' VPK's instead if the dedicated server is a standalone dedicated server
* Load server VPK's instead of client VPK's on standalone servers
* Dynamically search for 'g_bDedicated' global boolean instead of hardcoded address
* Add 'PatchString' to memory class
2022-01-26 23:45:58 +01:00
Amos
591559f8dc Add pseudodefs to precompiled header file 2022-01-26 23:45:08 +01:00
Amos
381b97eb65 Remove unnecessary include
basetypes.h is now precompiled
2022-01-16 01:40:27 +01:00
Amos
de3b3f53bd Optimizations + QoL improvements/cleanup
* IConsole overlay now clears the oldest log entries to stay under the vector limit instead of clearing the whole vector.
* IConsole code cleanup.
* IBrowser code cleanup, reordered class methods.
* Use ConVar utilities to get/set values for strings in IBrowser and IConsole.
* New ConVar's for RUI console overlay to tweak colors.
2022-01-12 02:56:17 +01:00
Amos
556894b3e3 Add connect command fix back
Accidentally removed.
2022-01-05 23:50:14 +01:00
Amos
47fdd4211d Fix for S3
For some reason the same byte pattern wasn't found in the miles dll for the S3 game, even though they where identical. Changed the byte patterns to search for the last 2 bytes of the instruction as well and made the conditional jmp instructions, unconditional for making sure mileswin64.dll doesn't close the process when a debugger is found.
2022-01-05 23:43:51 +01:00
Amos
d52bd5eeec Initial support for S1 2022-01-05 23:02:20 +01:00
Amos
c486c2d593 Portability to S2 completed
CServer functions are evolving quite heavily over these seasons, so these need a bit of work
2022-01-05 02:11:21 +01:00
Amos
84e7729ca0 Add client and debug utilities + cleanup 2022-01-04 11:56:31 +01:00
Amos
5f664d8e6b Create signatures for all used Dedicated functions 2021-12-31 03:44:21 +01:00
Amos
2c7ced128d Heavy dedicated cleanup
* Since the material mode is set to '2', all of the render loops and shader loading functions are no longer called. These have all been removed.
* Added description for patches that missed them
* Traced root caller/cause for certain patches to skip even more unnecessary code and save more memory.
2021-12-30 22:13:56 +01:00
Amos
22c0b5c867 Dedicated server improvements 2021-12-30 17:20:47 +01:00
Amos
c48ed7f7a5 Rename dedicated variables 2021-12-29 18:06:37 +01:00
IcePixelx
d1ba2bd567 Fixed changelevel, needs more research tho. 2021-12-29 15:35:48 +01:00
Amos
4695012571 Fix 'C_PropDoor' not spawning properly on the server 2021-12-29 13:58:03 +01:00
Amos
b514f928a6 Use a separate executable for dedicated server
The dedicated server still has directx dll imports which will cause issues with ReShade or 3DMigoto, or trying to load it on a headless machine with no directx installed. The imports have to be cleared to avoid issues. The most convenient approach is to do this with a separate exe rather then patching it in runtime.
2021-12-29 02:16:28 +01:00
Amos
bc8f9400d3 Fix collisions for headless dedicated server 2021-12-29 00:19:01 +01:00
Amos
0e36aa647f Dedicated without ShaderApi and DirectX pre-alpha
The instruction at 'CalcPropStaticFrustumCull' [0x14028F3B0 + 0x5C7] moves RSP + 0x70 into the R13 register.
RSP + 0x70 seems to contain a pointer to collission data for that particular prop model.
When running NoShaderApi() and passing the dedicated server the '-noshaderapi' command line parameter, RSP + 0x70 will be a nullptr.
This has to be fixed to have prop static collissions on the server.
2021-12-28 20:19:17 +01:00
Amos
69161ae6c0 Implement RTech_AsyncLoad hook and concommand
The ConCommand 'rtech_asyncload' allows the user to load specific pak files on-demand.
2021-12-27 16:53:35 +01:00
Amos
947049b7e6 Add RPak async load pattern 2021-12-27 03:27:22 +01:00
Amos
0107656b1b Dedicated server inaccessible memory fix
The approach could likely be performed better, however this is a multithreaded operation and isn't very easy to debug. So far this allowed the server to start and change to every level. The root cause has to be identified when the server is stable
2021-12-27 03:15:25 +01:00
IcePixelx
8ed86febff fixed file typo. 2021-12-25 22:54:32 +01:00
Amos
d5b2e58dae Code base refactor + major performance and readability improvement. Read description for details.
* Codebase restructured to SourceSDK codebase style and .cpp/.h assertion paths in the game executable.
* Document most functions with valve style 'Purpose' blocks.
* Rename variables to match the rest of the codebase and Valve's naming convention.
* Dedicated DLL and the SDKLauncher now share the same codebase as the DevSDK.

* Obtain globals or pointers directly instead of waiting for runtime initialized data.
* Dynamically search for all functions and globals (this doesn't count for dedicated yet!).
* Initialize most in-SDK variables.

* Move certain prints and other utilities under ConVars to reduce verbosity and increase performance.
* Print all pattern scan results through a virtual function to make it easier to add and debug new patterns in the future.
* Type global var pointers appropriately if class or type is known and implemented.
* Forward declare 'CClient' class to avoid having 2 'g_pClient' copies.
* Add IDA's pseudo definitions for easier prototyping with decompiled assembly code.

* RPAK decompress Command callback implementation.
* Load decompressed RPaks from 'paks\Win32\' overriding the ones in 'paks\Win64\' (the decompress callback will automatically fix the header and write it to 'paks\Win32\').

* VPK decompress Command callback implementation.
* Move CRC32 ands Adler32 to implementation files.

* Server will print out more details about the connecting client.

* Upgrade ImGui lib to v1.86.
* Don't compile id3dx.h for dedicated.
* Don't compile id3dx.cpp for dedicated
* Implement DevMsg print function allowing to print information to the in-game VGUI/RUI console overlay, ImGui console overlay and the external windows console

* Fixed bug where the Error function would not properly terminate the process when an error is called. This caused access violations for critical/non-recoverable errors.
* Fixed bug where the game would crash if the console or server browser was enabled while the game was still starting up.
* Several bug fixes for the dedicated server (warning: dedicated is still considered work-in-progress!).
2021-12-25 22:36:38 +01:00