ModernUO/Projects/Server/Network/Packets
Kamron Batman ecbee17690
fix: Optimizes OPL using string interpolation (#1041)
## Breaking Changes (New API)
ObjectPropertyList supports the following API:
```cs
list.Add(500000);
list.Add(500001, stringArgument);
list.Add("Some text");
list.Add($"Some text with {argument}");
list.Add(500002, $"{arg1}\t{arg2}");
```

## Notes
1. All API uses that require a formatter like this:
    ```cs
    list.Add(500002, "{0}\t{1}", arg1, arg2);
    ```
    Should be changed to use string interpolation, for example:
    ```cs
    list.Add(500002, $"{arg1}\t{arg2}");
    ```
2. The following paradigm should no longer be used:
    ```cs
    list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
    ```
    The new string interpolation API will avoid having to convert the argument to a string before writing it to the packet. Instead use the following:
    ```cs
    list.Add(1061170, $"{prop}"); // strength requirement ~1_val~
    ```

### Benchmarks
```cs
|                         Method |     Mean |   Error |  StdDev |  Gen 0 | Allocated |
|------------------------------- |---------:|--------:|--------:|-------:|----------:|
|                BenchmarkOldOPL | 241.0 ns | 0.56 ns | 0.47 ns | 0.0105 |      88 B |
| BenchmarkStringInterpolatedOPL | 199.9 ns | 2.44 ns | 2.39 ns |      - |         - |
```

### Changes
- [X] Removes crash in STArray.Return when array is null.
- [X] Fixes NPE in OPL when entity is null. Serial in packet will be 0 when entity is null.
- [X] Fixes NPE in AosAttributes when Parent is null.
- [X] Changes OPL to use string interpolation.
- [X] Introduces `IPropertyList` to allow extending PropertyList for other uses.
2022-06-02 10:09:53 -07:00
..
IncomingAccountPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingEntityPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingExtendedCommandPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingHousePackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingItemPackets.cs fix: Removes DropReq6017 (#1030) 2022-05-20 12:11:31 -07:00
IncomingMessagePackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingMobilePackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingMovementPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingPackets.cs fix: Adds freeshard protocol to information list (#1038) 2022-05-30 09:35:46 -07:00
IncomingPlayerPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingTargetingPackets.cs fix: Fixes packet length checks (#953) 2022-03-04 12:32:25 -08:00
IncomingVendorPackets.cs feat: Adds a PooledRefList (#676) 2022-03-26 11:11:22 -07:00
OutgoingAccountPackets.cs fix: Fixes expansion flags for animations (#1009) 2022-05-01 18:35:42 -07:00
OutgoingCombatPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingContainerPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingDamagePackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingEffectPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingEntityPackets.cs fix: Optimizes OPL using string interpolation (#1041) 2022-06-02 10:09:53 -07:00
OutgoingEquipmentPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingGumpPackets.cs fix: Updates ArrayPool to STArrayPool for performance. (#968) 2022-03-22 20:07:32 -07:00
OutgoingItemPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingLightPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingMapPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingMenuPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingMessagePackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingMobilePackets.cs fix: Cleans up mobile status packets (#835) 2022-02-27 03:10:35 -08:00
OutgoingMovementPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingPlayerPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingSecureTradePackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingTargetPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingVendorBuyPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
OutgoingVendorSellPackets.cs fix: Stops creating blocked packets entirely (#944) 2022-02-27 00:13:49 -08:00
PacketContainerBuilder.cs fix: Updates ArrayPool to STArrayPool for performance. (#968) 2022-03-22 20:07:32 -07:00