Commit graph

714 commits

Author SHA1 Message Date
Kamron Batman
bc2ed44440
fix: Fixes starting champion with valor (#1088) 2022-06-21 22:43:08 -07:00
Kamron Batman
087cc15f39
fix: Reverts changes to fists (#1087) 2022-06-21 21:24:31 -07:00
Kamron Batman
792f04a323
fix: Fixed lantern deserialization (#1086) 2022-06-21 21:04:02 -07:00
Kamron Batman
38b45d5e0b
fix: Cleans up AI code (#1084) 2022-06-20 19:32:16 -07:00
Kamron Batman
da877f59a7
fix: Fixes possibel NPE with misbehaving Weapon property (#1083) 2022-06-20 16:31:39 -07:00
Kamron Batman
7adf52ef48
fix: Moves mods and fixes migrations for lights (#1080)
- [X] Removes duplicate property for owner.
- [X] Codegens them all (even though they aren't used, just in case someone wants to).
2022-06-18 21:28:51 -07:00
Kamron Batman
dc7033d71f
fix: Fixes candle serialization (#1081) 2022-06-18 16:09:02 -07:00
Kamron Batman
354f7e2f41
fix: Codegens torches, candles, and lanterns (#1078) 2022-06-18 08:39:44 -07:00
Kamron Batman
35689a395b
fix: Fixes codegenning sack of flour (#1076) 2022-06-17 23:29:36 -07:00
Kamron Batman
41efa69b56
fix: Adds OSI candle/torch functionality, codegens lights (#1075) 2022-06-17 23:26:27 -07:00
Kamron Batman
cf1d037444
fix: Fixes serialization NPE when namespace is missing (#1074) 2022-06-16 22:45:39 -07:00
Kamron Batman
17e33a65d2
fix: Fixes source gen bugs (#1072) 2022-06-16 21:34:11 -07:00
Kamron Batman
6edccfe2aa
fix: Codegens mahjong (#1070) 2022-06-16 10:19:49 -07:00
Kamron Batman
800f864335
fix: Updates serialization generator to fix crashing from duplicate fields (#1071) 2022-06-16 09:31:09 -07:00
Kamron Batman
2fb660040b
fix: Cleans up namespaces (#1069) 2022-06-15 19:52:23 -07:00
Kamron Batman
4a057bf5ac
fix: Fixes poison charge OPL (#1068) 2022-06-15 19:11:52 -07:00
Kamron Batman
057cf87e60
fix: Updates encoded packet handler to use function pointers (#1066) 2022-06-15 17:20:36 -07:00
Stefano Merotta
f24b98f8e2
fix: Replaces throttlers and packet callbacks with function pointers (#1063)
Replaces multi-cast delegates with function pointers to gain 25% in performance and lower allocations.
2022-06-15 12:48:43 -07:00
Kamron Batman
b779d7737f
fix: Adds ISpanFormattable support to Serial (#1065) 2022-06-14 18:39:46 -07:00
Kamron Batman
4b2b7e2277
fix: Fixes old RunUO bug with skill mod owners (#1064) 2022-06-14 16:44:50 -07:00
Kamron Batman
c1cc1308a5
fix: Codegens guildstone and jewelery (#1061) 2022-06-14 08:29:00 -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
a07c42fc85
fix: Codegens gems (#1059) 2022-06-13 17:38:46 -07:00
Kamron Batman
368160144b
fix: Codegens games (#1058) 2022-06-13 17:31:56 -07:00
Kamron Batman
864440a05e
fix: Source generates food. (#1054) 2022-06-13 01:48:27 -07:00
Kamron Batman
59e1793c2d
fix: Codegens fillable containers (#862)
- [X] Fillable containers now relock/retrap after respawn.
- [X] Optimized the lookup and serialization.
2022-06-13 01:13:59 -07:00
Kamron Batman
db20722711
fix: Simplifies OPL (#1051) 2022-06-12 21:27:16 -07:00
Kamron Batman
b74b47159f
fix: Fixes localization corner cases with OPL (#1050)
## Changes
- [X] Adds OPL convenience methods
    - `opl.Add(cliloc, value)` and `opl.Add(value)` - value as an integer or string works just like `opl.Add(cliloc, $"{value}")`
    - `opl.AddLocalized(cliloc, clilocValue)` - works the same as `opl.Add(cliloc, $"#{clilocValue}");`
- [X] Simplifies basic `list.Add()` situations
- [X] Changes cliloc as an argument so it works with custom IPropertyList implementations (HTML)
- [X] Fixes plants so they support the old localization and new (changed in 7.0.12.0+)
- [X] Exposes more methods to override for Item to make creating custom OPL possible.

## Important Notes
* Using a ternary as an argument, like this `opl.Add(number, showType ? $"{type}\t{value}" : $"{value}");` _will not use the correct string interpolation_. This means if you use a custom PropertyList (for HTML or some other purpose), the property list won't be localized properly.
* All localization values must be interpolated, even if they are literal strings, or integers. Example: `opl.Add(number, $"{"Charges"}\t{m_Charges}");` is correct. Using the following: `$"Charges\t{m_Charges}"` will not work for custom PropertyList implementations!
2022-06-12 21:17:42 -07:00
Kamron Batman
12404ba6f6
fix: Fixes linux not enumerating directories, and wrong spelling for migration files (#1049) 2022-06-12 09:59:23 -07:00
Kamron Batman
ff1b7aa994
fix: Updates serialization generator to add serial support (#1047) 2022-06-06 17:32:57 -07:00
Kamron Batman
6e69d25e33
fix: Fixes structured logging (#1043)
- [X] Fixes various bugs in logging.
2022-06-05 01:00:22 -07:00
Kamron Batman
78bb4f4bb2
fix: Fixes localization test (#1046) 2022-06-04 12:09:19 -07:00
Kamron Batman
5f00330a66
fix: Adds optimized formatter for clilocs (#1045)
Adds an optimized formatter for localization. Example:
```cs
string localizationText = Localization.Format(1050039, "enu", $"{m_Amount}\t{LabelNumber:#}");
```

Fixes #1044
2022-06-04 11:53:32 -07:00
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
Kamron Batman
98a74a89c7
fix: Fixes drag drop bounce issue (#1040) 2022-05-30 15:47:06 -07:00
Kamron Batman
aeec7f78fd
fix: Fixes issue with wepoll losing GCHandle. (#1039)
- [X] Fixes issue with wepoll losing GCHandle.
- [X] `NetState.Disconnect()` is no longer thread safe.
  - Use `Core.LoopContext.Post()` to post disconnects
- [X] Optimizes PollGroup by not processing IntPtr -> GCHandle for discard polls.
2022-05-30 14:04:54 -07:00
Kamron Batman
d261973cee
fix: Adds freeshard protocol to information list (#1038) 2022-05-30 09:35:46 -07:00
Kamron Batman
1e6ab794fe
fix: Fixes ValueStringBuilder dispose incorrectly (#1037) 2022-05-29 15:01:39 -07:00
Kamron Batman
3b7e3c2fb7
fix: Fixes ValueStringBuilder empty ctor issue (#1035) 2022-05-27 17:49:36 -07:00
Stefano Merotta
fe225003c6
fix: Adds multithread optional flag to ValueStringBuilder (#1033)
Added multithread optional flag to ValueStringBuilder for multithread contexts.
Enabled new flag for VerifyType method.

Resolves #1032
2022-05-27 10:25:30 -07:00
Kamron Batman
ef883b2872
fix: Fixes socket disconnect on block. Fixes debug logging (#1031) 2022-05-21 20:24:46 -07:00
CA5A
9bbcb4b274
fix: Removes DropReq6017 (#1030) 2022-05-20 12:11:31 -07:00
Kamron Batman
e172dc9661
fix: Updates dependencies & adds Fedora 35/36 support (#1029) 2022-05-19 10:51:24 -07:00
Kamron Batman
f2ced497ec
fix: Updates pool of acid (#1028)
- [X] Removes duplicate Created property
- [X] Removes allocation while damaging mobiles
- [X] Adds manual dirty checking since we won't be codegenning it and we won't be serializing it.
2022-05-18 17:53:53 -07:00
Kamron Batman
dfdadd3204
fix: Fixes pool of acid and other empty serializations (#1025)
Fixes an issue where 0 byte objects are improperly deserialized. They should not be deserialized at all and instead deleted.
2022-05-18 17:36:23 -07:00
Kamron Batman
6b3617b08f
fix: Fixes BitArray serialization (#1027)
Fixes bit array serialization. This may cause objects that were serialized by bit array to fail to deserialize. I am sorry, please accept my condolences. It is probably easiest to just delete those objects. If it becomes a major problem, contact me and I'll help with a hacky per-case solution.
2022-05-18 17:25:03 -07:00
Kamron Batman
a7fd1905e9
fix: Deletes wanderer (#1023) 2022-05-16 15:10:49 -07:00
Kamron Batman
dd95a8a1e3
fix: Codegens Food & Beverages (#1021)
- [X] Simplifies beverages
- [X] Codegens food & beverages
2022-05-15 21:56:04 -07:00
Kamron Batman
7b619f23b8
fix: Fixes static persistence of faction system (#1020) 2022-05-15 12:45:51 -07:00
Kamron Batman
eee8494558
fix: Removes scale speed by dex for monsters, fixes NPC movement/thinking speed (#1019)
* Removes scaled speed by dex for monsters
* Changes scaled speed by dex for pets (HS+ expansion) to be 400ms -> 100ms between 50 -> 200 dex
* Removes speed changes that were broken for various mobs
* Combines "Legacy" speed and renames the class to `NPCSpeeds`
* Creates speed "classes" (slow, medium, fast, very fast)
* Introduces a new overridable property `SpeedClass`. Register a new speed class using `NPCSpeeds.Register()` and then set the speed class to bulk/mass apply speeds.

Order of speed determination:
1. SpeedMod
2. SpeedClass property (not null)
3. SpeedClass entry in Data\npc-speeds.json for that type
4. "Fast" (200ms Active, 400ms Passive)
2022-05-15 10:01:14 -07:00