* WIP
* SpellbookCache
This uses a dictionary to check if spells are known instead of having to iterate over every record of BiotaPropertiesSpellBook every time a player casts a spell.
* Change WorkFactor to 8
* Add configuration option for password workfactor, and migration option to support [up/down]grade at runtime
* Fix a default
* Do not pass in values less 4 and greater than 31 to prevent server crash
* Update defaults
* Update account authentication to use BCrypt.
This updates account authentication to use the BCrypt hashing algorithm in place of SHA512 and the need for a separate password salt.
Bcrypt is also more secure since it uses a "Work Factor" to discourage password brute force attacks and the implementaition is much cleaner overall since the salt is randomly generated and added as part of the password hash itself, effectively protecting against rainbow table attacks.
The default WorkFactor is set to 10 which is the considered the current industry standard. A server owner can easily increase this value to whatever level of security they desire which in turn will make password verification slower and much harder to crack if ever brute forced by a hacker.
Furthermore, BCrypt is used in PHP's passwordHash() function so this change will open up some more account management possibilities through PHP registration scripts, especially CMS's and database bridging.
* Update AuthDbContext.cs
* Add Update script for Auth database
* Update Account / AuthDb for in-place migrations
* Fix a whitespace error
* Add 'passwd' and 'set-accountpassword' commands
* Update changelog
* Update AuthenticationBase.sql
Revert Auth Base to previous commit
* Update changelog.md
This changes the SaveBiota from using a Write lock to using a Read lock. The benefit here is that now the biota can still be read while it is in the process of being saved.
We don't need a write lock when we save the biota because the only properties that will be changed are record id's will be added for records that are new.
Because we maintain the context for the life of the biota, when we add/save, it's simply a one way change, meaning, only the database will change. The biota itself is just read and compared to the clone that the context holds. Thus, this is a safe way to do it.
* 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
* Add DotDuration to Spell table
* Rename Emote Table script slightly
* Change to Double
* Update Duration to use DotDuration if it has a value
* Add DotDuration to SQL Writer
* Change Enchantment Registry to use composite key instead of a primary key id column
* Add a few indexes
* Remove indexes added in #1206
* Rescaffold
* Switch EnableSensitiveDataLogging in AuthDbContext to a specific EFAUTHDEBUG variable
* Update changelog.md
* WIP and bad WIP at that. Just transferring work from one computing device to another.
* Initial summoning functionality
* Remove debugging line
* Implement 45 second duration and remove unneeded monster spell casting dependency
* Add comment containing PCAP file providing good examples and first pass at implementing cool down timer enchantment
* Fix merge lint
* Add summoning features back in that were removed.
* Cleanup
* Bringing up-to-date with latest build
* Latest WIP build
* Moving SQL to ACE-World-16PY-Patches
* Adding some aggro methods
* Latest build / refactoring
* Adding skill usage requirements
* Adding combat pets drawing aggro
* Adding elemental damage types
* Adding message for summoning installation
* Some minor adjustments
* Cleanup
* Fixing callchain for SetEphemeralValues
* 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
* Use Dictionaries to hold biota property records for faster access
* Fix an exception in the stack merge code where the target is null
* Remove a couple unneeded using statements
* Landblock EnqueueBroadcast cleanup
Avoid double cast by using OfType
Change excludeList from IEnumerable to ICollection because it was being enumerated more than once.
* SerializedShard handle OperationCancledException
* SerializedShard break on the exceptions
* Landblock save progress
* Landblock merge fix
* Decayable -> Dynamic
* Improved ShutdownServer to include landblock unload and db queue wait
* Sleep during shutdown instead of using up all the CPU
* Shard GetDynamic was comparing against the wrong id... woops
* Fix shard biota caching
* Improve shutdown logging and actions
* cosmetic code order
* Fix crash when trying to add a bad wo to a landblock
* This fixes reloading dynamic objects
* Don't save item on pickup
* Don't save item on pickup from chest
* Don't save items on drop
* Set Home Position only for creatures (Used for navigation)
* Improve the landblock SaveDB code
* Don't save player corpse on death. Landblock will do that for us in bulk.
* Add the housing objects to statics that persist to the shard
* WorldObjectFactory dont overwrite location if object came from database
* Improved IsStaticThatShouldPersistToShard
* This should fix player dropped missiles
* Move PositionType into ACE.Entity.Enum.Properties
* Ephemeral support for Positions
* Decay code/saving works much better
* Filter out contained and wielded items from shard GetDynamicsByLandblock
* TimeToRot provision for -1 (No rot)
* Corpse decay is now controlled by landblock and uses the same decay code
* ShardDatabase: Fix add/remove biota bug
* WorldObject.Destroy now destroys contained and equipped items as well
* TryRemoveFromInventoryWithNetworking no longer removes the object from the db
* Player corpse items now remain when the corpse decays
* Cleaned up SetPropertiesForWorld
* Refactored generators, improved RNG selection formula
* Removing calls to PerfTimer
* .
* Fixing AL/RL display in character info panel
* Fixing issue with MaxCreate
* Adding check for GeneratorDisabled status, cleaning up EventManager
* Removing int cast for latest version of DB
* 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
* typo fix
* WorldObject Position/Cache cleanup
The positionCache (formerly named Positions) should only be referenced by the Get/Set/Remove functions.
Furthermore, on save, we make sure that the positions in the biota have the latest up to date values from the cache.
We must do this because we don't wrap Positions like we do attributes/skills/vitals.
* ACE.DatLoader BinaryReaderExtensiosn cosmetic
* WorldObject Obsolete Model Properties removed
* Remove Player.SetCharacterPosition()
* Important summary regarding setting positions
/// !!! VERY IMPORTANT NOTE REGARDING SetPosition !!!<para />
/// Position objects are reference types. Lets say you want to create a new object and give it the location of a player,
/// If you do LandscapeItem.SetPosition(PositionType.Location, Player.Location), you've now set the Location position
/// for both the player and the LandscapeItem to the same exact object. Modifying one will affect the other.<para />
/// The proper way to would be: LandscapeItem.SetPosition(PositionType.Location, (Position)Player.Location.Clone())<para />
/// Any time you want to set a position of a different PositionType, or, positions between WorldObjects, you should use the above Clone method.
* Removed unecessary virtual on some properties
* First batch of Character refactor
Characters are now cached with their dbContext, exactly like we do for Biotas. This greatly simplifies the way characters are pulled and saved, and is much more efficient.
Deleting and restoring characters have been migrated to the new SaveCharacter function. There is no need for separate functions to handle those specific tasks.
IsPlussed column added to Character. This removes the need to query the biota to see if we should display the + in front of the name at the character screen.
Character.LastLoginTimestamp, TotalLogins, CharacterOptions1, and CharacterOptions2 are now used. These property types were removed from the ACE.Entity.enum. (the 9000+ types)
Fixed a few places where ChangesDetected was being set insetad of CharacterChangesDetected. There is still more work to do to improve this pattern.
* Player_Client renamed to Player_Character
Plus some cleanup on the way CharacterOptions were get
* Remove duplicate appearance DID properties from WorldObject_Properties
* Removed the duplicate HairTexture DID properties
* Migrate HairTexture from biota property to Character property
* Forgot a CharacterChangesDetected
* Migrate Character specific functions to Player_Character
* Some more Biota wrappers added to BiotaExtensions
* CharacterPropertiesShortcutBar wrapped
* CharacterPropertiesSpellBar migrated to CharacterExtensions
* CharacterPropertiesTitleBook migrated to CharacterExtensions
* CharacterPropertiesFriendList migrated to CharacterExtensions
* drop AccountId from CharacterPropertiesFriendList
* EnchantmentRegistry improvements
Thread safety added to EnchantmentManager
Thread safety added to EnchantmentRegistry
The locks are required only when we iterate/insert/remove from the collections. EF accesses these collections on a separate thread and they cannot be modified while being iterated over.
Player save removed from EnchantmentManager. Saving a player should be a function of the player, not the enchantment manager. If we want to save a player on death, we can do that from the player.
Some minor cosmetic code improvements here and there.
* Moved the remaining thread locks to BiotaExtensions
* White spaces removed
SetProperty now has an out bool biotaChanged argument that can help the caller know if an actual change was made.
In addition, setting the objects CreationTimestamp was in the wrong place
* SaveBiota major changes
SaveBiota now only updates values in the database that have changed instead of updating every single value.
In addition. SaveBiota detects added and removed linked entities.
* Replace AddBiota(s) with SaveBiota(s)
* This improves the way a few places referenced the biota
* SaveBiota switched to a diff method. Still some work to do
* More notes + fixes
* SaveBiota move GetBiota to before EnterWriteLock
* Added a note about the lock performance
* More summary improvements for BiotaDatabaseLock
* Thread safety added to the SaveBiotas and AddBiotas functions
SavePlayer also switched to use the SaveBiotas bulk action instead of saving each biota individually.
* Biota.Clone() added
* BiotaExtensions cosmetic only
* DbUpdateException fixed
If there were multiple new records in a collection, the first one was attached but with the last new records values.
This would end up resulting in property records with duplicate types id's.
* ReoveBiota check if biota actually exists in db before removal.
* /databasequeueinfo added
* New From-Weenie Containers should not be searching the shard for inventory
* DeveloperDatabaseCommands removed RequiresWorld flag
* Improved DatabasePerfTest results.
* Shard PopulatedCollectionFlags
This greatly improves GetBiota performance.
It does so by recording the biotas populated collections on save, and then on Get, only pulling those known populated collections back from the database.
* Note added about GetBiota improvements
* Shard Parallel loops added for GetPlayerBiotas
This improves performance signifcantly.
Previously, a full mule too 8s to load.
Now, it's uder 500ms.
This removes Character as the parent of a Biota, and instead, makes them side by side objects that are owned by Player.
Session no longer owns Character.
Session maintains a list of the Characters for the account.
Session holds a reference to the current Player being used.
Player holds a reference to Biota and Character objects.
What I said in discord:
We have the Player object (our god class).
To put a player in the world, it requires a biota. It doesn't require a character or session.
To manipulate the player, we need a session (but not a character).
To give the player a user interface, we need a character.
The character holds all the user progress of the particular biota it's associated with.
So, a session holds a link to the current player the session is managing.
Player holds a link to the biota and character that represent the player.
The biota represents the player from the worlds pov.
The character represents the player from the users pov.
In the cache.bin, this is probably a bool. It is 1 for every instance found.
If/When we understand what this flag might have meant, we can re-add. However, given that it was always true in cache.bin, that is unlikely.
Furthermore, in GDLE, this bit was always set to 1 on write, and always masked off on read.
If an int/float had a default of '0', it was removed.
If a nullable had adefault of NULL, it was removed.
This isn't needed for EF.
This cleans up the SQL.
This also helps make sure our sql writers are generating the full INSERT query to recreate a record.
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.