Commit graph

181 commits

Author SHA1 Message Date
Kamron Batman
fbafd7210d
fix(core): Converts some packets & misc fixes/cleanup (#414)
- [X] Adds a stop music packet
- [X] Converts chat packets
- [X] Breaks out chat code a little bit more
- [X] Converts character statue animation packet
- [X] Renames some folders to have spaces
- [X] Organizes and consolidates incoming/outgoing packets for other content
- [X] Fixes virtual checks
2021-01-16 21:01:54 -08:00
Kamron Batman
a146955f6c
fix(core): Converts book packets (#413)
- [X] Splits out BaseBook
- [X] Converts book packets
- [X] Makes FixHtml faster
2021-01-16 18:49:53 -08:00
Kamron Batman
dc44142d29
fix(tests): Fixes tests failing (#410) 2021-01-14 20:32:56 -08:00
Kamron Batman
c58aad733d
fix(core): Converts BB packets (#406)
- [X] Organizes and splits up bulletin boards
- [X] Converts packets
2021-01-13 22:28:31 -08:00
Kamron Batman
5631c1da6d
fix(core): Converts map item packets (#404)
- [X] Converts map item packets
2021-01-12 19:25:45 -08:00
Kamron Batman
4bb2be4574
fix(core): Converts help topic packet (#403)
- [X] Converts help topic packet
2021-01-12 18:59:16 -08:00
Kamron Batman
ca196e4729
fix(content): Converts mahjong packets (#402)
- [X] Converts mahjong packets
2021-01-12 00:59:42 -08:00
Kamron Batman
f4dd7c8e7f
fix(party): Converts party packets (#401)
- [X] Converts party packets
2021-01-10 14:23:10 -08:00
Kamron Batman
f52e63f320
fix(core): Converts corpse packets (#400)
- [X] Converts corpse packets
- [X] Some cleanup
2021-01-10 09:53:05 -08:00
Kamron Batman
03bdff2293
fix(content): Converts buff icon packets (#389)
- [X] Converts buff icon packets, and avoids string formatting.
2021-01-06 01:01:21 -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
77ce2e1980
fix(core): Optimizes strings / .NET 5 compatibility changes (#354)
- [X] Removes some string allocations (e.g. split)
- [X] Optimizes some collections
- [X] Converts insensitive to extension methods of built-ins.
- [X] Adds ordinal (case sensitive) string helpers
- [X] Fixes conditionals for in-game commands so they use Ordinal comparisons.
- [X] Replaces ToLower.Contains with InsensitiveContains
- [X] Adds ValueStringBuilder
- [X] Implements ValueStringBuilder in a few places where it makes sense
- [X] Removes the redundant Wrap function and replaces it with an optimized version
- [X] Fixes list conversions in Utility

Closes #351

Bumps release version
2020-12-20 23:21:55 -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
ae436cb55f
Fix bad serials (#304)
- [X] Fixes bad serial calculations
- [X] Tightens HexStrings

Bumps release version
Updates documentation
2020-11-08 12:09:26 -08:00
Kamron Batman
013f333898
Adds official .NET 5 support (#300) 2020-11-07 13:26:27 -08:00
Kamron Batman
c3289a20ab
Changes damage packets (#299)
- [X] Changes damage packets

Bumps release version
2020-11-01 22:44:23 -08:00
Kamron Batman
6f5cb00cdd
Updates Combat Packets & Moves Tracking to Content (#298)
- [X] Changes outgoing combat packets
- [X] Moves quest arrow to PlayerMobile and moves quest arrow packets to content.

Bumps release version
2020-11-01 21:33:01 -08:00
Kamron Batman
403584e735
Bumps native versions to fix MT (#253)
- [X] Updates zlib to 1.3.0
- [X] Updates argon2 to 1.7.0

Bumps release version
2020-09-15 18:16:48 -07:00
Kamron Batman
8149620b0c
Fixes brace style (#248) 2020-09-13 21:49:46 -07:00
Kamron Batman
ad3775c4d7
Formats UO Content (#201) 2020-08-27 18:30:38 -07:00
Kamron Batman
bc2487946c
Adds .NET 5 & Ubuntu 20 LTS Targeting (#193) 2020-08-15 14:48:06 -07:00
Kamron Batman
e17195ca80
Adds more packet tests (#166) 2020-07-03 19:03:10 -07:00
Kamron Batman
997691fbb7
Adds specific linux operating system support (#169) 2020-07-02 17:35:46 -07:00
Kamron Batman
d76d60d900
Moves zlib to its own nuget (#164) 2020-06-25 13:48:40 -07:00
Kamron Batman
561b40c3d8
Moves Argon2 to real nuget (#163) 2020-06-25 13:06:31 -07:00
Kamron Batman
1246a135f7
Updates Data to JSON (#159) 2020-06-19 13:53:18 -07:00
Kamron Batman
050d6b5fa9
Replaces native argon2 with ref argon2 (#158) 2020-05-29 23:02:18 -07:00
Kamron Batman
4f1825152c
Fixes argon2 for osx and github action workflow issues (#157) 2020-05-29 18:02:00 -07:00
Kamron Batman
f408662af1
Fixes publishing (#156) 2020-05-29 17:31:47 -07:00
Kamron Batman
8eab05947b
Adds lock files and fixes caching in CI (#154) 2020-05-27 17:00:48 -07:00
Kamron Batman
8ec166bcd0
Adds assemblies config, fixes crash bugs. (#134) 2020-05-09 12:55:56 -07:00