Commit graph

14 commits

Author SHA1 Message Date
Kamron Batman
5b99402666
chore: Cleans up unused imports (#1550) 2023-10-15 11:45:42 -07:00
Kamron Batman
10a69bf754
feat: Adds a memory mirrored ring buffer for networking. (#1533)
## Breaking Changes

Incoming packet registration signature has changed to:
```cs
delegate* void OnReceiveCallback(NetState state, SpanReader reader, int packetLength);

IncomingPackets.Register(int packetID, int length, bool ingame, OnReceiveCallback onReceive);
```

For example, an incoming packet handler signature would now look like this:
```cs
public static void SomeIncomingPacket(NetState state, SpanReader reader, int packetLength)
{
    // Parse the data
}
```

## Summary

Updates the network Pipe class to use a mirrored memory technique. This technique involves mapping the same physical memory to two contiguous virtual memory spaces so the byte buffer appears duplicated. This allows writing to a double-sized array to wrap around without the need for the `CircularBuffer` classes.

In practice this allows us to use `Span<byte>` as if the buffer was a regular array.


### Bug Fixes

- [X] Fixes bad fixed length string parsing
2023-10-09 00:57:53 -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
8eaa859332
fix: Fixes code genning armor, clothing, and BODs (#810)
* Fixes code genning clothing
* Fixes code genning armor
* Fixes code genning BODs
2021-09-28 22:09:34 -07:00
Kamron Batman
97aa092f17
fix(core): Removes refs for network stack (#461) 2021-02-05 01:11:13 -08:00
Kamron Batman
126b80f74b
fix(core): Cleans up networking (#386)
- [X] Deletes some unused networking code.
2021-01-05 00:41:22 -08:00
Kamron Batman
ac76c57c39
fix(core): Converts account packets to spanwriter (#381)
- [X] Converts account packets to spanwriter
2021-01-04 18:47:20 -08:00
Kamron Batman
990e6fe188
Updates Pipe & Makes NetState more testable (#288)
Updates pipe eliminate result and segments from being allocated.

Bumps release version
2020-10-25 17:40:08 -07:00
Kamron Batman
293e691539
Changes Huffman to in-place & Adds CircularBuffer (#287)
- [X] Adds CircularBuffer
- [X] Updates Packet Encoding/Decoding
- [X] Changes Huffman to in-place

Bumps release version
2020-10-25 12:54:37 -07:00
Kamron Batman
3337cfa4e2
Adds PacketDecoder & Makes NetState testable (#286) 2020-10-24 21:49:28 -07:00
Kamron Batman
741e8d8300
Cleanup/Housekeeping (#242) 2020-09-12 15:31:21 -07:00
Kamron Batman
86b7b3aed1
Fixes formatting (#200) 2020-08-25 18:53:35 -07:00
Kamron Batman
2347533b9c
Bring ZLib in locally. (#132) 2020-05-06 20:07:28 -07:00
Kamron Batman
556a17aba8
Adds style cop (#109) 2020-04-26 00:16:02 -07:00
Renamed from Projects/Server/Network/Compression.cs (Browse further)