Skip to content

Conversation

@kirre-bylund
Copy link
Contributor

@kirre-bylund kirre-bylund commented Dec 12, 2025

Features

  • 🎊⚡Introducing Presence⚡🎊 - Our new presence system powers up the LootLocker Unity SDK with websocket support allowing for real time connections between the client and LootLocker. This opens some amazing new avenues such as online status, average play time statistics, detailed player journey reports and much more. Read more in our blog post.
  • LootLocker Latency Statistics - With presence enabled you will also be able to retrieve latency statistics for the clients latency towards LootLocker.
  • LootLocker Events - We've added an event system to the SDK so you can now subscribe to some select events that you may be interested in reacting to. Examples are session expiration and presence connection status changes.

Bug Fixes

  • ListBlockedPlayers now uses the correct endpoint

Full Changelog: v6.6.1...v7.0.0

kirre-bylund and others added 30 commits December 9, 2025 09:03
- Implements ILootLockerService interface for unified service lifecycle
- Provides singleton management with automatic GameObject creation
- Supports both MonoBehaviour and regular class services
- Includes proper initialization order and dependency management
- Handles Unity lifecycle events (pause, focus, quit) coordination
- Thread-safe service registration and access
- Auto-cleanup and DontDestroyOnLoad support
- Implement ILootLockerService interface for lifecycle management
- Add proper service initialization, reset, and cleanup methods
- Maintain all existing rate limiting functionality and constants
- Use UTC time for timezone-independent behavior
- Add null safety checks in Reset() method
- Remove singleton pattern in favor of service management
- Add comprehensive XML documentation for public methods
- Make class public for test inheritance compatibility
…ture

- Implement ILootLockerService interface for HTTP clients
- Cache RateLimiter reference for performance optimization
- Add service dependency validation during initialization
- Update legacy HTTP client for lifecycle manager compatibility
- Remove direct instantiation in favor of service management
- Add proper service reset and cleanup handling
- Ensure thread-safe initialization and cleanup
Core Event System:
- Centralized event system with typed event handlers and weak references
- Comprehensive session lifecycle events (started, refreshed, ended, expired)
- Local session management events (activated, deactivated)
- Thread-safe event subscription/unsubscription with automatic cleanup
- Memory leak prevention through weak reference event storage
- Service integration through ILootLockerService interface

Event Integration:
- LootLockerStateData integration with automatic session event triggers
- Event-driven session activation and deactivation with proper cleanup
- Coordinated event firing for all session state changes
- RuntimeInitializeOnLoadMethod for reliable event subscription setup

Technical Implementation:
- Generic event handlers with compile-time type safety
- Automatic dead reference cleanup to prevent memory leaks
- Service lifecycle integration with LifecycleManager
- UTC timestamp standardization across all events
- Configurable event logging for debugging and monitoring
…ectivity

Presence Client (LootLockerPresenceClient):
- WebSocket client with automatic connection management and reconnection
- Real-time latency tracking and connection statistics
- Battery optimization support for mobile platforms with configurable ping intervals
- Comprehensive connection state management (connecting, authenticated, failed, etc.)
- Thread-safe message processing with Unity main thread synchronization
- Proper resource cleanup and disposal patterns

Presence Manager (LootLockerPresenceManager):
- Centralized management of multiple presence clients per player session
- Automatic event-driven connection/disconnection based on session lifecycle
- ILootLockerService integration with LifecycleManager coordination
- Thread-safe client management with proper locking mechanisms
- Auto-connect functionality for existing sessions on initialization
- Battery optimization with app pause/focus handling for mobile platforms

Configuration and Platform Support:
- LootLockerPresencePlatforms enum with platform-specific enablement
- Project Settings UI for presence configuration and platform selection
- Mobile battery optimization settings with configurable update intervals
- Platform detection utilities and presence enablement checks
- Recommended platform presets (desktop + console, excluding mobile/WebGL)

Technical Implementation:
- WebSocket connection pooling and proper cleanup
- Ping/pong latency measurement with rolling average calculation
- Connection retry logic with exponential backoff
- Event-driven architecture with session lifecycle integration
- Memory-efficient weak reference patterns for event subscriptions
…Manager

SDK Manager Integration:
- Add comprehensive presence API methods (StartPresence, StopPresence, UpdatePresenceStatus, etc.)
- Integrate all authentication flows with event system triggers
- Replace direct LootLockerStateData.SetPlayerData calls with event-driven approach
- Add presence connection management methods with callback support
- Implement presence status and connection state utilities
- Add ResetSDK method with coordinated lifecycle management

Session Authentication Updates:
- All authentication methods now trigger LootLockerEventSystem.TriggerSessionStarted
- Consistent event-driven session management across all platform authentication flows
- Proper player data creation before event triggering for reliable event handling
- Comprehensive coverage of all authentication paths (Guest, Steam, Apple, Google, etc.)

Remote Session Integration:
- Convert RemoteSessionPoller to ILootLockerService architecture
- Lifecycle manager integration with proper service registration/cleanup
- Auto-cleanup functionality when all remote session processes complete
- Thread-safe service management with proper initialization patterns

Technical Implementation:
- Event-driven architecture replacing direct state manipulation
- Centralized session lifecycle coordination through event system
- Presence platform detection and configuration validation
- Comprehensive error handling and user feedback for presence operations
- Service-based architecture for all SDK components
…r integration

Editor Integration Updates:
- LootLockerAdminExtension now uses LootLockerLifecycleManager.ResetInstance() instead of direct HTTP client reset
- Proper service coordination through centralized lifecycle management
- Consistent cleanup patterns across all editor extensions

Configuration and Cleanup:
- Update LootLockerEndPoints.cs for any service integration requirements
- Ensure all SDK components follow the new service architecture patterns
- Maintain backward compatibility while adopting new lifecycle management

Technical Improvements:
- Centralized service reset through lifecycle manager
- Consistent service cleanup patterns across editor and runtime components
- Proper resource management coordination between all SDK systems
@kirre-bylund kirre-bylund merged commit 174f699 into main Dec 16, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants