Commit Graph

665 Commits

Author SHA1 Message Date
Robert Adam
5081d5a63a
Merge PR #6491: FEAT(positional-audio): Plugin for Grounded 2025-07-31 18:01:13 +02:00
Davide Beatrici
2a0683d0be FIX(cmake): Ensure the client installer target is built after its dependencies
Looks like targets are now built concurrently, which results in the installer failing to find the G15 and x64 overlay helpers.

This commit marks the G15 and overlay targets as dependencies of the client, when they're enabled.

As a bonus, plugins are now tied to their own dedicated target rather than the client's.
This is required because the client's subdirectory is now included later on.
2024-11-29 04:36:20 +01:00
sqwishy
2fa25dd479 FEAT(positional-audio): Plugin for Grounded
Positional audio support for the Steam release of Grounded.

Tested on 1.4.3.4578, 1.4.4.4634, and 1.4.5.4679.
2024-10-04 14:54:16 -07:00
sqwishy
1498b83559 FIX(plugins): Load correct pages for modules
This `VirtualQueryEx()` loop is called for each module in a
process. It reads pages starting at the module address but seems to
continue past into other modules and into dynamic allocations also.

This check stops enumerating pages once it encounters one that no longer
belongs to the module for which pages are being collected.

(Also this function opens two handles, this adds a clean up for the
first handle if opening the second fails.)

Fixes #6558
2024-10-04 10:37:13 -07:00
Robert Adam
330c356e71 MAINT: Remove copyright year from all copyright notices
Keeping these up-to-date is just super tedious and they don't really
fulfill any purpose these days.
2024-09-30 18:06:20 +02:00
Davide Beatrici
ffddb3ce54 REFAC(client): Replace <codecvt> usage
Deprecated in C++17 and slated for removal in C++26.

Unfortunately no standard replacement is available yet.
2024-07-26 20:14:22 +02:00
Robert Adam
8a764cf699 FIX(plugins): Compilation with new unified header
The new header (as introduced via
2b35c0c28f) was missing a typedef and a
utility macro for dealing with the versioned MumbleAPI struct.

Furthermore, plugins that are only build in debug builds were still
including the old (and now non-existing) headers.
2023-11-29 19:07:13 +01:00
Davide Beatrici
c912a416c9 FIX(positional-audio): Fix Source Engine plugin not working on Windows
The bug was introduced in 13cbf72877.

It was only reported last year and because of a side effect: consistent lag for the entire application.
That's something that should be dealt with independently.
2023-10-23 22:51:23 +02:00
Robert Adam
2b35c0c28f REFAC(plugins): Unified Mumble plugin headers
Having different include files that are needed (and which are
inter-dependent) to create your own plugin, makes things harder than it
needs to be.

Therefore, all plugin header files (those for the "new" (1.4) plugin
framework anyway) have been combined into one header file. Thus,
developers now only have to download a single file and include that
instead of having to figure out what files to download and what to
include where.

Taking the chance, the version number has been removed from the header
file's name. This allows one to track changes made to the API via git
(which is not quite as easy if you create a new file every time you make
a change).
2023-07-27 19:39:30 +02:00
Autumn
6647cbd63c REFAC(plugins): Specialize SharedMemory to LinkedMem
SharedMemory is only used to point to an instance of LinkedMem.
Preventing it from having a dynamic size simplifies the code.
2023-04-11 13:40:39 -07:00
Autumn
51c3e42648 FIX(plugins): Use atomic operations in Link plugin
The Link plugin uses an inherently racy protocol to communicate with
applications: shared memory with no means of synchronization. This
commit makes no changes to this protocol and shouldn't break anything
that was working before. That means it doesn't eliminate race
conditions, but it does allow the plugin to work without the risk of
*data races* specifically, which are undefined behavior.

This is done by using 32-bit atomic operations to copy the LinkedMem
struct out of shared memory before reading from it. This should work
well, since every field of LinkedMem has a size that's a multiple of
32 bits, and 32-bit atomics are widely supported.

