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
Taskandasync/awaitfor 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
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
- Import Package: Drag and drop the addon into your Unity project
- Add Prefab: Place the Player_PPI prefab in your lobby scene
- Server Setup: Upload one PHP file to your web server
- Configure: Adjust settings in the Unity Inspector
- Done! Your players can now inspect profiles
1. Database Setup
- Upload
bl_PlayerProfileAPI.phpto your web server in the same directory as your MFPS PHP files. - The system uses standard MFPS tables plus extended metadata tables which are created automatically.
2. Unity Setup
- Add the Player_PPI prefab to your Lobby scene (or main menu scene).
- Ensure
bl_PlayerProfileManageris initialized (it auto-creates itself if missing, but placing the prefab is safer). - 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
- Smart Caching: Frequently viewed profiles load instantly from cache
- Background Loading: Profile data loads without interrupting gameplay
- Automatic Updates: Profiles refresh automatically when data changes
- Error Handling: Graceful fallbacks ensure the system keeps working
The system follows a modular architecture separating data fetching, caching, and rendering.
Data Flow
- UI Request: A component (e.g.,
bl_ProfileDataRenderer) requests a profile by Nickname or ID. - Manager Check:
bl_PlayerProfileManagerchecks its local cache. - API Call: If not cached, it fetches data via
bl_PlayerProfileAPI.php. - Deserialization: JSON response is parsed into
bl_PlayerProfileData. - Event Broadcast:
OnProfileUpdatedfires, notifying all UI listeners to update.
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.
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:
- Performance Metrics: Accuracy, Damage Dealt/Taken, Performance Rating
- Team Statistics: Detailed team member stats for each match
- Weapon Analytics: Shots fired/hit, weapon usage statistics
- Objective Scoring: Objective-based game mode support
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
}
}
}