Commit graph

95 commits

Author SHA1 Message Date
Ty Conner
0395d73755
Change Shard Biota Palette table (#1679)
* Change Shard Biota Palette table

* Update changelog.md
2019-04-09 03:34:48 -05:00
Mag-nus
e8284981d6
SpellbookCache (#1656)
* 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.
2019-04-07 08:05:35 -05:00
Ty Conner
35c611bec3
Update ShardDB Enchantment Registry Composite Key (#1605) 2019-03-30 14:15:37 -05:00
gmriggs
abe9340bca
Adding alternate currency for vendors (#1575)
* Adding alternate currency for vendors

* minor update

* updating Pluralize()
2019-03-28 00:26:25 -04:00
gmriggs
ec3a4b0759
retaining item enchantments on death (#1551) 2019-03-18 22:50:27 -04:00
gmriggs
f46401248b
Adding items that can be leveled up (#1544)
* Adding items that can be leveled up

* initial implementation for item leveling, and item equipment set spells

* negative rating update
2019-03-18 22:50:00 -04:00
Ty Conner
d311df7e0c
Change BCrypt WorkFactor to configurable Option in Config.js (#1506)
* 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
2019-03-09 19:52:04 -06:00
zegegerslittlesis
cac4ea9e16 Update account authentication to use BCrypt. (#1468)
* 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
2019-03-08 13:41:23 -06:00
Ty Conner
bd5d7fc32d
Add LastModified to things (#1410)
* Add LastModified to things

* Create db-pr-override.txt

* Update changelog.md

* Update README.md
2019-02-04 11:55:13 -06:00
Mag-nus
57e97ecdde
Change the write lock to when we actually change the property (#1403)
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.
2019-02-03 13:21:43 -06:00
gmriggs
34d0494cb9
Improved enchantment layering, and refreshing for item spells (#1386) 2019-01-27 13:11:37 -05:00
Mag-nus
616feed958
Assembly changes (#1369)
* 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
2019-01-26 10:09:13 -06:00
gmriggs
29af3c1e9f
Adding scribing abilities (#1346) 2019-01-22 11:59:03 -05:00
Ty Conner
3dbf792591
Add and use DotDuration in Spells (#1331)
* 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
2019-01-20 22:15:12 -06:00
Ty Conner
350edddcf6
World DB Changes (#1295)
* Minor PCAP commenting fix

* Remove Duplicated Data from Spell Table

* Update MySqlInstall.bat

* Update Recipe Mods table column Unknown1 to Source

* Update SpellProperties.cs

* Add spell-export

* cleanup

* Update code

* delete spell-export

* remove data that was redunant from dat

* Update CreateList and Generator labels

* Change Emote.Display to Bool

* Change Emote.Display to Bool

* Fix script

* update changelog

* Add some null checks

* More null check

* syntax error

* cleanup

* more cleanup

* Create db-pr-override.txt
2019-01-19 19:55:26 -06:00
gmriggs
12469dd963
Adding /fillcomps persistence to server (#1307) 2019-01-18 17:07:58 -05:00
gmriggs
e105700e56
Adding server persistence for spellbook filters (#1306) 2019-01-18 16:42:11 -05:00
Ty Conner
e813990318
Change Enchantment Registry to use a composite key (#1202)
* 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
2019-01-03 10:53:29 -06:00
gmriggs
68c3d439d9
Improving recipe manager, adding tinkering and imbues to crafting system (#1184)
* prototyping tinkering / imbues

* Appending /buff with Arcanum Salvaging

* Removing debug messages

* Adding recipe requirements type checking system

* Refactoring old code

* Adding mod types

* re-org material types by skill

* update linen

* adding return

* Adding icon underlays from @dgatewood

* network sending icon updates

* adjusting icons

* Reverting Source back to Unknown1

* Fixing attuned and retained

* .
2018-12-30 17:47:40 -05:00
gmriggs
aaa7a64eae Updating house permission sql (#1193)
* Updating house permission sql

* Rename sql script

* Update SQL script

* Update SQL script

* Update Scaffolding

* Remove Invisible on keys
2018-12-29 14:20:15 -06:00
gmriggs
b23e6b8417
Adding house guest and storage permissions, open/closed, hook visibility, and boot system (#1183) 2018-12-28 01:48:05 -05:00
gmriggs
17cd82e1e8
Adding summoning from @mcreedjr (#1117)
* 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
2018-12-15 00:55:52 -05:00
Mag-nus
eeaf9725e4
PlayerManager (#1103)
* 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
2018-12-02 13:41:16 -06:00
Mag-nus
657abf1939
Property Dictionaries (#1096)
* 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
2018-11-20 07:44:55 -06:00
Mag-nus
502e716e8e
Landblock item saving + Much more (#1071)
* 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
2018-10-23 15:52:09 -05:00
gmriggs
abf3923355 Adding support for level 8 spells (#1048)
* Adding support for level 8 spells

* Updating /dispel command
2018-10-09 11:47:26 -04:00
gmriggs
ecf829d08b Refactored generators, improved RNG selection formula (#1041)
* 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
2018-10-03 15:01:59 -04:00
Ty Conner
eac0370646
Fix Generator Ints (#1042)
* Add SQL update scripts

* Update Shard and World base scripts

* Update Shard Scaffolding

* Update World database Scaffolding
2018-10-02 21:34:58 -04:00
gmriggs
43d1373568
Adding Void magic (#1028)
* 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
2018-09-28 03:55:32 -04:00
Mag-nus
51893199b4
WorldObject Position Updates (#1010)
* 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
2018-09-10 19:49:00 -05:00
Mag-nus
09e1c68135
Migrate Character tables over to similar caching/threading model as Biota (#979)
* 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
2018-08-30 07:11:25 -05:00
Mag-nus
7b03907897
EnchantmentRegistry improvements (#966)
* 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
2018-08-22 10:30:51 -05:00
Mag-nus
0393bbf618
Fix biotas being falsely detected as changed (#965)
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
2018-08-21 19:00:18 -05:00
Mag-nus
12c9eea68a
Shard Biota Save & Threading Model Rework (#960)
* 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.
2018-08-20 18:30:38 -05:00
Mag-nus
df8946b9da
Major Shard Performance Improvements (#941)
* 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.
2018-08-10 20:30:21 -05:00
Mag-nus
81fc08040e
Character refactor (#928)
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.
2018-08-07 21:08:22 -05:00
Mag-nus
47f89f18d6 Remove unused index
We never used any of these in ACE, so we don't need the database to keep track of them for us.
2018-08-06 01:28:24 -05:00
Mag-nus
128ca11fd4 Remove redundant keys for forein keys in Shard
Seem my previous checkin for World.

InnoDb will auto create these keys for us. We do not need to do them explicitly.
2018-08-06 00:38:42 -05:00
Mag-nus
c079bf0fd0 Treasure Death/Wielded column names updated (Thanks GDLE) 2018-08-06 00:16:28 -05:00
Mag-nus
478e891aa3 PropertiesSkill AdjustPP removed
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.
2018-08-05 23:27:06 -05:00
Mag-nus
15c9c6f8a3 Redunent keys for foreign keys removed
keys will automatically be created for columns that reference foreign keys.

We do not need to manually define them as well.
2018-08-05 12:40:34 -05:00
Mag-nus
e9db9ab530 Defaults removed for native type default values
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.
2018-08-05 12:24:43 -05:00
Mag-nus
7feffeedcc Spell table columns Id and SpellId merged into Id
There are no need for duplicate unique id's. The Spell Id is already gauranteed to be unique
2018-08-05 08:54:42 -05:00
Mag-nus
004d7d4f19 LandblockInstance refactored. DYNAMIC SUPPORT REMOVED
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.
2018-08-05 07:30:14 -05:00
Mag-nus
33ef2f2e7c Rename landblock_instances to landblock_instance
This follows the singular naming convention we are using for the other tables
2018-08-04 14:24:52 -05:00
Mag-nus
ab980c21b5 Didn't have the latest scaffold for worlddbcontet from previous checkin 2018-08-04 09:43:58 -05:00
Mag-nus
005fd2339a EmoteActions are now childeren of Emote 2018-08-04 09:02:41 -05:00
Mag-nus
409f7f28a1 Forgot to remove RecipeComponent.cs file after table was removed. 2018-08-01 23:11:14 -05:00
Mag-nus
70d7ca78a5 Quest message column allow null
Text columns should allow null
2018-08-01 22:58:19 -05:00
Mag-nus
1429c1751f Cook_book column reorder
Source now comes before target
2018-08-01 22:56:21 -05:00