Commit graph

58 commits

Author SHA1 Message Date
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
151eef470f
update(release): Updates .NET 5 version in workflows (#569) 2021-04-10 21:49:44 -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
af021f748a
fix(workflow): Updates workflow for docs (#528) 2021-02-27 20:14:19 -08:00
Kamron Batman
6a80dfea00
fix(workflow): Fixes wrong branch (#505) 2021-02-09 10:32:39 -08:00
Kamron Batman
517190b820
fix(workflows): Deletes sonar cloud (#504) 2021-02-09 10:23:13 -08:00
Kamron Batman
d61f07abd5
fix(releases): Uses an access token for checkout (#501) 2021-02-08 16:33:50 -08:00
Kamron Batman
f1065b119d
fix(releases): Fixes broken merge (#500) 2021-02-08 16:24:32 -08:00
Kamron Batman
0895d43624
fix(releases): Adds git credentials (#499) 2021-02-08 16:21:03 -08:00
Kamron Batman
47dd962725
fix(releases): More cleanup (#498) 2021-02-08 15:54:48 -08:00
Kamron Batman
f107c96065
fix(releases): Add missing token for fake release tag (#497) 2021-02-08 15:51:58 -08:00
Kamron Batman
4bf8447530
fix(core): Fixes release token use (#496) 2021-02-08 15:37:00 -08:00
Kamron Batman
db76c941e6
fix(releases): Do not update tags remotely (#495) 2021-02-08 15:29:00 -08:00
Kamron Batman
ecf5a4f048
fix(release): Fixes error in syntax (#494) 2021-02-08 13:54:16 -08:00
Kamron Batman
e7f01c1326
fix(releases): Fix create release and remove old tag (#493) 2021-02-08 13:51:42 -08:00
Kamron Batman
6753822cd9
fix(releases): Adds fake release message (#492) 2021-02-08 13:43:39 -08:00
Kamron Batman
f43b1e1d4e
fix(releases): Fixes fake tag failing (#491) 2021-02-08 13:41:13 -08:00
Kamron Batman
b9cb85855b
fix(releases): Fixes release deletion (#488) 2021-02-08 00:55:06 -08:00
Kamron Batman
17d8620cd1
fix(releases): Removes .NET 5 from releases workflow and fixes checkout tags (#487) 2021-02-08 00:51:43 -08:00
Kamron Batman
1cdd70ed46
fix(releases): Attempts to fix release tags (#486) 2021-02-08 00:45:17 -08:00
Kamron Batman
da00aef735
fix(releases): Fixes version detection (#485) 2021-02-07 23:50:07 -08:00
Kamron Batman
e75f92879f
fix(releases): Fixes version tagging (#484) 2021-02-07 23:44:29 -08:00
Kamron Batman
30dff3959a
fix(releases): Fixes release count (#483) 2021-02-07 23:35:38 -08:00
Kamron Batman
1736469ac0
fix(releases): Updates release flow. Fixes windows builds (#482) 2021-02-07 23:30:11 -08:00
Kamron Batman
1ed4a797a0
fix(release): Updates release flow (#481) 2021-02-07 22:37:29 -08:00
Kamron Batman
7c7490d3b4
fix(releases): Updates releases (#478)
- [X] Updates the workflows
- [X] Removes automatic releases.

Notes: We may need multiple release updates to get this right.
2021-02-07 09:09:50 -08:00
Kamron Batman
75c1b32513
fix(core): NPE in Cycles per second (#331)
- [X] Fixes an edge case where the cycle index goes negative and crashes
- [X] Fixes average CPS calculation
- [X] Fixes issue with logout delay
- [X] Bumps release version
2020-11-30 23:12:16 -08:00
Kamron Batman
00beaf8e6e
Fixes NBGV & Adds Big Sur to CI/CD (#317) 2020-11-17 13:02:51 -08:00
Kamron Batman
eb1c03c38b
Fixes create release work flow
Fixes create release workflow
Bumps release version
2020-11-16 09:03:32 -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
4456056f83
A little bit of docs cleanup (#244)
Updates documentation
2020-09-13 15:35:44 -07:00
Kamron Batman
8f378dbd78
Adds ModernUO docs skeleton (#243) 2020-09-13 15:21:28 -07:00
Kamron Batman
90ede0659f
Fixes bad formatting in FUNDING.yml 2020-09-12 14:33:46 -07:00
Kamron Batman
14eb03ee87
Updates FUNDING.yml 2020-09-12 14:32:24 -07:00
Kamron Batman
bd583f2013
Release Version 0.6.3 (#223)
Fixes:
- [X] Go Menu Crash
- [X] Add Menu Crash
2020-09-04 00:29:08 -07:00
Kamron Batman
dcbbb13e72
Fixes publish script to work with zsh (#218)
Fixes the publish script so it works with zsh and bash. (bump release)
2020-09-03 17:18:28 -07:00
Kamron Batman
113ef98b5d
Adds github sponsorship 2020-09-03 09:02:16 -07:00
Kamron Batman
88c669b3dd
Cleans up release url (bump release) (#214) 2020-09-02 19:06:55 -07:00
Kamron Batman
46b2221e87
Fixes actual operating system used for building (#212) 2020-09-02 18:34:10 -07:00
Kamron Batman
8ac9848555
Adds all OS for Release (#211)
Adds all operating systems as a matrix for Release
2020-09-02 18:28:03 -07:00
Kamron Batman
ffa3e1012c
Tests Release (#210)
Fixes create release action and tests for an actual Release
2020-09-02 17:58:26 -07:00
Kamron Batman
192cf70d20
Adds gitversioning for releases (#209) 2020-09-02 17:50:57 -07:00
Kamron Batman
584d4bc1d9
Release Version 0.6.1 (Attempt 2 fix workflow) (#208) 2020-08-30 23:42:46 -07:00
Kamron Batman
04cd3190ee
Release v0.6.1 (Fix attempt #1 for workflow) (#207) 2020-08-30 23:34:37 -07:00
Kamron Batman
030f122a3b
Release Version 0.6.1 (Moves Github Workflow to do release) (#206) 2020-08-30 23:29:30 -07:00
Kamron Batman
40f88d98e4
Release Version 0.6.1 (#205) 2020-08-30 23:15:47 -07:00
Kamron Batman
bc2487946c
Adds .NET 5 & Ubuntu 20 LTS Targeting (#193) 2020-08-15 14:48:06 -07:00
Kamron Batman
c32efdd7aa
Create FUNDING.yml 2020-08-01 08:52:55 -07:00
Kamron Batman
bde6d6a149
Updates CI with Azure Pipelines (#170) 2020-07-03 00:38:19 -07:00