This document outlines how the DropTracker application processes incoming submissions for drops, collection logs, combat achievements, and personal bests.
The submission system processes four main types of data:
- Drops - Loot drops from NPCs/bosses
- Collection Logs - Collection log item completions
- Combat Achievements - Combat achievement task completions
- Personal Bests - Boss kill time records
All submissions require authentication through the check_auth() function:
Parameters:
player_name(String) - In-game character nameaccount_hash(String) - Unique account verification hash
Return Values:
(True, True)- Player exists and hash matches (authenticated)(True, False)- Player exists but hash doesn't match (failed auth)(False, False)- Player doesn't exist
Authentication Flow:
- Query player by name
- If player doesn't exist, return
(False, False) - If player exists but no account_hash stored, update with provided hash
- If hash exists and matches, return
(True, True) - If hash exists but doesn't match, return
(True, False)
If a player doesn't exist, the system attempts to create them via create_player():
Process:
- Validate account_hash (minimum 5 characters)
- Query WiseOldMan API for player data
- Check if player already exists by WOM ID or account hash
- Handle name changes if player exists with different name
- Create new player record with WOM data
- Generate notifications for new player creation
{
"source": "NPC name", // or "npc_name"
"value": 1000000, // GP value per item
"item_id": 12345, // or "id"
"item_name": "Item name", // or "item"
"quantity": 1, // Number of items
"player_name": "Player", // or "player"
"acc_hash": "hash_string", // Account verification hash
"kill_count": 100, // Optional kill count
"image_url": "url", // Optional image URL
"attachment_url": "url", // Optional attachment URL
"attachment_type": "image/png", // Optional attachment type
"downloaded": false // Whether image is pre-downloaded
}-
Validation & Authentication
- Validate player authentication
- Verify item exists in database (create if missing)
- Verify NPC exists in database (create if missing)
-
Value Verification
- For drops over 1M GP, verify item can drop from specified NPC
- Prevents fake submissions of valuable items
-
Database Operations
- Create Drop record
- Update player Redis cache
- Handle image download/processing
-
Notification Processing
- Get player's groups
- Check each group's minimum notification value
- Create notifications for qualifying drops
- Handle direct message preferences
- Each group has a
minimum_value_to_notifyconfiguration - Default threshold: 2,500,000 GP
- Only drops meeting/exceeding threshold generate notifications
{
"player_name": "Player", // or "player"
"acc_hash": "hash_string", // Account verification hash
"item_name": "Item name", // or "item"
"source": "NPC name", // Source of the item
"reported_slots": 500, // Total collection log slots
"kc": 100, // Optional kill count
"attachment_url": "url", // Optional attachment URL
"attachment_type": "image/png", // Optional attachment type
"downloaded": false, // Whether image is pre-downloaded
"image_url": "url" // Optional direct image URL
}-
Validation
- Authenticate player
- Validate item exists (create if missing)
- Validate NPC exists (create if missing)
-
Duplicate Check
- Query for existing collection log entry
- Only process if item not already logged
-
Database Operations
- Create CollectionLogEntry record
- Process image if provided
- Commit transaction
-
Notification Processing
- Check if groups have
notify_clogsenabled - Create notifications for enabled groups
- Handle DM preferences
- Check if groups have
{
"player_name": "Player", // Player name
"acc_hash": "hash_string", // Account verification hash
"points": 5, // Points awarded for task
"total_points": 500, // Total CA points
"completed": "Hard", // Completed tier
"task": "Task name", // Task name
"tier": "hard", // Task tier
"attachment_url": "url", // Optional attachment URL
"attachment_type": "image/png", // Optional attachment type
"downloaded": false, // Whether image is pre-downloaded
"image_url": "url" // Optional direct image URL
}-
Validation
- Authenticate player
- Check for duplicate task completion
-
Database Operations
- Create CombatAchievementEntry if new
- Process image if provided
-
Notification Processing
- Check if groups have
notify_casenabled - Verify task tier meets minimum notification tier
- Create notifications for qualifying achievements
- Check if groups have
Tiers in order: easy → medium → hard → elite → master → grandmaster
Groups can set minimum tier for notifications via min_ca_tier_to_notify config.
{
"player_name": "Player", // Player name
"acc_hash": "hash_string", // Account verification hash
"npc_name": "Boss name", // or "boss_name"
"current_time_ms": 120000, // Current kill time in milliseconds
"personal_best_ms": 150000, // Previous PB in milliseconds
"team_size": "Solo", // Team size (Solo, 2-5, etc.)
"is_new_pb": true, // Whether this is a new PB
"attachment_url": "url", // Optional attachment URL
"attachment_type": "image/png", // Optional attachment type
"downloaded": false, // Whether image is pre-downloaded
"image_url": "url" // Optional direct image URL
}-
Validation
- Authenticate player
- Validate NPC exists
- Determine actual time used
-
Database Operations
- Query existing PB for player/NPC/team size
- Update existing or create new PB record
- Process image if new PB
-
Notification Processing
- Only process if
is_new_pbis true - Check if groups have
notify_pbsenabled - Create notifications for new personal bests
- Only process if
drop- Drop notificationsclog- Collection log notificationsca- Combat achievement notificationspb- Personal best notificationsdm_drop- Direct message drop notificationsdm_clog- Direct message collection log notificationsdm_ca- Direct message CA notificationsdm_pb- Direct message PB notificationsnew_player- New player creationname_change- Player name changenew_npc- New NPC discoverednew_item- New item discovered
Notifications are queued in the notification_queue table with:
- Duplicate prevention via SHA256 hashing
- Group-specific notification tracking
- JSON data storage for notification details
Users can configure DM preferences via UserConfiguration:
dm_drops- Receive drop DMsdm_clogs- Receive collection log DMsdm_cas- Receive combat achievement DMsdm_pbs- Receive personal best DMsdm_account_changes- Receive account change notifications
- Images can be provided via
attachment_urlor directimage_url - System downloads and processes images via
download_player_image() - Supports various file types based on
attachment_type - Images are stored with structured naming:
{type}_{player_id}_{name}_{timestamp}
- Drop images:
drop_{player_id}_{item_name}_{timestamp} - Collection log:
clog_{player_id}_{item_name}_{timestamp} - Combat achievement:
ca_{player_id}_{task_name}_{timestamp} - Personal best:
pb_{player_id}_{boss_name}_{timestamp}
minimum_value_to_notify- Minimum GP value for drop notifications (default: 2,500,000)notify_clogs- Enable collection log notifications (true/false)notify_cas- Enable combat achievement notifications (true/false)notify_pbs- Enable personal best notifications (true/false)min_ca_tier_to_notify- Minimum CA tier for notificationsauthed_users- JSON array of authorized Discord user IDs
- Player validation via WOM API
- Fetches player stats and collection log data
- Handles name changes and account updates
- Creates forum entries for significant submissions
- Tracks submissions across web platform
- Caches player totals and leaderboard data
- Updates player statistics in real-time
- Stores temporary notification tracking
- Invalid Authentication - Player exists but hash doesn't match
- Missing Items/NPCs - Items or NPCs not in database
- Duplicate Submissions - Already processed submissions
- Image Processing Failures - Failed image downloads
- Database Conflicts - Transaction rollback scenarios
- Account hash minimum length (5 characters)
- Item/NPC existence verification
- Drop value vs NPC source validation (for high-value drops)
- Duplicate prevention at notification level
- Player list caching (
player_listdictionary) - NPC list caching (
npc_listdictionary) - Redis for real-time statistics
- Notification deduplication
- Image processing optimization
- Database transaction management
- Support for external session injection
- Proper transaction handling and rollback
- Connection pooling for database operations