Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions Pengu Loader/plugins/ROSE-PartyMode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
// Party state
let partyState = {
enabled: false,
relay_connected: false,
auto_reconnect: false,
automatic: true,
auto_room_active: false,
my_token: null,
my_summoner_id: null,
my_summoner_name: "Unknown",
Expand Down Expand Up @@ -683,9 +687,9 @@
<span class="party-status offline">Offline</span>
</div>
<div class="party-content">
<div class="party-description">Share your skins with friends in the same lobby. Enable party mode and exchange tokens to connect.</div>
<div class="party-description">Automatic mode is always active. Friends using this private Rose build are linked as soon as they are together in the same premade lobby.</div>

<div class="party-section" id="party-toggle-section">
<div class="party-section" id="party-toggle-section" style="display: none;">
<button class="party-toggle-btn enable" id="party-toggle-btn">
Enable Party Mode
</button>
Expand All @@ -700,7 +704,7 @@
</div>

<div class="party-section" id="party-add-section" style="display: none;">
<div class="party-section-title">Add Friend</div>
<div class="party-section-title">Approve Friend Once</div>
<div class="add-peer-container">
<input type="text" class="add-peer-input" id="add-peer-input" placeholder="Paste friend's token here...">
<button class="add-btn" id="add-peer-btn">Add</button>
Expand All @@ -709,7 +713,7 @@
</div>

<div class="party-section" id="party-peers-section" style="display: none;">
<div class="party-section-title">Connected Friends (<span id="peer-count">0</span>)</div>
<div class="party-section-title">Approved Friends (<span id="peer-count">0</span> online)</div>
<div class="peers-list" id="peers-list">
<div class="no-peers">No friends connected yet</div>
</div>
Expand Down Expand Up @@ -760,6 +764,7 @@

const statusEl = partyPanel.querySelector(".party-status");
const toggleBtn = document.getElementById("party-toggle-btn");
const toggleSection = document.getElementById("party-toggle-section");
const tokenSection = document.getElementById("party-token-section");
const addSection = document.getElementById("party-add-section");
const peersSection = document.getElementById("party-peers-section");
Expand All @@ -768,21 +773,31 @@
const peersList = document.getElementById("peers-list");

if (partyState.enabled) {
statusEl.className = "party-status online";
statusEl.textContent = "Online";
if (partyState.automatic && !partyState.auto_room_active) {
statusEl.className = "party-status online";
statusEl.textContent = "Waiting for lobby";
} else {
statusEl.className = partyState.relay_connected
? "party-status online"
: "party-status offline";
statusEl.textContent = partyState.relay_connected
? (partyState.automatic ? "Lobby linked" : "Online")
: "Reconnecting...";
}

toggleBtn.className = "party-toggle-btn disable";
toggleBtn.textContent = "Disable Party Mode";

tokenSection.style.display = "block";
addSection.style.display = "block";
toggleSection.style.display = partyState.automatic ? "none" : "block";
tokenSection.style.display = partyState.automatic ? "none" : "block";
addSection.style.display = partyState.automatic ? "none" : "block";
peersSection.style.display = "block";

if (partyState.my_token) {
tokenDisplay.value = partyState.my_token;
}

// Update peers list (show all peers, including those still connecting)
// Keep approved friends visible even while their Rose is offline.
const allPeers = partyState.peers || [];
const connectedPeers = allPeers.filter((p) => p.connected);
peerCountEl.textContent = connectedPeers.length;
Expand All @@ -795,7 +810,7 @@
const cs = (peer.connection_state || "disconnected").toLowerCase();
const isWaiting = cs === "connecting" || cs === "handshaking";
const statusText = isWaiting
? "Waiting for your friend"
? "Saved - reconnects automatically"
: cs === "connected"
? (peer.in_lobby ? "In lobby" : "Connected")
: cs === "handshaking"
Expand Down Expand Up @@ -834,6 +849,7 @@
toggleBtn.className = "party-toggle-btn enable";
toggleBtn.textContent = "Enable Party Mode";

toggleSection.style.display = partyState.automatic ? "none" : "block";
tokenSection.style.display = "none";
addSection.style.display = "none";
peersSection.style.display = "none";
Expand Down Expand Up @@ -913,6 +929,10 @@
case "party-state":
partyState = {
enabled: data.enabled || false,
relay_connected: data.relay_connected || false,
auto_reconnect: data.auto_reconnect || false,
automatic: data.automatic !== false,
auto_room_active: data.auto_room_active || false,
my_token: data.my_token || null,
my_summoner_id: data.my_summoner_id || null,
my_summoner_name: data.my_summoner_name || "Unknown",
Expand All @@ -928,6 +948,7 @@

if (data.success) {
partyState.enabled = true;
partyState.auto_reconnect = true;
partyState.my_token = data.token;
console.log(`${LOG_PREFIX} Party mode enabled`);
} else {
Expand Down
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
APP_VERSION = "1.2.14" # Application version
APP_USER_AGENT = f"Rose/{APP_VERSION}" # User-Agent header for HTTP requests

# Automatically discover Party Mode peers from the premade League lobby.
PARTY_MODE_ALWAYS_ON = True
PARTY_AUTO_ROOM_MAX_AGE_SECONDS = 6 * 60 * 60

_CONFIG = configparser.ConfigParser()
_CONFIG_MTIME: float = 0.0 # Last known modification time of config.ini

Expand Down
3 changes: 2 additions & 1 deletion party/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

from .party_manager import PartyManager
from .party_state import PartyState
from .party_storage import PartyStorage

__all__ = ["PartyManager", "PartyState"]
__all__ = ["PartyManager", "PartyState", "PartyStorage"]
Loading