ReStreet: FIFA Street (2012) recompiled for Windows PC, with online play, a launcher with friends, chat and rooms. Bring your own game.
Launcher 2.1.4: ranked with real teams, Online/Away, Looking for a match tab, update_required
SamuelitoDaVila1c0a449e9476
diff --git a/Launcher/FifaStreetLauncher.Linux/Social.cs b/Launcher/FifaStreetLauncher.Linux/Social.csindex bd1128a..93d284e 100644--- a/Launcher/FifaStreetLauncher.Linux/Social.cs+++ b/Launcher/FifaStreetLauncher.Linux/Social.cs@@ -84,7 +84,7 @@ internal sealed partial class Launcher}else if (cmd == "friend"){- using var r = await PostJson(server, "/v1/friends", new { me = name, key, action = Str("action"), other = Str("other") });+ using var r = await PostJson(server, "/v1/friends", new { me = name, key, action = Str("action"), other = Str("other"), value = Str("value") });if (r != null && r.RootElement.TryGetProperty("result", out var fr) && fr.ValueKind == JsonValueKind.String)error = fr.GetString() switch { "unknown" => $"No player called {Str("other")}", "self" => "You can't add yourself", _ => null };}@@ -167,6 +167,7 @@ internal sealed partial class Launcher"in_game" => "Playing " + (p.TryGetProperty("mode", out var md) ? md.GetString() : ""),"searching" => "Searching · " + (p.TryGetProperty("mode", out var md2) ? md2.GetString() : "") +(waited.TryGetValue(p.GetProperty("name").GetString() ?? "", out int w) ? $" · {w / 60}:{w % 60:00}" : ""),+ "away" => "Away",_ => "In the menus",},}).ToArray()@@ -245,8 +246,9 @@ internal sealed partial class Launcher"tournament_full" => "The tournament is full","not_signed_up" => "Sign up first","checkin_not_open" => "Check-in opens 10 minutes before the start",- "real_team_required" => "Tournaments are played with real teams: pick a club or a national team",+ "real_team_required" => "Ranked matches and tournaments are played with real teams: pick a club or a national team","already_in_match" => "You already have a match waiting: play it first",+ "update_required" => "Update ReStreet to play online matches (the new version unlocks every trick for everyone)","unknown_action" or "route_not_found" => "This server does not have competitive play yet",_ => "Could not do that: " + code,};@@ -266,6 +268,7 @@ internal sealed partial class Launcher"wrong_password" => "Wrong password for that game","not_friends" => "You can only invite your friends","not_in_room" => "Post a match first, then invite",+ "update_required" => "Update ReStreet to play online matches (the new version unlocks every trick for everyone)",_ => "Could not do that: " + code,};diff --git a/Launcher/FifaStreetLauncher/GlassUi.cs b/Launcher/FifaStreetLauncher/GlassUi.csindex 642c707..4d93d0d 100644--- a/Launcher/FifaStreetLauncher/GlassUi.cs+++ b/Launcher/FifaStreetLauncher/GlassUi.cs@@ -420,7 +420,7 @@ public partial class LauncherForm}else if (cmd == "friend"){- using var r = await PostJson(server, "/v1/friends", new { me = name, key, action = Str("action"), other = Str("other") });+ using var r = await PostJson(server, "/v1/friends", new { me = name, key, action = Str("action"), other = Str("other"), value = Str("value") });if (r != null && r.RootElement.TryGetProperty("result", out var fr) && fr.ValueKind == JsonValueKind.String)error = fr.GetString() switch { "unknown" => $"No player called {Str("other")}", "self" => "You can't add yourself", _ => null };}@@ -503,6 +503,7 @@ public partial class LauncherForm"in_game" => "Playing " + (p.TryGetProperty("mode", out var md) ? md.GetString() : ""),"searching" => "Searching · " + (p.TryGetProperty("mode", out var md2) ? md2.GetString() : "") +(waited.TryGetValue(p.GetProperty("name").GetString() ?? "", out int w) ? $" · {w / 60}:{w % 60:00}" : ""),+ "away" => "Away",_ => "In the menus",},}).ToArray()@@ -582,8 +583,9 @@ public partial class LauncherForm"tournament_full" => "The tournament is full","not_signed_up" => "Sign up first","checkin_not_open" => "Check-in opens 10 minutes before the start",- "real_team_required" => "Tournaments are played with real teams: pick a club or a national team",+ "real_team_required" => "Ranked matches and tournaments are played with real teams: pick a club or a national team","already_in_match" => "You already have a match waiting: play it first",+ "update_required" => "Update ReStreet to play online matches (the new version unlocks every trick for everyone)","unknown_action" or "route_not_found" => "This server does not have competitive play yet",_ => "Could not do that: " + code,};@@ -603,6 +605,7 @@ public partial class LauncherForm"wrong_password" => "Wrong password for that game","not_friends" => "You can only invite your friends","not_in_room" => "Post a match first, then invite",+ "update_required" => "Update ReStreet to play online matches (the new version unlocks every trick for everyone)",_ => "Could not do that: " + code,};diff --git a/Launcher/FifaStreetLauncher/ui/lang.js b/Launcher/FifaStreetLauncher/ui/lang.jsindex feb1683..29da7ba 100644--- a/Launcher/FifaStreetLauncher/ui/lang.js+++ b/Launcher/FifaStreetLauncher/ui/lang.js@@ -85,6 +85,11 @@'Add friends from the Online list': ['Adicione amigos pela lista Online', 'Añade amigos desde la lista En línea', 'Ajoutez des amis depuis la liste En ligne','Füge Freunde aus der Online-Liste hinzu', 'Aggiungi amici dalla lista Online'],'No requests': ['Nenhum pedido', 'Sin solicitudes', 'Aucune demande', 'Keine Anfragen', 'Nessuna richiesta'],+ 'Away': ['Ausente', 'Ausente', 'Absent', 'Abwesend', 'Assente'],+ 'In the menus': ['Nos menus', 'En los menús', 'Dans les menus', 'In den Menüs', 'Nei menu'],+ 'Looking for a match': ['Procurando partida', 'Buscando partida', 'Cherche un match', 'Sucht ein Spiel', 'Cerca partita'],+ 'Nobody is looking for a match right now': ['Ninguém está procurando partida agora', 'Nadie está buscando partida ahora', 'Personne ne cherche de match pour le moment', 'Gerade sucht niemand ein Spiel', 'Nessuno sta cercando una partita ora'],+ 'Choose how other players see you': ['Escolha como os outros jogadores veem você', 'Elige cómo te ven los demás jugadores', 'Choisis comment les autres joueurs te voient', 'Wähle, wie andere Spieler dich sehen', 'Scegli come ti vedono gli altri giocatori'],'Nobody online': ['Ninguém online', 'Nadie en línea', 'Personne en ligne', 'Niemand online', 'Nessuno online'],'Wants to be your friend': ['Quer ser seu amigo', 'Quiere ser tu amigo', 'Veut être votre ami', 'Möchte dein Freund sein', 'Vuole essere tuo amico'],'Request sent': ['Pedido enviado', 'Solicitud enviada', 'Demande envoyée', 'Anfrage gesendet', 'Richiesta inviata'],@@ -510,6 +515,11 @@"signed up": ["inscritos", "inscritos", "inscrits", "angemeldet", "iscritti"],"Real teams only": ["Só times reais", "Solo equipos reales", "Équipes réelles uniquement", "Nur echte Teams", "Solo squadre reali"],"Tournaments are played with real teams: pick a club or a national team": ["Os torneios são jogados com times reais: escolha um clube ou uma seleção", "Los torneos se juegan con equipos reales: elige un club o una selección", "Les tournois se jouent avec des équipes réelles : choisis un club ou une sélection", "Turniere werden mit echten Teams gespielt: wähle einen Verein oder eine Nationalmannschaft", "I tornei si giocano con squadre reali: scegli un club o una nazionale"],+ "Ranked matches and tournaments are played with real teams: pick a club or a national team": ["Partidas ranqueadas e torneios são jogados com times reais: escolha um clube ou uma seleção", "Las partidas clasificatorias y los torneos se juegan con equipos reales: elige un club o una selección", "Les matchs classés et les tournois se jouent avec des équipes réelles : choisis un club ou une sélection", "Ranglistenspiele und Turniere werden mit echten Teams gespielt: wähle einen Verein oder eine Nationalmannschaft", "Le partite classificate e i tornei si giocano con squadre reali: scegli un club o una nazionale"],+ "Ranked matches are played with real teams: pick a club or a national team.": ["As partidas ranqueadas são jogadas com times reais: escolha um clube ou uma seleção.", "Las partidas clasificatorias se juegan con equipos reales: elige un club o una selección.", "Les matchs classés se jouent avec des équipes réelles : choisis un club ou une sélection.", "Ranglistenspiele werden mit echten Teams gespielt: wähle einen Verein oder eine Nationalmannschaft.", "Le partite classificate si giocano con squadre reali: scegli un club o una nazionale."],+ "Update ReStreet to play online matches (the new version unlocks every trick for everyone)": ["Atualize o ReStreet para jogar partidas online (a nova versão desbloqueia todos os truques para todos)", "Actualiza ReStreet para jugar partidas online (la nueva versión desbloquea todos los trucos para todos)", "Mets ReStreet à jour pour jouer en ligne (la nouvelle version débloque tous les gestes pour tout le monde)", "Aktualisiere ReStreet, um online zu spielen (die neue Version schaltet alle Tricks für alle frei)", "Aggiorna ReStreet per giocare online (la nuova versione sblocca tutti i trick per tutti)"],+ "Pick a team first": ["Escolha um time primeiro", "Elige un equipo primero", "Choisis d'abord une équipe", "Wähle zuerst ein Team", "Scegli prima una squadra"],+ "Pick a team": ["Escolha um time", "Elige un equipo", "Choisis une équipe", "Team wählen", "Scegli una squadra"],"You already have a match waiting: play it first": ["Você já tem uma partida esperando: jogue-a primeiro", "Ya tienes un partido esperando: juégalo primero", "Tu as déjà un match qui t'attend : joue-le d'abord", "Auf dich wartet schon ein Spiel: spiel es zuerst", "Hai già una partita in attesa: giocala prima"],"Final": ["Final", "Final", "Finale", "Finale", "Finale"],"Semi-finals": ["Semifinais", "Semifinales", "Demi-finales", "Halbfinale", "Semifinali"],@@ -531,6 +541,9 @@};// Texts with a name or a number inside: $1 is the captured part as is, $T1 the captured part translated.const PATTERNS = [+ [/^Playing (.+)$/, ['Jogando $1', 'Jugando $1', 'En match · $1', 'Spielt $1', 'In partita · $1']],+ [/^Searching · (.+)$/, ['Procurando · $1', 'Buscando · $1', 'Recherche · $1', 'Sucht · $1', 'Cerca · $1']],+ [/^Posted (.+?)( \(private\))? · (.+)$/, ['Publicou $1$2 · $3', 'Publicó $1$2 · $3', 'A publié $1$2 · $3', 'Hat $1$2 erstellt · $3', 'Ha pubblicato $1$2 · $3']],[/^The save from (.+) becomes your save again\. The one in use now is kept with the deleted saves, and a full backup is made first\. Close the game before you restore\.$/, ["O save de $1 volta a ser o seu save. O que está em uso agora fica guardado com os saves apagados, e antes é feita uma cópia de segurança completa. Feche o jogo antes de restaurar.","La partida del $1 vuelve a ser tu partida. La que usas ahora se guarda con las partidas borradas, y antes se hace una copia de seguridad completa. Cierra el juego antes de restaurar.",diff --git a/Launcher/FifaStreetLauncher/ui/launcher.html b/Launcher/FifaStreetLauncher/ui/launcher.htmlindex c496dcc..ae6e0a2 100644--- a/Launcher/FifaStreetLauncher/ui/launcher.html+++ b/Launcher/FifaStreetLauncher/ui/launcher.html@@ -49,6 +49,9 @@ button{font:inherit;color:inherit}.av{width:36px;height:36px;flex:none;border-radius:50%;background:var(--stock-ink);color:var(--stock);display:grid;place-items:center;font:800 18px var(--display)}.side .me b{display:block;font:800 21px/1 var(--display);letter-spacing:.8px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side .me small{display:flex;align-items:center;font:700 12px Archivo;color:#246338;margin-top:3px}+.dot.away{background:#f5b301}+.side .me .stbtn{display:block;margin-top:5px;padding:2px 9px;border-radius:99px;border:1px solid var(--stock-muted);background:transparent;color:var(--stock-ink);font:700 11px Archivo;letter-spacing:.8px;text-transform:uppercase;cursor:pointer}+.side .me .stbtn:hover{border-color:var(--stock-ink)}.side .me .tag{display:block;font:700 11px Archivo;letter-spacing:1.2px;color:var(--stock-muted);margin-top:4px;text-transform:uppercase}.side .me>div{min-width:0}.dot{width:7px;height:7px;border-radius:50%;background:var(--ok);display:inline-block;margin-right:6px;flex:none}@@ -246,7 +249,7 @@ body.deck .old-only,body:not(.deck) .deck-only{display:none!important}.person:hover{background:var(--panel)}.pav{position:relative;width:34px;height:34px;flex:none;border-radius:50%;display:grid;place-items:center;font:800 14px Archivo;color:#fff}.pav::after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;border:2px solid var(--night);background:#6b7280}-.pav.online::after{background:var(--ok)}.pav.game::after{background:var(--brand)}+.pav.online::after{background:var(--ok)}.pav.game::after{background:var(--brand)}.pav.away::after{background:#f5b301}.pn{flex:1;min-width:0}.pn b{display:block;font-size:13.5px}.pn small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.pact{flex:none;width:30px;height:30px;border-radius:8px;border:1px solid var(--seam-2);background:var(--panel-2);color:#fff;cursor:pointer;font-size:14px;display:grid;place-items:center}.pact:hover{border-color:var(--brand)}.pact.ok{background:var(--brand);border-color:var(--brand);color:#111}.pact[disabled]{opacity:.55;cursor:default}@@ -395,7 +398,7 @@ body.deck .old-only,body:not(.deck) .deck-only{display:none!important}<button type="button" class="nav" data-p="p-advanced"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 6h16M4 12h16M4 18h10"/></svg><span class="lb">Advanced</span></button><div class="spacer"></div><div class="tg side-tg" data-id="onlineMode" tabindex="0" role="switch" title="Off: the game starts offline, with no server, friends or rooms."><div>Play online</div><div class="sw"></div></div>- <div class="me"><div class="av" id="meav">?</div><div><b id="mename">Offline</b><small><span class="dot" id="medot"></span><span id="meserver">Not set up</span></small><span class="tag" id="ver">V2.1 · ONLINE BETA</span></div></div>+ <div class="me"><div class="av" id="meav">?</div><div><b id="mename">Offline</b><small><span class="dot" id="medot"></span><span id="meserver">Not set up</span></small><button type="button" class="stbtn" id="meStatus" title="Choose how other players see you">Online</button><span class="tag" id="ver">V2.1 · ONLINE BETA</span></div></div><div class="credits"><h4>CREDITS</h4><div>Performance · <b>AnDr3zF</b></div><div>PT-BR translation · <b>Eze_.</b></div></div></aside>@@ -433,11 +436,12 @@ body.deck .old-only,body:not(.deck) .deck-only{display:none!important}<section class="page" id="p-social"><div class="people">- <div class="ptabs"><div class="ptab on" data-t="t-online" tabindex="0">Online <span class="badge" id="bOnline">0</span></div><div class="ptab" data-t="t-friends" tabindex="0">Friends</div><div class="ptab" data-t="t-req" tabindex="0">Requests <span class="badge" id="bReq" style="display:none"></span></div></div>+ <div class="ptabs"><div class="ptab on" data-t="t-online" tabindex="0">Online <span class="badge" id="bOnline">0</span></div><div class="ptab" data-t="t-friends" tabindex="0">Friends</div><div class="ptab" data-t="t-req" tabindex="0">Requests <span class="badge" id="bReq" style="display:none"></span></div><div class="ptab" data-t="t-seek" tabindex="0">Looking for a match <span class="badge" id="bSeek" style="display:none"></span></div></div><form id="addForm" style="display:flex;gap:8px"><input class="search" id="addName" maxlength="15" placeholder="Add a friend by name" autocomplete="off"><button class="pact ok" style="height:41px;width:41px" aria-label="Add friend"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button></form><div class="plist" id="t-online"></div><div class="plist" id="t-friends" style="display:none"></div><div class="plist" id="t-req" style="display:none"></div>+ <div class="plist" id="t-seek" style="display:none"></div></div><div class="chat"><div class="chathead"><div class="ctabs" id="ctabs"></div><small id="chatNote">be nice, chat is moderated</small></div>@@ -850,6 +854,18 @@ document.querySelector('[data-p=p-matches]').addEventListener('click', () => { srequestAnimationFrame(() => { const t = document.querySelector('.spic.on'); if (t) $('gPics').scrollLeft = t.offsetLeft - $('gPics').offsetLeft - 16; }); });document.querySelectorAll('.ptab').forEach(t => t.onclick = () => { document.querySelectorAll('.ptab').forEach(x => x.classList.toggle('on', x === t));document.querySelectorAll('.plist').forEach(l => l.style.display = l.id === t.dataset.t ? 'flex' : 'none'); });+// Online / Away, picked in the profile card: kept on this PC and sent again when the server shows otherwise (a+// server restart forgets it). A match or a search shows over it.+let wantAway = false, statusSentAt = 0;+try { wantAway = localStorage.getItem('restreet.status') === 'away'; } catch (e) { /* no storage: Online */ }+function sendStatus() { statusSentAt = Date.now(); send({cmd: 'friend', action: 'status', value: wantAway ? 'away' : 'online'}); }+function showStatus() { $('meStatus').textContent = wantAway ? 'Away' : 'Online'; $('medot').classList.toggle('away', wantAway); }+$('meStatus').onclick = () => {+ wantAway = !wantAway;+ try { localStorage.setItem('restreet.status', wantAway ? 'away' : 'online'); } catch (e) { /* kept for this session only */ }+ showStatus(); sendStatus();+};+showStatus();$('addForm').onsubmit = e => { e.preventDefault(); const n = $('addName').value.trim(); if (n) { send({cmd: 'friend', action: 'add', other: n}); $('addName').value = ''; } };$('compose').onsubmit = e => { e.preventDefault(); const v = $('say').value.trim(); if (!v) return; send({cmd: 'chatSend', channel, text: v}); $('say').value = ''; };@@ -888,25 +904,28 @@ showMyTeam();let tpPick = 0, tpLeague = '', tpDone = null;function tpRender() {const q = $('tpSearch').value.trim().toLowerCase();- const ids = [0, ...Object.values(TEAMS).flat().map(([id]) => id)].filter(id =>+ const real = tpDone && tpDone.real; // ranked and real-team tournaments: no World Tour team+ const ids = [...(real ? [] : [0]), ...Object.values(TEAMS).flat().map(([id]) => id)].filter(id =>(!tpLeague || (tpLeague === 'wt' ? !id : LEAGUE_OF[id] === tpLeague)) && (!q || (id ? TEAM_NAME[id] : 'my world tour team').toLowerCase().includes(q)));$('tpGrid').innerHTML = ids.map(id => '<button type="button" class="tpt' + (id === tpPick ? ' on' : '') + '" role="option" aria-selected="' + (id === tpPick) +'" data-team="' + id + '">' + crest(id) + '<span>' + esc(id ? TEAM_NAME[id] : 'My World Tour team') + '</span></button>').join('') ||'<div class="tpempty">No team matches your search.</div>';- $('tpChips').innerHTML = [['', 'All'], ['wt', 'World Tour'], ...Object.keys(TEAMS).map(g => [g, g])].map(([k, n]) =>+ $('tpChips').innerHTML = [['', 'All'], ...(real ? [] : [['wt', 'World Tour']]), ...Object.keys(TEAMS).map(g => [g, g])].map(([k, n]) =>'<button type="button" class="tpchip' + (k === tpLeague ? ' on' : '') + '" data-league="' + esc(k) + '">' + esc(n) + '</button>').join('');- $('tpOk').textContent = tpDone && tpDone.join ? 'Join with ' + (tpPick ? TEAM_NAME[tpPick] : 'my World Tour team') : 'Use this team';+ $('tpOk').textContent = real && !tpPick ? 'Pick a team first' : tpDone && tpDone.join ? 'Join with ' + (tpPick ? TEAM_NAME[tpPick] : 'my World Tour team') : 'Use this team';+ $('tpOk').disabled = !!real && !tpPick;}function openTeamPicker(done, title, sub) {- tpPick = myTeam; tpLeague = ''; tpDone = done; $('tpSearch').value = '';+ tpPick = 'pick' in done ? done.pick : myTeam; tpLeague = ''; tpDone = done; $('tpSearch').value = '';$('tpTitle').textContent = title; $('tpSub').textContent = sub;tpRender(); $('teamPick').classList.remove('gone');setTimeout(() => { const on = $('tpGrid').querySelector('.tpt.on'); if (on) { on.scrollIntoView({block: 'nearest'}); on.focus(); } else $('tpSearch').focus(); }, 30);}function closeTeamPicker(ok) {+ if (ok && tpDone && tpDone.real && !tpPick) return; // real teams only: wait for a pick$('teamPick').classList.add('gone');const done = tpDone; tpDone = null;- if (ok && done) { setMyTeam(tpPick); done.run(tpPick); }+ if (ok && done) { (done.store || setMyTeam)(tpPick); done.run(tpPick); }}$('tpGrid').onclick = e => { const t = e.target.closest('.tpt'); if (!t) return; tpPick = Number(t.dataset.team); tpRender(); const on = $('tpGrid').querySelector('.tpt.on'); if (on) on.focus(); };$('tpGrid').ondblclick = e => { if (e.target.closest('.tpt')) closeTeamPicker(true); };@@ -983,6 +1002,7 @@ const onTickets = e => {};$('games').addEventListener('click', onTickets);$('hList').addEventListener('click', onTickets);+$('t-seek').addEventListener('click', onTickets);let gamesHtml = '', readyShown = 0, gameIsRunning = false, canInvite = null, invShown = 0, pendingInvite = null, myRoomNow = null;const invited = new Set(), invDismissed = new Set();$('invJoin').onclick = () => { const i = invShown; if (!i) return; $('inviteCard').hidden = true; invDismissed.add(i.room);@@ -1046,9 +1066,25 @@ function renderSocial(d) {$('bOnline').textContent = (d.players || []).length;const invBtn = n => canInvite && !canInvite.includes(n.toLowerCase())? '<button class="pact inv" data-invite="' + esc(n) + '"' + (invited.has(n) ? ' disabled>Invited' : '>Invite') + '</button>' : '';- $('t-online').innerHTML = (d.players || []).map(p => person(p.name, p.note, p.state === 'in_game' ? 'game' : 'online',+ const stClass = st => st === 'in_game' || st === 'searching' ? 'game' : st === 'away' ? 'away' : 'online';+ $('t-online').innerHTML = (d.players || []).map(p => person(p.name, p.note, stClass(p.state),p.name.toLowerCase() === (d.me || '').toLowerCase() ? '' : friendNames.has(p.name.toLowerCase()) ? '<button class="pact" data-dm="' + esc(p.name) + '" aria-label="Send message">' + ICO.msg + '</button>' : pendingNames.has(p.name.toLowerCase()) ? sentBtn : '<button class="pact" data-add="' + esc(p.name) + '" aria-label="Add friend">' + ICO.add + '</button>')).join('') || '<div class="sys">Nobody online</div>';- $('t-friends').innerHTML = (d.friends || []).map(f => person(f.name, f.online ? 'Online' : 'Offline', f.online ? 'online' : '', (f.online ? invBtn(f.name) : '') + '<button class="pact" data-dm="' + esc(f.name) + '" aria-label="Send message">' + ICO.msg + '</button>')).join('') || '<div class="sys">Add friends from the Online list</div>';+ const live = Object.fromEntries((d.players || []).map(p => [p.name.toLowerCase(), p]));+ const fNote = f => !f.online ? 'Offline' : live[f.name.toLowerCase()] ? live[f.name.toLowerCase()].note : 'Online';+ const fClass = f => !f.online ? '' : live[f.name.toLowerCase()] ? stClass(live[f.name.toLowerCase()].state) : 'online';+ $('t-friends').innerHTML = (d.friends || []).map(f => person(f.name, fNote(f), fClass(f), (f.online ? invBtn(f.name) : '') + '<button class="pact" data-dm="' + esc(f.name) + '" aria-label="Send message">' + ICO.msg + '</button>')).join('') || '<div class="sys">Add friends from the Online list</div>';+ const meNow = live[(d.me || '').toLowerCase()];+ if (meNow && (meNow.state === 'online' || meNow.state === 'away') && (meNow.state === 'away') !== wantAway && Date.now() - statusSentAt > 10000) sendStatus();+ // Looking for a match: players searching in the game, and posted matches still waiting for a player.+ const searching = (d.players || []).filter(p => p.state === 'searching');+ const waiting = (social.rooms || []).filter(r => r.players.length < r.seats && !(social.myRoom && social.myRoom.id === r.id));+ $('t-seek').innerHTML = searching.map(p => person(p.name, p.note, 'game', '')).join('') ++ waiting.map(r => person(r.host, 'Posted ' + (MODE[r.mode] || r.mode) + (r.private ? ' (private)' : '') + ' · ' + r.name, 'online',+ '<button type="button" class="pact inv" data-join="' + r.id + '"' + (r.private ? ' data-private="1"' : '') + ' data-host="' + esc(r.host) ++ '" data-hostteam="' + esc(teamLabel((r.teams || {})[r.host])) + '">Join</button>')).join('') ||+ '<div class="sys">Nobody is looking for a match right now</div>';+ const seekCount = searching.length + waiting.length;+ $('bSeek').style.display = seekCount ? '' : 'none'; $('bSeek').textContent = seekCount;const req = d.requests || [];if (d.friends) $('hStands').innerHTML = d.friends.filter(f => f.online).map(f => person(f.name, 'Online', 'online', invBtn(f.name) + '<button class="pact" data-dm="' + esc(f.name) + '" aria-label="Send message">' + ICO.msg + '</button>')).join('') ||'<div class="empty">Add friends from the Online list</div>';@@ -1211,15 +1247,23 @@ function compNote(text) {$('cNote').textContent = text || ''; clearTimeout(window.cNoteTimer);if (text) window.cNoteTimer = setTimeout(() => { $('cNote').textContent = ''; }, 8000);}+// Ranked is played with real teams only (a World Tour team can be levelled to 99): its own team, never team 0.+let rankTeam = 0;+try { rankTeam = Number(localStorage.getItem('restreet.rankteam')) || 0; } catch (e) { /* no storage: picked again */ }+if (!TEAM_NAME[rankTeam]) rankTeam = TEAM_NAME[myTeam] ? myTeam : 0;+function setRankTeam(id) { rankTeam = id; try { localStorage.setItem('restreet.rankteam', String(id)); } catch (e) { /* kept for this session only */ } }function showCompTeam() {- $('cTeamBtn').innerHTML = crest(myTeam) + '<span class="tn"><small>YOUR TEAM</small><span>' + esc(myTeam ? TEAM_NAME[myTeam] : 'My World Tour team') + '</span></span>';+ $('cTeamBtn').innerHTML = crest(rankTeam) + '<span class="tn"><small>YOUR TEAM</small><span>' + esc(rankTeam ? TEAM_NAME[rankTeam] : 'Pick a team') + '</span></span>';}showCompTeam();-$('cTeamBtn').onclick = () => openTeamPicker({join: false, run: showCompTeam}, 'Pick your team', 'Choose the team you will play ranked matches with.');+const pickRankTeam = run => openTeamPicker({join: false, real: true, pick: rankTeam, store: setRankTeam, run: () => { showCompTeam(); if (run) run(); }},+ 'Pick your team', 'Ranked matches are played with real teams: pick a club or a national team.');+$('cTeamBtn').onclick = () => pickRankTeam();+const rankQueue = () => { send({cmd: 'comp', action: 'queue', mode: $('cMode').value, team: rankTeam}); setTimeout(() => send({cmd: 'comp', action: 'me'}), 300); };$('cPlay').onclick = () => {- if (compMe && compMe.queue) send({cmd: 'comp', action: 'cancel'});- else send({cmd: 'comp', action: 'queue', mode: $('cMode').value, team: myTeam});- setTimeout(() => send({cmd: 'comp', action: 'me'}), 300);+ if (compMe && compMe.queue) { send({cmd: 'comp', action: 'cancel'}); setTimeout(() => send({cmd: 'comp', action: 'me'}), 300); }+ else if (!rankTeam) pickRankTeam(rankQueue);+ else rankQueue();};function renderRank(d) {compMe = d;@@ -1272,7 +1316,7 @@ function renderTours(list) {: t.state === 'running' ? '<span class="state live">Live</span>' : t.state === 'done' ? '<span class="state done">Finished</span>' : '<span class="state">Cancelled</span>';let acts = '';if (t.state === 'open') {- if (!t.me_signed) acts = '<button type="button" class="go" data-tour="signup" data-id="' + esc(t.id) + '">Sign up</button>';+ if (!t.me_signed) acts = '<button type="button" class="go" data-tour="signup" data-id="' + esc(t.id) + '"' + (t.real_teams !== false ? ' data-real="1"' : '') + '>Sign up</button>';else {if (!t.me_checked) acts += '<button type="button" class="go" data-tour="checkin" data-id="' + esc(t.id) + '"' +(now < t.checkin ? ' disabled title="Check-in opens 10 minutes before the start"' : '') + '>Check in</button>';@@ -1298,7 +1342,7 @@ function renderTours(list) {$('cTours').onclick = e => {const b = e.target.closest('[data-tour]'); if (!b || b.disabled) return;const go = team => { send({cmd: 'comp', action: b.dataset.tour, id: b.dataset.id, team}); setTimeout(() => send({cmd: 'comp', action: 'tournaments'}), 300); };- if (b.dataset.tour === 'signup') openTeamPicker({join: false, run: go}, 'Sign up', 'Pick the team you will play the tournament with.');+ if (b.dataset.tour === 'signup') openTeamPicker({join: false, real: !!b.dataset.real, run: go}, 'Sign up', 'Pick the team you will play the tournament with.');else go(myTeam);};function renderComp(d) {