With this change, applications can avoid data races with the Link
plugin by also accessing shared memory exclusively with 32-bit atomic
operations. Applications that already work with the plugin should
continue to work.
2023-04-11 13:40:06 -07:00
Robert Adam
249d2c6298 MAINT: Update copyright headers to 2023 2023-01-08 15:54:35 +01:00
Davide Beatrici
13c051b36b FIX(positional-audio): Force 8 bytes alignment for CCameraAngles in GTAV plugin
https://en.cppreference.com/w/cpp/language/alignas

This fixes compilation when the implicit alignment is not 8 bytes.

It can be the case with 32 bit targets.
2022-09-01 23:32:57 +02:00
Hartmnt
03c9fc7a11 FEAT(client): Add possibility to change notification volume
Previously all notification sounds were played as is, without
taking anything into account. The only way to change the
volume was to manually edit the sound files, or change the
overall volume of the entire Mumble application.

This commit adds the ability for the user to adjust the
volume of notification sounds and audio cues. There are two
new settings added "notificationVolume" and "cueVolume"
to adjust the volume independently. Sliders in the "Messages"
have been added and together with the existing TTS volume
slider make up the new group "Message Volume".

A side effect is the centralization of the db <-> factor
conversion functions in the "VolumeAdjustment" class.

Furthermore, this commit also introduces a change to the
"playSample" API call, accepting a volume parameter,
and therefore bumps the Mumble API version to 1.2.x.

Implements #3963
2022-08-01 12:27:08 +02:00
Robert Adam
92170ead6f
FIX(plugin): Typo in error string representation 2022-07-23 12:53:54 +02:00
Davide Beatrici
5b7f95b54f REFAC(positional-audio): Define "procid_t" as "uint64_t" instead of "uint32_t"
This allows us to take advantage of the full range provided by the plugin API.
2022-06-05 02:48:50 +02:00
Davide Beatrici
799926b8a3 FEAT(positional-audio): Rewrite GTAV plugin to use signatures and game structs
It should now work flawlessly with all variants (Rockstar, Steam, Epic Games).
2022-06-05 02:48:47 +02:00
Davide Beatrici
444094d2de FEAT(positional-audio): Add ProcessBase::peekRIP(), for x64 processes 2022-06-04 22:56:26 +02:00
Sergei Trofimovich
b92d82d2b2 BUILD: Fix missing <cstdint> include
Without the change mumble build fails on this week's gcc-13 snapshot as:

    plugins/Module.h:13:9: error: 'uint64_t' does not name a type
       13 | typedef uint64_t procptr_t;
          |         ^~~~~~~~
    plugins/Module.h:12:1: note: 'uint64_t' is defined in header '<cstdint>';
      did you forget to '#include <cstdint>'?
       11 | #include <unordered_map>
      +++ |+#include <cstdint>
       12 |

Co-authored-by: Davide Beatrici <github@davidebeatrici.dev>
2022-05-27 09:02:15 +01:00
Magnus Groß
36b58eb688
FIX(positional-audio): Update GTAV plugin to version 1.59.2612 2022-05-17 11:56:45 +02:00
Orangestar
5a0a57edfe FIX(positional-audio): Fix Quake Live plugin
The "spectator" property address was slightly off, which prevented the
plugin from working at all. Additionally, the previous "map" address
only worked for listen servers.

I've corrected the first, and found a new, properly-working address for
the second.
2022-04-30 08:14:58 -05:00
Davide Beatrici
cf38096242 FIX(positional-audio): Update Among Us plugin to work with v2022.3.29s (1864)
https://store.steampowered.com/news/app/945360/view/3121564363609006624
2022-04-01 07:21:37 +02:00
Sergei Trofimovich
36398fb3b2 BUILD(positional-audio): Fix missing <memory> include
Without the change the build fails on upcoming gcc-12 as:

    /build/mumble/plugins/gtav/gtav.cpp:13:13:
      error: 'unique_ptr' in namespace 'std' does not name a template type
       13 | static std::unique_ptr< Game > game;
          |             ^~~~~~~~~~
    /build/mumble/plugins/gtav/gtav.cpp:12:1:
      note: 'std::unique_ptr' is defined in header '<memory>';
        did you forget to '#include <memory>'?
       11 | #include <cstring>
      +++ |+#include <memory>
       12 |
