Commit graph

2142 commits

Author SHA1 Message Date
Kamron Batman
59dcd24bed
fix: Fixes DeltaQueue recursion, StatMod bug, and memory leak (#1233)
* Fixes recursion with DeltaQueue causing multiple sets of packets to be sent to the client.
* Fixes StatMods that are expired not being checked properly.
* Adds a timer to properly expire/remove stat mods instead of relying on a side-effect.
2022-11-08 09:08:05 -08:00
Kamron Batman
d7d914df6c
fix: Adds ISpanFormattable to Geometry structs (#1231)
* Adds ISpanFormattable to geometry structs and makes ToString() near-zero-allocation.
* Adds IEquatable, and Parsable to Rectangle3D to get it in-line with the other structs.

Closes #1067
2022-11-06 17:37:30 -08:00
Kamron Batman
c75bde55da
fix: Fixes possible NPE in bounce logic (#1232) 2022-11-06 13:55:07 -08:00
Kamron Batman
ab4aaa0fa8
chore: Adds .NET 7 to release workflow (#1230) 2022-11-06 10:04:32 -08:00
Kamron Batman
5bd41d5b68
feat: Adds .NET 7 & Arm64 support (#1229)
## BREAKING CHANGE
**Publishing for linux will no longer include runtimes**

## Major Changes
* Adds .NET 7 support.
* Adds ARM64 support (experimental).
* Changes linux support to be open-ended against anything .NET 7 supports.
* Fixes native library resolutions. (Make sure to install `dev` versions of the libraries)
* Updates README
* Adds Ubuntu 22, CentOS 8/9 Stream to CI/CD.

## TODOs:
* Update modernuo.com docs

Closes #1173
Closes #1159
2022-11-06 09:59:11 -08:00
Kamron Batman
119eec6b61
fix: Fixes serializing strings in GenericPersistence (#1228) 2022-11-04 19:14:50 -07:00
Kamron Batman
448e5bec7b
fix: Fixes multithreading in AllianceInfo serialize (#1227) 2022-11-03 21:00:34 -07:00
Kamron Batman
de39b1036f
fix: Fixes IDE modifying arcane circle migration. (#1226) 2022-11-02 22:20:52 -07:00
Kamron Batman
e47b62c0ae
fix: Fixes serious stacking issue (#1225)
* Fixes a major bug where players can stack items into their backpack infinitely even if they get a message saying they can't.
* Fixes other minor issues and cleans up code.
2022-11-02 22:18:44 -07:00
Kamron Batman
d0ba94aa83
fix: Fixes addons that do not give deeds (#1224) 2022-11-02 19:26:51 -07:00
Kamron Batman
fd6f4239e2
fix: Adds FindItemOnLayer generic (#1223) 2022-11-01 00:49:20 -07:00
mark1145
053dbcbad0
fix: Fixes ignoring mobs, champions, party crash, slayer rarity, boat speedhack, etc (#1222)
* Movie ignore mobiles to Mobile class
* Allow necromancer familiars to ignore mobiles
* ChampionSpawn should not quietly fail when creating new spawn
* Fix client party crash bug: 2 people partied, the leader logs out, other client is hung
* Fix spellbooks creating with magery/meditation only and creating magery multiple times
* Fix BaseRunicTool.GetRandomSlayer() creating more undead slayers than intended
* Do not allow players to dismount each other whilst mounted
* Fix AOS onwards damage increase tooltip and wrong formula in AOS
* Fix monsters killing other monster revenants + animate dead should not attack player pets + other animates
* Fix fire steed having loot pack added twice
* Fix oaks spawn not able to create Unicorns + Kirins via Activator.CreateInstace() due to constructor having name as parametr
* Fix ignoreMobiles flag not propagated to client for non-players.
* Fix harrower tents not leeching from players
* Fix boats speedhacking around the map
* Fix bless, agility etc. not renewing duration
* Fix reveal always worked
* Fix empty constructor for steeds so they don't throw now.
2022-10-31 22:16:50 -07:00
Kamron Batman
910e06767b
fix: Optimizes TextDefinition to eliminate allocations. Removes TextDefinition ctor. (#1221)
### BREAKING CHANGE ###
The constructor for `TextDefinition` has been removed. Instead use `TextDefinition.Of()` or cast the integer/string to TextDefinition.
2022-10-30 16:53:23 -07:00
Kamron Batman
213b7025af
fix: Updates branding of BuyMeACoffee 2022-10-30 02:42:42 -07:00
Kamron Batman
169876fb63
docs: Updates Funding (#1220) 2022-10-30 02:37:35 -07:00
Kamron Batman
8a26afe28b
fix: Fixes regression in primitive UO codegen (#1219) 2022-10-30 01:58:45 -07:00
Kamron Batman
2e78a07cab
fix: Fixes NPE in Champion Titles (#1218) 2022-10-30 01:49:13 -07:00
Kamron Batman
d791feb583
feat: Adds TextDefinition serialization support. (#1217) 2022-10-30 01:42:48 -07:00
Kamron Batman
39e6f62ec9
fix: Codegens more misc items (#1216) 2022-10-29 16:08:23 -07:00
Kamron Batman
32a5825ddd
fix: Bumps serialization generator to add CanBeNull support (#1215) 2022-10-29 15:25:33 -07:00
Kamron Batman
212ce8bc24
fix: Codegens more misc items (#1214) 2022-10-29 00:43:30 -07:00
Kamron Batman
505865e3ed
fix: Codegens misc ML items (#1213) 2022-10-28 20:44:08 -07:00
Kamron Batman
ebbffc3755
fix: Fixes world load not deleting bad objects (#1212) 2022-10-28 16:58:52 -07:00
Kamron Batman
5151ff66b5
fix: Fixes typo in ResetRng command (#1211) 2022-10-27 23:29:51 -07:00
Kamron Batman
49e6c6f2d1
fix: Adds AfterSerialize support. Removes BeforeSerialize support. (#1208)
### Changes
* Implements an AfterSerialize method that is executed synchronously.
* Removes `BeforeSerialize` support since it was dangerous in its current implementation.
* Moves PlayerMobile kill/virtual decay to AfterSerialize.
* Adds kill decay to after Deserialize.
2022-10-27 23:27:22 -07:00
Kamron Batman
deabab575a
fix: Fixes champion titles atrophying immediately (#1210) 2022-10-27 22:15:18 -07:00
Harley Holt
be19d9aae6
fix: Optimizes Point2D by implementing ISpanFormattable (#1203)
Point2D implements a basic TryFormat function. Only a single format is supported: "(X, Y)" where X and Y are base 10 integers.

Uses recent improvements in string interpolation to write the characters to the destination without first allocating memory for boxed arguments or intermediate strings.

This is a partial solution to issue #1067. A similar solution well be implemented in other classes in Geometry if it looks promising.

Benchmarks
---
d6f8dabf3c/Program.cs

Before change:
```
BenchmarkDotNet=v0.13.2, OS=ubuntu 22.04
Intel Core i7-9700K CPU 3.60GHz (Coffee Lake), 1 CPU, 8 logical and 8 physical cores
.NET SDK=6.0.402
  [Host]     : .NET 6.0.10 (6.0.1022.47605), X64 RyuJIT AVX2
  DefaultJob : .NET 6.0.10 (6.0.1022.47605), X64 RyuJIT AVX2


|                           Method |      Mean |    Error |   StdDev |   Gen0 | Allocated |
|--------------------------------- |----------:|---------:|---------:|-------:|----------:|
|                     CallToString |  44.27 ns | 0.068 ns | 0.063 ns | 0.0063 |      40 B |
|               InterpolatedString | 110.64 ns | 0.316 ns | 0.295 ns | 0.0126 |      80 B |
| InterpolatedStringMultiplePoints | 211.36 ns | 0.349 ns | 0.326 ns | 0.0293 |     184 B |
```

After change:
```
BenchmarkDotNet=v0.13.2, OS=ubuntu 22.04
Intel Core i7-9700K CPU 3.60GHz (Coffee Lake), 1 CPU, 8 logical and 8 physical cores
.NET SDK=6.0.402
  [Host]     : .NET 6.0.10 (6.0.1022.47605), X64 RyuJIT AVX2
  DefaultJob : .NET 6.0.10 (6.0.1022.47605), X64 RyuJIT AVX2

|                           Method |      Mean |    Error |   StdDev |   Gen0 | Allocated |
|--------------------------------- |----------:|---------:|---------:|-------:|----------:|
|                     CallToString |  55.13 ns | 0.826 ns | 0.772 ns | 0.0063 |      40 B |
|               InterpolatedString |  55.73 ns | 0.954 ns | 0.892 ns | 0.0063 |      40 B |
| InterpolatedStringMultiplePoints | 105.42 ns | 0.151 ns | 0.134 ns | 0.0101 |      64 B |
```
2022-10-25 12:08:35 -07:00
Kamron Batman
5797c85d75
fix: Handles timers outside of the wheels max capacity of 17yrs (#1204) 2022-10-23 20:29:18 -07:00
Kamron Batman
bae017c45b
fix: Use TryWrite for Serial formatting (#1205) 2022-10-23 18:17:08 -07:00
Kamron Batman
27e8f37294
fix: Bonding is only enabled on LBR+ (#1202) 2022-10-22 21:56:19 -07:00
Kamron Batman
24e2696510
fix: Adds reset RNG command (#1201) 2022-10-22 14:46:23 -07:00
Kamron Batman
28040582bc
fix: Fixes skill mods NPE with Skills (#1200) 2022-10-22 09:56:52 -07:00
Kamron Batman
c711e7ab02
fix: Fixes NPE with resistance mods in Mobile (#1199) 2022-10-22 09:11:56 -07:00
Kamron Batman
f936314326
fix: Removes debug message on timers for attach (#1198) 2022-10-19 21:10:18 -07:00
Kamron Batman
ca3b173c4c
fix: Removes timer error for world in initial state, and removes OPL requirement for spellbooks (#1197) 2022-10-19 02:32:04 -07:00
Kamron Batman
791128f238
fix: Fixes timer orphaning issue (#1196)
* Fixes an edge case where a check to see if a timer was being executed resulted in it not being properly detached on stop. Fixed this by changing how we determine what timer is currently being executed.
* Adds execution count to #DEBUG_TIMERS so shards can get notified (rudimentarily for now) about sequentially executing long chains of timers.

Unfortunately, for now, there is no good option when it comes to executing timers. If we execute let's say 500, and defer the rest, that makes all timers effectively 8ms off until it "catches up". Depending on the shard, that may never happen.
2022-10-18 18:14:26 -07:00
Kamron Batman
919b7e9416
fix: Adds more debugging to the timer system. Simplifies the timer pool. (#1195) 2022-10-17 23:25:49 -07:00
Kamron Batman
d5416b6dec
fix: Fix direction change speed hack (#1194) 2022-10-16 20:17:18 -07:00
Kamron Batman
9b2b34f5fb
fix: Fixes debug say (#1193) 2022-10-16 17:57:14 -07:00
Kamron Batman
5e7dbb53c1
fix: Updates Github Actions & Azure Pipelines (#1192) 2022-10-16 10:10:55 -07:00
Kamron Batman
3396338926
fix: Fixes blocking sockets (#1191) 2022-10-15 22:23:34 -07:00
Kamron Batman
53ebc66a93
fix: Fixes code gen of nested classes (#1190) 2022-10-15 19:58:34 -07:00
Kamron Batman
8479306279
fix: Removes SetTypeRef for generated code. (#1189) 2022-10-15 15:12:49 -07:00
Kamron Batman
ffdc08259f
fix: Adds name support for all mods (#1128) 2022-10-15 10:46:31 -07:00
Kamron Batman
b1cf95f810
fix: Fixes public moongate expansion checks (#1188) 2022-10-14 20:28:16 -07:00
Kamron Batman
e1e30998ba
fix: Adds ReadType/Write(Type) and improves type referencing (#1172)
## Changes
* Improves type hashing by introducing xxHash3 (64bit)
* Removes individual `tdb` files in favor of a single `SerializedTypes.db` file. This file is only used to identify a type that is being deserialized, which doesn't exist.
* Adds duplicate type alias detection
* Adds `AssemblyHandler.FindTypeByHash`

View changed files whitespaces: https://github.com/modernuo/ModernUO/pull/1172/files?diff=split&w=1

## SerializedTypes.db
The serialized types file is used to get back the original name of a type in case it no longer exists in code. This can easily be necessary if a class is renamed in code and no `TypeAlias` is provided.

### Format
byte[4] - version
byte[4] - count
--array--
byte[8] - xxHash
byte[1] - flag, 0 - null, 1 - not null
byte[n] - Full class name in UTF8

### Example
<img width="472" alt="SerializedTypes_Example" src="https://user-images.githubusercontent.com/3953314/195255429-31d24293-6bd1-419e-811b-07874dd0f78d.png">

## Benchmarks
Serialized 500 Type fields. The 8192bytes comes from the _ConcurrentQueue_ that would later be used for SerializedTypes.
Note that the queue is never cleared, so it's size grew considerably.
```cs
|               Method |     Mean |    Error |   StdDev | Allocated |
|--------------------- |---------:|---------:|---------:|----------:|
|      BenchmarkXXHash | 18.44 us | 0.278 us | 0.260 us |    8192 B |
| BenchmarkTypeStrings | 25.09 us | 0.292 us | 0.259 us |         - |
```

TODO:
* Add support in the Serialization Generator for `ReadType()` and `Write(Type)`
* Remove `SetTypeRef` from Serialization Generator
2022-10-11 22:17:22 -07:00
Kamron Batman
f268d5d4e2
fix: Cleans up core code (#1187)
**Only one functional change**
* Fixes a bug in LogFactory where `Warning` is being logged as `Information`

Non-functional changes:
* Updates/Fixes copyright headers
* Removes namespace scopes for core files.

View with [whitespace off](https://github.com/modernuo/ModernUO/pull/1187/files?w=1).
2022-10-10 21:47:08 -07:00
Kamron Batman
0138d40bda
fix: Fixes cast delay issue being 0 (#1186) 2022-10-10 13:30:41 -07:00
Kamron Batman
2806e5d4b7
feat: Adds reflect damage ability. Fixes magical barrier (#1184) 2022-10-08 10:39:28 -07:00
Kamron Batman
3c5e9eaec9
fix: Removes console log for has access (#1183) 2022-10-06 13:53:32 -07:00