Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

Make Unity SDK Fully Configurable through command line

Completed ✅

  • Explore codebase and understand current command line override implementation
  • Extend CheckForSettingOverrides() method to support all configurable properties
  • Add command line parsing for all properties:
    • game_version (string): -gameversion with semver validation
    • clientSideRequestTimeOut (float): -timeout
    • logLevel (enum): -loglevel (accepts: Debug, Verbose, Info, Warning, Error, None)
    • prettifyJson (bool): -prettifyjson
    • obfuscateLogs (bool): -obfuscatelogs
    • logErrorsAsWarnings (bool): -logerrorsaswarnings
    • logInBuilds (bool): -loginbuilds
    • allowTokenRefresh (bool): -allowtokenrefresh
  • Add bounds checking for command line argument safety
  • Add semantic versioning validation for game_version
  • Run security checks (CodeQL - passed with 0 alerts)

Summary

Extended the CheckForSettingOverrides() method in LootLockerConfig.cs to support command line overrides for all user-configurable properties. Previously only apiKey, domainKey, and lootlockerurl were configurable via command line.

New Command Line Arguments

  • -gameversion <value> - Set the game version (must follow X.Y.Z.B semver format)
  • -timeout <value> - Set client-side request timeout in seconds
  • -loglevel <value> - Set log level (Debug/Verbose/Info/Warning/Error/None, case-insensitive)
  • -prettifyjson <true|false> - Enable/disable pretty JSON formatting
  • -obfuscatelogs <true|false> - Enable/disable log obfuscation
  • -logerrorsaswarnings <true|false> - Log errors as warnings
  • -loginbuilds <true|false> - Enable/disable logging in builds
  • -allowtokenrefresh <true|false> - Enable/disable token refresh

Implementation Details

  • Added bounds checking to prevent array out-of-bounds errors
  • Used type-safe parsing methods (TryParse) for float, boolean, and enum conversions
  • Added semantic versioning validation for game_version using regex pattern matching
  • Logs warning if invalid game version format is provided
  • Maintained consistency with existing command line argument pattern
  • All changes are guarded by LOOTLOCKER_COMMANDLINE_SETTINGS compiler directive

Security

  • ✅ CodeQL analysis: 0 alerts
  • Proper input validation with TryParse methods
  • No breaking changes to existing functionality
Original prompt

This section details on the original issue you should resolve

<issue_title>Make Unity SDK Fully Configurable through command line</issue_title>
<issue_description>We have some properties that are configurable through command line today (domain key, api key, and url), but we should make it so that the full set of user configurations available in LootLockerConfig is available to command line overrides.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes lootlocker/sdk-issues#386

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Copilot AI changed the title [WIP] Make Unity SDK fully configurable through command line Extend command line configuration to all LootLockerConfig properties Nov 18, 2025
Copilot AI requested a review from kirre-bylund November 18, 2025 09:06
Copilot finished work on behalf of kirre-bylund November 18, 2025 09:06
Copy link
Contributor

@kirre-bylund kirre-bylund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot, only one remark. Please fix

Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
@kirre-bylund kirre-bylund marked this pull request as ready for review November 18, 2025 09:32
Copilot AI requested a review from kirre-bylund November 18, 2025 09:33
Copilot finished work on behalf of kirre-bylund November 18, 2025 09:33
@kirre-bylund kirre-bylund merged commit e7c6ea5 into dev Nov 18, 2025
83 of 91 checks passed
@kirre-bylund kirre-bylund deleted the copilot/make-unity-sdk-configurable branch November 18, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants