Commit graph

21 commits

Author SHA1 Message Date
Mag-nus
759b01ac0c
/serverperformance command (Server Performance Monitor) (#1642)
* /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
2019-04-04 13:38:01 -05:00
gmriggs
74b0c0dc72
moving HouseManager (#1442) 2019-02-13 18:15:28 -05:00
gmriggs
c2eac1532f
Adding house maintenance (#1427)
* Adding house maintenance

* Adding trade notes -> pyreals

* Adding AllegianceMinRank checking / warning message for maintenance

* Updating for 0.9.15

* adding HouseInstance null check

* more consistency updates / refactoring

* Adding slumlord.MergeAllStackables()

* Adding CheckHouse
2019-02-12 07:10:43 -05:00
Mag-nus
eb02530c78 This switches two world db house functions to use caching (#1434)
* This switches two world db house functions to use caching

GetHousePortals
GetHousePortalsByLandblock

* added CacheAllHousePortals()
2019-02-11 14:35:21 -05:00
Mag-nus
411b5fdfaa
use AppDomain.CurrentDomain.UnhandledException (#1300)
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.
2019-01-17 10:05:48 -06:00
gmriggs
796bc35411
Improved EmoteManager timing (#1273)
* Improved EmoteManager timing

* Fix giving pyreals to TC

* Update SetSanctuaryPosition
2019-01-15 16:31: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
23100087a8
keepOpen option added to DatDatabase FileStream (#1097) 2018-11-20 07:45:09 -06:00
Ty Conner
ca6c8d1fc3
Fixes for Anniversary Event emotes (#1086)
* 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
2018-11-01 20:10:54 -04:00
gmriggs
4619970f80
Refactoring LandblockManager, improving VitalTick performance (#1079)
* Physics Cache cleanup (Mostly cosmetic)

* Vertex/Polygon/BSP CacneEnabled flags added, default to false

Testing results:

Debug mode, loading 31,329 landblocks (x = 0x20-0xD0, y = 0x20-0xD0)

With Vertex, Polygon & BSP Cache:
2018-10-25 10:05:12,121 DEBUG: Loaded Landblocks in 120.39 seconds
2018-10-25 10:05:12,218 DEBUG: 13759 MB used

2018-10-25 10:08:00,330 DEBUG: Loaded Landblocks in 101.11 seconds
2018-10-25 10:08:00,427 DEBUG: 13667 MB used

2018-10-25 10:13:08,448 DEBUG: Loaded Landblocks in 104.36 seconds
2018-10-25 10:13:08,507 DEBUG: 13666 MB used

With Vertex, Polygon & BSP Cache Disabled:
2018-10-25 10:17:55,339 DEBUG: Loaded Landblocks in 100.63 seconds
2018-10-25 10:17:55,404 DEBUG: 14175 MB used

2018-10-25 10:21:11,596 DEBUG: Loaded Landblocks in 89.23 seconds
2018-10-25 10:21:11,666 DEBUG: 14220 MB used

2018-10-25 10:27:22,145 DEBUG: Loaded Landblocks in 93.74 seconds
2018-10-25 10:27:22,200 DEBUG: 14206 MB used

* PhysicsCaches, remove redundant null check

* Improved GfxObjCache model

* DBObj Boxing/Unboxing improvements

* Add thread safety to GfxObjCache

* Landblock phsyics loading async

* Adding setup "caching"

* Redirecting properties to DatLoader

* Refactoring LandblockManager, resolving Physics Landblock loading bug

* Tabs vs. spaces

* Improving VitalTick performance

* Adding refactored AttributeFormula to CreatureSkill

* Disabling BSP cache
2018-10-28 09:56:48 -04: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
678681fbfa Adding methods to QuestManager (#1052)
* 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
2018-10-13 03:57:04 -04:00
Mag-nus
b7ca774e53 WeeniePrecaching (#1047)
* 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)
2018-10-09 11:52:00 -04:00
kdmxp256
561fd5d4ae
Landblock Preloading PoC (#1038)
* Landblock Preloading PoC

* Add TODO comment

* Reformat RawLandblockId array

* Requested changes

* Third change
2018-10-02 09:53:24 -07:00
Mag-nus
b5df7bb060
Usage of DateTime/PhysicsTimer cleaned up across the board (#1016)
* Remove duplicate Timer from Physics.Common

* Clean up ACE.Common.Time and its usages

* WorldObject: Fix CreationTimestamp

* Remove PhysicsTimer which was just a class wrapping a double

* WorldManager.UpdateWorld Stopwatch Usage change

Before we were calculating the elapsed seconds manually with this:
(double)worldTickTimer.ElapsedTicks / Stopwatch.Frequency

The stopwatch can already do this for us via this:
worldTickTimer.Elapsed.TotalSeconds

* WorldManager UpdateWorld Summary improvement

* DateTime based tick removed from Tick() arguments

* No need to pass DateTime.UtcNow.Ticks to Session.Tick

* LastMovementBroadcastTicks was obsolete

Probably souldn't be referencing WorldManager.PortalYearTicks as well.

If we need this in the future, it's probably better to reference DateTime.UtcNow or Time.GetUnixTime()

* Fix WorldObject.Tick() overhead

* Revert "WorldObject: Fix CreationTimestamp"

This reverts commit 457bebc48e.

* PhysicsTimer stuff

Move the Timer back to the Physics namespace and rename it PhysicsTimer

Change some references from PhysicsTimer to DateTime.UtcNow

* timeBeginPeriod and timeEndPeriod added for Windows to improve timer resolution

* ServerManager Shutdown was using 100% cpu

* Fix the usage of CreationTimestamp

* CharacterHandler should not be setting default values. Player ctor should.

* EmoteManager switched from PhysicsTimer to DateTime.UtcNow

* Use PropertyInt and not PropertyFloat for LoginTimestamp

* Fix Session GetAll() to also include sessions that are at the character selections creen
2018-09-15 15:26:10 -05:00
Mag-nus
70decf7361
Property manager logging tweaks + misc (#981)
* UpdateWorld sleep/tickCalc should be last thing loop does

* Don't show decimal places for debug logs that show time elapsed

* PropertyManager less debug output

Also, Propertymanager should be init after the database is init, and before the rest of the server comes up.

Other items in the server might reference properties from the PropertyManager.
2018-08-29 15:36:49 -05:00
OptimShi
58020a3077 Text Encoding Updates (#838)
* Added CP1252 Text Encoding

* Changelog
2018-07-01 20:47:03 -07:00
Evan Merlock
e406ef4853 Add a configurable property storing database to resolve issue #753 (#820)
* Added the configuration database base script.

This should initialize the config database to hold different values that can be changed during the server operation.

* Added database models and connection.

This should begin to add in the new configuration database and its models so that it can be accessed from the server.

* Added boolean statistic access methods.

Modified the database file so that it was properly casting to a boolean and added the methods into the server configuration database API.

* Added the ability to access/modify integers in the config database.

* Added the ability to access/modify floating point variables in the configuration database

* Added the ability to access/modify string values in the configuration database

* Added the ServerConfigurationDatabase to the DatabaseManager.

* Added in the initial caching layer for configuration

* Added the ability to modify cached items.

* Changed from regular dictionaries to concurrent dictionaries.

* Added in the ability for the ConfigurationManager to self-update from the database.

* Added fallback parameters instead of forcing a default

* Added customizable vitae statistics.

This is the first big stat that can be modified. It is a float, so more floats should now work when they have support added.

* Updated the configuration manager to separate methods and ensure semantics are correct.

* Added command to fetch float value from server

* Add property for XP/Lum multipler.

* Welcome message/MOTD is now configurable from the database.

* Added string modification commands

* Database is no longer required for server configuration.

* Added in all modification/fetch commands and a resync command

* Renamed ConfigurationManager -> PropertyManager as this removes ambiguity

* Changed logging string to be more consistent

* Pass w/ StyleCop

* Added comments to the property manager

* Added the ability to disable caching fallback values.

This can be used for default settings or if a fetch with the default fallback should not cache (ie fetching xp_multipler before xp_multiplier has been fetched from the DB/the default value has been given, and therefore xp_multiplier is fetched as 0 and cached as 0). This functionality should be used for server commands.

* The admin commands now properly obey cacheFallback restrictions

* Added initial default property handling.

* Moved to using constant values as defaults.

* Switched to using a Dictionary for resolution of default properties

* Added warning when the server configuration database is not loaded.

* Corrected MOTD default string

* Renamed some of the database connection objects and changed float -> double and int -> long

* Fixed admin commands not being named correctly

* Fixed spelling error

* Config tables now lie in the shard database

* Added descriptions to properties across the board that can be analyzed through admin commands

* Removed property from PlayerXP file

* Removed vitae properties from EnchantmentManager

* Added null checks to make output nicer

* Added command to modify property descriptions

* Fixed string not being stored properly in the DB and crashing the server

* Wrapped the old ServerPropertyDatabase into SerializedShardDatabase

* Fixed ShardDbContext having a modified OnConfiguring method
2018-06-20 21:58:17 -04:00
Ty Conner
5bddbc4351
Changes to Links and Generators, misc other changes (#755)
* Changes to Links and Generators, misc other changes

* Debug cleanup

* Code Dedup
2018-04-23 13:28:27 -04:00
Mag-nus
07aaaf903a ACE.Diagnostics removed 2018-03-06 04:37:56 -05:00
Mag-nus
a162905b1c WIP: Switch Database system to Entity Framework Core, DB First (#633)
* AuthenticationDatabase switched to Entity Framework Core, DB First

* Adds AsNoTracking() for performance and implements CreateAccount() instead of AddAccount()

* woops

* Auth db no longer needs to be init, or inherit from Database

* test fix hopefully

* Database objects in ACE.Entity would no longer be required

* Major WIP

* more progress

* AuthenticationDatabase switched to Entity Framework Core, DB First

* Adds AsNoTracking() for performance and implements CreateAccount() instead of AddAccount()

* woops

* Auth db no longer needs to be init, or inherit from Database

* test fix hopefully

* Database objects in ACE.Entity would no longer be required

* Major WIP

* more progress

* include missing CharacterCreateInfo

* GetCharacters changes to show how we can use the propertybag for these values

* Lot of progress with the WorldObject code

* comment add

* add biota to CreateWorldObject for loading inv from db
2018-03-06 04:35:48 -05:00
Renamed from Source/ACE.Server/ACE.cs (Browse further)