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
3930037f
Commit
3930037f
authored
Nov 13, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update game logic out of game
parent
7afccaf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
44 deletions
+104
-44
player.py
mbetterclient/qt_player/player.py
+104
-1
MbetterClient-1.2.11-linux-x86_64-README.txt
packages/MbetterClient-1.2.11-linux-x86_64-README.txt
+0
-43
MbetterClient-1.2.11-linux-x86_64.tar.gz
packages/MbetterClient-1.2.11-linux-x86_64.tar.gz
+0
-0
No files found.
mbetterclient/qt_player/player.py
View file @
3930037f
...
@@ -2079,10 +2079,14 @@ class QtVideoPlayer(QObject):
...
@@ -2079,10 +2079,14 @@ class QtVideoPlayer(QObject):
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
START_INTRO
,
self
.
_handle_start_intro
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
START_INTRO
,
self
.
_handle_start_intro
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
PLAY_VIDEO_MATCH
,
self
.
_handle_play_video_match
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
PLAY_VIDEO_MATCH
,
self
.
_handle_play_video_match
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
PLAY_VIDEO_RESULT
,
self
.
_handle_play_video_result
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
PLAY_VIDEO_RESULT
,
self
.
_handle_play_video_result
)
self
.
message_bus
.
subscribe
(
self
.
name
,
MessageType
.
GAME_STATUS
,
self
.
_handle_game_status
)
logger
.
info
(
"QtPlayer subscriptions completed successfully"
)
logger
.
info
(
"QtPlayer subscriptions completed successfully"
)
# Delay loading default overlay to allow JavaScript initialization
# Delay loading default overlay to allow JavaScript initialization
QTimer
.
singleShot
(
2000
,
self
.
_load_default_overlay
)
# Wait 2 seconds
QTimer
.
singleShot
(
2000
,
self
.
_load_default_overlay
)
# Wait 2 seconds
# Request initial game status to check if we should play intro
QTimer
.
singleShot
(
3000
,
self
.
_request_initial_game_status
)
# Wait 3 seconds for everything to be ready
logger
.
info
(
"QtVideoPlayer (PyQt6) initialized successfully"
)
logger
.
info
(
"QtVideoPlayer (PyQt6) initialized successfully"
)
return
True
return
True
...
@@ -3422,7 +3426,7 @@ class QtVideoPlayer(QObject):
...
@@ -3422,7 +3426,7 @@ class QtVideoPlayer(QObject):
volume
=
self
.
window
.
audio_output
.
volume
()
*
100
volume
=
self
.
window
.
audio_output
.
volume
()
*
100
muted
=
self
.
window
.
audio_output
.
isMuted
()
muted
=
self
.
window
.
audio_output
.
isMuted
()
fullscreen
=
self
.
window
.
isFullScreen
()
fullscreen
=
self
.
window
.
isFullScreen
()
status_response
=
MessageBuilder
.
system_status
(
status_response
=
MessageBuilder
.
system_status
(
sender
=
self
.
name
,
sender
=
self
.
name
,
status
=
"status_response"
,
status
=
"status_response"
,
...
@@ -3440,3 +3444,102 @@ class QtVideoPlayer(QObject):
...
@@ -3440,3 +3444,102 @@ class QtVideoPlayer(QObject):
self
.
message_bus
.
publish
(
status_response
)
self
.
message_bus
.
publish
(
status_response
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
f
"Failed to execute status request: {e}"
)
logger
.
error
(
f
"Failed to execute status request: {e}"
)
def
_request_initial_game_status
(
self
):
"""Request initial game status to determine if we should play intro"""
try
:
logger
.
info
(
"Requesting initial game status to check if intro should be played"
)
status_request
=
MessageBuilder
.
system_status
(
sender
=
self
.
name
,
status
=
"status_request"
,
details
=
{
"request_type"
:
"game_status"
}
)
self
.
message_bus
.
publish
(
status_request
,
broadcast
=
True
)
except
Exception
as
e
:
logger
.
error
(
f
"Failed to request initial game status: {e}"
)
def
_handle_game_status
(
self
,
message
:
Message
):
"""Handle GAME_STATUS messages to determine when to play intro"""
try
:
status
=
message
.
data
.
get
(
"status"
)
logger
.
info
(
f
"Received GAME_STATUS: {status}"
)
# Check if this indicates no active game
if
status
in
[
"ready"
,
"shutdown"
,
"completed_no_old_matches"
]:
logger
.
info
(
"No active game detected, checking if we should play intro"
)
self
.
_check_and_play_intro
()
elif
status
==
"started"
:
logger
.
info
(
"Game is active, intro will be handled by START_INTRO message"
)
elif
status
==
"already_active"
:
logger
.
info
(
"Game already active, no intro needed"
)
except
Exception
as
e
:
logger
.
error
(
f
"Failed to handle game status: {e}"
)
def
_check_and_play_intro
(
self
):
"""Check if we should play the intro video when no game is active"""
try
:
# Only play intro if we're not already playing something
if
self
.
window
and
self
.
window
.
media_player
.
playbackState
()
==
QMediaPlayer
.
PlaybackState
.
StoppedState
:
logger
.
info
(
"Player is stopped, playing waiting intro"
)
self
.
_play_waiting_intro
()
else
:
logger
.
info
(
"Player is already playing, skipping intro"
)
except
Exception
as
e
:
logger
.
error
(
f
"Failed to check and play intro: {e}"
)
def
_play_waiting_intro
(
self
):
"""Play the INTRO video on repeat with waiting overlay when no game is active"""
try
:
logger
.
info
(
"Playing waiting intro video"
)
# Find the INTRO video file
intro_path
=
self
.
_find_intro_video_file_for_waiting
()
if
intro_path
:
# Set up loop control for infinite repeat
loop_data
=
{
'infinite_loop'
:
True
,
'continuous_playback'
:
True
}
# Create overlay data for waiting state
overlay_data
=
{
"title"
:
"Waiting for game to start..."
,
"message"
:
"Waiting for game to start..."
,
"icon"
:
"⏳"
}
# Play the intro video with loop and overlay
if
self
.
window
:
self
.
window
.
play_video
(
str
(
intro_path
),
template_data
=
overlay_data
,
template_name
=
"default.html"
,
# Use default template
loop_data
=
loop_data
)
logger
.
info
(
"Waiting intro video started with overlay"
)
else
:
logger
.
error
(
"No window available for waiting intro playback"
)
else
:
logger
.
warning
(
"No INTRO video found for waiting state"
)
except
Exception
as
e
:
logger
.
error
(
f
"Failed to play waiting intro: {e}"
)
def
_find_intro_video_file_for_waiting
(
self
)
->
Optional
[
Path
]:
"""Find the INTRO video file for waiting state"""
try
:
# Priority 1: Check for INTRO.mp4 in assets directory
assets_dir
=
Path
(
__file__
)
.
parent
.
parent
/
"assets"
assets_intro
=
assets_dir
/
"INTRO.mp4"
if
assets_intro
.
exists
():
logger
.
info
(
f
"Using INTRO.mp4 from assets for waiting: {assets_intro}"
)
return
assets_intro
logger
.
warning
(
"No INTRO video found for waiting state"
)
return
None
except
Exception
as
e
:
logger
.
error
(
f
"Failed to find intro video for waiting: {e}"
)
return
None
packages/MbetterClient-1.2.11-linux-x86_64-README.txt
deleted
100644 → 0
View file @
7afccaf1
# MbetterClient v1.2.11
Cross-platform multimedia client application
## Installation
1. Extract this package to your desired location
2. Run the executable file
3. The application will create necessary configuration files on first run
## System Requirements
- **Operating System**: Linux 6.16.3+deb14-amd64
- **Architecture**: x86_64
- **Memory**: 512 MB RAM minimum, 1 GB recommended
- **Disk Space**: 100 MB free space
## Configuration
The application stores its configuration and database in:
- **Windows**: `%APPDATA%\MbetterClient`
- **macOS**: `~/Library/Application Support/MbetterClient`
- **Linux**: `~/.config/MbetterClient`
## Web Interface
By default, the web interface is available at: http://localhost:5001
Default login credentials:
- Username: admin
- Password: admin
**Please change the default password after first login.**
## Support
For support and documentation, please visit: https://git.nexlab.net/mbetter/mbetterc
## Version Information
- Version: 1.2.11
- Build Date: zeiss
- Platform: Linux-6.16.3+deb14-amd64-x86_64-with-glibc2.41
packages/MbetterClient-1.2.11-linux-x86_64.tar.gz
deleted
100644 → 0
View file @
7afccaf1
File deleted
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