Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions - Add Linux support for the Mumble plugin #1218

Open
wants to merge 21 commits into
base: mumble-plugin
Choose a base branch
from

Commits on Aug 28, 2022

  1. Cleanup some whitespace

    Mostly trailing whitespace at the end of lines
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    dba936c View commit details
    Browse the repository at this point in the history
  2. Make some syntactic changes for other compilers

    Make some of the first steps to be able to build parts of ACRE on other
    platforms (such as GCC).
    
    Mostly, this amounts to differences in preprocessors, and some builtins.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    f791e31 View commit details
    Browse the repository at this point in the history
  3. Update CMakelists for Linux compatibility

    This allows ACRE2Core, ACRE2Shared, and ACRE2Wine to be built under
    Linux toolchains.
    
    We gate DirectX inclusion to Windows only; on Linux, we include FAudio
    as a drop in replacement for x3daudio. .pdb debugging symbols generated
    on the Windows build are not copied on Linux. PIC has been flipped on
    for Shared and Core on Linux.
    
    ACRE2Arma, ACRE2TS, ACRE2Steam, and the utility modules are not built on
    Linux, and it doesn't really make sense for them to be.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    9bb6948 View commit details
    Browse the repository at this point in the history
  4. Extend compat.h to provide Linux compat types

    Some Windows types and functions have been aliased for compilation on
    Linux.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    8a2833f View commit details
    Browse the repository at this point in the history
  5. Provide FAudio/x3daudio compatibility on Linux

    FilterPosition relies on x3daudio to do positional transformations. On
    Linux, we can use FAudio as an (almost) drop-in replacement.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    51c0737 View commit details
    Browse the repository at this point in the history
  6. Alias tbb concurrency modules on Linux

    Intel TBB is available as a library on Linux, under the `tbb` namespace,
    rather than the `concurrency` namespace as on Windows.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    a986200 View commit details
    Browse the repository at this point in the history
  7. Update paths when building on Linux

    ACRE's config file will be stored in $XDG_CONFIG_HOME (~/.config), as
    per the XDG standard. Temporary files are stored in /tmp/acre-${USER},
    and logs in $XDG_DATA_HOME (~/.local/share).
    
    This tends to be Linux desktop users expect.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    34ab3c6 View commit details
    Browse the repository at this point in the history
  8. Make Wave build on Linux

    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    af178c9 View commit details
    Browse the repository at this point in the history
  9. Build Log, TextMessage, ini on Linux

    Replace some Windows specific string functions with cross-compatible
    ones, and don't try to pop up message boxes on Linux.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    bec0e99 View commit details
    Browse the repository at this point in the history
  10. Wrap Windows includes in platform checks

    An unused sddl.h include has also been removed
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    891ef08 View commit details
    Browse the repository at this point in the history
  11. Use clock_gettime on Linux

    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    c984069 View commit details
    Browse the repository at this point in the history
  12. Do not load AcreSettings in constructor

    If the default path baked into the constructor is not the same as one
    that is later loaded, the user will end up with two config files! Only
    one will be used.
    
    There is no need to load the config file in the constructor, however.
    Hardcoded defaults are already set, and users of the class all load
    config files explicitly.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    8def745 View commit details
    Browse the repository at this point in the history
  13. Reimplement NamedPipeServer on Linux

    This is the most involved change in this changeset.
    
    On Linux, Arma runs under WINE, but Mumble is native. There's no (known
    to me) way to do IPC between WINE processes and native processes; WINE
    makes it (purposefully?) difficult.
    
    It may be possible to use Windows 10+ Unix socket compatibility (if WINE
    supports it), or some other mechanism. But this solution uses a simple
    duplex network socket listening on localhost, with a default port of
    19141. The Mumble side is responsible for setting up the server, and the
    Arma side connects.
    
    ACRE uses Windows named pipes in "message" mode, which means rather than
    a stream of bytes, senders send a stream of messages and receivers
    receive whole messages, not partial messages.
    
    This is not the case with a TCP socket, and so a simple length encoding
    is used. Whenever a sender has a message to send, they first send a four
    byte unsigned integer that is the length of the message to come, and the
    receiver first reads exactly four bytes, decodes the length of the
    message, then reads exactly that many bytes.
    
    The code is written to be tolerant (as in: will not crash, and will
    simply drop the connection and wait for the otherside to reconnect) to
    network faults and partial sends/receives. However, given that the
    client and server are on the same networking stack, conditions are
    ideal: sends and receives should match up exactly, and faults should be
    impossible.
    
    Since the port chosen could conflict with another server, possibly
    another instance of Mumble/Acre/Arma, it is configurable. On the Mumble
    side, it can be configured in the ACRE config file. On the Arma side, it
    will be specified as a CBA setting and passed in to the extension via
    a parameter to callExtension.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    a8957d9 View commit details
    Browse the repository at this point in the history
  14. Modify arma2ts to use sockets if running in Wine

    When running in Wine, ACRE2Arma.dll will mirror the changes to
    NamedPipeServer.cpp for Linux; instead of using named pipes, it will
    connect to the socket opened on the other side.
    
    A helper function has been added to detect if running under Wine, by
    checking for a function Wine defines in ntdll.
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    b2b9b17 View commit details
    Browse the repository at this point in the history
  15. Add a Linux build job to CI

    Also, publish the resulting Linux/Mumble plugin
    DylanFrese committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    4ff349d View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2022

  1. Fix arma2ts to detect Wine once on start

    This is how I intended it, but during a rewrite/rebase it got screwed
    up.
    DylanFrese committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    61ea041 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2022

  1. Set LC_NUMERIC=C on Linux

    The atof function is locale dependent. Specifically, it uses the
    locale-specific decimal separator to convert floating-point strings;
    that is, in a locale that uses commas as decimal separators, "0,5" will
    convert to 0.5, whereas "0.5" will fail, and convert as 0.0. Strings
    coming from Arma will always use a period as a decimal separator, this
    causes myriad failures.
    
    On Linux, on startup, we now set LC_NUMERIC to C, which has the behavior
    we want.
    
    I'm not certain why this isn't a problem on Win32. There may be a path
    in Qt/Mumble that sets locale one way on Linux and another on Windows.
    DylanFrese committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    da36155 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2022

  1. Configuration menu
    Copy the full SHA
    87d15c1 View commit details
    Browse the repository at this point in the history
  2. Remove hardcoded filenames from voip_plugin

    Instead of hardcoding the filenames of the destination files for
    plugins, VOIPPlugin::handle_update_plugin will now use the basenames of
    the x32 and x64 plugins paths passed into it.
    DylanFrese committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    a8def6d View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Auto-install plugin to Mumble on Linux

    If running under Wine, ACRE2Steam will now detect that and automatically
    install the Linux Mumble plugin to the Linux version of Mumble, if it is
    present.
    DylanFrese committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    659bffb View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2022

  1. Configuration menu
    Copy the full SHA
    5d9af92 View commit details
    Browse the repository at this point in the history