889 Commits

Author SHA1 Message Date
Kawe Mazidjatari
bbe885689a Add define for compiling launcher for dedicated servers
This sets the selected mode to server by default upon launch
2022-06-06 01:31:20 +02:00
Kawe Mazidjatari
e2bc64a65e Overlap edge of text box with send button 2022-06-06 01:16:40 +02:00
Kawe Mazidjatari
76d8da3db2 Fix return bug
CPackedStore::GetManifest() did not return a value in all control paths.
Use proper size types for entry block constructor.
2022-06-06 00:21:13 +02:00
Kawe Mazidjatari
400fc3b47a Add VPK build exec files 2022-06-06 00:12:48 +02:00
Kawe Mazidjatari
616f9b34fb Log number of descriptors build into VPK directory file 2022-06-06 00:06:54 +02:00
Kawe Mazidjatari
c9e3ea1f08 Rename to use correct terminology 2022-06-05 22:30:29 +02:00
Kawe Mazidjatari
f446ee03dd Correct terminology 2022-06-05 22:27:43 +02:00
Kawe Mazidjatari
0ff27bb20d Fixed bug where logged total directory size is wrong
changed writer.GetPosition() to sizeof(VPKDirHeader_t) + m_vHeader.m_nDirectorySize because we seek back to the offset of m_vHeader.m_nDirectorySize.
2022-06-05 22:12:22 +02:00
Kawe Mazidjatari
13f518d773 Fixed VPK manifest bug
Fixed bug where VPK root character gets written to the manifest file.
Show detailed data sharing statistics.
2022-06-05 20:55:34 +02:00
Kawe Mazidjatari
d005626aa0 Fix VPK root files bug
Files names of files located in the root of a VPK weren't formatted properly
2022-06-05 18:01:23 +02:00
Kawe Mazidjatari
92daef5a32 VPK system improvements
More detailed operation statistics.
Discard VPK directory files who's header doesn't match engine requirements.
Separated manifest properly between language and context (you can now package for each language and context from a single workspace).
2022-06-05 17:28:39 +02:00
Kawe Mazidjatari
15c1908478 Additional cleanup
Cast to proper types.
Set the archive offset only instead of the entire block. The entry could still have its own flags. The only thing needed for saving data is sharing the same offset and size.
2022-06-05 12:28:49 +02:00
Kawe Mazidjatari
a4783a755e Fix memory leak
Access checksum objects directly vs pointer reference. Structure size equals a 64 bit pointer (fits into a single register).
Allocated memory was never deallocated (my mistake).
2022-06-05 03:01:10 +02:00
Kawe Mazidjatari
fb0a3db69e Fix spelling V2.0 2022-06-05 02:44:55 +02:00
Kawe Mazidjatari
c7e7a38b08 Set maximum compression level 2022-06-05 02:25:00 +02:00
Kawe Mazidjatari
22029abfc2 Fixed compression bug for VPK system
Fixed bug where the compressed buffer size equals the source buffer size getting packed into the VPK chunk. In all occurrences this resulted in corrupted data upon export.

The reason for data being corrupt upon export is because the engine checks the equality of the compressed and decompressed size fields in the directory file, if they are equal, the engine doesn't attempt to decompress the block. So we end up with a still compressed block on the disk (technically not corrupt in the context of the compression lib, but useless as-is on the disk).

If a compressed file doesn't get lower in size we are better out storing it rather than compressing it.

Added a new condition in lzham::lzham_lib_compress_memory which checks source and destination buffer size equality.
2022-06-05 02:24:44 +02:00
Kawe Mazidjatari
ad0f94e973 Implement data sharing algorithm in VPK packing
This reduces size of the resulting VPK (checks entry block in hash map).
mp_common compresses to 32mb instead of 37.3mb (original is 38.5mb).
2022-06-04 13:55:24 +02:00
Kawe Mazidjatari
3dd96964e3 Cast and format to proper types 2022-06-04 03:19:05 +02:00
Kawe Mazidjatari
6e32775c71 Additional VPK system improvements
Added DevMsg logs to show the elapsed time of the operation.
Fixed post decompress CRC/ADLER error checking.
Slight cleanup.
2022-06-04 03:12:46 +02:00
Kawe Mazidjatari
b3dd9c8ad6 Revert declaration 2022-06-04 01:30:18 +02:00
Kawe Mazidjatari
2e77c584b4 Cleanup 2022-06-04 01:17:07 +02:00
Kawe Mazidjatari
655d1c65b2 Proper VPK repacking
Initial proper implementation pending cleanup.

The new system builds a manifest file when a VPK is unpacked. The manifest files contains data such as the entry flags and texture flags. It also contains a field determining whether the file should be compressed or not.

When a user repacks a pack, the system attempts to load this manifest file and does a lookup to the object to retrieve the flags (most of these flags are unknown, but they are used by the engine and are necessary for stuff like cubemaps and texture files to work correctly. Cubemaps won't work with proper flags, and textures (decals, particle system components, etc..) will look washed out without them.

I think some also determine whether a file within the VPK should be cached or not, so simply marking everything as 0x101 will probably end up in more CPU time and higher filesystem cache usage (depot/ is only 0x1, I don't think anything there is getting cached ever without the 0x100 flag).

User could also repack a VPK while excluding anything that is not in the manifest file. So you could unpack all VPK's into a single directory (each VPK has its own manifest file tied to its level name), and rebuild all the VPK's with only the files that where originally in them.

fs_pack_vpk command usage: <locale> <context> <level_name> <manifest_only>

locale determines the pak language (default english), context determines whether is a server/client vpk, level_name determines the BSP name of the pak, manifest_only determines whether the pack system should only include files within the manifest (leaving this arg out will build all files into the vpk).

The VPK workspace path is determined with ConVar 'fs_packedstore_workspace'.
2022-06-04 01:08:23 +02:00
Kawe Mazidjatari
b65928b0c7 Improve spelling 2022-06-03 19:38:58 +02:00
PixieCore
3b46780a38 Temp fix so I can compile (UTF8Decode) 2022-06-02 16:30:35 +02:00
Amos
07533cb0c4 packedstore cleanup
Add const qualifiers to params.
Enable compression flags.
2022-06-02 15:20:22 +02:00
Kawe Mazidjatari
f1f0ca35f8 Merge branch 'master' into indev 2022-06-02 02:02:36 +02:00
Kawe Mazidjatari
14f409c8c6 Update packedstore.cpp 2022-06-02 02:00:35 +02:00
Kawe Mazidjatari
649060c8cc Update packedstore.cpp 2022-06-02 01:59:03 +02:00
Kawe Mazidjatari
f824954640 Update packedstore.cpp 2022-06-02 01:58:29 +02:00
Kawe Mazidjatari
ec7582e476 Fixed VPK repack with multiple files
VPK's could now be repacked with compression and multiple files. The output is identical to the input as far as currently tested (mp_rr_canyonlands_staging).
2022-06-02 01:57:18 +02:00
Kawe Mazidjatari
e6e4bd703c Fix string utility bugs
GetFileName returned null string if file is not within a path, now returns the input file name.
RemoveFileName returned file name if file is not within a path, now returns null string.
Added StringReplaceC (string replace with copy instead of modifying the reference object).
2022-06-02 01:55:41 +02:00
Kawe Mazidjatari
4d8d164df6 Improve CIOStream class
Add read/write with specified size.
Add data vector.
2022-06-02 01:52:49 +02:00
rexx
5e58b7a5d3 fix access violation on script command
running "script_client" from main menu would cause an access violation when attempting to access m_hVM from the CSquirrelVM instance for the client vm, which has not been created by this point
2022-06-01 19:57:39 +01:00
PixieCore
6ea1a8bebc Executing commands from launcher. 2022-05-31 18:05:43 +02:00
Kawe Mazidjatari
f2472e9275 Fix dev menu not showing up when launching with sv_cheats v2.0.7_rc2 2022-05-30 22:28:03 +02:00
Kawe Mazidjatari
6fbe900ba9 Initial implementation of compressed VPK rebuilding
The 'fs_pack_vpk' allows compressing specific files into a VPK (compressed). This implementation has better compression ratio's then currently available VPK tools with compression (at the cost of speed).
The implementation is early, a directory iterator with a files for flags is planned soon to fully rebuild VPK's on-demand. A dedicated standalone program is also planned.

The output dir and archive formats should match 1:1 with the original game
2022-05-30 02:56:15 +02:00
Kawe Mazidjatari
5b75903ac2 Fixed missed rename of 'Read()' 2022-05-30 02:47:55 +02:00
Kawe Mazidjatari
2ee9cce393 Improve binary stream class 2022-05-30 02:47:15 +02:00
Kawe Mazidjatari
b3583cf005 Declare more common types in the global scope
This should had gone before the prior commit
2022-05-30 01:50:53 +02:00
Kawe Mazidjatari
399131d57d Add additional useful string utils 2022-05-30 01:50:21 +02:00
Kawe Mazidjatari
148a6f424c Update sqscript.cpp 2022-05-30 01:45:06 +02:00
Kawe Mazidjatari
4a512522ab Set hostname via 'hostname' ConVar instead v2.0.7_rc1 2022-05-29 02:32:00 +02:00
Kawe Mazidjatari
87157d3202 Update config files
Most of these are managed by the launcher. Keeping these here will cause problems as values we set in the launcher get reset by those.
2022-05-29 02:31:43 +02:00
Kawe Mazidjatari
97592fee97 Update playlists file
Added custom_ctf and adjusted visibility for certain items for the new RUI/VGUI server browser
2022-05-29 02:08:59 +02:00
Kawe Mazidjatari
86c1322aa0 Update sqinit.cpp 2022-05-29 02:08:07 +02:00
Kawe Mazidjatari
377b5dc262 Fix dereference crash if pointer exceeds int32 size
The crash only happened when the game executable had the ASLR flag set, because only then the pointer value overflowed the int32 type due to my bad cast
2022-05-29 00:39:13 +02:00
Kawe Mazidjatari
9aa665b374 Remove extraneous deref
Caused crash when calling sq_getstring/sq_getinteger.
Forgot to remove this after derefing it from the VM pointer.
2022-05-29 00:02:03 +02:00
Kawe Mazidjatari
84f6f37721 Rename unknown parameter
Unkmown parameter was socket (pServer + 0xC).
2022-05-28 23:36:29 +02:00
Kawe Mazidjatari
7bc18c8012 Align CServer structure with game's memory
Unknown fields have been padded to match the structure's size in memory. Iteration is now possible.
2022-05-28 23:14:01 +02:00
Kawe Mazidjatari
61c7dbf5c1 Fix memory leaks 2022-05-28 23:05:10 +02:00