Skip to content

Conversation

@OmniTroid
Copy link
Contributor

Replace ~350 lines of repetitive if/elif validation code with a data-driven approach using schema definitions and a helper method.

  • Add _MS_BASE_FIELDS, _MS_26_FIELDS, _MS_28_FIELDS, _MS_DRO_FIELDS as class attributes defining field names and types for each protocol
  • Add _MS_SCHEMAS list to try schemas from most to least complete
  • Add _MS_DEFAULTS dict for optional field default values
  • Add _parse_ms_args() helper that validates against schemas and handles DRO ding normalization and pair_order extraction
  • Simplify net_cmd_ms() to use the new helper

DISCLAIMER: This was refactored by Claude Code. The end goal seems quite bounded and straightforward. Should be tested with the various clients/protocols it supports.

OmniTroid and others added 3 commits January 23, 2026 11:02
Replace ~350 lines of repetitive if/elif validation code with a
data-driven approach using schema definitions and a helper method.

- Add _MS_BASE_FIELDS, _MS_26_FIELDS, _MS_28_FIELDS, _MS_DRO_FIELDS
  as class attributes defining field names and types for each protocol
- Add _MS_SCHEMAS list to try schemas from most to least complete
- Add _MS_DEFAULTS dict for optional field default values
- Add _parse_ms_args() helper that validates against schemas and
  handles DRO ding normalization and pair_order extraction
- Simplify net_cmd_ms() to use the new helper

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@OmniTroid
Copy link
Contributor Author

Separated ms parsing into different file as this is 10x more complex than anything else.

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.

1 participant