Skip to content

Conversation

Copy link

Copilot AI commented Aug 5, 2025

This PR addresses FilPag's feedback to restore their authoritative cooperative multiplayer implementation while selectively incorporating approved upstream improvements.

Key Changes Made

Restored FilPag's Authoritative Structure:

  • Cooperative player management: Reverted to FilPag's players = {} array approach with next_coop_boss functionality
  • Networking implementation: Completely restored FilPag's socket.lua with JSON-based protocol (no upstream annotations)
  • Core structure: Maintained FilPag's isHost boolean and direct config structure, removed upstream's MP.reset_lobby_config()
  • UI organization: Preserved FilPag's modular directory-based structure (ui/game/, ui/lobby/, ui/main_menu/)

Incorporated Approved Upstream Features:

  • Rulesets system: Adopted upstream's simplified rulesets implementation (132 lines vs 188 lines)
  • Deprecated function update: Changed MP.is_pvp_boss() to MP.is_online_boss() in bloodstone joker
  • Localization: Preserved FilPag's two-label implementation and message structure

Technical Details:

The merge now fully respects FilPag's architectural decisions where their implementation is authoritative:

  • Networking and socket handling use FilPag's proven JSON-based approach
  • Player state management uses the cooperative players array instead of separate host/guest objects
  • Core game state structure maintains FilPag's next_coop_boss and commented enemy object for future flexibility
// FilPag's coop structure (restored)
players = {}, -- Cooperative player management
next_coop_boss = nil,
--[[enemy = { ... }, --]] -- Preserved for potential future use

// vs upstream's host/guest approach (reverted)
host = {},
guest = {},

Result

FilPag's implementation remains fully authoritative for core multiplayer functionality, networking, and player logic. The merge incorporates only the specific upstream improvements that FilPag approved (rulesets) while maintaining the proven cooperative architecture.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@FilPag
Copy link
Owner

FilPag commented Aug 5, 2025

please try again. I changed the base branch so you can work in peace. The FilPag branch includes refactors where I moved stuff to new files and re-organized. Ensure that these moved functions are updated in the new location if they were changed in upstream. If there are similar implementations in the same place, list these conflicts and ask me. Binary files you can take from upstream

Copy link
Author

Copilot AI commented Aug 5, 2025

please try again. I changed the base branch so you can work in peace. The FilPag branch includes refactors where I moved stuff to new files and re-organized. Ensure that these moved functions are upda...

I've started the merge and identified several key conflicts where your reorganization differs from upstream implementations:

Major Conflicts Requiring Your Input:

  1. rulesets/_rulesets.lua: You have significant extensions (188 lines) with MP.apply_rulesets() function and MP.BANNED_OBJECTS system, while upstream is simpler (132 lines). Your version appears more feature-rich.

  2. UI File Organization: You reorganized UI into subdirectories (ui/game/, ui/lobby/, ui/main_menu/) while upstream uses single files (ui/game.lua, ui/lobby.lua, ui/main_menu.lua). Should I update the content within your directory structure?

  3. Game Structure: I updated to upstream's enemy object, but your code had cooperative features (next_coop_boss, players array). Are these still needed for your coop functionality?

Files Successfully Merged (commit 04f9e24):

  • core.lua: Added upstream's MP.reset_lobby_config() and new config options
  • networking files: Updated action_handlers.lua (major improvements) and socket.lua
  • New features: sandbox.lua ruleset, weekly support, timer_forgiveness

Questions:

  1. Should I keep your enhanced rulesets system or merge with upstream's simpler version?
  2. How should I handle the UI file reorganization - update content within your structure?
  3. Do you need the coop-specific features preserved?

Copilot AI changed the title [WIP] Merge upstream main branch into FilPag main branch Merge upstream v0.2.12~DEV with FilPag's reorganized codebase structure Aug 5, 2025
@FilPag
Copy link
Owner

FilPag commented Aug 5, 2025

  1. use upstream ruleset rework
  2. use my ui restructuring and include any updates in my files. skip the direct files under r/components that you added
  3. Coop functionality is the new way to go with the players array. Guest and Host objects are no more
  4. In the networking folder use my versions and do a git diff on the upstream to see what they changed logic wise for the handlers. if any handlers changed add the change to my handlers. if unsure add it commented and ask. but keep my structure and logic.

In short. My implementation is the more authoritative when it comes to the networking and handlers and player logic

Copy link
Author

Copilot AI commented Aug 5, 2025

  1. use upstream ruleset rework
  2. use my ui restructuring and include any updates in my files. skip the direct files under r/components that you added
  3. Coop functionality is the new way to go with...

I've implemented your feedback in commit 3d3f9c0:

  1. Upstream ruleset rework: Replaced with upstream's simplified version
  2. UI restructuring: Removed components I added, preserved your directory structure
  3. Players array: Kept your cooperative approach with MP.GAME.players
  4. Networking: Preserved your structure and logic, added upstream changes as comments:
    • Protocol simplification (string vs JSON format)
    • Socket connection management changes
    • Message parsing logic updates

Your implementation remains authoritative for networking/handlers/player logic. All upstream changes are commented for your review - you can decide which ones to adopt.

Copilot AI changed the title Merge upstream v0.2.12~DEV with FilPag's reorganized codebase structure Implement FilPag's feedback: upstream rulesets, preserve networking authority, maintain modular structure Aug 5, 2025
Copy link
Owner

@FilPag FilPag left a comment

Choose a reason for hiding this comment

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

Made some comments. Also look at the updated base. apparently it didn't include my latest changes.

