Commit Graph

208 Commits

Author SHA1 Message Date
47a7f78c9d Change %c to %lc for wchar arguments.
swprintf_s expected an argument of type char (due to %c). Given an
argument of type wchar.
This fixes N7 and N8 from #5288

Refs #5288

Patch By: @animus
Accepted By: @phosit, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4993
This was SVN commit r27751.
2023-07-05 07:37:28 +00:00
a3abe8605c Ignore broken symlinks instead of crashing on them, fixes #6586.
Print a warning in the debug output for now, as the logger is not
available at this point.

Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4743
This was SVN commit r27612.
2023-04-19 16:35:00 +00:00
880a797ce0 Fix replay cache creation in non latin folders.
IRC:
https://irclogs.wildfiregames.com/%230ad-dev/2022-08-14-QuakeNet-%230ad-dev.log
Reported by: @AirXonix2
Thread:
https://wildfiregames.com/forum/topic/89261-a-new-series-of-bugs/#comment-514734
Discussed with: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4763
This was SVN commit r27054.
2022-08-14 17:23:50 +00:00
8c068aab07 Removes possibility to link lowlevel library dynamically.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4470
This was SVN commit r26281.
2022-01-31 06:53:30 +00:00
809e3ed0bd Removes rand function usage from tests to avoid non-uniform distributions.
This was SVN commit r26012.
2021-11-25 17:57:59 +00:00
645e053fd2 Remove executable bit on some source files.
Reported by: Ralph Sennhauser
Fixes: #6325

This was SVN commit r25917.
2021-09-12 18:41:51 +00:00
Angen
52baaa4bbd Fix updating existing mods
Replace wrename, that fails when mod exists already with RenameFile by
@Stan
Check if mod was actually installed when downloading it
error if mod cannot be coppied into modTemp

Differential revision: D4222
This was SVN commit r25854.
2021-08-22 11:35:34 +00:00
455b784f62 Delete test .zip file after running tests
Issue spotted by kalimaps
Reviewed by: wraitii
Code parts by: wraitii
Differential Revision: https://code.wildfiregames.com/D4043
This was SVN commit r25646.
2021-06-02 21:31:18 +00:00
5656c4117d Adds std namespace to shared_ptr usages in lib.
This was SVN commit r25529.
2021-05-22 19:32:38 +00:00
b477892440 Fix issues in 87a2c3347f
Fixes 87a2c3347f:
- NoPCH was broken
- two warnings slipped through.

Differential Revision: https://code.wildfiregames.com/D3751
This was SVN commit r25147.
2021-03-28 07:01:34 +00:00
87a2c3347f Make real directory paths on the VFS predictable (retry)
This is the same commit as 4bb31f084e, reverted in 5d1899785a. Noted
issues were fixed.

Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.
It also makes it explicit that a directory must be passed to Mount().

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3728
This was SVN commit r25107.
2021-03-23 12:46:59 +00:00
5d1899785a Revert 4bb31f084e
4bb31f084e led to an issue in windows-specific code not detected by the
tests. I'll debug later.

This was SVN commit r25105.
2021-03-22 19:52:07 +00:00
4bb31f084e Make real directory paths on the VFS predictable.
Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3217
This was SVN commit r25104.
2021-03-22 18:49:42 +00:00
7a71011149 Refactors smart pointers creation, reduces code duplication and improves exception safety.
This was SVN commit r24915.
2021-02-13 23:53:40 +00:00
596155cede Use C++17 std::size instead of sizeOf
This was SVN commit r24413.
2020-12-17 22:17:46 +00:00
387b2106ae Fix style issues in archive_zip code. test for more things.
This was SVN commit r24410.
2020-12-17 22:00:31 +00:00
14cc771b6d Fix zip with comments triggering assertion on game startup
Fixes #5165

Patch by: @Teiresias
Differential Revision: https://code.wildfiregames.com/D1511
This was SVN commit r24368.
2020-12-10 19:09:10 +00:00
369c2e8801 Further header & precompiled cleanup, fix no-PCH builds.
GUIObjectBase is made a IGUIObject* to avoid including those headers
un-necessarily. Subsequent diffs ought to clean up the various of
pointers for that with a similar type with reference semantics.

