Documentation

User Guide - Roster/roster Counting

AI Powered
Back to Docs

Advertisement

User Guide - Roster/roster Counting

Documentation & Guides

Roster Counting and Limits

📊 Understanding Roster Counts

RiftSurge uses a sophisticated roster counting system to ensure fair billing and accurate team size tracking. This system prevents double-counting while maintaining flexibility for different types of team members.

🧮 How Roster Counting Works

The Counting Logic

Our roster counting system follows these rules:

1. Players with User Accounts: If a player has a RiftSurge user account (Membership), they count as 1 roster spot

2. Players without User Accounts: If a player doesn't have a RiftSurge user account, they count as 1 roster spot

3. No Double Counting: A player is never counted twice, regardless of how they're added to the team

Centralized Counting System

Single Source of Truth: All roster counting throughout the platform uses centralized methods in the Team model. This ensures:

  • Consistency: Same counting logic everywhere
  • Maintainability: Changes only need to be made in one place
  • Reliability: No discrepancies between different parts of the system
  • Performance: Optimized queries and caching

Available Methods:

  • getRosterCount(): Total roster count (main counting logic)
  • getStartersCount(): Count of starting players only
  • getSubsCount(): Count of substitute players only
  • hasValidStartingLineup(): Check if team has 5 starters

Example Scenarios

Scenario 1: Mixed Team

  • 5 Players with User Accounts: 5 roster spots
  • 2 Players without User Accounts: 2 roster spots
  • Total Roster Count: 7 players

Scenario 2: All Registered Users

  • 7 Players with User Accounts: 7 roster spots
  • 0 Players without User Accounts: 0 roster spots
  • Total Roster Count: 7 players

Scenario 3: External Players Only

  • 0 Players with User Accounts: 0 roster spots
  • 5 Players without User Accounts: 5 roster spots
  • Total Roster Count: 5 players

🎯 Why This System?

Fair Billing

  • Accurate Counting: Prevents overcharging for team size
  • Flexible Membership: Teams can include external players
  • Transparent Limits: Clear understanding of roster capacity

Team Flexibility

  • Mixed Teams: Support for both registered and external players
  • Gradual Onboarding: Players can join the platform later
  • Temporary Members: Add players for specific events or trials

Data Integrity

  • No Duplicates: Each player counted exactly once
  • Consistent Tracking: Reliable roster size across all features
  • Limit Enforcement: Proper tier limit enforcement

📈 Tier Limits and Roster Size

Free Tier

  • Maximum Roster Size: 7 players
  • Includes: Both registered and external players
  • Billing: Based on actual roster count

Gold Tier

  • Maximum Roster Size: 10 players
  • Includes: Both registered and external players
  • Billing: Based on actual roster count

Challenger Tier

  • Maximum Roster Size: Unlimited
  • Includes: Both registered and external players
  • Billing: Based on actual roster count

🔍 Checking Your Roster Count

Dashboard Display

  • Current Count: Shows your current roster size
  • Limit Display: Shows your tier's maximum allowed
  • Visual Indicator: Progress bar showing usage

Roster Management

  • Add Player Warning: System prevents exceeding limits
  • Real-time Updates: Count updates immediately
  • Clear Feedback: Error messages when limits reached

⚠️ Important Considerations

Billing Impact

  • Subscription Quantity: Based on roster count, not user count
  • Automatic Updates: Billing adjusts when roster changes
  • Fair Pricing: Pay only for actual team size

Limit Enforcement

  • Hard Limits: Cannot exceed tier maximums
  • Upgrade Required: Need higher tier for larger rosters
  • Grace Period: Existing players grandfathered in

Data Consistency

  • Cross-Platform Sync: Counts consistent across all features
  • Real-time Updates: Changes reflected immediately
  • Audit Trail: Track roster changes over time

🛠️ Managing Your Roster Count

Adding Players

1. Check Current Count: Verify you have space available

2. Choose Method: Add via user account or external player

3. Monitor Limits: System prevents exceeding tier limits

4. Update Billing: Subscription quantity updates automatically

Removing Players

1. Immediate Effect: Count decreases immediately

2. Billing Adjustment: Subscription quantity updates

3. Data Preservation: Player data retained for history

4. Re-add Capability: Can add players back later

Upgrading Tiers

1. Higher Limits: Access to larger roster sizes

2. Immediate Effect: New limits apply instantly

3. Billing Update: New pricing based on tier

4. Growth Support: Room for team expansion

📋 Best Practices

Roster Planning

  • Start Small: Begin with core team members
  • Plan Growth: Consider future expansion needs
  • Monitor Usage: Keep track of roster count
  • Optimize Efficiency: Use roster spots effectively

