Commit graph

54 commits

Author SHA1 Message Date
dependabot[bot]
b4b3af84d4
chore(deps): Bump Serilog from 2.12.0 to 3.0.1 (#1447)
Bumps [Serilog](https://github.com/serilog/serilog) from 2.12.0 to 3.0.1.
- [Release notes](https://github.com/serilog/serilog/releases)
- [Commits](https://github.com/serilog/serilog/compare/v2.12.0...v3.0.1)

---
updated-dependencies:
- dependency-name: Serilog
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 08:51:52 -07:00
Kamron Batman
d9d04f1f38
fix: Adds better arm64 support (#1409) 2023-07-26 20:43:42 -07:00
Kamron Batman
f92d821168
fix: Fixes timezone issue (#1388)
### Summary
Removes the timezone specific logic in favor of globalization non-invariance. This should fix culture issues too.
2023-05-19 16:40:06 -07: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
32a5825ddd
fix: Bumps serialization generator to add CanBeNull support (#1215) 2022-10-29 15:25:33 -07:00
Kamron Batman
8479306279
fix: Removes SetTypeRef for generated code. (#1189) 2022-10-15 15:12:49 -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
5f91598c15
chore: Add generic linux target (#1164) 2022-09-06 10:28:19 -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
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
e172dc9661
fix: Updates dependencies & adds Fedora 35/36 support (#1029) 2022-05-19 10:51:24 -07:00
Kamron Batman
36d07dd34d
fix: Fixes ruleset (#934) 2022-02-17 08:45:08 -08:00
Kamron Batman
48f1fe3384
fix: Moves codegen to its own repo (#918)
- [X] Replace serialization generator with nuget
- [X] Replace schema migration with dotnet bool
- [X] Add ability to run migrations in VS/Rider using a project build
2022-02-12 17:58:42 -08:00
Kamron Batman
6fef622715
fix: Fixes en-us forced pricing culture throwing when bulding in VS (#921)
* fix: Fixes en-us forced pricing culture throwing when bulding in VS

* Fixes value
2022-01-30 14:02:46 -08:00
Kamron Batman
ba378fc5f2
fix: Adds Ubuntu 14 and Linux Mint 17/18/19 support specifically (#908) 2022-01-03 14:19:39 -08:00
Kamron Batman
b3c153eae3
fix: Removes Debian 9 support, Adds Windows 11 (#877) 2021-12-05 00:13:47 -08:00
Kamron Batman
b67d57d806
fix: Adds Debian 11 and fixes Fedora 34 support (#875)
* Adds Debian 11 support
* Fixes Fedora 34 support
* Updates CentOS8 support
2021-12-04 23:40:38 -08:00
Kamron Batman
c8a6d4c696
fix: Fixes .net 6 compilation (#860) 2021-11-21 18:06:39 -08:00
Kamron Batman
78f587f496
fix: Fixes dictionary codegen (#844)
* Fixes code gen with .net 6 by not using .net 6
* Fixes dictionary codegen
* Fixes kvp codegen
2021-11-13 16:18:16 -08:00
Kamron Batman
c31bf20d0e
feat: Updates to .NET 6 (#843)
* Fixes an issue with moving directories across volumes
* Removes usages of WebClient
* Removes usages of Cryptographic Providers

Note: Even though .NET 6 introduces Xoshiro RNG, there is no way to control the seed. I'll do some reconciliation of Xoshiro so it functions closer to the built in one. For the most part, it has parity though.
Benchmarks show there is nothing odd about the implementations, they are within 1ns of each other.
2021-11-13 13:38:01 -08:00
Kamron Batman
bfbe2a6512
fix: Updates professions & new player gargish equipment (#819)
* Now reads Prof.txt to get the professions
* The templated professions are based on profession `TrueName`
* Adds missing starting equipment
* Implements gargish starting equipment
* Consolidates some of the code
* Moves TC stuff to the TC file.
* Fixes some starting equipment that was wrong.

Note:
* Implementing the original T2A professions is possible on the client side, but requires moving the old clilocs to the current clilocs file. In the current file the entries are blank.
* Using the original LBR professions (they match AOS but without necromancy/chivalry) is kind of confusing because the profession indexes are ripped out of the UOTD/UOR ones and have non-sequential indexes. This will probably cause confusion and people will get no templated items when they select the wrong profession.
2021-10-16 10:48:58 -07:00
Kamron Batman
ec785e6f07
fix: Updates dependencies, cleans up csproj, and updates README (#784) 2021-09-15 09:54:15 -07:00
Kamron Batman
bd34e2fb0d
fix(build): Fixes building with VS 2019 16.10+ (#661)
**Note for Rider users** Code generation only works with Rider v2021.1+. For Rider 2021.1.x you must set a global msbuild attribute so that the IDE can recognize generated code after building. JetBrains claims this will be fixed in Rider 2021.2.

**Rider 2021.1 Required Setting for Code Generation**
<img width="945" alt="Screen Shot 2021-07-19 at 9 36 30 PM" src="https://user-images.githubusercontent.com/3953314/126262725-a4d58dd0-e9e0-400f-a172-0b29ef7a00d7.png">

**Note for VS 2019+ users**: Code generation requires completely cleaning your solution, doing a full build, closing VS 2019, and then opening the solution. This is a known issue and there are no plans to fix this multiple restart requirement for VS 2022 at this time.
2021-07-19 21:43:29 -07:00
Kamron Batman
fb915992dd
fix(core): Adds Hashed & Hierarchical Timer Wheel (#655)
- Removes TimerPriority
- Removes TimerThread
- Adds a [Hashed & Hierarchical Timer Wheel](http://www.cs.columbia.edu/~nahum/w6998/papers/ton97-timing-wheels.pdf)
2021-07-11 22:42:06 -07:00
Kamron Batman
9afa4e4cab
feat: Source generated Serialization/Deserialization (#550)
### Features
* Fully abstracts serialization by using compile-time attributes.
* Supports serializing the following:
  - Primitives (integers, strings, etc)
  - IP Addresses
  - BigDecimal
  - DateTime, Delta DateTimes
  - TimeSpan
  - Server.Race
  - Server.Map
  - Point2D, Point3D, Rect2D, Rect3D
  - Existing/New `ISerializable` references
  - Lists/Sets of serializable types
  - Type with a `Serialize` method and constructor that takes an `IGenericReader`
* Supports forward-only migration
* Supports existing RunUO deserialization for older versions by changing to the following signature:
  - `public void OldDeserialize(IGenericReader reader, int version)`
  - Must remove deserializing the version since this is already done
* Supports serializing from private fields or custom made properties.
* Types do not require inheriting Item/Mobile. Code gen will fully create `ISerializable` information.
  - This is not recommended yet, since it requires wiring to `Persistence` which will cause lots of unresolved symbol errors until code gen is built.

### Example
```cs
using System.Collections.Generic;

namespace Server.Items
{
    [Serializable(1)]
    public partial class TestItem1 : Item
    {
        [SerializableField(1)]
        [SerializableFieldAttr("[CommandProperty(AccessLevel.Administrator)]")]
        private List<Item> _someProperty;

        private void Deserialize(IGenericReader reader, int version)
        {
        }
    }
}
```

Generates this:
```cs
namespace Server.Items
{
    public partial class TestItem1
    {
#pragma warning disable 0414
        private const int _version = 1;
#pragma warning restore 0414

        [CommandProperty(AccessLevel.Administrator)]
        public System.Collections.Generic.List<Server.Item> SomeProperty
        {
            get => _someProperty;
            set
            {
                if (value != _someProperty)
                {
                    ((ISerializable)this).MarkDirty();
                    _someProperty = value;
                }
            }
        }

        public TestItem1(Serial serial) : base(serial)
        {
        }

        public override void Serialize(IGenericWriter writer)
        {
            var savePosition = ((Server.ISerializable)this).SavePosition;
            if (savePosition > -1)
            {
                writer.Seek(savePosition, System.IO.SeekOrigin.Begin);
                return;
            }
            writer.WriteEncodedInt(_version);
            writer.Write(_someProperty);
        }

        public override void Deserialize(IGenericReader reader)
        {
            var version = reader.ReadEncodedInt();
            if (version < 1)
            {
                OldDeserialize(reader, version);
                ((Server.ISerializable)this).MarkDirty();
                return;
            }
            SomeProperty = reader.ReadEntityList<Server.Item>();
        }
    }
}
```

And this:
```json
{
  "version": 1,
  "type": "TestItem1",
  "properties": [
    {
      "name": "SomeProperty",
      "type": "System.Collections.Generic.List\u003CServer.Item\u003E",
      "rule": "ListMigrationRule",
      "ruleArguments": [
        "Server.Item",
        "SerializableInterfaceMigrationRule"
      ]
    }
  ]
}
```
2021-05-23 21:06:23 -07:00
Kamron Batman
8418d4a7db
fix(builds): Adds Fedora for build testing (#605)
- [X] Removes CentOS 8 docker image
- [X] Adds Fedora 32/33
2021-05-16 01:14:09 -07:00
Kamron Batman
4e9d656809
fix(core): Adds Fedora 32/33 & RHEL 7/8 support. (#601)
- [X] Adds support for Fedora 32/33 (runtimes included)
- [X] Adds support for RHEL 7/8 (will require manual install of zlib and argon2)
- [X] Updates dependencies
2021-05-14 00:32:22 -07:00
Kamron Batman
ec1cc10821
fix(network): Converts House Design Detailed Packet (#538)
- [X] Converts design state detailed packet
- [X] Removes `Packet` class
- [X] Removes `Send(Packet)` function signatures
- [X] Removes `PacketWriter` class
- [X] Updates dependencies.
2021-03-03 02:09:15 -08:00
Kamron Batman
f147cb119f
fix: Reverts GitVersioning (#435) 2021-01-29 01:42:37 -08:00
Kamron Batman
3d7c4583a8
fix(build): Adds MUO Constant (#412)
- [X] Adds an MUO solution constant for 3rd party drop-ins.
2021-01-16 15:03:08 -08:00
Kamron Batman
bae568d856
fix(git): Fixes git versioning (#408) 2021-01-13 20:52:09 -08:00
Kamron Batman
582e1877b8
feat(core): Makes spanwriter resizable (#376)
SpanWriter now has an argument that allows it to be resizable.
```cs
public SpanWriter(Span<byte> initialBuffer, bool resize = false)
public SpanWriter(int initialCapacity, bool resize = false)
```

If a SpanWriter is set to be resizable, or given an initial capacity instead of a buffer, it must be disposed:
```cs
public static void SomeMethod()
{
    using var writer = new SpanWriter(stackalloc byte[512], true);
    // stuff
    
    // Automatic Dispose of writer
}
```

This is because the SpanWriter uses `ArrayPool<byte>.Shared` _rented buffers_ to resize. If the writer is not disposed, those buffers will never be reused resulting in a _memory leak_.

It is possible that the SpanWriter will outright ditch the initial buffer if resize is set to true and growing is needed. To check/account for that we can do the following:

```cs
public static void SomeMethod()
{
    Span<byte> span = stackalloc byte[512];
    using var writer = new SpanWriter(span, true);
    // write some stuff that causes the span to grow
    
    span = writer.RawBuffer;
    // Do stuff with the span
}
```

Make sure you don't accidentally `Dispose()` the writer or use the `RawBuffer` outside of the `using` block. If you do, bad things will happen! (NullPointerException, or a fresh SpanWriter with no buffer, depending on the situation).

SpanWriter can also now be used with a fixed statement since it has a `PinnableReference()` function.
2020-12-31 19:57:02 -08:00
Kamron Batman
03d0a4664e
fix(core): Adds SkipLocalsInitAttribute support, optimizes broadcasted packets (#363)
- [X] Adds support for `SkipLocalsInitAttribute`. SkipLocalsInitAttribute skips initializing stack variables including `stackalloc`. I don't think it is wired/working yet but should be implemented soon.
- [X] Optimizes broadcasted packets by checking if the first byte (packet ID) is non-zero. If it is already set, it reuses the buffer.
- [X] Removes unnecessary refs to Spans. I don't think the Span struct itself is mutable, so a ref is not helpful.
2020-12-26 12:46:06 -08:00
Kamron Batman
10a6e17640
fix(core): Converts mobile moving packet (#357)
- [X] Converts mobile moving packet
2020-12-24 17:13:55 -08:00
Kamron Batman
b6cd408623
Updates Message Packets (#321)
### API Breaking Change
Combined `AsciiMessage` and `UnicodeMessage` into a single function that takes two arguments, `bool ascii` and `string lang`. Lang can be null (or anything) if ascii is true. 

- [X] Changes message packets
- [X] Cleans up some code
- [X] Uses benchmarks to determine if the spanwriter + copyfrom
2020-11-20 21:50:13 -08:00
Kamron Batman
00beaf8e6e
Fixes NBGV & Adds Big Sur to CI/CD (#317) 2020-11-17 13:02:51 -08:00
Kamron Batman
525cda5413
Cleanup & Fixes for .NET 5 (#309)
- [X] Fixes several bugs
- [X] Updates more ordinal issues
- [X] Cleans up the code a bit
- [X] Turns classes static that should have been
- [X] Changes TcpServer.Instances to a HashSet

Bumps release version
2020-11-15 10:03:50 -08:00
Kamron Batman
1c9439e4fd
Drop .NET Core 3.1 (#307)
- [X] Updates Zlib Bindings
- [X] Updates Argon2 Bindings
- [X] Drops .NET Core 3.1 support
- [X] Updates CI/CD

Bumps release version
Updates documentation
2020-11-10 20:28:05 -08:00
Kamron Batman
013f333898
Adds official .NET 5 support (#300) 2020-11-07 13:26:27 -08:00
Kamron Batman
4e799ddbd7
Adds back in old benchmarks. Cleans up tests. (#270) 2020-10-04 11:45:07 -07:00
Kamron Batman
23b8dff68c
Fixes more line ending issues (#267) 2020-09-27 13:54:56 -07:00
Kamron Batman
bbdb561de8
Fixes leaking tests (#231) 2020-09-06 14:16:57 -07:00
Kamron Batman
6df1098e06
Fixes building with VS2019 (#230)
Fixes building with VS2019. Now use F6 to build, then F5 to debug.

bumps release
2020-09-06 13:58:58 -07:00
Kamron Batman
192cf70d20
Adds gitversioning for releases (#209) 2020-09-02 17:50:57 -07:00
Kamron Batman
40f88d98e4
Release Version 0.6.1 (#205) 2020-08-30 23:15:47 -07:00
Kamron Batman
259fdb5ae8
Remove .NET 5 From Targeted Frameworks (#202) 2020-08-28 10:24:15 -07:00
Kamron Batman
1f651992d7
Updates formatting rules (#199) 2020-08-25 18:00:51 -07:00
Kamron Batman
bc2487946c
Adds .NET 5 & Ubuntu 20 LTS Targeting (#193) 2020-08-15 14:48:06 -07:00
Kamron Batman
997691fbb7
Adds specific linux operating system support (#169) 2020-07-02 17:35:46 -07:00