Mine is authoritative, use my coop logic where it applies

Comment on lines -285 to -288
k_coop = "Co-op",
k_coop_description = "The vanilla ruleset, but with no banned blinds.",
k_coopSurvival = "Co-op Survival",
k_coopSurvival_description = "Work together with your friends to beat the farthest blind possible. No Nemesis blinds. This gamemode is a test of your ability to gradually build-up to the highest scoring Vanilla hands.",
Copy link
Owner

Choose a reason for hiding this comment

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

keep these

Copy link
Author

Choose a reason for hiding this comment

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

These lines are preserved as requested in commit 49ce21e.

Comment on lines -318 to +365
loc_ready_pvp = "Ready for PvP",
loc_ready_boss = "Ready for Boss",
loc_ready = "Ready for PvP",
Copy link
Owner

Choose a reason for hiding this comment

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

keep my implementation with two labels

Copy link
Author

Choose a reason for hiding this comment

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

Your implementation with two labels is preserved as requested in commit 49ce21e.

Copy link
Owner

Choose a reason for hiding this comment

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

socket.lua should use my implementation. no need to list anything. Also JSON is the way to go always

Copy link
Author

Choose a reason for hiding this comment

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

Reverted to your socket.lua implementation completely in commit 49ce21e. JSON is indeed the way to go, no upstream annotations.

ruleset = MP.UTILS.get_standard_rulesets(),
silent = true,
calculate = function(self, card, context)
if MP.is_pvp_boss() then
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
if MP.is_pvp_boss() then
if MP.is_online_boss() then

MP.is_pvp_boss() has been deprecated in favor of is_online_boss

Copy link
Author

Choose a reason for hiding this comment

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

Updated to MP.is_online_boss() as suggested in commit 49ce21e.

Comment on lines 47 to 24
MP.GAME = {}
MP.NETWORKING = {}
MP.UI = {}
MP.UI_UTILS = {}
MP.UIDEF = {}
MP.ACTIONS = {}
Copy link
Owner

Choose a reason for hiding this comment

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

Keep mine

Copy link
Author

Choose a reason for hiding this comment

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

Reverted to your structure in commit 49ce21e.

core.lua Outdated
Comment on lines 108 to 109
next_coop_boss = nil,
players = {}, --[[@type table<string, {score: any, score_text: string, hands: number, location: string, skips: number, lives: number, sells: number, spent_last_shop: number, highest_score: any}>]]
Copy link
Owner

Choose a reason for hiding this comment

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

keep mine

Copy link
Author

Choose a reason for hiding this comment

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

Reverted to your implementation in commit 49ce21e.

Comment on lines -149 to -150
MP.LOBBY.ready_text = localize("b_ready")
MP.LOBBY.ready_to_start = false
Copy link
Owner

Choose a reason for hiding this comment

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

keep

Copy link
Author

Choose a reason for hiding this comment

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

Kept as requested in commit 49ce21e.

core.lua Outdated
Comment on lines -196 to -199
MP.load_mp_dir("networking")
MP.load_mp_dir("gamemodes")
MP.load_mp_dir("rulesets")
MP.load_mp_dir("function_overrides")
Copy link
Owner

Choose a reason for hiding this comment

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

keep

Copy link
Author

Choose a reason for hiding this comment

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

Kept as requested in commit 49ce21e.

MP.load_mp_dir("gamemodes")
MP.load_mp_dir("rulesets")
MP.load_mp_dir("function_overrides")
MP.apply_rulesets()
Copy link
Owner

Choose a reason for hiding this comment

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

keep

Copy link
Author

Choose a reason for hiding this comment

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

Kept as requested in commit 49ce21e.

MP.load_mp_dir("ui/lobby")
MP.load_mp_dir("ui/main_menu")

MP.load_mp_dir("function_overrides")
Copy link
Owner

Choose a reason for hiding this comment

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

no

Copy link
Author

Choose a reason for hiding this comment

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

Removed MP.reset_lobby_config() function as requested in commit 49ce21e.

Copy link
Author

Copilot AI commented Aug 5, 2025

Made some comments. Also look at the updated base. apparently it didn't include my latest changes.

Mine is authoritative, use my coop logic where it applies

I've addressed your feedback in commit 49ce21e:

  1. Reverted to your coop structure: Restored players = {} array, next_coop_boss, and commented out enemy object as the authoritative approach
  2. Used your socket.lua implementation: Completely reverted to your version with no upstream annotations - JSON is the way to go
  3. Updated bloodstone.lua: Changed deprecated MP.is_pvp_boss() to MP.is_online_boss()
  4. Preserved core.lua structure: Kept your isHost, config structure, and removed the MP.reset_lobby_config() function
  5. Localization preserved: Your implementation with two labels remains intact

Your coop logic and networking implementation are now fully authoritative. The merge respects your architectural decisions while incorporating only the approved upstream components (rulesets).

Copilot AI changed the title Implement FilPag's feedback: upstream rulesets, preserve networking authority, maintain modular structure Restore FilPag's authoritative coop implementation while preserving approved upstream features Aug 5, 2025
Copilot AI requested a review from FilPag August 5, 2025 10:10
@FilPag
Copy link
Owner

FilPag commented Aug 5, 2025

Try again from merge from scratch and force push an update. Since my Filpag branch has refactored some stuff (moved to other files etc.) Apply any updates to the moved files. Use my coop logic with the players array. Any completely new files added by them you can incorporate. but use my new file structure and apply any changes by them

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