Commit graph

2078 commits

Author SHA1 Message Date
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
Kamron Batman
3c636b04fd
feat: Adds magical barrier and ebolt counter ability (#1182)
* Adds magical barrier ability (Pre-UOML)
* Adds ebolt counter (Post-UOML)
2022-10-02 20:48:53 -07:00
Kamron Batman
1cf5d59116
feat: Adds drain life ability (#1181) 2022-10-02 11:36:15 -07:00
Kamron Batman
dc6f75c3b4
feat: Adds stun, death explosion, poison gas, throw hatchet abilities (#1180)
* Adds Colossal Blow
* Adds Death Explosion
* Adds Poison Gas
* Adds AOE Poison Gas (Counter)
* Adds Stun
* Adds Throw Hatchet
2022-10-02 10:16:37 -07:00
Kamron Batman
43e7fe29c2
feat: Adds Monster Abilities (#1179)
* Adds ability to create monster abilities
* Adds Fire/Cold/Chaos Breath
* Adds Grasping Claw
* Adds Summon Skeletons & Summon Undead w/ Polymorph
2022-10-01 21:09:36 -07:00
Kamron Batman
8a2c0ead3d
fix: Fixes cast spell speeds for various expansions (#1178)
* Adds 0.25s for all spells for SA+ Era
* Fixes Summon Creature & Blade Spirits cast delay
* Fixes minimum cast delay for chivalry spells
* Fixes poison strike and wither spells
2022-10-01 12:25:40 -07:00
mark1145
aa270ac868
fix: Abusing summons offscreen (#1175) 2022-09-30 14:54:19 -07:00
Kamron Batman
f5122fff2a
docs: Adds contributors section to readme 2022-09-30 14:49:28 -07:00
Kamron Batman
4946afee51
fix: Fixes loading map and static files (#1177) 2022-09-29 16:02:41 -07:00
Kamron Batman
cd5541ec74
fix: Fixes compiling with .NET 7 SDK (#1176) 2022-09-28 21:17:30 -07:00
mark1145
060edaa76a
fix: Fixes disarm, strangle, curse, summons, looting rights, creatures attacking, and items going to the floor (#1174)
* Fixes disarm
* Fixes strangle not refreshing
* Fixes curse not refreshing
* Fixes 125% bonus to looting rights
* Fixes mobs attacking each other, or not attacking each other
* Fixes items dropping to the floor
* Fixes protection spell
* Fixes cure sending wrong message
2022-09-27 22:19:15 -07:00
Kamron Batman
906ec095b9
fix: Use the latest number for the next serial after world load. (#1171) 2022-09-13 21:25:21 -07:00
Kamron Batman
fe94aa050a
fix: Fixes gauntlet spawner and map item deserialization (#1170) 2022-09-13 18:20:10 -07:00
Kamron Batman
4499c8397d
fix: Fixes pooled ref list resizing (#1169) 2022-09-12 09:06:50 -07:00
Kamron Batman
f31cc275bd
fix: Code gens artifacts (#1168) 2022-09-10 14:40:19 -07:00