Compare commits

...

6 commits

Author SHA1 Message Date
GhostlyDark
9ce1e45d64
README: Add missing libusb dependency (#379)
The mupen64plus-input-gca plugin can't run without libusb-1.0.dll being present, but is able to build fine without libusb being installed. If not installed, the dependency script silently fails to find/copy the DLL.
2025-06-23 17:58:21 +02:00
Rosalie Wanders
be738f0cb7 ci: use windows-2022 2025-06-09 16:01:11 +02:00
Rosalie Wanders
e882e0f22c RMG: add NETPLAY guard to QWebSocket in NetplayCommon.hpp 2025-06-09 15:59:54 +02:00
Rosalie Wanders
f7a1d0f952 RMG: add IPv4 resolver to NetplayCommon and use it 2025-06-09 15:35:46 +02:00
Logan McNaughton
6b8990fa1a
RMG: ensure that netplay only connects using IPv4 (#374) 2025-06-09 15:18:35 +02:00
Rosalie Wanders
a74cff50f8 Package: add vulkan-headers to makedepends of PKGBUILD 2025-05-20 09:35:34 +02:00
7 changed files with 44 additions and 8 deletions

View file

@ -61,7 +61,7 @@ jobs:
path: Bin/*.AppImage
build-windows:
runs-on: windows-2019
runs-on: windows-2022
strategy:
matrix:
features: [ ON, OFF ]

View file

@ -1,14 +1,14 @@
# Maintainer: Rosalie Wanders <rosalie@mailbox.org>
pkgname=rmg
pkgver=0.7.9
pkgrel=1
pkgrel=2
pkgdesc="Rosalie's Mupen GUI"
arch=('x86_64' 'aarch64')
url="https://github.com/Rosalie241/$pkgname"
license=('GPL3')
depends=("hidapi" "libsamplerate" "speexdsp" "minizip" "sdl2" "sdl2_net" "zlib" "freetype2" "qt6-base" "qt6-svg" "qt6-websockets")
makedepends=("git" "nasm" "cmake")
makedepends=("git" "nasm" "cmake" "vulkan-headers")
source=("git+https://github.com/Rosalie241/$pkgname.git#tag=v$pkgver")
sha256sums=('SKIP')

View file

@ -73,9 +73,9 @@ cmake --install "$build_dir" --prefix="/usr"
```
#### Windows
* Download & Install [MSYS2](https://www.msys2.org/)
* Download & Install [MSYS2](https://www.msys2.org/) (UCRT64)
```bash
pacman -S --needed make mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-hidapi mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-libpng mingw-w64-ucrt-x86_64-qt6 mingw-w64-ucrt-x86_64-SDL2 mingw-w64-ucrt-x86_64-SDL2_net mingw-w64-ucrt-x86_64-speexdsp mingw-w64-ucrt-x86_64-libsamplerate mingw-w64-ucrt-x86_64-nasm mingw-w64-ucrt-x86_64-minizip mingw-w64-ucrt-x86_64-vulkan-headers git
pacman -S --needed make mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-hidapi mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-libpng mingw-w64-ucrt-x86_64-qt6 mingw-w64-ucrt-x86_64-SDL2 mingw-w64-ucrt-x86_64-SDL2_net mingw-w64-ucrt-x86_64-speexdsp mingw-w64-ucrt-x86_64-libsamplerate mingw-w64-ucrt-x86_64-libusb mingw-w64-ucrt-x86_64-nasm mingw-w64-ucrt-x86_64-minizip mingw-w64-ucrt-x86_64-vulkan-headers git
./Source/Script/Build.sh Release
```

View file

@ -253,7 +253,10 @@ void CreateNetplaySessionDialog::on_serverComboBox_currentIndexChanged(int index
this->pingLineEdit->setText("Calculating...");
QString address = this->serverComboBox->itemData(index).toString();
this->webSocket->open(QUrl(address));
if (!NetplayCommon::ConnectToIPv4Server(address, this->webSocket))
{
QtMessageBox::Error(this, "Failed to find IPv4 address of server");
}
}
void CreateNetplaySessionDialog::on_nickNameLineEdit_textChanged(void)

View file

@ -13,6 +13,8 @@
#include <QByteArray>
#include <QFileInfo>
#include <QDateTime>
#include <QHostInfo>
#include <QUrl>
#include <RMG-Core/Settings.hpp>
#include <RMG-Core/Plugins.hpp>
@ -108,3 +110,23 @@ void NetplayCommon::RestoreSelectedServer(QComboBox* comboBox)
comboBox->setCurrentIndex(index);
}
}
bool NetplayCommon::ConnectToIPv4Server(QString address, QWebSocket* webSocket)
{
QUrl addressUrl(address);
QHostInfo hostInfo = QHostInfo::fromName(addressUrl.host());
for (const QHostAddress &resolvedAddr : hostInfo.addresses())
{
// mupen64plus-core only supports IPv4 (due to SDL2_net)
if (resolvedAddr.protocol() == QAbstractSocket::IPv4Protocol)
{
addressUrl.setHost(resolvedAddr.toString());
webSocket->open(addressUrl);
return true;
}
}
webSocket->close();
return false;
}

View file

@ -12,6 +12,9 @@
#include <QJsonDocument>
#include <QJsonObject>
#ifdef NETPLAY
#include <QWebSocket>
#endif // NETPLAY
#include <QComboBox>
#include <QString>
@ -32,6 +35,11 @@ namespace NetplayCommon
// Restores previously selected server
void RestoreSelectedServer(QComboBox* comboBox);
#ifdef NETPLAY
// Attempts to connect the web socket to the given address using IPv4
bool ConnectToIPv4Server(QString address, QWebSocket* webSocket);
#endif // #ifdef NETPLAY
}
#endif // NETPLAYCOMMON_HPP

View file

@ -324,11 +324,14 @@ void NetplaySessionBrowserDialog::on_serverComboBox_currentIndexChanged(int inde
}
this->pingLineEdit->setText("Calculating...");
this->sessionBrowserWidget->StartRefresh();
QString address = this->serverComboBox->itemData(index).toString();
this->webSocket->open(QUrl(address));
if (!NetplayCommon::ConnectToIPv4Server(address, this->webSocket))
{
this->sessionBrowserWidget->Reset();
QtMessageBox::Error(this, "Failed to find IPv4 address of server");
}
}
void NetplaySessionBrowserDialog::on_sessionBrowserWidget_OnSessionChanged(bool valid)