Gift System New
The Gift System is a powerful social commerce addon for MFPS that allows players to purchase shop items and send them as gifts to other players. It supports friend list integration, user searching, and a complete transaction history.
Key Features
Sending & Receiving
Seamless workflow for selecting items, adding a personalized message, and sending them to friends or specific users.
Transaction History
Complete logs for both sent and received gifts, allowing players to track their generosity and rewards.
Smart Notifications
Real-time notifications when a gift is received. Includes an in-game inbox to claim pending gifts.
User Search
Built-in search functionality to find gift recipients by username or ID, even if they aren't on the friend list.
System Integrations
The Gift System connects deeply with existing MFPS systems:
Shop Integration
Adds a "Send as Gift" button to shop items alongside the standard "Buy" button. It hooks into the purchase flow but redirects the asset to the recipient's inventory upon claiming.
Friend List Integration
Automatically imports the player's friend list into the recipient selector, making it easy to send gifts to squadmates. Online friends are prioritized in the list.
Backend Architecture
The system uses a robust PHP/MySQL backend to ensure secure transactions.
- id (int): Unique Transaction ID
- sender_id (int): User ID of the giver
- recipient_id (int): User ID of the receiver
- product_id (string): The item identifier
- status (int): 0=Pending, 1=Claimed, 2=Expired
- sent_date (timestamp): When the gift was sent
Security Features
- Validation: Server-side verification of currency and item validity.
- Expiration: Gifts can be configured to expire if not claimed within a certain period.
- Anti-Abuse: Rate limiting on gift sending to prevent spam.
Setup & Configuration
To enable the Gift System in your project:
- Import: Import the `BlinkBox/GiftSystem` folder.
- Database: Import the `bl_game_gifts` SQL structure into your database.
- Upload: Upload the PHP scripts from the `PHP` folder to your server's addon directory.
- Manager: Add the `bl_GiftManager` prefab to your main menu scene.
- UI: Instantiate the `GiftUI` prefab and link it to the manager.