2022-02-27 17:24:07 +00:00
Magnus Groß
f0d7381e49
FIX(positional-audio): Update GTAV plugin to version 1.58.2545 2022-01-27 23:21:34 +01:00
Magnus Groß
31a9522a0f
REFAC(positional-audio): Remove useless memory locations in GTAV
These addresses provide no additional meaningful data. The identity
context is supposed to identify an user, not provide meaningless info
about unrelated ingame objects.

Remove these unnecessary variables, as they only increase the amount of
work needed when reverse-engineering positional audio.

The username is already alone an unique identity, so instead of setting
the identity to a JSON of multiple values, we now set the identity to
just the username.
2022-01-27 23:21:18 +01:00
Sören Tempel
b47eb5055b BUILD: include libgen.h for files which use basename(3)
As per POSIX, basename(3) is defined in libgen.h. Without including
this header file the code presently does not compile (on musl) due to
`-Werror` and a `-Wimplicit-function-declaration` warning.
2022-01-19 11:28:15 +01:00
Robert Adam
d100ff1467 MAINT: Update copyright to 2022 2022-01-04 20:17:33 +01:00
Robert Adam
d816fb5688 BUILD(windows): Fix debug build
When performing a debug build, the "deadlock plugin" will be included
in the build, which uses the thread functionality of the std. However,
during compiling there would be an error about a symbol in thread.hpp
not being found (_beginthreadex). As it turns out, this was due to us
having a header file called Process.h, which would shadow the windows-
specific header file defining the mentioned symbol.

Therefore, in this commit we rename the Process base class to
AbstractProcess and rename the files accordingly, fixing that error.

See also: https://stackoverflow.com/q/27230258
2021-12-23 21:47:54 +01:00
Davide Beatrici
9c4ff543be FIX(positional-audio): Update Among Us plugin to work with v2021.12.15s (1421)
https://store.steampowered.com/news/app/945360/view/5918290951261475310
2021-12-19 21:59:47 +01:00
Davide Beatrici
cf8c941b2a FIX(positional-audio): Update Among Us plugin to work with v2021.11.9.5s
https://store.steampowered.com/news/app/945360/view/3097907147121066176
https://store.steampowered.com/news/app/945360/view/3097908416252836584
2021-12-11 23:33:16 +01:00
Robert Adam
a4b6b8e84d
Merge PR #5316: FIX(client): Link plugin incompatibility
This PR performs multiple things, all related to the Link plugin. For details, see the
individual commit messages.

Among other things, the Link plugin was ported to the new plugin API and the
different implementations for Windows as Posix where unified into a single implementation.

Fixes #5217
2021-11-28 18:35:31 +01:00
Robert Adam
16956afa22 FIX(client): Error if API call can't work due to server
The sendData API call requires the server to be of version 1.4.0 or
newer to work. Thus, when calling this API function while connected to
an older server, we can already tell that this won't work. Previously
this was silently ignored.

This commit introduces a new API error that will inform the user about
this problem. This should clear up the confusion as to why the sendData
call is apparently not doing anything.

Fixes #5331

Co-authored-by: Davide Beatrici <github@davidebeatrici.dev>
2021-11-26 12:41:49 +01:00
Robert Adam
e981827de5 MAINT: Add Link plugin tester
This commit adds a small CLI program that just connects to the Link
plugin and sends random positions to it. It is meant to be used as a
test-case for the Link plugin.
2021-11-18 19:25:28 +01:00
Robert Adam
658b33e4c8 REFAC(plugins): Unify Link plugin implementations
This commit merges the two separate Link plugin implementations that
were previously used (one for Posix and one for Windows systems) and
merges them into a single one (abstracting away the platform differences
at most places).

While doing so, this commit ports the "Link" plugin to the new plugin
API (introduced with Mumble 1.4.0), such that it can make use of the
possibility to set a custom context prefix. Thus, this prefix is no
longer dependent on the plugin name (in Link's case it is set to
whatever the linked application declares as its name).

