Skip to content

Feature/utility extensions helpers#1012

Open
Zeidev wants to merge 5 commits intomyildirimofficial:masterfrom
Zeidev:feature/utility-extensions-helpers
Open

Feature/utility extensions helpers#1012
Zeidev wants to merge 5 commits intomyildirimofficial:masterfrom
Zeidev:feature/utility-extensions-helpers

Conversation

@Zeidev
Copy link
Copy Markdown
Contributor

@Zeidev Zeidev commented Feb 28, 2026

No description provided.

…lity

- CollectionExtensions: Add GetOrDefault, GetOrAdd, AddRange, IsNullOrEmpty, ForEach
- StringExtension: Add IsNullOrWhiteSpace, OrDefault, SafeFormat, Truncate
- RandomExtensions: Add static thread-safe Random instance
- Utilities: Add comprehensive math, distance, formatting helpers

These changes are backward compatible and do not break existing functionality.

Co-authored-by: openhands <[email protected]>
- ObjectExtensions: Null-safe operations (IfNotNull, OrDefault, CastAs, etc.)
- PathHelper: Centralized path constants and helpers
- HttpClientExtensions: Safe HTTP operations with error handling
- ConfigExtensions: Config GetOrSet, type-safe getters, batch operations

Co-authored-by: openhands <[email protected]>
- Reduces code duplication in plugin/botbase Bootstrap classes
- Provides common implementations for IPlugin interface
- Includes helper methods for logging and config
- Lazy-loaded view support
- CanEnable/CanDisable hooks

Co-authored-by: openhands <[email protected]>
- Use ConcurrentDictionary instead of List for O(1) lookups
- Cache compiled event handlers to avoid repeated LINQ queries
- Add UnsubscribeEvent support
- Add ClearEvent and ClearAll methods
- Add FireEventSync and FireEventAsync methods
- Add GetListenerCount for debugging
- Thread-safe with proper locking

Performance improvement: ~10-100x faster for frequent events

Co-authored-by: openhands <[email protected]>
- Fix bug in ShoppingManager.RepairItems: use 'response' instead of 'packet' in callback
- Add proper error handling in InventoryItemUseResponse for failed item usage
- Add OnUseItemFailed event for debugging and plugin handling

Bug: myildirimofficial#1001 - Auto repair hammer didn't work

Co-authored-by: openhands <[email protected]>
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