User Search System

Comprehensive documentation for the BlinkBox User Search Addon

Introduction

The User Search addon provides a powerful interface for players to find other users by name, view their basic profiles, and send friend requests. It includes a random user discovery feature to encourage social interaction.

Core Capabilities

Setup & Installation

Requirement: This addon relies on ULogin System Pro for database connectivity.

1. Database Setup

  1. Upload bl_UserSearch.php to your web server (same directory as MFPS PHP files).
  2. Upload bl_UserUID.php to the same directory (required for UID management).

2. Unity Setup

  1. Add the User Search UI prefab to your Lobby canvas.
  2. Ensure a bl_UserUIDManager is present in the scene (or use the provided manager prefab).
  3. Configure the settings in Resources/UserSearchSettings.

Architecture

bl_UserSearch

The main controller script attached to the UI panel.

bl_UserSearchUI

Represents a single user entry in the results list.

Key Features

Random User Loading

To keep the community active, the system can load a list of random users when the search panel is opened. This is controlled by the LoadRandomUsersOnStart setting.

// Manually trigger random user refresh
public void RefreshRandomUsers()
{
    if (settings.loadRandomUsersOnStart)
    {
        StartCoroutine(LoadRandomUsersOnStart());
    }
}

Smart Friend Status

The UI automatically detects the relationship status with the searched user:

UID System

The addon includes a robust UID (Unique Identifier) management system via bl_UserUIDManager.

Why UID? While usernames can sometimes change or be similar, UIDs provide a permanent reference for friend requests and database relationships.

bl_UserUIDManager

A singleton that manages the synchronization of UIDs. It can run in "Cron Mode" to batch update user records in the database.

Usage

// Run a manual UID update check
bl_UserUIDManager.Instance.UpdateUIDs();

// Run in Cron Mode (faster timeout, used for automated tasks)
bl_UserUIDManager.Instance.TestCronJob();

Configuration

Settings are managed via the UserSearchSettings ScriptableObject.

Setting Description
PHP Files Names of the PHP scripts (default: bl_UserSearch.php, bl_UserUID.php).
Max Search Results Limit on how many users are returned per query.
Random Users Count How many random users to show on start (default: 10).
Shuffle Users Randomize the order of results locally.
Cache Data Cache results for X seconds to reduce server load.