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
* 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
* fix null spellbook
* Add another null check
This is redundant as the check is also upstream.
This is to prevent an exception in the future if this function is called from another source.
* 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.
* add support for recipes to DeveloperContentCommands
* adding landblock instance support to import-sql and import-json
* fixing spelling
* updating json landblock key
* adding quest support to import-json and import-sql
* fixing bug in original GDLEConverter.TryConvert() for reading landblock json
* adding comment
* removing duplicate code from merge
* adding preliminary support for dual-wielding monsters
* fixing monster special attack fx
* improved monster combat maneuvers table
* adding dual wield speed modifier for mobs
* fixing mobs casting flame wave
* adding support for EmoteManager.CastSpell untargeted spell projectiles
* fixing untargeted Blast spells
* fixing blast spells
* fixing spell z-angle
* re-add Emote.Move* physics position sync w/ valid rotation check
* wip
* latest wip
* cleanup
* small position adjustments
* matching create.Y formula up to retail pcaps
* refactoring spell projectiles
* startPos based on targetPos instead of casterPos for strike spells?
* improved strike spawn position
* add error logging
* add support for peturbation, improve ring positioning for even # of projectiles
* adding /clearcache for content developers
* fixing boost variance
* adding quadrant stuff
* splatter dir
* better usage of body part quadrants for physical attacks
* found CMTs with multiple entries per lookup key, cycle through anims
* fixing portal gems
* Debugging for CE
* Add guid and name
* Revert "Add guid and name"
This reverts commit 6de8fb6078.
* Revert "Debugging for CE"
This reverts commit 7ea2e521f9.
* Focus logging on CreateCorpse
* Seaparte GetCachedWeenie from CreateNewWorldObject
* Improve weenie by name lookups using a dictionary
* Remove stopwatch diagnostics from creature_die
* Update CombatPet to not drop loot, not spawn things
* Revert Caching of HasEnchantments (Players with no spells do not start ticking until relog)
* Remove Emotes from CombatPets
* Add Pet and CombatPet to IsCreature
* Always Allow ID for Pets
* .
* Restore HasEnchantments
* Update changelog.md
* Update changelog.md
* 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
* Adding support for new recipe formats
* hotspot / corpse fixes
* tinkering updates
* adding tinkering local broadcasts
* line endings
* updating for World DB 0.7.14
* reverting
* fixing item tinkering value
* Reuse available Dynamic GUIDs
On ACE startup, the shard database is queried for available id's in the dynamic guid range.
This helps further reduce (max + 1) id allocation.
It's a bit premature, but, based on current architecture, I don't know if we'll ever need to do a id defragment.
A requirement of this method is that ace_world may only contain guids in the static range.
* GetMaxGuidFoundInRange has no valid use in ace_world
All ids must be in the static range
* Add world update script
* Change child assemblies to AnyCPU. Ace.Server still x64
* Fix LifestonedConverter for > ushort.MaxValue weenies
* Allow DbContexts to be configured/used by other applications
* Make GetWeenie public
* SQLWriters should take IDictionary, not Dictionary
* Include links
* Keep tests as x64
* Adding scrolls to loot profiles
Scroll weenies are cached into lists, then created from those weenies, so the database isnt hit everytime there is a new scroll created.
* Fixed so that the lists for spell weenies are persistent and only are added when weenies are not present.
This should be good to go as I tested it thoroughly.
* Loads all weenies on first weenie looup
also, renamed variable of result to spellWeenie and returned the dict value and not the value of the lookup.
* changed field to static so no need to make Database object
* WorldDatabase GetRandomWeeniesOfType -> GetRandomCachedWeeniesOfType
WorldDatabasePrecaching set to true is a requirement for proper loot generation
* Improve getting scroll weenies by spell id
* GetRandomCachedWeeniesOfType -> GetRandomWeeniesOfType
* adding command verb "list" to developer command /telepoi that (re)caches and lists all POIs
* hiding integral collection to make the data less vulnerable
removing return value of POI caching function
* Fixing stance shuffling / refactoring moveto chains a bit
* Fixing vendor rotate
* Removing debug message
* Fixing stance change for player activating switches
* Adding methods to QuestManager
* Adding TimeSpanExtensions
* Adjusting walk/run threshold
* Adding quest restrictions for portals, and portal spawning triggered by monster deaths
* Updating function names
* Adding HasQuestCompletes
* Adding support for character titles to emotes
* Added emote hooks for portal use and creature death
* Adding KillTaunt and NewEnemy, updating questName@comment format
* Updating broadcast emotes
* Updating InqQuestSolves
* Adding fixes for Aerfalle
* Fixed rolling balls of death
* Landblock Preloader cleanup
* WorldDatabase spelling fixes
* Added CacheAllWeeniesInParallel
* Add WeeniePrecaching
* Improved WorldDatabase Caching
Null entries are now cached as well to prevent excessive queries to the database to pull records that do not exist.
The callers should raise warnings when a record doesn't exist.
* WorldDatabasePrecaching (~400MB)
* Remove the LastTickDuration code. It was never used
* RateLimiter added
* Spelling fix
* Session TickInParallel summary expanded
* RateLimiter argument range check changes for cosmetic reasons
* DoSessionWork Parallel option when session count >= 5
* Adding Void magic
* Mapping BaseRangeConstant to SpellBase
* Fixing DoTs to only use the top layer enchantments
* Added limiter for switching between war and void magic
* Adding the ability for players to buy houses
* Updating Property IDs
* Fixing links
* Updating purchase time to match AC data, calculating rent time dynamically
* Processing nested links recursively
Columns id and guid have been combined into a single guid column.
This requires that every landblock instance be provided with a valid unique guid.
In the old code, you could provide an instance that would have an auto generated id (column) and a guid of 0. ACE would then see the guid is 0 and would use the following:
GuidManager.NewDynamicGuid();
In the cache.bin, every landblock instance has a unique id.
If we need to add the ability to have dynamically guid'd landblockinstances, this is an easy thing to add back.
We were relying on the order of the recipe_componet records to remain the same, but this isn't gauranteed unless we provide a zIndex.
Instead of adding a zIndex to the Recipe_Component table, we can just put the static values in the base Recipe table.