Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VasquezRivero92/HabboCafe/llms.txt

Use this file to discover all available pages before exploring further.

A Dado Admin is responsible for the day-to-day operation of a single tournament instance (a Dado). They can add and manage players, assign roles within their Dado, and configure all tournament details — prize pool, qualifying spots, rules, and schedule. Dado Admins are appointed by the Global Admin and their authority is scoped strictly to the one Dado they are assigned to; they cannot view or modify players in any other Dado.

Accessing the Dado Admin Panel

After signing in, the Admin Dado tab appears in the navigation bar when your account is the dado_admin of the currently selected Dado. The app derives your effective role at runtime:
const getActiveRole = () => {
  if (activeDado?.adminId === currentUser?.uid) return 'dado_admin';
  // ...
};
Switching to a Dado where you are not the admin hides the panel automatically.

Adding Players

Players are added manually by entering their Habbo nickname. HADOS uses the nickname to fetch the player’s avatar from the official Habbo imaging service and pre-populates the avatar URL automatically.
1

Open the Add Player modal

In the Dado Admin panel, click Crear Usuario. The creation modal opens.
2

Enter the Habbo nickname

Type the player’s exact Habbo username in the Nickname field.
As you type, HADOS renders a live avatar preview using the Habbo imaging API: https://www.habbo.es/habbo-imaging/avatarimage?user=<nickname>&direction=3&head_direction=3&gesture=std&size=m. Verify the avatar matches the player before saving.
3

Set optional starting points

If the player carries over points from a previous stage, enter them in Puntos Iniciales. The default is 0. Negative values are coerced to 0.
4

Save the player

Click Crear Usuario. The handleCreateUser function writes a new document to the users Firestore collection and recalculates ranks for every player in the Dado in the same batch:
const newUser = {
  username: newNick.trim(),
  email: `${newNick.trim().toLowerCase()}@dummy-habbo.com`,
  points: pointsVal,          // 0 or the value you entered
  previousRank: users.length + 1,
  currentRank: users.length + 1,
  avatarUrl: `https://www.habbo.es/habbo-imaging/avatarimage?user=${encodeURIComponent(newNick.trim())}&direction=3&head_direction=3&gesture=std&size=m`,
  createdAt: new Date().toISOString(),
  role: 'jugador',
  dadoId: activeDado.id      // bound to your Dado
};
HADOS checks for duplicate usernames before saving. If a player with the same nickname already exists in your Dado, the operation is blocked with an alert.

Managing Roles

Every user in a Dado holds one of two operational roles: jugador (player) or intermediario (score loader). The Dado Admin can toggle between these roles at any time from the member list.
RoleWhat they can do
jugadorView rankings, see their own position
intermediarioEverything a jugador can do, plus load and adjust points for any player
Clicking the role badge next to a player calls handlePromoteRole:
await updateDoc(doc(db, 'users', userId), {
  role: newRole  // 'jugador' or 'intermediario'
});
You cannot demote or modify a user who holds the dado_admin or global_admin role. Those roles are managed exclusively by the Global Admin.

Configuring Tournament Info

The Dado Admin panel exposes a configuration form that saves four fields to the Dado’s Firestore document. These values are displayed publicly on the tournament’s Info, Rules, and Schedule tabs.
FieldTypeDefaultDescription
totalPrizestring'3000 USDT'Prize pool label shown on the info panel
qualifyingCountnumber12Number of players who qualify from this Dado
rulesstring[]See belowOne rule per line in the text area
schedulestring[]See belowOne schedule entry per line in the text area
Rules and schedule are entered as plain text — HADOS splits the content on newlines and stores each line as a separate array element:
const parsedRules    = editRulesText.split('\n').filter(line => line.trim() !== '');
const parsedSchedule = editScheduleText.split('\n').filter(line => line.trim() !== '');

await updateDoc(doc(db, 'dados', activeDado.id), {
  totalPrize: editTotalPrize.trim(),
  qualifyingCount: editQualifyingCount,
  rules: parsedRules,
  schedule: parsedSchedule
});
Default rules text loaded into the editor:
1. Los puntos se acumulan al ganar partidas verificadas en tu Dado asignado.
2. Los intermediarios de tu Dado son los únicos autorizados para verificar y cargar puntos.
3. Los premios se distribuirán directamente según la configuración de tu administrador.
Default schedule text loaded into the editor:
• Rondas Clasificatorias: Lunes a Viernes 18:00 - 22:00 UTC
• Gran Final: Domingo 2 de Agosto a las 20:00 UTC
Click Guardar Configuración to persist all four fields at once.

Viewing the Member List

The member list in the Dado Admin panel shows every player registered to your Dado. The table includes four columns:
  • Usuario — the Habbo nickname
  • Email — the dummy email address assigned when the player was created
  • Rol Actual — a colour-coded badge showing the player’s current role (jugador, intermediario, or dado_admin)
  • Modificar Rol — two buttons, Hacer Intermediario and Hacer Jugador, for toggling the player’s operational role
For any user whose role is dado_admin, the buttons are replaced with the label “Propietario del Dado” — those accounts cannot be demoted from this panel. The list updates in real time via a Firestore onSnapshot listener scoped to where('dadoId', '==', activeDado.id). Any change made by any admin appears instantly for all viewers.

Build docs developers (and LLMs) love