mirror of
https://github.com/Rosalie241/RMG.git
synced 2025-06-25 14:07:02 -04:00
Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
|
9ce1e45d64 | ||
|
be738f0cb7 | ||
|
e882e0f22c | ||
|
f7a1d0f952 | ||
|
6b8990fa1a | ||
|
a74cff50f8 |
7 changed files with 44 additions and 8 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -61,7 +61,7 @@ jobs:
|
|||
path: Bin/*.AppImage
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
matrix:
|
||||
features: [ ON, OFF ]
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue