Player Profile Inspect

Comprehensive documentation for the BlinkBox Player Profile Inspect Addon

Introduction

Player Profile Inspect (PPI) is an essential Unity addon that transforms how players interact in your multiplayer game. This powerful system creates a rich social experience by allowing players to explore each other's profiles, achievements, and gaming history.

What This Addon Does For You

  • Enhanced Player Engagement: Players spend more time in your game exploring profiles and building connections
  • Competitive Community: Foster healthy competition with visible statistics and rankings
  • Social Features: Easy friend requests, clan invitations, and player interactions
  • Professional Polish: AAA-quality profile system that makes your game stand out
  • Easy Integration: Works seamlessly with your existing MFPS setup

Perfect For These Game Types

  • First-person shooters (FPS)
  • Multiplayer battle arenas
  • Competitive racing games
  • Any multiplayer game with player statistics

Player Profile Inspect (PPI) is a comprehensive system that allows players to view detailed statistics, match history, and customization data of other players. It serves as a central hub for social interaction, statistics tracking, and competitive analysis.

Technical Architecture

Built on a robust client-server architecture with Unity's async/await pattern for optimal performance. The system uses a 5-minute caching mechanism to minimize database load while ensuring data freshness.

Integration Benefits

  • Modular Design: Clean separation of concerns with dedicated manager classes
  • Performance Optimized: Built-in caching and async data loading
  • Extensible: Easy to add custom data fields and UI components
  • Cross-Addon Compatible: Works with Clans, Level Manager, Extended Avatars

Key Features

  • Universal Inspection: Players can view any profile from anywhere in your game - lobby, friend list, rankings, or during matches
  • Lightning-Fast Performance: Smart caching ensures profiles load instantly without lagging your game
  • Rich Statistics Display: Show off player achievements, win rates, and competitive rankings
  • Social Integration: One-click friend requests, clan invitations, and player interactions
  • Character Showcase: Let players display their custom characters, equipment, and achievements new
  • Battle Style Profiles: Highlight each player's unique combat approach and specialties new
  • Privacy Protection: Players control what information others can see new
  • Universal Inspection: Inspect any player from any context (Lobby, Room, Friend List, Rankings).
  • Caching System: Built-in 5-minute cache to minimize database calls and improve performance.
  • Async Data Loading: Uses Task and async/await for non-blocking UI updates.
  • Match History: View detailed results of recent matches (K/D, Score, Win/Loss).
  • Cross-Addon Support: Built-in integration for Clans, Level Manager, and Extended Avatars.
  • Character Customization: View character equipment and customization options. new
  • Battle Styles: Display player's preferred combat styles and tactics. new
  • Privacy Controls: Players can control what information is visible to others. new

Setup & Installation

Quick Setup: Get your Player Profile Inspect system running in just a few simple steps!

What You Get

  • Complete Unity package with all scripts and prefabs
  • PHP API file for server-side integration
  • Ready-to-use UI components and animations
  • Comprehensive documentation and examples

Installation Process

  1. Import Package: Drag and drop the addon into your Unity project
  2. Add Prefab: Place the Player_PPI prefab in your lobby scene
  3. Server Setup: Upload one PHP file to your web server
  4. Configure: Adjust settings in the Unity Inspector
  5. Done! Your players can now inspect profiles
No Coding Required: This addon works out-of-the-box with your existing MFPS setup!
Requirement: This addon relies on ULogin System Pro for database connectivity.

1. Database Setup

  1. Upload bl_PlayerProfileAPI.php to your web server in the same directory as your MFPS PHP files.
  2. The system uses standard MFPS tables plus extended metadata tables which are created automatically.

2. Unity Setup

  1. Add the Player_PPI prefab to your Lobby scene (or main menu scene).
  2. Ensure bl_PlayerProfileManager is initialized (it auto-creates itself if missing, but placing the prefab is safer).
  3. Configure settings in Resources/PlayerProfileSettings.

Architecture

Built with performance and reliability in mind, the Player Profile Inspect system ensures smooth gameplay while providing rich profile data.

How It Works

  1. Smart Caching: Frequently viewed profiles load instantly from cache
  2. Background Loading: Profile data loads without interrupting gameplay
  3. Automatic Updates: Profiles refresh automatically when data changes
  4. Error Handling: Graceful fallbacks ensure the system keeps working
Performance First: The system is designed to handle thousands of concurrent players without impacting game performance.

The system follows a modular architecture separating data fetching, caching, and rendering.

Data Flow

  1. UI Request: A component (e.g., bl_ProfileDataRenderer) requests a profile by Nickname or ID.
  2. Manager Check: bl_PlayerProfileManager checks its local cache.
  3. API Call: If not cached, it fetches data via bl_PlayerProfileAPI.php.
  4. Deserialization: JSON response is parsed into bl_PlayerProfileData.
  5. Event Broadcast: OnProfileUpdated fires, notifying all UI listeners to update.
