Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterc
Commits
e9ca7272
Commit
e9ca7272
authored
Sep 26, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update latest changes
parent
2d7b817a
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
68 deletions
+123
-68
build.sh
build.sh
+14
-0
main.py
main.py
+16
-2
client.py
mbetterclient/api_client/client.py
+68
-61
application.py
mbetterclient/core/application.py
+10
-2
player.py
mbetterclient/qt_player/player.py
+15
-3
No files found.
build.sh
View file @
e9ca7272
...
@@ -49,10 +49,24 @@ else
...
@@ -49,10 +49,24 @@ else
pip
install
-r
requirements.txt
--break-system-packages
pip
install
-r
requirements.txt
--break-system-packages
fi
fi
# Backup MBetterDiscovery.exe if it exists
if
[
-f
"dist/MBetterDiscovery.exe"
]
;
then
echo
"📦 Backing up MBetterDiscovery.exe..."
cp
dist/MBetterDiscovery.exe /tmp/MBetterDiscovery.exe.backup
fi
# Run the build script
# Run the build script
echo
"🔨 Starting build process..."
echo
"🔨 Starting build process..."
python3 build.py
python3 build.py
# Restore MBetterDiscovery.exe if backup exists
if
[
-f
"/tmp/MBetterDiscovery.exe.backup"
]
;
then
echo
"📦 Restoring MBetterDiscovery.exe..."
mkdir
-p
dist
cp
/tmp/MBetterDiscovery.exe.backup dist/MBetterDiscovery.exe
rm
/tmp/MBetterDiscovery.exe.backup
fi
# Removed Qt platform plugins and qt.conf copying for self-contained binary
# Removed Qt platform plugins and qt.conf copying for self-contained binary
echo
"📦 Building self-contained binary - no external Qt files needed"
echo
"📦 Building self-contained binary - no external Qt files needed"
...
...
main.py
View file @
e9ca7272
...
@@ -21,7 +21,7 @@ if hasattr(sys, '_MEIPASS'):
...
@@ -21,7 +21,7 @@ if hasattr(sys, '_MEIPASS'):
# Running in PyInstaller bundle
# Running in PyInstaller bundle
qt_plugins_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'platforms'
)
qt_plugins_path
=
os
.
path
.
join
(
sys
.
_MEIPASS
,
'platforms'
)
os
.
environ
[
'QT_QPA_PLATFORM_PLUGIN_PATH'
]
=
qt_plugins_path
os
.
environ
[
'QT_QPA_PLATFORM_PLUGIN_PATH'
]
=
qt_plugins_path
print
(
f
"Set QT_QPA_PLATFORM_PLUGIN_PATH to: {qt_plugins_path}"
)
print
(
"Set QT_QPA_PLATFORM_PLUGIN_PATH to: {}"
.
format
(
qt_plugins_path
)
)
from
mbetterclient.core.application
import
MbetterClientApplication
from
mbetterclient.core.application
import
MbetterClientApplication
from
mbetterclient.utils.logger
import
setup_logging
from
mbetterclient.utils.logger
import
setup_logging
...
@@ -203,6 +203,13 @@ Examples:
...
@@ -203,6 +203,13 @@ Examples:
help
=
'Configure timer delay in minutes for START_GAME_DELAYED message when START_GAME is received (default: 4 minutes)'
help
=
'Configure timer delay in minutes for START_GAME_DELAYED message when START_GAME is received (default: 4 minutes)'
)
)
parser
.
add_argument
(
'--rustdesk_id'
,
type
=
str
,
default
=
None
,
help
=
'RustDesk ID for periodic whoami API calls (enables /api/whoami endpoint)'
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
def
validate_arguments
(
args
):
def
validate_arguments
(
args
):
...
@@ -273,6 +280,13 @@ def main():
...
@@ -273,6 +280,13 @@ def main():
if
args
.
db_path
:
if
args
.
db_path
:
settings
.
database_path
=
args
.
db_path
settings
.
database_path
=
args
.
db_path
# Set RustDesk ID if provided
if
args
.
rustdesk_id
:
settings
.
api
.
rustdesk_id
=
args
.
rustdesk_id
logger
.
info
(
"COMMAND LINE: Set rustdesk_id to: {}"
.
format
(
args
.
rustdesk_id
))
else
:
logger
.
info
(
"COMMAND LINE: No rustdesk_id provided"
)
# Create and initialize application
# Create and initialize application
app
=
MbetterClientApplication
(
settings
,
start_timer
=
args
.
start_timer
)
app
=
MbetterClientApplication
(
settings
,
start_timer
=
args
.
start_timer
)
...
...
mbetterclient/api_client/client.py
View file @
e9ca7272
This diff is collapsed.
Click to expand it.
mbetterclient/core/application.py
View file @
e9ca7272
...
@@ -120,6 +120,9 @@ class MbetterClientApplication:
...
@@ -120,6 +120,9 @@ class MbetterClientApplication:
# Update settings from database
# Update settings from database
stored_settings
=
self
.
config_manager
.
get_settings
()
stored_settings
=
self
.
config_manager
.
get_settings
()
if
stored_settings
:
if
stored_settings
:
# Preserve command-line rustdesk_id before merging
command_line_rustdesk_id
=
getattr
(
self
.
settings
.
api
,
'rustdesk_id'
,
None
)
# Merge runtime settings with stored settings (command line overrides database)
# Merge runtime settings with stored settings (command line overrides database)
stored_settings
.
fullscreen
=
self
.
settings
.
fullscreen
stored_settings
.
fullscreen
=
self
.
settings
.
fullscreen
stored_settings
.
web_host
=
self
.
settings
.
web_host
stored_settings
.
web_host
=
self
.
settings
.
web_host
...
@@ -140,6 +143,11 @@ class MbetterClientApplication:
...
@@ -140,6 +143,11 @@ class MbetterClientApplication:
self
.
settings
=
stored_settings
self
.
settings
=
stored_settings
# Restore command-line rustdesk_id after settings merge
if
command_line_rustdesk_id
is
not
None
:
self
.
settings
.
api
.
rustdesk_id
=
command_line_rustdesk_id
logger
.
debug
(
"APPLICATION: Restored command-line rustdesk_id: {}"
.
format
(
command_line_rustdesk_id
))
# Re-sync runtime settings to component configs
# Re-sync runtime settings to component configs
self
.
settings
.
qt
.
fullscreen
=
self
.
settings
.
fullscreen
self
.
settings
.
qt
.
fullscreen
=
self
.
settings
.
fullscreen
self
.
settings
.
web
.
host
=
self
.
settings
.
web_host
self
.
settings
.
web
.
host
=
self
.
settings
.
web_host
...
...
mbetterclient/qt_player/player.py
View file @
e9ca7272
...
@@ -310,6 +310,18 @@ class OverlayWebView(QWebEngineView):
...
@@ -310,6 +310,18 @@ class OverlayWebView(QWebEngineView):
def
_setup_custom_scheme
(
self
):
def
_setup_custom_scheme
(
self
):
"""Setup custom URL scheme handler for overlay resources"""
"""Setup custom URL scheme handler for overlay resources"""
try
:
try
:
# Register the custom scheme before installing the handler
from
PyQt6.QtWebEngineCore
import
QWebEngineUrlScheme
overlay_scheme
=
QWebEngineUrlScheme
(
b
"overlay"
)
overlay_scheme
.
setSyntax
(
QWebEngineUrlScheme
.
Syntax
.
HostAndPort
)
overlay_scheme
.
setDefaultPort
(
0
)
overlay_scheme
.
setFlags
(
QWebEngineUrlScheme
.
Flag
.
SecureScheme
|
QWebEngineUrlScheme
.
Flag
.
LocalScheme
|
QWebEngineUrlScheme
.
Flag
.
LocalAccessAllowed
)
QWebEngineUrlScheme
.
registerScheme
(
overlay_scheme
)
logger
.
info
(
"Custom overlay:// URL scheme registered successfully"
)
# Get the page's profile
# Get the page's profile
profile
=
self
.
page
()
.
profile
()
profile
=
self
.
page
()
.
profile
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment