* Update output of DateTime strings
Define and use explicit formatting for DateTime objects used throughout source
* Update Player.cs
* Update GameActionQueryBirth.cs
* Update DateTimeExtensions.cs
* Update GameActionQueryBirth.cs
match the backpack panel output
* Bump Harmony version
* Add command category support
* Switch usage to unpatch all, split register commands from patch with Harmony
* Move instantiation of command handler dictionary to declaration
* Remove deferred command registration
* Revert build output changes
* Move mod listing to end of startup
* Add mod support
* Change .NET Core 3.1 to .NET 6 for DatLoader.Tests to remove dependency.
* Add default mod path
* Attempt to create missing mod folder
* Update Source/ACE.Server/Mods/ModManager.cs
Co-authored-by: gmriggs <gmriggs@gmail.com>
* Use pre-release Harmony
---------
Co-authored-by: gmriggs <gmriggs@gmail.com>
* Added optional check for newer server binary. Changed DB Update to check only 'latest'
* Update OfflineConfiguration.cs
* Update Program.cs
* Update Config.js.example
Co-authored-by: Ty Conner <tyconner@itcproductions.com>
This is significantly faster than what is currently in master, and just slightly slower than PR #3582
It is now a single threaded operation, just like #3582 but instead of stitching the objects together manually, it lets EF stitch the objects together.
EF Tracking is required for the stitching to work.
This is the recommended pattern for these types of actions when dealing with EF.
I think similar improvements can be made to startup player caching
* minor performance improvements to AssignMagic()
* minor performance improvements to material / color caches
* adding comment
* updating to latest master branch
* updating to latest master branch
* [TEST] Biota Guid Consolidator
Seems to work. Need to make sure the following weenie types are ok:
Allegiance
Hooker
* Update EnchatnmentRegistry
* ... such a simple fix
The second foreach was running the linq query again which wasn't returning the results needed.. ToList() gets our results so we can iterate over them twice, properly.
* Add guid conversion for shortcuts
Co-authored-by: Ty Conner <tyconner@itcproductions.com>
* Step 1. Add new adapter classes and models
All classes and objects added are in new namespaces.
This add has 0 interraction on existing ACE code.
This sets the groundwork for Step 2. Moving World DB caching to the new models
* first part of the world entity usage
* almost there
* final part
* update WeenieExtensions
* fix
* merge fixes and improvements
* ACE.Database new code
* it compiles
* InitializePropertyDictionaries
* WOrldDatabaseWithEntityCache cleanup
* ShardDatabaseWithCaching
* ShardDatabase Cleanup
* todo
* cache counts reported in serverstatus
* House InitializePropertyDictionaries
* improve ServerStatus
* BiotaModel change HousePermissions to Dictionary<uint, bool>
* PropertiesAllegiance to dictionary
* BiotaUpdater improvements
* Shard Database Cache Reporting
* More code ported from Step 3
* Remove stub CharacterCache
* Update WorldDatabaseWithEntityCache.cs
* build fixes
* code audit
* Remove non-callback functions from SerializedShardDatabase
* BiotaUpdater progress.. only emote left
* Emotes done... now need to test
* fix
* Burden/Value fix for containers
* fat fingered EncumbranceVal
* add some safety
* Don't cache player biotas for initial PlayerManager load
* Step 4. Don't duplicate common properties when copying weenie to biota
This builds on Step 3.
This is a run time optimization. It reduces RAM allocation and in turn also makes less work for the garage collector.
When a biota is instantiated from a weenie (not from a database biota), the biota will point to the weenie for the following collections nstead of duplicating them:
PropertiesCreateList
PropertiesEmote
PropertiesEventFilter
PropertiesGenerator
* Collection capacitys added to ctors (reduce resizing)
* fix override_encounter_spawn_rates
* new Projectile() -> static ProjectileCollisionHelper methods
* disable by default, working out issues...
* Fix for referencing weenie collections directly
* Reduce EnchantmentManager ToList() and clone usage
* fix
* Set ChangesDetected only when a property actually changes
* fix build
* fix
* Fix nullable Order for AnimPart and TextureMap
* FixAnimPartAndTextureMapFromPR2731
* Step 1. Add new adapter classes and models
All classes and objects added are in new namespaces.
This add has 0 interraction on existing ACE code.
This sets the groundwork for Step 2. Moving World DB caching to the new models
* first part of the world entity usage
* almost there
* final part
* update WeenieExtensions
* fix
* merge fixes and improvements
* More code ported from Step 3
* Update WorldDatabaseWithEntityCache.cs
* GetCachedCookbooks(recpieId) -> GetCookbooksByRecipeId(recpieId)
* build fix
* changelog
Limit number of threads used by database parallel work. This helps avoid "too many connections" errors on larger threaded machines. It also helps reduce memory consumption.
Use parallel for PlayerManager.Initialize()
ForceGC at the end of Startup, before the world is open. ForceGC is a pretty controversial thing. Typically if you're forcing gc, you're doing something wrong. In this case, we're forcing gc before the world starts up so that the work is done in an off-line state. This work will be done eventually, natrually by the gc, so better to get it done before the world is active. We force gc 10 times to make sure we get all objects. On a large server with many players and world precaching, this can free up 4 GB - 6 GB.
In current master, on a windows platform, ACE requires the current environment directory to be the same location that the ACE.Server.exe (.NET core 3.1) exists.
If you try to startup the application from an outside directory, the Config.js and log4net.config will not be found as only the Environment.CurrentDirectory were searched.
Now, that directory is searched first. If the files are not found, the ExecutingAssembly Location is searched next.
This needs to be tested on Linux.
* Limit database from taking all the threads
This adds limits to the database thread consumption.
It also should allow the world to now consume threads easier.
The way it is done is as follows.
- We determine the number of available threads using Environment.ProcessCount
- We allocate (int)Math.Max(Environment.ProcessorCount * .34, 1) to the World, and the remainder tothe database.
It breaks down as follows
1 vCPU = 1 thread world, 1 thread database
2 vCPU = 1 thread world, 1 thread database
3 vCPU = 1 thread world, 2 thread database
4 vCPU = 1 thread world, 3 thread database
5 vCPU = 1 thread world, 4 thread database
6 vCPU = 2 thread world, 4 thread database
7 vCPU = 2 thread world, 5 thread database
8 vCPU = 2 thread world, 6 thread database
9 vCPU = 3 thread world, 6 thread database
10 vCPU = 3 thread world, 7 thread database
I'd like to get some feedback from this PR on various sized servers.
What you may notice is that loading a player may take slightly longer (very slightly).
What you will probably notice is no discenerable difference in-game.
What I want to make sure happens is that the world doesn't end up feeling more choppy due to the parallel processing of outbound network traffic. Hopefully the more fair thread distriubiton will help prevent thread starvation.
* quit if not enough vCPU
* Give World Manager thread AboveNormal priority.
* support 1 CPU
* Add Covenant Armor and create framework for setting a default Material Type
* Default Material type
* Add Thrown weapons that do not use a missile launcher
* Fix-up thrown weapons
* Change flatware creation
* Change flatware creation 2
* Random Colors in Loot
* WIP with TreasureMaterialColor usage.
* WIP
* More WIP
* Added Material Tables, debug command for testing
* Updated treasure tables for consistent int/uint usage. Added required SQL.
* Set the lootgeneration items to use the new GetMaterial function
* Update changelog
* Removed data from new tables.
* Update changelog.md
* Update 2019-04-20-00-Treasure-Materials.sql
* Update README.md
* Update changelog.md
* Changed lootgen() access level to developer
* Fixed null material type crashing the value function in loot gen
* Random Colors in Loot
* WIP with TreasureMaterialColor usage.
* WIP
* More WIP
* Added Material Tables, debug command for testing
* Updated treasure tables for consistent int/uint usage. Added required SQL.
* Set the lootgeneration items to use the new GetMaterial function
* Update changelog
* Removed data from new tables.
* Update changelog.md
* Update 2019-04-20-00-Treasure-Materials.sql
* Update README.md
* Update changelog.md
* Changed lootgen() access level to developer
* /serverperformancemonitor command
Optional parameters are:
start
stop
reset
If no parameters are present, the current performance metrics are spit out.
When disabled, overhead is the cost of some simple function calls and a bool check. When enabled, the additional cost is stopwatch events. In comparisson to the work that ACE does for normal processing, the work done when serverperformance is enabled is nearly 0.
Default is disabled.
Enable it to start up automatically in the config.js. This is recommend for most servers. Enable it at runtime using /serverperformance start
* Fix Reset
This will (should) catch any unhandled exception from any thread.
It will log it as an error, and the application will exit (unsafely).
The user will see the same exception twice on their console, but only one will be logged to the logger. This is expected behavior.
This was tested with the gem exception and works.
If you're wondering, there is no safe way to handle exceptions from UpdateWorld and keep going, nor is there any safe thing we can do if we're in that state to save players. We have no idea what state a player might be in when this is thrown. The could be between two very critical modifications. Furthermore, if we did try to save all players on exceptions, it could be used as an exploit to try to save players/items in a "bugged" state.
The safest thing to do is quit and trust that the last player saves are good.
Due to the way ACE handles biotas and items, dupes aren't an issue for us.
* PlayerManager initial checkin
* OfflinePlayer initial checkin
* More progress
* Comment out Console.WriteLine debug messages
* Add property dictionaries to OfflinePlayer
* IPlayer initial checkin
* Add allegiance vars to IPlayer
* Couple comments
* More progress
* Add more to IPlayer
* line endings fix
* More progress. Compiles. Friends list works again.
* Friend status updates now work (again)
* PlayerManager save OfflinePlayers every 1hr
* Bye bye legacy AllPlayers
* using cleanup
* Allegience switch to PlayerManager progress
* More Allegiance progress
* More progress
* More allegiance progress
* IPlayer adds
* Migrate inversefriends to PlayerManager
* Switch WorldManager GetPlayerByGuid over to PlayerManager
* WorldManager Find(ObjectGuid characterGuid) removed. Use PlayerManager instead
* WorldManager FindByPlayerName(string name) removed. Use PlayerManager instead
* PlayerManager thread safety switched to ReaderWriterLockSlim
* More progress
* ServerStatus added TotalAccountsCreated, TotalCharactersCreated
* No more Player access/management stuff in WorldManager. It's all in PlayerManager now
* Player.IsOnline is no more.
* Friends AppearOnline fix
* Handle dead session better to switch player from online to offline
* Remove adding the + to names in ChatChannels. Name property should be changed to not include +
* serverstatus total accounts and characters on same line
* Allegience initial fix, still more bugs though
* PlayerManager minor cleanup
uint should be faster key than ObjectGuid
Changed the dictionaries to private. We don't want anyone outside of this class referencing them.
* Thread safety added to LScape.get_landcell
* Fixes for Anniversary Event emotes
* Add Pre+Permaload of Global Event Landblock
* Making requested changes
* Add correct check for GlobalEventLandblockPreloading
* Further requested changes. New config setup for Preloaded and Permaloaded Landblocks
* Minor cleanup
* Add a hardcoded fallback incase config file not updated
* Update example to fix syntax error
* Minor tweak to example and console output