Commit graph

11 commits

Author SHA1 Message Date
Kamron Batman
4ea1d79cad
fix: Removes broken OrderedHashSet and adds a simple OrderedSet (#1756)
> [!CAUTION]
> **BREAKING CHANGE**
> Removed `OrderdHashSet` and `PooledOrderedHashSet` due to bugs.

> [!NOTE]
> **Developer Note**
> The OrderedSet is not a full data structure. It is not particularly efficient. Pull Requests are welcome for a better implementation, especially if it ends up supporting `ISet<T>` and `IReadOnlySet<T>`

## Summary

The ordered hash set was buggy. It's kind of painful to implement, so for now, I added a simple `OrderedSet` to suffice for gumps. Please reach out if this causes disruption!
2024-05-03 18:03:26 -07:00
Kamron Batman
dba3ec2db5
fix: Use built-in RNG (#1599)
### Summary

.NET 8 supports Xoroshiro 256** off the shelf and added Shuffle. Switching to that implementation.

### Developer Notes

* Removed many convenience methods that weren't used.
2023-11-17 17:45:18 -08:00
Kamron Batman
e9642d61f1
fix: Removes custom BitArray (#1597)
### Summary

The BitArray class will be optimized over the next several years for various platforms/hardware and maintaining a duplicate for serialization is not practical. Removing the custom implementation. Recommend against using BitArray for serialization unless it is absolutely necessary.
2023-11-17 14:37:07 -08:00
Kamron Batman
d919f71149
fix: Fixes map iterators for Items (#1564)
### Summary

Modifying a ValueLinkList using one of the methods will bump the "version". This field is used by iterators (foreach loops) to determine if the link list was modified while iterating. The sector.Items (and in the future other lists), will no longer be safe to modify while iterating. The server will _CRASH_ if the ValueLinkList is modified.

Thanks to @stefanomerotta for help!


### Screenshots
<img width="588" alt="image" src="https://github.com/modernuo/ModernUO/assets/3953314/83ee0b6e-ff4f-4768-9e29-84456e04b1ec">
2023-10-26 17:49:15 -07:00
Kamron Batman
fbd194339a
feat: Adds ValueLinkList (#1545) 2023-10-14 18:58:36 -07:00
Kamron Batman
35b7c35167
fix: Fixes tests to use C# 11 syntax (#1462) 2023-08-17 00:58:44 -07:00
Kamron Batman
bde5357f89
fix: Removes Moq due to privacy concerns (#1445)
Due to privacy/security concerns, Moq has been removed.

See: https://github.com/moq/moq/issues/1372
2023-08-09 08:12:45 -07:00
Kamron Batman
6b3617b08f
fix: Fixes BitArray serialization (#1027)
Fixes bit array serialization. This may cause objects that were serialized by bit array to fail to deserialize. I am sorry, please accept my condolences. It is probably easiest to just delete those objects. If it becomes a major problem, contact me and I'll help with a hacky per-case solution.
2022-05-18 17:25:03 -07:00
Kamron Batman
23532db603
fix: Cleans up LINQ calls. (#965)
- [X] Removes several `ToList()` uses with `PooledRefQueue`
- [X] Adds a `PeekRandom` to PooledRefQueue
- [X] Updates EV/BS so they dispel each other in a more efficient manner.
- [X] Fixes Firebomb so it works like a normal firefield.
- [X] Fixes field spells so they aren't unnecessarily using a Point3D ref more than necessary.
- [X] Removes extra allocation in campfire by using reverse loop.
- [X] Removes other LINQ calls that aren't needed.
2022-03-20 19:20:54 -07:00
Kamron Batman
995149ad01
fix(core): Adds ability to store null value in ordered hash set (#447)
- [X] Adds the ability to store a null value in an ordered hash set

TODO:
Optimized the OrderedHashSet. See this:
* https://github.com/dotnet/runtime/issues/10050
Looks like the OrderedDictionary that I based this structure from was not updated.
See the source for diffing:
https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs

Difference between a HashSet and an OrderedHashSet is updating the indexes of the entries after fixing the chain to preserve insertion order.
2021-02-03 17:57:03 -08:00
Kamron Batman
3b413371dc
fix(core): Adds Gump component functionality (#377)
- [X] Adds gump close packet
- [X] Fixes gump tooltip
- [X] Adds new compile/append functions for the new gump packets
2021-01-02 19:08:35 -08:00