Commit graph

1721 commits

Author SHA1 Message Date
Kamron Batman
b4ab052241
fix: Adds more folder safety to auto archiving (#803) 2021-09-26 18:13:52 -07:00
Michael Whelehan
f1a4195543
fix: Ensure backup folder exists before rolling up directories too (#802) 2021-09-26 15:12:33 -07:00
Kamron Batman
b5799c33af
fix: Fixes backup folder not being created (#801) 2021-09-26 09:06:11 -07:00
Kamron Batman
fa5eafdaff
fix: Adds Created, LastSerialized, and BeforeSerialize for all entities. (#775)
* Adds `BeforeSerialized` for entities to handle cleanup.
* Adds `Created` and `LastSerialized` fields to all entities. While this is a big bloat, this will be necessary for identifying dangling references to other invalid entities.
* Changes formula for determining a valid reference to be _not null, not deleted, and reference's created date must be at or before the entities last serialized date_.
* Adds versioning to idx file and serializes `Created` and `LastSerialized`.
* Fixes Save Stats and also disables it by default.
2021-09-26 01:09:45 -07:00
Kamron Batman
3f6a87483b
feat: Adds auto archiving (#794)
## Adds Auto Archiving
Backups are archived once an hour, day, and month. Archives older than 60 days are pruned automatically.

_Note: Automatic pruning is off by default_

### Archive compression format
The following formats are supported:
* Zstd (The fastest with best compression ratio)
* GZip
* Zip
* None (Tar)

_Note: By default archives use [zstandard](http://facebook.github.io/zstd/) format.
The archive format can be changed in modernuo.json `autoArchive.compressionFormat`_

### Restoring world from archive
Move the archive to the Saves folder (tar.zst file). On startup the server will extract the file and restore the latest save. See pictures below.

### Manually extracting an archives
#### Windows
* Use the latest version of [7-zip w/ ZStandard](https://github.com/mcmilk/7-Zip-zstd/releases/latest)
  1. Extract the `.tar.zst` file.
  2. Extract the `.tar` file. (Yes you have to do it in two steps)
* On Windows 10 you can use the command line. `zstd.exe` is in the Assemblies folder after building ModernUO.
  1. `tar --use-compress-program "Distribution\Assemblies\zstd.exe -d" -xvf "Archives\Hourly\archivefile.tar.zst" -C "path to where you want to extract it"`
#### Mac
* Install [Keka](https://www.keka.io)
  1. Drop the .tar.zst onto the keka interface.
#### Linux
  1. Install zstd from a package manager
  2. Run `tar -I zstd -xvf "Archives\Hourly\archivefile.tar.zst" -C "path to where you want to extract it"`

### Other changes
* Changes Autosave to occur at the same time no matter when the server is booted.
* Adds `[SaveFrequency <delay> [warning]`command to set save frequency and warning frequency in-game.
* Adds support for time zones that are configurable. The system timezone can also be manually configured. Check `TimeZoneHandler.cs` for details.

<img width="257" alt="Screen Shot 2021-09-22 at 11 23 18 PM" src="https://user-images.githubusercontent.com/3953314/134464929-a5bf3cd8-2ef0-4476-a9ad-71d0816a19ac.png">
<img width="241" alt="Screen Shot 2021-09-22 at 11 23 39 PM" src="https://user-images.githubusercontent.com/3953314/134464945-5f6f96dc-3d1e-434d-8256-5c6b3705e786.png">
<img width="836" alt="Screen Shot 2021-09-22 at 11 34 39 PM" src="https://user-images.githubusercontent.com/3953314/134464957-625e57f2-ef47-4ca1-a0a7-cd40c9b6539c.png">
<img width="631" alt="Screen Shot 2021-09-22 at 11 34 50 PM" src="https://user-images.githubusercontent.com/3953314/134464969-b2d65c0d-f8f5-497a-a832-5d805e8e0b22.png">
2021-09-25 17:22:05 -07:00
Michael Whelehan
2f5b26ae68
feat(expansions): Adds expansion.json and loads expansions dynamically (#798)
Moves hardcoded expansion settings to the file Data\expansion.json.
2021-09-23 20:28:43 -07:00
IAmDanielDinner
a0c3158675
fix: Minor refactor of spells (#795) 2021-09-19 15:45:05 -07:00
Kamron Batman
77e5d8521f
fix: Simplifies server list (#797) 2021-09-19 00:40:39 -07:00
Kamron Batman
7c18997965
fix: Fixes no draw text for addons (#796) 2021-09-19 00:02:33 -07:00
SpeedyDevil
ee6be3d0dc
fix: Fixes quiver damage type modifier (#792) 2021-09-18 11:28:42 -07:00
Kamron Batman
56c348ac68
fix: Adds idle cpu config and forces on in debug (#790)
* Adds `core.enableIdleCPU` to modernuo.json
* Forces idle CPU on in DEBUG
* Reverts idle detection back to CPS
2021-09-17 00:15:16 -07:00
Kamron Batman
b6641c4853
fix: Don't crash the world if a stealable artifact fails to construct (#789) 2021-09-16 23:55:37 -07:00
Kamron Batman
fd440f29ce
fix: Fixes FastAStar (#788)
* Fixes FastAStar algorithm, thanks @nullptr-w8
* Cleans up the code a little
* Removes SlowAStar
* Changes [Path recall runes to waypoints
2021-09-16 23:38:51 -07:00
Kamron Batman
73c65a43ad
fix: Cleans up movement code (#787)
* Removes FastMovementImpl since it isn't used and I am not convinced it is better.
* Moves some of the new movement logic from FastMovementImpl to MovementImpl
* Makes MovementImpl more readable
2021-09-16 23:23:22 -07:00
Kamron Batman
7785f7e06c
fix: Fixes timer wheel edge cases (#782)
1. Stopping a different timer, on the same slot as the timer being executed during OnTick
    * Adds a check for the timer wheel currently being executed and does not detach the timer on Stop().
1. Timers are added to the current slot if they need 4095 slots, before the chain is fully detached/executed
    * Removes all chains that will be executed from the timer wheel before executing.
2021-09-16 08:52:32 -07:00
Kamron Batman
bba5346a92
fix: Consolidates properties code (#785)
* Consolidates the property logic between properties and add.
* Fixes a bug with setting properties
2021-09-15 21:48:30 -07:00
Kamron Batman
ec785e6f07
fix: Updates dependencies, cleans up csproj, and updates README (#784) 2021-09-15 09:54:15 -07:00
Kamron Batman
3ade2d5e73
fix: Fixes random 0 (#783) 2021-09-14 22:40:07 -07:00
Kamron Batman
c5e35c9b69
fix: Uses client bug to make addon containers work (#776)
* Fixes tooltip for container furniture so it works. This doesn't work on ClassicUO.
* Fixes double click opening container furniture by double clicking the addon component.
* Fixes the context menu not showing up sometimes on the addon piece.

Note: You cannot drop anything into the addon component since it might be far away and it is not a real container. There is no easy fix for this without building an entire custom container class for addons or changing how items drag/drop entirely. Requires closing/opening container gumps as it switches from one component to another that shares the same content. Also requires sharing tooltips, invalidated properties, process delta changes, etc.
Not worth the effort.

<img width="444" alt="Screen_Shot_2021-09-12_at_4 27 28_PM" src="https://user-images.githubusercontent.com/3953314/133011752-c5b54cf2-2c7b-45c0-882d-0365ef62e686.png">
2021-09-12 22:23:15 -07:00
Kamron Batman
52dacec68f
fix: Fixes overflow in timer wheel add timer (#780) 2021-09-12 14:00:48 -07:00
Kamron Batman
c2d8f7d913
fix: Fixes string set in properties (#779) 2021-09-12 12:03:30 -07:00
Kamron Batman
46fc95ae71
fix: Fixes wrong path for spawning post-uoml era (#777) 2021-09-09 11:44:49 -07:00
Kamron Batman
75fd8137b1
fix: Fixes codegen migrations nullable valuetypes (#774) 2021-09-07 20:22:11 -07:00
Arthrutus
bfb716f24f
chore: Cleans up code in blacksmithy (#769) 2021-09-06 09:29:47 -07:00
Kamron Batman
3f4ff328b3
fix: Fixes codegen spacing for class generation (#768) 2021-09-06 01:34:10 -07:00
Kamron Batman
21aa6aaade
fix: Fixes sourcegen spacing (#766) 2021-09-05 13:18:31 -07:00
Kamron Batman
04b5a6c609
fix: Makes guid settable. Cleans up type conversions (#765)
* Marks GUID a parsable type
* Cleans up type conversions
2021-09-05 01:53:00 -07:00
Arthrutus
1916dc00cb
fix: Fixes spawner generation in admin gump (#764) 2021-09-04 19:27:10 -07:00
Kamron Batman
2f8508e320
fix: Fixes spawning on admin gump (#763) 2021-09-04 18:41:24 -07:00
Kamron Batman
437ebf7038
fix: Fixes spawners (#762)
* Fixes spawner counts
* Fixes globbing
2021-09-04 18:31:17 -07:00
Kamron Batman
54e56d2fc1
fix: Fixes assembly loading. (#759)
* `AssemblyHandler.Assemblies` will now only contain assemblies listed in `assemblies.json`
* `assemblies.json` has been updated to only contain asssemblies directly loaded by the server. Namely, only `UOContent.dll`.
  * Specifically assemblies loaded by assemblies.json are subject to check for `Configure` and `Initialize` methods.
* `modernuo.json` now has a new property called `assemblyDirectories`. This will be automatically set to `Distribution/Assemblies` (absolute path on your machine).
  * You can add more directories to this list.
* All assemblies in assemblies.json _AND_ dependents of any assembly will be searched for in the directories specified by `assemblyDirectories`.
2021-09-03 23:35:44 -07:00
Kamron Batman
0d1fffd9fc
fix: Fixes spawners, adds convertpremiumspawners, exportspawners, and replaces with neruns distro (#751)
### Additions
* Adds `[exportspawners <relative json file path to distro>`
  * If no path is provided, it will be saved to the `Data\Spawns` folder with the current timestamp as the file name.
  * Supports global, facet, region, multi, and area
* Fixes client disconnect for bad spawner generation command.
* Moves spawner commands to their own folder.
* Adds GUIDs for spawners. This allows for easy replacement during import to reduce duplication.
* Allows exporting the name of the spawner.
* Fixes globbing when using [generatespawners
* Adds [convertpremiumspawners to convert Premium Spawners (from Neruns distro)

Possibly in .NET 6 serializing JSON will be more performant using JSON nodes.


### Screenshots
![Screen_Shot_2021-08-31_at_10 20 06_PM](https://user-images.githubusercontent.com/3953314/131618495-cf7e3ae5-58e5-4f86-9d3c-3cc49906d9fc.png)
![Screen_Shot_2021-08-31_at_10 21 08_PM](https://user-images.githubusercontent.com/3953314/131618502-c39cc368-2266-47a5-9b87-e5ffa108b875.png)
![Screen_Shot_2021-08-31_at_10 13 29_PM](https://user-images.githubusercontent.com/3953314/131618512-f9807f1b-76e4-4503-989d-42324798fbf5.png)
2021-09-03 21:52:44 -07:00
Kamron Batman
dbd4d6f13f
fix: Various code cleanup (#756) 2021-09-03 19:41:12 -07:00
Arthrutus
f4378acd05
fix: Adds some missing equipment for warriors (#742) 2021-09-03 14:07:32 -07:00
Kamron Batman
e7e0151b38
fix: Fixes armor not scaling properly from world deserialization (#752) 2021-08-31 19:46:41 -07:00
Kamron Batman
fd59b080f4
fix: Fixes boat movement & moves weapon ability out of core (#750)
* Fixes boats only moving once.
* Removes event sink for weapon ability
* Moves weapon ability packets out of the core.
2021-08-30 21:30:09 -07:00
Kamron Batman
c789a7f78a
fix: Fixes various issues (#748)
https://github.com/modernuo/ModernUO/pull/741/files
2021-08-30 07:54:52 -07:00
SpeedyDevil
28faf4346f
fix: Fixes damage types when wearing quivers (#747) 2021-08-29 10:04:59 -07:00
Kamron Batman
251acec102
fix: Fixes tests that require races to be loaded (#745) 2021-08-29 00:48:11 -07:00
Kamron Batman
8ffd5a5bd0
fix: Updates races to properly support gargoyle equipment. (#744)
* Adds `RaceFlag` to the `Race` object. This is `1 << RaceIndex`
* Replaces `RequiredRace`  with `RequiredRaces` for items.
* Adds convenience flags for `RequiredRaces`
  ```cs
  
  public const int AllowAllRaces = 0x7;      // Race.Human.RaceFlag | Race.Elf.RaceFlag | Race.Gargoyle.RaceFlag
  public const int AllowHumanOrElves = 0x3;  // Race.Human.RaceFlag | Race.Elf.RaceFlag
  public const int AllowElvesOnly = 0x2;     // Race.Elf.RaceFlag
  public const int AllowGargoylesOnly = 0x4; // Race.Gargoyle.RaceFlag
  ```
* Example usage on an item:
  ```cs
  public override int RequiredRaces => Race.AllowHumanOrElves;
  ```
* Adds Wood and Stone armor material types
* Updates Woodland armor to Wood
* Adds proper messaging for race restrictions
* Adds gargoyle only for object properties
* Adds `CheckRace` functions for validating if a race or mobile can use the item:
  ```cs
  bool CheckRace(Race race);
  bool CheckRace(Mobile from, bool message = true);
  ```
2021-08-29 00:43:55 -07:00
Kamron Batman
bf20800382
fix: Removes BodyValue and fixes modifying Body and BodyMod in props gump. (#743)
* Removes BodyValue
* Removes BodyPicker gump
* Fixes setting Body and BodyMod in props gump
* Props will now look for an `implicit cast` in order to find a way to allow you to modify values with the props gump.
* Fixed `[self set body 0x190` so it works too.
2021-08-28 22:56:00 -07:00
Arthrutus
244fc6a136
fix: Adds studded armor to warrior template when making new character. (#740) 2021-08-27 23:43:41 -07:00
Kamron Batman
3bfd5c4d3e
fix: Adds CanSeeStaffOnly for staff only items (#739) 2021-08-27 19:12:32 -07:00
Kamron Batman
862e868cf0
fix: Fixes codegenning nested classes (#738) 2021-08-27 19:08:04 -07:00
Kamron Batman
408a343e0c
Fix: Fixes evil mages so they look correct for T2A/UOTD (#735) 2021-08-26 19:11:16 -07:00
Kamron Batman
db59bf6dd0
fix(cleanup): Cleans up attribute syntax (#734) 2021-08-26 18:30:16 -07:00
Kamron Batman
996fdeb011
fix: Removes testing fastwalk (#733) 2021-08-26 17:42:11 -07:00
Kamron Batman
451e53d006
fix: Fixes base armor deserializing old version (#731) 2021-08-26 13:45:31 -07:00
Kamron Batman
1a336752a6
fix: Fixes benchmarks (#729) 2021-08-25 00:35:07 -07:00
Kamron Batman
0dc4acc164
fix(core): Removes implicit cast between Serial and uint (#728)
* Fixes spellbooks using serial ctor
* Fixes misc items where someone thought they had an amount and it didn't
* Fixes all `Food` types.
2021-08-25 00:27:19 -07:00