Commit graph

2399 commits

Author SHA1 Message Date
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
Kamron Batman
fbd194339a
feat: Adds ValueLinkList (#1545) 2023-10-14 18:58:36 -07:00
Vitalii Zurian
f9517854d0
feat: Adds configurable skill and stat gain (#1489)
### Summary

- Adds the following configurations:
```json
"stats.statMax": "125",
"stats.gainChanceMultiplier": 1.0,
"stats.primaryStatGainChance": 0.75,
"stats.gainDelay": "00:10:00",
"stats.petGainDelay": "00:05:00",
"stats.usePub45StatGain": "False"
```

- Adds Pub 45 stat gain rate for UOML+.
- Reduces the gain delay for legacy stat gain from 15 minutes to 10 minutes.
- Legacy gain no longer requires a gain in skill to gain in a stat.
2023-10-14 12:02:36 -07:00
dependabot[bot]
29c7d839a7
chore(deps): Bump xunit from 2.5.1 to 2.5.2 (#1543)
Bumps [xunit](https://github.com/xunit/xunit) from 2.5.1 to 2.5.2.
- [Commits](https://github.com/xunit/xunit/compare/2.5.1...2.5.2)

---
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-13 17:07:10 -07:00
dependabot[bot]
b4ee44fe44
chore(deps): Bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 (#1544)
Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.1 to 2.5.3.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.1...2.5.3)

---
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>
2023-10-13 17:06:07 -07:00
Kamron Batman
75c58e2526
fix: Codegens doom items and mobs (#1541) 2023-10-11 23:53:51 -07:00
Kamron Batman
28068c8241
fix: Fixes world save decay (#1540) 2023-10-11 14:04:13 -07:00
Kamron Batman
1ebaf5390d
fix: Fixes span reader ReadString (#1539) 2023-10-11 13:41:24 -07:00
Kamron Batman
0018901a79
fix: Codegens more quest entities (#1538) 2023-10-09 23:58:04 -07:00
Kamron Batman
0086d674e7
fix: Codegens special systems (#1537) 2023-10-09 22:06:09 -07:00
Kamron Batman
e1f22d9694
fix: Adds back missing world state (#1536) 2023-10-09 10:02:39 -07:00
Kamron Batman
10a69bf754
feat: Adds a memory mirrored ring buffer for networking. (#1533)
## Breaking Changes

Incoming packet registration signature has changed to:
```cs
delegate* void OnReceiveCallback(NetState state, SpanReader reader, int packetLength);

IncomingPackets.Register(int packetID, int length, bool ingame, OnReceiveCallback onReceive);
```

For example, an incoming packet handler signature would now look like this:
```cs
public static void SomeIncomingPacket(NetState state, SpanReader reader, int packetLength)
{
    // Parse the data
}
```

## Summary

Updates the network Pipe class to use a mirrored memory technique. This technique involves mapping the same physical memory to two contiguous virtual memory spaces so the byte buffer appears duplicated. This allows writing to a double-sized array to wrap around without the need for the `CircularBuffer` classes.

In practice this allows us to use `Span<byte>` as if the buffer was a regular array.


### Bug Fixes

- [X] Fixes bad fixed length string parsing
2023-10-09 00:57:53 -07:00
Kamron Batman
629a5008c3
fix: Fixes hanging tests (#1535) 2023-10-09 00:22:59 -07:00
Eric Vintimilla
d0d81d0d5f
fix: Fix ConsumeTotal always failing (#1534) 2023-10-06 11:02:59 -07:00
Eric Vintimilla
f4db1e3aad
fix: Fix animal trainer pet list only showing first pet. (#1532) 2023-10-04 11:03:25 -07:00
Kamron Batman
9b87049658
fix: Codegens BulkOrderBooks (#1531) 2023-10-03 20:44:15 -07:00
Kamron Batman
1f0acddc46
fix: Fixes serialization threading, moves world save to end of loop, and eliminates Parallel.ForEach. (#1530) 2023-10-03 00:42:49 -07:00
Kamron Batman
e18115dd94
fix: Fixes extension method refactors causing crash (#1529) 2023-10-02 22:24:16 -07:00
Kamron Batman
f2de2fbb77
fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528)
### Summary
- [X] Fixed a bug where entity persistence was serialized out of order, causing world corruption.
- [X] Fixed LastSerialized not being utilized properly and dangling references still becoming an issue.
- [X] Added a new `GenericEntityPersistence<T>` type to encapsulate `ISerializable` serialization.
- [X] Removing the custom logic and moved Items, Mobiles, Guilds, and Accounts  to GenericEntityPersistence.
- [X] Changed serialization to use the singleton pattern to reduce calling methods from stored variables.
2023-10-01 22:10:47 -07:00
Kamron Batman
e0225c6e59
fix: Adds generic entity persistence support and BOBEntry as entities (#1527)
### Summary
Adds a generic entity persistence. This can be used to create new entity types that have a `Serial`.

Here is an example:

```cs
public class BOBEntries : GenericEntitySerialization<IBOBEntry>
{
    public static void Configure()
    {
        Configure("BOBEntries");
    }
}
```

The annotation tells the system what folder to serialize the entries to. The class/interface (`IBOBEntry`) is the root type that implements `ISerializable`.
2023-10-01 17:38:52 -07:00
Mink80
666b83a3dd
fix: ForceOfNature should damage the target (#1526) 2023-10-01 08:21:28 -07:00
Kamron Batman
d55406337f
fix: Fixes ML Escortables and codegens (#1525)
### Summary
- [X] Adds tot.json to ignore list.
- [X] Fixes bias in escortable random quest selection.
- [X] Adds New Haven specific destination/payment messages for escortable quests.
- [X] Codegens escortables.
2023-09-30 14:11:48 -07:00
Kamron Batman
7d05e3b1cb
fix: Codegens ToT and replaces persistence with config (#1524) 2023-09-30 02:09:28 -07:00
Kamron Batman
5ea5fb43cc
fix: Codegens character statues (#1523) 2023-09-30 01:30:47 -07:00
Kamron Batman
27cd214d58
fix: Codegens ML Quest items (#1522) 2023-09-30 00:46:07 -07:00
Kamron Batman
145c93ccf7
fix: Codegens Khaldun and Doom (#1521) 2023-09-30 00:27:06 -07:00
Kamron Batman
5dc2d09392
fix: Codegens construction items (#1520) 2023-09-29 23:28:51 -07:00
Kamron Batman
972949455b
fix: Changes BaseWeapon to source generator and changes crafter to string (#1519) 2023-09-29 22:45:37 -07:00