Commit graph

116 commits

Author SHA1 Message Date
Guyute
9d0d454b4e
feat: Moves logger to a separate assembly for reuse (#2001) 2024-12-30 20:25:34 -08:00
Kamron Batman
60b97f80d8
chore(deps): Bumps xunit to 3.0, serialization generator to 2.12.18, high performance to 8.4, and mailkit to 4.9 (#2032) 2024-12-27 12:56:41 -08:00
Reetus
f33e218c0b
fix: Fix HolidayTree not serializing components (#2024) 2024-12-17 08:59:50 -08:00
Kamron Batman
c75514cc04
feat: Updates to .NET 9 (#1984)
### Summary

* Bumps to .NET 9 with updated dependencies
* Comparing a value type against null is no longer allowed
* CI/CD now uses the version specified in global.json
* Serialization generator updated to .NET 9 with bug fixes, fixes to turkish language, and parallelization
2024-12-08 10:16:34 -08:00
Kamron Batman
4e2fcee7a2
chore(deps): Bumps xunit to 2.9.1 and CommunityToolkit.HighPerformance to 8.3.2 (#1962) 2024-09-25 10:27:37 -07:00
Kamron Batman
4110556e89
chore(deps): Bumps dependencies (#1944) 2024-09-05 21:24:47 -07:00
Kamron Batman
8ec203f387
feat: Updates serialization to use MMF (considerable memory savings) (#1841)
### Summary
Updates the serialization strategy to use `MemoryMappedFile` instead of thick buffers. This has the benefit of being on-par with the current implementation (based on hardware/OS), however won't incur the double-memory issue.

> [!Important]
> **Developer Note**
> The `BinaryFileWriter` and `BinaryFileReader` has been removed in favor of `MemoryMapFileWriter` and `UnmanagedDataReader`
2024-06-23 10:51:20 -07:00
Kamron Batman
f87c8f73ab
fix: Bumps PollGroup to 1.5.1 to fix edge case with sequential struct layout (#1834) 2024-06-16 10:24:41 -07:00
Kamron Batman
5f8f7982eb
fix: Fixes publishing (#1808)
### Summary
- Fixes publishing issues when the Application project was created.
- Fixes missing dotnet clean file deletions
2024-05-31 12:59:59 -07:00
Kamron Batman
60a3a6f501
feat: Splits Server in Core and Application (#1806)
> [!Note]
> **Developer Note**
> Now developers will only need to build/run the Application project instead of everything.
> When adding new projects, make sure to: 
> 1. Add a reference to that project in the Application project.
> 2. Add the dll file to the Distribution/Data/assemblies.json file

### Summary
- Adds an application project
- Consolidates process restarts to use `Core.Kill(true)`
- Removes some old messaging, for example processor optimization
- Fixes missing build cleanup
2024-05-30 23:34:03 -07:00
Kamron Batman
21c5e46565
fix: Fixes libdeflate gc pin issue (#1794) 2024-05-25 18:11:46 -07:00
Kamron Batman
6596046216
fix: Bumps PollGroup to .Net 8 (#1789) 2024-05-22 18:17:20 -07:00
Stefano Merotta
50d3779d9b
fix: Adds dispose call to LibDeflateBinding on process exits (#1784) 2024-05-21 13:40:03 -07:00
Kamron Batman
1f701e7b55
feat: Replaces Zlib with LibDeflate (#1774)
> [!Warning]
> Users on Linux/OSX will need to follow the Readme
> and make sure `libdeflate` is properly installed

> [!Note]
> **Developer Note**
> The API for compression has changed. Use `Deflate.Standard` for the same functionality.

### Summary
* Replaces Zlib with LibDeflate for a 50% performance improvement!
* Adds MacOS 14 to properly test Arm64
2024-05-16 22:53:01 -07:00
Kamron Batman
61e9dd29ac
fix: Adds missing migration files. (#1642)
### Summary

- Bumps serialization generator. v2.10.9 fixes an issue with nuget publishing where files were missing.
- Fixes camps missing serialization of their prisoner.
- Adds missing serialization migration files.
2023-12-20 13:02:01 -08:00
Kamron Batman
b7882df136
fix: Fixes serialization and dirty tracking conveniences (#1627)
### Summary
- Fixes issues with non-_ISerializable_ objects having bad serialization (Skill/Stat. Mods)
- Fixes issues with MarkDirty and namespaces: https://github.com/modernuo/SerializationGenerator/issues/29
- Fixes missing dirty tracking for some data structures.
- Fixes cascading MarkDirty for non-serializable types that have owners that are also non-serializable types.

### New Codegenned API
When a data structure (Array, List, Dictionary, HashSet, etc) is source generated for serialization, new methods are added which will handle dirty tracking. Use these instead of the built in methods for that data structure.

_All Data Structures_
```cs
public void Clear<PropertyName>();
```

_Lists and Sets_
```cs
public void AddTo<PropertyName>(V value);
public void RemoveFrom<PropertyName>(V value);
```

_Lists_
```cs
public void InsertInto<PropertyName>(int index, V value);
public void RemoveFrom<PropertyName>At(int index);
```

_Dictionaries_
```cs
public void AddTo<PropertyName>(T key, V value);
public void RemoveFrom<PropertyName>(T key);
public void ReplaceIn<PropertyName>(T key, V value);
```

Over time, they will be cleaned up and more variants added such as `bool RemoveFrom<PropertyName>(T key, out V value)`
2023-12-03 15:55:31 -08:00
Kamron Batman
e21ff0eb28
fix: Codegens BaseMulti, Container, and VirtualCheck (#1624) 2023-12-02 10:00:02 -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
0da6e46d67
feat: Updates to .NET Standard 2.1 source generators (#1602) 2023-11-19 10:03:28 -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
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
Kamron Batman
3481f60f5b
fix: Updates PollGroup to use the refactored/fixed changes by stefanomerotta (#1499) 2023-09-13 23:58:28 -07:00
Kamron Batman
0d6a77ea74
fix: Bumps PollGroup to fix NPE error (#1497) 2023-09-13 12:51:12 -07:00
Kamron Batman
f4b329f203
fix: Bumps PollGroup to fix arm support (#1496) 2023-09-13 10:26:15 -07:00
Kamron Batman
ffb0b24e1a
fix: Codegens talismans - Fixes memory leak (#1469) 2023-08-23 22:41:48 -07:00
Kamron Batman
455b11de9c
fix: Updates schema generator to 2.6.4 (#1452) 2023-08-11 00:09:56 -07:00
Kamron Batman
09fc30546b
fix: Fixes RunebookEntry serialization and removes unused migrations (#1449)
### Summary

- [X] Removes migration files were committed that aren't actually (and have never) been used.
- [X] Moves runebook entry from being manually serialized to using the serialization generator.
2023-08-10 19:27:01 -07:00
Kamron Batman
d9d04f1f38
fix: Adds better arm64 support (#1409) 2023-07-26 20:43:42 -07:00
Kamron Batman
32c15f214b
feat: Adds GUID support for codegen (#1251) 2022-11-14 21:25:51 -08:00
Kamron Batman
936000ecf7
feat: Adds SerializedCommandProperty (#1249)
## Breaking Change
* Removes `SerializableFieldAttrAttribute` in favor of `SerializedPropertyAttr`.

## Important Change
* Adds `SerializedCommandProperty`

Example:
```cs
    [InvalidateProperties]
    [SerializableField(0)]
    [SerializedCommandProperty(AccessLevel.GameMaster)]
    private Mobile _completedBy;
```
2022-11-14 18:24:33 -08:00
Kamron Batman
810061db8c
chore: Update from .NET 7 preview to release. (#1234) 2022-11-08 09:46:48 -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
8a26afe28b
fix: Fixes regression in primitive UO codegen (#1219) 2022-10-30 01:58:45 -07:00
Kamron Batman
d791feb583
feat: Adds TextDefinition serialization support. (#1217) 2022-10-30 01:42:48 -07:00
Kamron Batman
32a5825ddd
fix: Bumps serialization generator to add CanBeNull support (#1215) 2022-10-29 15:25:33 -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
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
cd5541ec74
fix: Fixes compiling with .NET 7 SDK (#1176) 2022-09-28 21:17:30 -07:00
Kamron Batman
93c2c824dd
feat: Bumps serialization generator (v2.3) to add diagnostics (#1163) 2022-09-06 00:18:15 -07:00
Kamron Batman
89815ad4d3
feat: Updates to Serialization Generator v2.2 (#1157)
* Adds `SerializationProperty` - This will generate the private variable for serialization. Also provides an option `useField` to specify your own. Example:
  ```cs
  [SerializationProperty(0, useField: nameof(_resource)]
  ```
2022-09-04 08:45:27 -07:00
Kamron Batman
8d3aaaeb2a
fix: Removes razor negotiations since they arent maintained (#1090) 2022-06-26 08:33:53 -07:00
Kamron Batman
35689a395b
fix: Fixes codegenning sack of flour (#1076) 2022-06-17 23:29:36 -07:00
Kamron Batman
cf1d037444
fix: Fixes serialization NPE when namespace is missing (#1074) 2022-06-16 22:45:39 -07:00
Kamron Batman
17e33a65d2
fix: Fixes source gen bugs (#1072) 2022-06-16 21:34:11 -07:00
Kamron Batman
800f864335
fix: Updates serialization generator to fix crashing from duplicate fields (#1071) 2022-06-16 09:31:09 -07:00
Kamron Batman
3594e97109
fix: Updates serialization generator (#1062)
Updates the serialization and schema generators to a considerably more optimized version.
2022-06-13 23:28:33 -07:00
Kamron Batman
ff1b7aa994
fix: Updates serialization generator to add serial support (#1047) 2022-06-06 17:32:57 -07:00
Kamron Batman
aeec7f78fd
fix: Fixes issue with wepoll losing GCHandle. (#1039)
- [X] Fixes issue with wepoll losing GCHandle.
- [X] `NetState.Disconnect()` is no longer thread safe.
  - Use `Core.LoopContext.Post()` to post disconnects
- [X] Optimizes PollGroup by not processing IntPtr -> GCHandle for discard polls.
2022-05-30 14:04:54 -07:00
Kamron Batman
e172dc9661
fix: Updates dependencies & adds Fedora 35/36 support (#1029) 2022-05-19 10:51:24 -07:00