Also:
- Add standard C and C++ headers (mostly cstring for memcpy, string and
vector) where needed.
- Swap out some includes for forward declarations
- Clean up un-necessary boost includes in precompiled and other headers.
- Clean up precompiled headers, including fewer things.
- Move ACPI to the windows-specific folder as it's included there only
and mostly specific to that platform.

Thanks Stan for the testing.

Differential Revision: https://code.wildfiregames.com/D3129
This was SVN commit r24352.
2020-12-09 14:39:14 +00:00
2288de4aa6 Remove UniqueRange custom code in favour of unique_ptr
UniqueRange was a unique_ptr replacement with a few tweaks (such as a
compulsory custom deleter). Its features are not really used, it
contains outdated atomic calls, and it blocks D1511, thus it is removed.

Refs #5165

Differential Revision: https://code.wildfiregames.com/D613
This was SVN commit r24234.
2020-11-22 13:43:19 +00:00
61e3f1ec0d Fix hotkey events synching with hotkey state.
This is a semi-revert of 78bc56f33e and a correct fix for #3194.

The core issue is that the GUI handler must come behore the hotkey
handler, otherwise typing in boxes can set off hotkeys, and the hotkey
handler is repsonsible for updating the hotkey state.
Thus the GUI handler never has an up-to-date hotkey state, since that's
done later. 78bc56f33e fixed that by calling HotkeyInputHandler
manually, but that was still broken in some (unused) cases and was hacky
(indeed, it even looked hacky as noted by elexis).

The simplest fix is to split the 'hotkey creator' handler from the
'hotkey state change' handler, and run the 'hotkey state change handler'
before any other handler. Thus the gui handler remains in front of the
'hotkey creator' handler, but it has a correct hotkey state at any time.

Differential Revision: https://code.wildfiregames.com/D1839
This was SVN commit r22909.
2019-09-15 12:16:28 +00:00
1ff20e8f6a pthread -> std::thread (4/7) - Replace pthread in remaining files
This removes pthread mutexes/threads from:
- vfs
- the resource handler manager
- timer
- the network server.

This allows removing it from our general posix include header.

Differential Revision: https://code.wildfiregames.com/D1920
This was SVN commit r22666.
2019-08-15 09:07:16 +00:00
e2233a4a90 Don't clear pathnames in vfs::GetPathnames so it can be called several times.
Differential Revision: https://code.wildfiregames.com/D1914
This was SVN commit r22312.
2019-05-28 10:18:04 +00:00
404e1a9a4a Add a mod installer, fixes #4027.
pyrogenesis can now take a zip file (rename it to .pyromod for direct
file association following 943a61e4ea) and install it. It then starts
the mod selector.

Patch by vladislavbelov, with contributions from Imarok, elexis and
myself.
Differential Revision: https://code.wildfiregames.com/D1142
This was SVN commit r21726.
2018-04-15 01:46:28 +00:00
cc67d54aeb Fix compiler warnings on VS 2015, refs #3439, refs #5069.
Patch By: Stan
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1262
This was SVN commit r21480.
2018-03-10 09:58:53 +00:00
89e339dd16 Remove VFS cache, because it is less effective and less efficient than the OS cache (and partially redundant with higher level application caches).
Patch By: Sandarac
Discussed with: Philip, echotangoecho, Bezerra
Fixes #4072.
Differential Revision: https://code.wildfiregames.com/D587
This was SVN commit r20639.
2017-12-10 17:33:03 +00:00
43137fef3f Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c).
Differential Revision: https://code.wildfiregames.com/D716
Refs 09e974e1cb
Reviewed By: bb
Change in agreement with leper.