Logging System: The manager includes a granular logging system. You can toggle specific log categories (Core, UI, Network, etc.) in the Inspector.

Core Components

What Each Component Does

Profile Manager

The brain of the system - handles all profile data requests and ensures smooth performance.

Profile Inspector

The beautiful full-screen profile window that players see when they click on someone's profile.

Profile Cards

Compact profile displays perfect for friend lists, rankings, and lobby screens.

Ready to Use: All components come pre-configured with professional animations and responsive design.

bl_PlayerProfileManager

The singleton brain of the operation. Handles caching (default 300s duration) and API communication.

// Example: Log a custom message using the manager
bl_PlayerProfileManager.Instance.Log("Fetching profile...", ProfileLogCategory.Network);

bl_InspectProfile

The main UI controller for the full-screen profile window. It manages:

  • Basic Info: Name, ID, Bio, Level.
  • Stats: Kills, Deaths, Score, K/D Ratio.
  • Interaction: Add Friend, Join Clan, Copy ID buttons.

bl_ProfileDataRenderer

A versatile component used to display summarized profile data on small cards, friend list items, or popups.

  • DataSource: Can be set to Self, Ranking, FriendList, etc.
  • Auto-Load: Can automatically fetch data when enabled.

Data Structure new

The bl_PlayerProfileData class is the container for all profile info. It is composed of several sub-classes:

Class Contains
bl_PlayerBasicInfo UID, Nickname, Email, JoinDate, Role, IsActive
bl_PlayerStats Kills, Deaths, Score, PlayTime, KDRatio
bl_PlayerSocialData Clan, Friend List, Blocked Users, Pending Requests
bl_PlayerCustomization AvatarID, BannerID, Unlocked Items
bl_MatchHistoryEntry Match ID, Map, Result (Win/Loss), K/D, Score
bl_PlayerProfileData Bio, Battle Styles (1-3), Match Statistics
bl_CharacterCustomizer Character Equipment (Head, Face, Chest, Legs, Foot, Accessories)
bl_PlayerPreferences Privacy settings for profile visibility

Extended Data Fields

The system now supports comprehensive match statistics including:

Integration Guide new

Opening a Profile

To open a player's profile from anywhere in your UI:

// Open by Nickname (Recommended)
bl_UserProfilePopup.OpenProfile("PlayerName123");

// Open by ID
bl_UserProfilePopup.OpenProfile(54);

Accessing Cached Data

You can retrieve data without triggering a UI opening if you just need the stats:

// Async method to get data
var profile = await bl_PlayerProfileManager.Instance.GetProfile("PlayerName");

if(profile != null) {
    Debug.Log($"Player K/D: {profile.Stats.KDRatio}");
}

Accessing Character Customization Data

To access character equipment and customization information:

// Get character customization data
var characterData = profile.CharacterCustomizer;
var currentCharacter = characterData.Characters[characterData.CurrentCharacterID];

// Access equipment slots
var headEquipment = currentCharacter.Head;
var chestEquipment = currentCharacter.Chest;
var legEquipment = currentCharacter.Legs;

// Get avatar and banner IDs
var avatarID = profile.Customization.avatarID;
var bannerID = profile.Customization.bannerID;

Accessing Battle Styles and Bio

To get player's battle styles and bio information:

// Access battle styles
var battleStyle1 = profile.profileData.BattleStyle1;
var battleStyle2 = profile.profileData.BattleStyle2;
var battleStyle3 = profile.profileData.BattleStyle3;
var bio = profile.profileData.Bio;

// Access match statistics
var matchStats = profile.profileData.matchStats;
var winRate = matchStats.winRate;
var avgKills = matchStats.avgKills;
var gameModes = matchStats.gameModesPlayed;

Accessing Detailed Match History

To get comprehensive match data including team stats:

// Access match history
var matchHistory = profile.profileData.matchHistory;
foreach(var match in matchHistory) {
    Debug.Log($"Match: {match.map} - {match.result}");
    Debug.Log($"K/D: {match.kills}/{match.deaths} - Accuracy: {match.accuracy}%");
    
    // Access team and enemy statistics
    var teamStats = match.teamStats;
    var enemyStats = match.enemyStats;
    
    // Get performance metrics
    var damageDealt = match.damageDealt;
    var performanceRating = match.teamStats[0].PerformanceRating;
}

Custom Data Rendering

To create a custom widget that displays player info:

public class MyWidget : MonoBehaviour {
    void OnEnable() {
        bl_PlayerProfileManager.Instance.OnProfileUpdated += UpdateUI;
    }

    void UpdateUI(bl_PlayerProfileData data) {
        if(data.BasicInfo.nickname == "TargetPlayer") {
            // Update your UI elements
        }
    }
}