Player Management

  • Regular Review: Periodically assess roster needs
  • Clear Communication: Explain roster policies to players
  • Flexible Approach: Adapt to changing team needs
  • Documentation: Keep records of roster decisions

Tier Optimization

  • Right-Size: Choose tier that fits your needs
  • Growth Planning: Consider future team size
  • Cost Efficiency: Balance features with cost
  • Regular Assessment: Review tier needs periodically

🔧 Technical Details

Database Structure

  • TeamRoster Table: Links teams to players
  • Player Table: Stores player information
  • User Table: Stores user account information
  • Membership Table: Links users to teams

Centralized Counting Algorithm

/

Get the roster count following the specific counting logic:

- Count players with Membership (User) as 1

- Count players without Membership as 1

- Avoid double-counting players with User profiles

/

public function getRosterCount(): int

{

// Get all roster entries with their associated players and users

$rosterEntries = $this->roster()

->with(['player.user', 'player'])

->get();

$countedPlayerIds = [];

$totalCount = 0;

foreach ($rosterEntries as $rosterEntry) {

$player = $rosterEntry->player;

// If this player has a user (Membership), count them

if ($player->user_id && !in_array($player->id, $countedPlayerIds)) {

$countedPlayerIds[] = $player->id;

$totalCount++;

}

// If this player doesn't have a user, count them

elseif (!$player->user_id && !in_array($player->id, $countedPlayerIds)) {

$countedPlayerIds[] = $player->id;

$totalCount++;

}

}

return $totalCount;

}

/

Get the count of starting players (non-substitutes)

/

public function getStartersCount(): int

{

return $this->roster()->starters()->count();

}

/

Get the count of substitute players

/

public function getSubsCount(): int

{

return $this->roster()->subs()->count();

}

/

Check if the team has a valid starting lineup (5 starters)

*/

public function hasValidStartingLineup(): bool

{

return $this->getStartersCount() === 5;

}

Where These Methods Are Used

The centralized roster counting methods are used consistently across the platform:

  • Dashboard: Quick stats, tier usage, and team validity displays
  • Billing: Subscription quantity calculations
  • Limit Enforcement: Team member addition validation
  • Analytics: Performance tracking and reporting
  • API Endpoints: All roster-related API responses
  • Onboarding: Progress tracking and completion checks
  • Team Management: OP.GG link generation and roster validation

Performance Considerations

  • Efficient Queries: Optimized database queries with eager loading
  • Caching: Roster counts cached for performance
  • Real-time Updates: Immediate count updates
  • Scalability: Handles large roster sizes efficiently

🔄 System Integration

Billing Integration

// Automatic billing updates when roster changes

$teamRosterCount = $team->getRosterCount();

$teamUserCount = $team->users->count();

$subscription->updateQuantity($teamRosterCount > $teamUserCount ? $teamRosterCount : $teamUserCount);

Limit Enforcement

// Prevents exceeding tier limits

if (!$team->canAddRosterMember()) {

throw new TierLimitException::rosterLimitReached([

'current_count' => $team->getRosterCount(),

'max_allowed' => $team->getTierConfig()['max_users'],

]);

}

Dashboard Display

// Real-time roster count display

$rosterSize = $team->getRosterCount();

$maxRosterSize = $team->getTierConfig()['max_roster_size'];

// Team validity check

$startersCount = $team->getStartersCount();

$isTeamValid = $team->hasValidStartingLineup();

// Substitute count

$subsCount = $team->getSubsCount();

❓ Frequently Asked Questions

Q: Why do external players count toward my roster limit?

A: External players use platform resources and features, so they count toward your tier limits to ensure fair usage and billing.

Q: Can I exceed my roster limit temporarily?

A: No, the system enforces hard limits to maintain fair usage across all teams and ensure proper billing.

Q: What happens if I remove a player and add them back?

A: The player will be counted once when added back, maintaining the same counting logic.

Q: How does billing work with mixed rosters?

A: Billing is based on your total roster count, regardless of whether players have user accounts or not.

Q: Can I see who is counted in my roster?

A: Yes, the roster management page shows all players and their status (registered vs external).

Q: Is the counting logic consistent across all features?

A: Yes, all features use the centralized getRosterCount() method, ensuring complete consistency.

Q: How often is the roster count updated?

A: The count updates in real-time whenever roster changes are made, with no delays or caching issues.

Q: What happens if there's a discrepancy in counting?

A: The centralized system prevents discrepancies, but if any issues arise, they're immediately resolved by the single source of truth.


_Next: Managing Player Roles →_

Need help? Check our FAQ

Advertisement