Fixes #5217
2021-11-18 19:25:28 +01:00
Robert Adam
bed0fa57fa REFAC(plugins): Add SharedMemory class
This abstracts away the platform differences between Posix and Windows
systems when it comes to managing shared memory.
2021-11-18 19:25:28 +01:00
Robert Adam
86375de2a6 FEAT(plugins): Add option to use context prefix
With the new plugin function, plugins can choose a custom prefix for use
in the positional audio context.
2021-11-18 19:25:28 +01:00
Robert Adam
3d142ac238 REFAC(plugins): Add plugin function version specifier 2021-11-18 19:25:28 +01:00
Robert Adam
60888caadc FEAT(plugins): Add typedef for API type
This typedef can be used by plugins that don't want to hard-code the
type of the Mumble API type (which contains the API's version) into
their source code.

If this typedef is used, a newer API can be used simply by including a
different API header.
2021-11-18 19:25:28 +01:00
Robert Adam
fea949767a TEST(client): Add plugin to test deadlock prevention
This plugin tests the built-in deadlock prevention of the Mumble plugin
API.
2021-11-09 08:51:18 +01:00
Davide Beatrici
4c24e862b0 FIX(positional-audio): Update Source Engine plugin to work with L4D2 2.2.2.0
https://store.steampowered.com/news/app/550/view/2990935241286354880
https://store.steampowered.com/news/app/550/view/2990936690600094237
2021-07-14 09:56:03 +02:00
Davide Beatrici
7aabb14836 FIX(positional-audio): Update Among Us plugin to work with v2021.6.30s
https://steamcommunity.com/games/945360/announcements/detail/2994312940971770701

This commit also updates the name of a few variables.
2021-07-14 06:35:42 +02:00
Robert Adam
524e43b6aa
Merge PR #5161: FIX(client): Potential deadlocks in plugins
Using the API functions from outside the "main thread" would cause them
to block until the request can be processed on the main thread. This
could easily produce a deadlock if used without caution.

These changes add a timeout for this waiting turning preventing
deadlocks because the calling thread won't be blocked indefinitely. In
case of a timeout, a special error code is returned.
2021-07-04 16:25:51 +02:00
Robert Adam
fc5c31341d FIX(client): Potential deadlocks in plugins
Using the API functions from outside the "main thread" would cause them
to block until the request can be processed on the main thread. This
could easily produce a deadlock if used without caution.

These changes add a timeout for this waiting turning preventing
deadlocks because the calling thread won't be blocked indefinitely. In
case of a timeout, a special error code is returned.
2021-07-04 15:37:30 +02:00
Magnus Groß
696c47b50c
REFAC(positional-audio): Port GTA5 to new Plugin API 2021-07-01 12:58:41 +02:00
Magnus Groß
cf998316a1
REFAC(positional-audio): Remove unused context code 2021-06-30 10:32:30 +02:00
Magnus Groß
732d9b3831
FIX(positional-audio): Update GTA5 plugin
This works with the latest Steam version 1.54 Build 2245.
2021-06-30 10:32:26 +02:00
Davide Beatrici
2e93212d74 FIX(positional-audio): Update Source Engine plugin to work with L4D2 2.2.1.3
This commit makes the plugin work again with the Linux version of the game.

The game update didn't break support for the Windows version.

https://steamcommunity.com/games/L4D2/announcements/detail/4625740823862061052
2021-06-17 01:38:29 +02:00
Robert Adam
9b50fd7a12 BUILD(cmake): Reorganize how plugins are handled
Instead of excluding all plugins but the link one on OSes other than
Windows and Linux, the new approach allows for a more granular control
by introducing a list of plugins that is supported on the different
platforms.

This replaces the globbing approach which means that new plugins have
now to be included in this list explicitly.

The advantage of this is that this allows for a much greater flexibility
for handling plugins on different OS.

Furthermore the plugin's own directory is no longer added to the
include-path by default. If a plugin wishes to do this, it should do so
explicitly. This should help make the plugins easier to move around in
the future.
2021-06-16 19:24:25 +02:00
Davide Beatrici
40f03e5a3a
Merge PR #5126: FIX(positional-audio): Update Among Us plugin to work with v2021.6.15s 2021-06-16 08:47:47 +02:00
Davide Beatrici
1f609561a6 FIX(positional-audio): Update Among Us plugin to work with v2021.6.15s
https://steamcommunity.com/games/945360/announcements/detail/3055110270127094252
2021-06-16 06:00:49 +02:00