This was SVN commit r19899.
2017-07-10 14:26:24 +00:00
7c88529b45 Call std::terminate() instead of throwing in a destructor.
We don't catch this specific exception, so no behavioural change, but we
do no longer violate the implicit noexcept for destructors in C++11.
(Fixes a GCC6 and VS2015 warning.)

Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D416
This was SVN commit r19612.
2017-05-19 17:48:43 +00:00
51f7502bb1 Don't move temporaries, so possibly allowing for copy elision.
Pointed out by clang's -Wpessimizing-move.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D421
This was SVN commit r19559.
2017-05-11 23:24:54 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
12ad190a51 Allow .Deleted to work on directories. Fixes #2641. Patch by leper.
This was SVN commit r18916.
2016-11-10 22:52:39 +00:00
f4e69b7c07 Cleanup of #3255, fixes #3966.
Don't create an empty oos_logs directory when starting the game.
Rename getDateIndexSubdirectory to createDateIndexSubdirectory.
Add a comment for the breakpoint argument of CreateDirectories.

This was SVN commit r18183.
2016-05-16 00:56:07 +00:00
a32ed75bff Fix a race-condition when two games have been started simultaneously and attempt to create the same replay directory, refs #3255.
Instead of triggering a debug-breakpoint, print a warning to stdout and
succeed in the N'th retry when having started N processes
simultaneously.
Previously the problem had been addressed by using the processID in the
directory name.

This was SVN commit r17776.
2016-02-19 11:22:32 +00:00
6f09803e8c TerrainTextureManager file loading rewrite. Fixes #3358.
Add directory callback to vfs::ForEachFile.
Each terrain directory should now have a terrains.xml file,
as using the previous terrains.xml file is unlikely to be what was
intended.

This was SVN commit r17341.
2015-11-30 20:12:12 +00:00
c0b4e78801 Fixes stream serialization bug on OS X 10.8 and older, which caused instant OOS in multiplayer games, fixes #3108.
Fixes test failures on OS X 10.7 and older, refs #3109

This was SVN commit r17133.
2015-10-15 03:31:30 +00:00
674f49f1a8 Remove generated test files during clean-workspaces.sh. Patch by otero. Fixes #3275.
Also remove two generated and disabled test files.

This was SVN commit r16921.
2015-08-19 01:30:09 +00:00
c5aad60776 Actually stop iterating if retval != INFO::OK. Also fix comments.
This was SVN commit r16900.
2015-07-30 21:50:58 +00:00
b6bcfdbb2e Fixes missing newlines in debug_printf, patch by elexis, fixes #3056
This was SVN commit r16534.
2015-04-12 19:38:31 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
0843100d11 Remove partial emulation of some C++11 features for older compilers.
This was SVN commit r16226.
2015-01-24 20:37:18 +00:00
689272d4bd Remove collision in global namespace.
Fixes config/vfs deadlocks on OSX.

This was SVN commit r15504.
2014-07-09 19:16:03 +00:00
190f3b0ce1 Exclude .git dirs when adding subfolders to the VFS.
This was SVN commit r15373.
2014-06-15 17:06:24 +00:00
59c9ae670f Stop VFS from causing a crash when the AI player isn't found. Patch by Itms. Fixes #2558
This was SVN commit r15254.
2014-05-31 14:55:09 +00:00
5dfc3746e3 Remove old and unused archive stats.
This was SVN commit r14114.
2013-11-08 17:27:21 +00:00
93cffe9deb Remove the old and no longer used archive builder that rebuilt the archive while the game is running.
This approach isn't used anymore. Now we start the archive building with
parameters to pyrogeneis.

Refs #2241 (the code used g_ScriptingHost which is going to be removed)

This was SVN commit r14102.
2013-11-07 21:06:18 +00:00
b1bd61938e add file notification to Mac ticket 514, also change name of class FileInfo to CFileInfo to ease Mac development
This was SVN commit r13821.
2013-09-10 14:17:04 +00:00
04ed87bf28 Display error messages instead of breaking into the debugger when we don't have rights to save a map in Atlas. Fixes #1941.
This was SVN commit r13818.
2013-09-09 23:31:22 +00:00
2567fee329 Write mod data correctly. Fixes #1940.
This was SVN commit r13472.
2013-06-11 20:50:09 +00:00
2f19cf86d3 Fix mod priority. Add user mod support. Fixes #1838.
This was SVN commit r13167.
2013-02-14 00:40:02 +00:00
7fa6afac37 Corrects some Doxygen comments and adds a few others of interest.
This was SVN commit r11209.
2012-03-01 03:55:05 +00:00