Commit graph

1146 commits

Author SHA1 Message Date
Voxpire
3109f59d4d
fix: Updates container searches for non-generic types (#1567) 2023-11-23 09:29:45 -08:00
Kamron Batman
331f24cb71
fix: Fixes TimeSpan rounding issues (#1610)
### Summary

TLDR - .NET Framework rounded TimeSpan (and some DateTime) methods to the nearest millisecond. This was actually _expected_ accidentally for parts of RunUO.

We are aiming to fix this and clean up some other bad assumptions.

Closes #1604
2023-11-22 18:03:56 -08:00
mark1145
98727d13b3
fix: Fixes vendor buy int overflow (#1586) 2023-11-22 14:41:50 -08:00
Kamron Batman
d93e363017
fix: Fixes VS support by reverting source generators back to net standard 2.0 (#1609) 2023-11-21 17:10:13 -08:00
Kamron Batman
d5253c2bae
chore: Cleans up unused imports (#1608) 2023-11-21 12:32:51 -08:00
mdodkins
e680bdb4b5
fix: Adds boolean support for Server.TryParse (#1605) 2023-11-21 12:21:59 -08:00
Kamron Batman
03f850fe03
fix: Fixes sending packets and sidesteps a major issue with stackalloc and PGO in .NET 8 (#1607)
### Summary
- Works around a sneaky edge case bug in the JIT with stackalloc where sometimes the buffer is not zero'd.
- Fixes SendDisplayBoatHS
- Fixes sending health bars in the `SendEverything()` logic.
- Fixes a bug in sizing for some string helper functions.

### Developer Note
We are enabled `SkipLocalsInit` - do not rely on `stackalloc` to be zero'd. To zero the buffer, use `span.Clear();`

Closes #1606
2023-11-21 12:18:20 -08:00
Kamron Batman
79ba1ea917
fix: Fixes tests (#1603) 2023-11-19 10:11:04 -08:00
Kamron Batman
0da6e46d67
feat: Updates to .NET Standard 2.1 source generators (#1602) 2023-11-19 10:03:28 -08:00
Kamron Batman
021ebd0a88
fix: Fixes multi search (#1601) 2023-11-18 12:37:26 -08:00
Kamron Batman
b5c984e5de
fix: Fixes negative random numbers (#1600) 2023-11-18 10:22:40 -08: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
1769d47ba5
fix: Removes Standart XxHash in favor of the built in one (#1598) 2023-11-17 16:11:35 -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
a1dffd10ce
fix: Acquired recipes are now a Set (#1596) 2023-11-17 00:04:46 -08:00
Quick
6f0c33bd10
fix: Fixes serialization on disguise kits (#1595) 2023-11-17 00:04:04 -08:00
Kamron Batman
2e4668dbe5
feat: Updates to .NET 8. (#1542)
### Breaking Changes
- Updating to .NET 8 - Required O/S's have slightly changed.
2023-11-14 17:08:09 -08:00
dependabot[bot]
bd79509400
chore(deps): Bump MailKit from 4.2.0 to 4.3.0 (#1590) 2023-11-13 22:11:41 -08:00
Eric Vintimilla
f71d5bcff1
fix: Fixes missing ethereal horse label (#1585) 2023-11-09 14:16:41 -08:00
dependabot[bot]
1201f04321
chore(deps): Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.8.0 (#1584) 2023-11-08 22:36:06 -08:00
Kamron Batman
c8463e2eaf
fix: Fixes lightning arrow (#1583)
### Summary
- [X] Lightning arrow no longer allows SDI
- [X] Lightning arrow now proc's even without arrows
- [X] Fixed NPE with lightning arrow when a monster is already killed.
2023-11-05 17:36:09 -08:00
Kamron Batman
ca3df9cfa7
fix: Adds multis to map iterators, fixes searching empty nested containers (#1581)
### Summary
Eliminates `IPooledEnumerable<BaseMulti>` and `eable.Free()` from `Map` for multis. This drastically simplifies code that iterates in range, for example:

```cs
foreach (var m in m.GetMultisInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.


### Bug Fixes
- [X] Fixes an issue with searching through nested empty containers.
2023-11-05 08:17:34 -08:00
Kamron Batman
1f04a13f67
fix: Fixes poison field duration, cleans up skill calculations and poison calculations (#1582)
### Summary
- [X] Fixes poison field duration
- [X] Adds SA+ poison spell calculations
- [X] Cleans up skill calculations
- [X] Adjusts poison level thresholds to properly reflect OSI
2023-11-04 12:32:54 -07:00
Kamron Batman
54431f05b5
fix: Fixes memory leak with houses (#1580) 2023-11-03 15:05:08 -07:00
Kamron Batman
977fdc2c5a
fix: Removes GetObjectsInRange and fixes boat planks closing (#1579)
## BREAKING CHANGE

- Deletes `map.GetObjectsInRange` and `map.GetObejctsInBounds`

### Notes

Developers are expected to enumerate mobiles and items separately now using `map.GetMobilesInRange` and `map.GetItemsInRange`. This helps keep the code streamlined so we don't have to maintain multiple copies of ref struct enumerators that do the same thing.


### Fixes

- [X] Fixes bug with planks closing
- [X] Fixes issue with iterating items/mobiles from a null map
2023-11-03 13:45:18 -07:00
dependabot[bot]
cb1638591b
chore(deps): Bump xunit from 2.5.3 to 2.6.1 (#1578)
Bumps [xunit](https://github.com/xunit/xunit) from 2.5.3 to 2.6.1.
- [Commits](https://github.com/xunit/xunit/compare/2.5.3...2.6.1)

---
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>
2023-11-03 10:52:13 -07:00
Kamron Batman
cde59a82f2
fix: Adds GetClients to map iterators (#1574)
### Summary

Eliminates `IPooledEnumerable<NetState>` and `eable.Free()` from `Map` for clients. This drastically simplifies code that iterates in range, for example:

```cs
foreach (var m in m.GetClientsInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
2023-10-30 18:49:00 -07:00
Kamron Batman
469b89370d
fix: Adds back Average CPS to Admin Gump (#1573) 2023-10-30 18:05:32 -07:00
Quick
c32aa39931
fix: Fixes crash on single-core machines (#1572) 2023-10-30 14:44:16 -07:00
Kamron Batman
28c06c1cc0
fix: Changes Map.Sector.Mobiles to link list & Fixes various related crash bugs (#1553)
### Summary

Eliminates `IPooledEnumerable<T>` and `eable.Free()` from `Map` for mobiles. This drastically simplifies code that iterates in range, for example:

```cs
foreach (var m in m.GetMobilesInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.

- [X] Fixed several locations where an NPC that was damaged would cause a server crash.
- [X] Removed an unnecessary allocation in guard fake calls (NPCs calling guards on you)
- [X] Fixes damage precision loss in Poison Strike Spell
- [X] BogThing no longer attempts to "search" for boglings to eat when it is at full health
2023-10-29 22:42:46 -07:00
Kamron Batman
27f0cec1fa
fix: Cleans up Tracking skill and makes it much faster (#1571) 2023-10-29 19:38:59 -07:00
Kamron Batman
8c305261b3
fix: Fixes enabling factions causing NPE (#1569) 2023-10-29 08:32:06 -07: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
658f564f34
fix: Fix the namespace for serialization ext (#1566) 2023-10-25 20:34:11 -07:00
Kamron Batman
e6d30fef0f
fix: Reverts GetAccount to use IAccount. Adds IAccount to serialization. (#1565)
### Summary

- Fixes usernames not being `Intern`ed
- Reverts methods related to getting accounts from returning `Account` to `IAccount`.
- Makes `IAccount` also `ISerializable`
- Adds `IGenericReader.ReadAccount()` and `IGenericWriter.Write(IAccount)` -> The read method supports the original serialization of username, and using `IAccount.Serial`. The write method only serializes the `Serial`.
- Exposes `ReadStringRaw()` to allow some advanced scenarios.
2023-10-25 19:17:57 -07:00
Eric Vintimilla
a4e2226a5c
fix: FlippableAttribute with empty list will crash the client (#1563) 2023-10-23 10:38:47 -07:00
Kamron Batman
4d8e9fc515
fix: Fixes map item iteration when multis are moved (#1562) 2023-10-22 13:22:11 -07:00
mark1145
f6491c0fe5
fix: Fixes mana vampire creating mana from thin air (#1561) 2023-10-22 12:07:14 -07:00
Kamron Batman
68f3e15e5b
fix: Cleans up doors and house placement (#1560) 2023-10-21 14:20:16 -07:00
Kamron Batman
6239b418a8
fix: Fixes process delta calls during death/res (#1559) 2023-10-21 10:39:13 -07:00
Kamron Batman
aaf0fc32fa
fix: Fixes skill gain issue (#1558) 2023-10-21 10:03:50 -07:00
Kamron Batman
74f67487c4
fix: Adds DupeExcludedProperty to Items (#1556) 2023-10-17 20:14:05 -07:00
Eric Vintimilla
85e23d8d83
fix: Fix for witch's apprentice quest - was not "beatable" (#1554) 2023-10-17 07:57:59 -07:00
Kamron Batman
24858f3989
fix: Changes Map.Sector.Items to link list. (#1547)
### Summary

Eliminates `IPooledEnumerable<T>` and `eable.Free()` from `Map` for items. This drastically simplifies code that iterates in range, for example:

```cs
foreach (var item in m.GetItemsInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
2023-10-16 20:51:02 -07:00
dependabot[bot]
1330c4a830
chore(deps): Bump xunit from 2.5.2 to 2.5.3 (#1552)
Bumps [xunit](https://github.com/xunit/xunit) from 2.5.2 to 2.5.3.
- [Commits](https://github.com/xunit/xunit/commits)

---
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>
2023-10-16 20:50:39 -07:00
Kamron Batman
6178f2851a
fix: Fixes item serials (#1551) 2023-10-15 16:58:51 -07:00
Kamron Batman
5b99402666
chore: Cleans up unused imports (#1550) 2023-10-15 11:45:42 -07:00
Kamron Batman
e2f5728258
fix: Fixes null enumerable compile erorr (#1549) 2023-10-15 11:39:00 -07:00
Kamron Batman
d57f1fecc1
fix: Prepares for IPooledEnumerable removal (#1548)
### Summary

- Removes `IPooledEnumerable` (non-generic)
- Changes `IPooledEnumerable<T>` so that  `Free()` is replaced with the `IDisposable` pattern
2023-10-15 11:20:49 -07:00
Kamron Batman
c2d6578955
feat: Adds Next/Prev for future link list support (#1546) 2023-10-14 19:43:10 -07:00