Commit graph

2550 commits

Author SHA1 Message Date
Kamron Batman
becd7aad05
fix: Cleans up FixHtml (#1757) 2024-05-03 21:24:31 -07:00
Bohica
af67c48621
fix: Fixes EvilMage/Lord spawning naked, without hair (#1755) 2024-05-03 18:27:16 -07:00
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
kaczy93
dc118d836f
feat: Cleans up UOP file handling. Adds automatic bounds.bin generation (#1744)
### Summary
* Unifies reading UOP File indexes
* Adds ArtData file reader to get graphic bounds
* Automatically generates Bounds.bin from art file if missing
* Adds [GenBounds command to regenerate the bounds.bin file. Useful for when the art file changes.
2024-05-01 20:02:06 -07:00
Kamron Batman
db0621b884
fix: Fixes NPE with stun attack (#1751) 2024-04-30 19:20:06 -07:00
dependabot[bot]
347ac28ffe
chore(deps): Bump xunit.runner.visualstudio from 2.5.8 to 2.8.0 (#1750)
Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.8 to 2.8.0.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.8...2.8.0)

---
updated-dependencies:
- dependency-name: xunit.runner.visualstudio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:54:12 -07:00
dependabot[bot]
67cb15a193
chore(deps): Bump xunit from 2.7.1 to 2.8.0 (#1749)
Bumps [xunit](https://github.com/xunit/xunit) from 2.7.1 to 2.8.0.
- [Commits](https://github.com/xunit/xunit/compare/2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:41:30 -07:00
Bohica
248af59e62
fix: Update Nails.cs with correct graphic (#1746) 2024-04-28 23:54:04 -07:00
Kamron Batman
d23d92d278
fix: Fixes reading prof.txt (#1745)
### Summary
* Fixes reading the professions file.
2024-04-27 19:10:37 -07:00
Kamron Batman
c4fbc6b88e
fix: Adds text command to throttle. Fixes throttle itself. (#1743) 2024-04-26 17:54:33 -07:00
Kamron Batman
bb7bc57e42
fix: Adds static warning/notice gumps. (#1741)
### Summary
* Adds `StaticNoticeGump<T>` and `StaticWarningGump<T>`
* Converts NoticeGump/WarningGump to use `DynamicGump`
* Changes various uses of notice gump and warning gump to their static counterpart.
2024-04-26 17:19:16 -07:00
Kamron Batman
65532ea887
feat: Adds optimized dynamic/static layout gumps (#1652)
# New Gump API
We are pleased to release a new API that is faster, allocates nearly zero memory, and still feels very similar to the original API. The API is broken into 3 types of gumps, dynamic, static with placeholders, and static without placeholders. 

### Dynamic Gumps
These gumps will inherit `DynamicGump` and are meant for gumps that have a dynamic layout. This includes specifying dynamic arguments to HtmlLocalized entries.

## Static Gumps 
Static gumps are those where the function to the build the layout is called only once and cached forever. They can optionally have placeholders. These placeholders allow the developer to specify the string values later, dynamically in a `BuildStrings` method on the gump. If a gump does not have any placeholders, the string entries will also be cached forever.

## Benchmarks
To make sure we were going in the right direction and not wasting time, we took copious benchmarks. Here are the final benchmarks for a really simple gump. 

Note:
* The majority of creating a gump is compressing the layout and the strings. Compressing each section takes ~6,000ns (12us total).

```cs
| Method                         | Mean         | Error        | StdDev       | Median       | Ratio | RatioSD | Gen0   | Allocated | Alloc Ratio |
|------------------------------- |-------------:|-------------:|-------------:|-------------:|------:|--------:|-------:|----------:|------------:|
| OldGump                        | 13,308.29 ns | 1,059.695 ns | 1,883.608 ns | 14,330.72 ns | 1.000 |    0.00 | 0.1526 |    2400 B |        1.00 |
| DynamicLayoutGump              | 13,357.86 ns |   129.144 ns |   226.185 ns | 13,323.60 ns | 1.029 |    0.17 |      - |      48 B |        0.02 |
| StaticLayoutDynamicStringsGump |  6,653.10 ns |    81.815 ns |   143.292 ns |  6,617.45 ns | 0.514 |    0.09 |      - |      40 B |        0.02 |
| StaticLayoutGump               |     86.33 ns |     0.760 ns |     1.350 ns |     86.07 ns | 0.007 |    0.00 | 0.0020 |      32 B |        0.01 |
```

# Non-Breaking Changes
* All gump components in the core have been moved to `Gumps/Legacy`.
* All legacy gumps will still inherit `Gump`, which now inherits `BaseGump`

# Special Thanks

Thank you to @stefanomerotta for considerable contributions/benchmarking/testing to make this effort a reality! We collectively went through over 10 iterations, but it is finally ready.
2024-04-25 22:40:30 -07:00
Kamron Batman
1c10b6dbed
fix: Adds support for ROS to HashUtility (#1740) 2024-04-25 00:42:10 -07:00
Kamron Batman
9cd84ba3d6
fix: Removes support for v4 Client and old gump packet. (#1739)
### Summary
* Removes old gump packet support
* Removes support for v4 clients
* Removes `Unpack` flag and assumes it is always true.
* Removes StringToBuffer since this is built into .NET now.

> [!Note]
> View the file changes with white space off: https://github.com/modernuo/ModernUO/pull/1739/files?diff=split&w=1
2024-04-24 19:39:37 -07:00
Kamron Batman
98d31bc707
fix: Fixes crafting items with IHasQuality attribute (#1738) 2024-04-23 23:33:29 -07:00
Kamron Batman
7a160bb0fd
fix: Fixes STArray size and tests (#1737) 2024-04-23 16:18:24 -07:00
Kamron Batman
3a27ab8810
fix: Improves STArray and SpanWriter with packets (#1736) 2024-04-21 20:44:25 -07:00
Kamron Batman
44df304575
fix: Archive locally is not an async function (#1735) 2024-04-21 08:08:12 -07:00
dependabot[bot]
72261a6b9c
chore(deps): Bump MailKit from 4.4.0 to 4.5.0 (#1732)
Bumps [MailKit](https://github.com/jstedfast/MailKit) from 4.4.0 to 4.5.0.
- [Changelog](https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/jstedfast/MailKit/compare/4.4.0...4.5.0)

---
updated-dependencies:
- dependency-name: MailKit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 18:31:16 -07:00
Kamron Batman
ada2378e33
fix: Fixes champion drop logic (#1731)
### Summary
- Fixes which maps can drop SoT and PS
- Fixes the percentage chance that SoT/PS can drop
2024-04-14 16:40:09 -07:00
dependabot[bot]
4140209df2
chore(deps): Bump xunit from 2.7.0 to 2.7.1 (#1730)
Bumps [xunit](https://github.com/xunit/xunit) from 2.7.0 to 2.7.1.
- [Commits](https://github.com/xunit/xunit/compare/2.7.0...2.7.1)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 17:33:16 -07:00
dependabot[bot]
cbb25dfe62
chore(deps): Bump xunit.runner.visualstudio from 2.5.7 to 2.5.8 (#1729)
Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.7 to 2.5.8.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.7...2.5.8)

---
updated-dependencies:
- dependency-name: xunit.runner.visualstudio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 16:00:14 -07:00
Kamron Batman
3e3b08e666
fix: Fixes max items serializatio n issue (#1728)
### Summary

Fixes an issue where max items is deserialized as 0 instead of -1. To fix broken containers, run the following in-game:
`[global set maxitems -1 where container maxitems = 0`

In vanilla MUO, there are no containers that actually have max items set to 0.
2024-04-12 14:11:58 -07:00
srosellj
7ec19cf39a
fix: BaseEscortable Destination not returned properly. (#1727) 2024-04-08 09:12:38 -07:00
Kamron Batman
389d154576
Update BaseEscortable.cs (#1726) 2024-04-07 16:05:49 -07:00
Kamron Batman
d115716a60
fix: Fixes missing destinations crashing (#1724) 2024-04-07 15:48:09 -07:00
srosellj
6c07673a37
fix: Change Decorate FindItem range from 0 to 1 (#1725) 2024-04-07 14:56:39 -07:00
srosellj
d6fe50233a
fix: Fix unguarded/termur regions in regions.json (#1723) 2024-04-07 13:30:35 -07:00
Kamron Batman
ac562e67dc
fix: Adds back socket connected event (#1688)
### Summary
Adds back the `SocketConnected` event. This event only fires asynchronously! (TcpServer thread).

Example:
```cs

public static void Configure()
{
    TcpServer.EventSink.SocketConnected += OnSocketConnected;
}

// WARNING: Executed on the TcpServer thread!
private static void OnSocketConnected(TcpServer.SocketConnectedEventArgs args)
{
    if (... logic here...)
    {
        AdminFirewall.Add(((IPEndPoint)Socket.RemoteEndPoint)!.Address);
    }
}
```
2024-04-06 10:26:46 -07:00
Kamron Batman
90fa2e09de
fix: Fixes mount stamina, adds Pub46+ Ethereal stamina (#1716)
### Summary
* Makes mount stamina significantly faster.
* Reduces absolute reset from 24 hours to 4 hours.
* Adds Pub 46+ Ethereal stamina where the stamina is global to all mounts for the player
* Removes serialization of stamina entirely because it's ok if it gets reset during shard restarts.
2024-04-05 21:05:16 -07:00
Kamron Batman
c63bf84ad4
fix: Fixes bad localized messages (#1722)
### Summary
- Apparently affixes and other old packets do not support unicode, so we can't translate them. On OSI they use English for quite a bit.
2024-04-05 20:28:15 -07:00
Kamron Batman
6cb18f87fa
fix: Simplifies create food and localizes. Fixes localization fallback (#1721) 2024-04-05 19:45:42 -07:00
Kamron Batman
912eaab460
fix: Fixes unresponsive console input (#1720)
### Summary
Fixes an issue where the call priority of `Initialize` functions causes a dead lock because the console input handler was not initialized.
2024-04-05 15:07:43 -07:00
Kamron Batman
974062b0d4
feat: Adds leather/metal food, fixes weapons/armors with wrong materials (#1718)
### Summary
- Fixes the name `Vegies` to `Veggies`
- Adds feeding leather to goats
- Adds metal for Lava Lizards
- Fixes Bone Helm being classified as plate instead of bone.
- Fixes wooden shields not classified as wood.

### Note
On OSI, the preferred foods on the animal lore gump doesn't contain all possible favorite food categories. Furthermore, the one listed is not necessarily always the "first" in the list of possible categories. We aren't going to try and fix that since it isn't important.
2024-04-04 19:43:02 -07:00
Kamron Batman
29ea813242
fix: Cleans up code with feeding pets and adds batch coin flips random check (#1717) 2024-04-04 15:09:15 -07:00
Kamron Batman
183f6fa4ac
fix: Fixes stuck connections (#1708) 2024-04-03 08:14:41 -07:00
Kamron Batman
39215935cf
fix: Fixes amount error spam from scissors (#1715) 2024-03-30 09:52:40 -07:00
Kamron Batman
e638fb7893
feat: Adds console commands (#1714)
### Summary
* Adds console command support.
* Adds `save`, `restart`, and `shutdown` commands.
2024-03-30 09:40:43 -07:00
Kamron Batman
855f8c67ae
chore: Adds [AddonGen to commands page on modernuo.com (#1713) 2024-03-28 16:52:00 -07:00
Kamron Batman
1c5813d8f4
feat: Adds [AddonGen (#1712)
### Summary

* Adds Arya's addon generator.
* Updates it for MUO


### ToDos
* Update to use search values when .NET 9 is introduced
* Add ability to codegen basic items from data files (JSON?)
2024-03-28 16:50:27 -07:00
Kamron Batman
1a7e7c7c70
fix: Fixes spawner timer deserialization, decimal deserialization, and adds potion keg reverse lookup (#1711)
### Summary
* Fixes spawner timer deserialization
* Adds a check for a null timer and allows the timer to get recreated
* Adds PotionKeg reverse lookup
* Heavily optimizes decimal serialize/deserialize
2024-03-28 13:34:12 -07:00
Kamron Batman
70575e1517
fix: Fixes weapon and armor quality default value (#1710) 2024-03-28 10:30:42 -07:00
Kamron Batman
f3d1fb82d8
fix: Consolidates commodity interface for reagents. (#1709) 2024-03-21 11:31:14 -07:00
Kamron Batman
3332fabc39
fix: Reverts to RunUO speeds, fixes direction glitching, adds movement speed interpolation (#1695)
> [!IMPORTANT]  
> Please read through these changes, as they changed certain expectations for how the internal AI thinking/movement work.
> Note that some mobs still don't have smooth movement on ClassicUO due to how the client handles animations/movement.

### Summary
- **Important Change**: Mobs will now move at a more regular pace. If the OnThink results in a move, but the cooldown would otherwise prevent the move, then the movement is scheduled on another timer.
- Added a 400ms delay to mobs turning to face a player to attack in order to avoid glitching between moving and turning.
- Reverted AI thinking speeds back to RunUO specific speeds.
- Reverted the AI thinking to moving conversion delays back to RunUO.
- For thinking speeds that are not exactly the predefined speeds from RunUO, there is a new calculation to determine the correct conversion to movement speed. This stops speeds like `0.35` from being faster than `0.3`

> [!NOTE]  
> **Developer Note**
> BaseAI.CheckMove() no longer contains the check for whether or not a mob is on movement cooldown. This function can now be overwritten without causing issues to figuring out that cooldown.
2024-03-18 14:13:41 -07:00
Kamron Batman
9e37879f19
fix: Fixes iterating with multiple multis in a sector (#1706) 2024-03-10 11:35:57 -07:00
Kamron Batman
b5342a82e1
fix: Fixes language casing and adds localization reset command (#1703) 2024-03-09 11:02:56 -08:00
Stefano Merotta
1147a80b34
fix: Fixes missing reader seek for switches in gump response (#1700) 2024-03-09 09:00:32 -08:00
Stefano Merotta
76f132fd49
fix: Make RelayInfo zero allocation (#1699) 2024-03-08 22:58:32 -08:00
Kamron Batman
cfe9e04c78
fix: Optimizes gump relay info (Prep for Static Gumps) (#1698) 2024-03-07 20:54:53 -08:00
dependabot[bot]
50fcee12dc
chore(deps): Bump MailKit from 4.3.0 to 4.4.0 (#1694)
Bumps [MailKit](https://github.com/jstedfast/MailKit) from 4.3.0 to 4.4.0.
- [Changelog](https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/jstedfast/MailKit/compare/4.3.0...4.4.0)

---
updated-dependencies:
- dependency-name: MailKit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 21:10:10 -08:00