Skip to content

Add ability to disable preview #51

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

Merged
merged 3 commits into from
Apr 18, 2025
Merged

Conversation

WilliamQiufeng
Copy link
Member

@WilliamQiufeng WilliamQiufeng commented Apr 3, 2025

Requires https://github.com/Quaver/Quaver.Server.Client/pull/33

Adds EnablePreview toggle and relevant packet for multiplayer games. This does not have any effect on server side, but there is client code to prevent preview being enabled by the player if EnablePreview == false.

Adds a !mp preview command for toggling EnablePreview.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new toggle to enable or disable preview functionality in multiplayer games, as well as the corresponding network packets and command handlers.

  • Added new packet IDs and packet types for client and server preview changes
  • Updated the MultiplayerGame structure and defaults to include the preview toggle
  • Introduced command handling (both in chat bot and packet handlers) for toggling preview

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packets/packet_id.go Added new packet ID constants for preview enable/disable
packets/ServerGameEnablePreview.go Created a new server packet struct and constructor for preview
packets/ClientGameEnablePreview.go Added new client packet struct for preview changes
objects/multiplayer_game.go Added a new EnablePreview field and default setting
multiplayer/redis.go Updated settings caching to include the preview flag
multiplayer/game.go Added a new SetEnablePreview method to update preview state
multiplayer/chat_bot.go Added a new case to handle the preview command
handlers/packets.go Registered the new packet type for preview toggling
handlers/ClientGameEnablePreview.go Implemented the packet handler to update the preview setting
Comments suppressed due to low confidence (1)

packets/packet_id.go:142

  • [nitpick] The constant name 'PacketIdClientGameChangeEnablePreview' is inconsistent with the corresponding file name 'ClientGameEnablePreview.go'. Consider renaming it to 'PacketIdClientGameEnablePreview' for consistency.
PacketIdClientGameChangeEnablePreview

@AiAe AiAe merged commit 5b241a1 into Quaver:main Apr 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants