* Components: Make ComponentType inline
Prevents the next commits ODR violation
* Components: Add new components
* Entity: Add headers
inline script component ComponentType
* Components: Flip constructor argument order
Entity comes first always
* Entity: Add generic AddComponent
Allows for much easier adding of components and is error proof by not allowing the user to add more than 1 of a specific component type to an Entity.
* Entity: Migrate all component constructors
Move all to the new variadic templates AddComponent function to reduce clutter and ways the component map is modified.
The new function makes no assumptions. Component is assumed to not exist and is checked for with operator[]. This will construct a null component which will then be newed if the component didnt exist, or it will just get the current component if it does already exist. No new component will be allocated or constructed if the component already exists and the already existing pointer is returned instead.
* Entity: Add placement new
For the case where the component may already exist, use a placement new to construct the component again, it would be constructed again, but would not need to go through the allocator.
* Entity: Add comments on likely new code
* Tests: Fix tests
* Update Entity.cpp
* Update SGCannon.cpp
* Entity: call destructor when re-constructing
* Update Entity.cpp
Update Entity.cpp
---------
Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
* Logger: Rename logger to Logger from dLogger
* Logger: Add compile time filename
Fix include issues
Add writers
Add macros
Add macro to force compilation
* Logger: Replace calls with macros
Allows for filename and line number to be logged
* Logger: Add comments
and remove extra define
Logger: Replace with unique_ptr
also flush console at exit. regular file writer should be flushed on file close.
Logger: Remove constexpr on variable
* Logger: Simplify code
* Update Logger.cpp
Adds a missing edge case on the client where you may have the is_smashable flag set, but dont actually have a destroyable component. In this case you should create only a destroyable component and add it to the component and serialize it last after all other data. We also needed to add the set_faction var reading and setting as this is how Oliver Sudden actually gets their faction since they have no actual information in the database, it is all stored in ldf keys.
Tested that Oliver Sudden no longer logs Unable to unserialize logs when serialized or constructed.
Fixes#1222
addresses an issue where the death behavior of a destructible component was not being respected and enemies with destroyable components that had special death animations were not able to play the animation on death. This pr adds in the hardcoded constant the client uses for the same metric of 12 seconds.
Tested that claiming Nimbus Rock and completing the property guards mission allows him to vacuum away and then network the destruction packet 12 seconds later.
Fix gravity not being adjusted when colliding with a phantom physics object
Tested that while on moonbase, the players gravity is no longer reset to 1 when they change their cheat info.
* Move away from constructor queries
Fix up other large tables to have proper backup lookups
Revert "idk im just dumb ig"
This reverts commit 5d5be5df53b8959b42b291613d7db749a65a3585.
idk im just dumb ig
* Fix slow components registry lookup
* add define for cdclient cache all
* Huge loot namespace rework
- Remove all excess memory usage
- do not cache components registry
- cache loot matrices on startup of the destroyable component
- convert loot singleton class to a namespace
- rework loot cdclient tables to operate closer to how someone would actually use them (basically doing the previous LootGenerator::LootGenerator caching but in those tables)
- Memory usage reduced by 10%+ across the board
* cache rebuild matrix
* Database: move reading to own function
Also change name of cache to PascalCase
* Database: Move common function rading
* Make serialize actually virtual
yep
* Abstract to PhysicsComponent
Move shared functionality of all physics related classes to a base class.
Tested that there were no failed to unserialize errors when in main gameplay in Gnarled Forest or in a race.
Tested that 2 players were able to see each other in the above scenarios just fine as well.
* Update PhantomPhysicsComponent.cpp
* Add SimplePhysicsTest
* Add construction test
* Update SimplePhysicsComponentTests.cpp
* remove flags and fix override
* Update VendorComponent.h
* Re-write AOE behavior for new filter targets
Update Tacarc to use new filter targets
Added dev commands for skill and attack debugging
* Get all entities by detroyable
rather than controllable physics
Since destroyables are what can be hit
* Re-work filter targets to be 100% live accurate
reduce memory usage by only using one vector and removing invalid entries
get entities in the proximity rather than all entities with des comps in the instance, as was done in live
* remove debuging longs and remove oopsie
* address feedback
* make log more useful
* make filter more flat
* Add some more checks to filter targets
add pvp checks to isenemy
* fix typing
* Add filter target to TacArc and update filter target
* fix double declaration
* Some debugging logs
* Update TacArc reading
* make log clearer
* logs
* Update TacArcBehavior.cpp
* banana
* fix max targets
* remove extreanous parenthesesuuesdsds
* make behavior slot use a real type
---------
Co-authored-by: David Markowitz <EmosewaMC@gmail.com>
This reverts commit d7e16ab589697fd1a0a270a02c622b8fa752638f.
Fixes an issue where the incorrect mission is marked as being offerable and this overwrote the original mission offered by wisp lee and forced him to offer a different, unacceptable mission.
Tested that completing the mission twice from a new daily state and a repeatable state both completed the chain correctly. Unsure what the original bug was, but it does not appear to be present.
On top of that, there is no pre-requisite for mission 1883 anywhere in the cdclient, so at best, this check was always false, but the correct behavior is exact equivalence for the mission state.
* Fixed Scrapped Racecar Stuck Issue
Changed RacingControlComponent to boot players back to the hub world when trying to race after dismantling a vehicle.
* Modified OnPlayerLoaded to fix Vehicle Inventory issue
* Change 3
---------
Co-authored-by: David Markowitz <EmosewaMC@gmail.com>
* Fix deleting last character
Fix an issue where deleting your last character caused the character to still show up on the character selection screen.
Tested that deleting my final character results in an empty character selection scene.
* Update UserManager.cpp
* chore: cleanup LU(W)string writing
and add methods for reading
remove redunent "packet" from packet reading helpers
move write header to bitstreamutils since it's not packet related
add tests for reading/writing LU(W)Strings
* remove un-needed function defintions in header
* make reading and writing more efficient
* p
p
* quotes
* remove unneeded default
---------
Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
* Move away from constructor queries
Fix up other large tables to have proper backup lookups
Revert "idk im just dumb ig"
This reverts commit 5d5be5df53b8959b42b291613d7db749a65a3585.
idk im just dumb ig
* Fix slow components registry lookup
* add define for cdclient cache all
* Update CDBehaviorParameterTable.cpp
* cleanup
* more cleanup and fully implement the sound trigger
and racing sound trigger
* more cleanup, and better defaults
* fixes and tested
* update initializor for guid and when to load sound guids
* make racing sound trigger it's own component
* fix type
* Remove global
move serializes
---------
Co-authored-by: David Markowitz <EmosewaMC@gmail.com>
* rename and cleanup file
* more
* fix broken function
* Further naming fixes
t
Revert "Further naming fixes"
This reverts commit 057189982ba56788d48f9265d815e6c562ba6328.
* next step
* undo all testing changes
* minor tweaks
* refactor: Vendor inventory loading
Implement proper delta compression
dynamically determine multicostitems and standard cost items
Quatantine max's custom code
* address feedback
* fix newline
* oops
* remove header
* fix default and const for
* he said make it a reference too, not just const
* Convert BrickDatabase to namespace
This did not need to be a class.
* Fix linker errors
* convert to anonymous namespace
so the cache is unmodifiable outside the brickcache
* Move to lower scope level and remove log
* Move EntityManager to Game namespace
* move initialization to later
Need to wait for dZoneManager to be initialized.
* Fix bugs
- Cannot delete from a RandomAccessIterator while in a range based for loop.
Touchup zone manager initialize
replace magic numbers with better named constants
replace magic zonecontrol id with a more readable hex alternative
condense stack variables
move initializers closer to their use
initialize entity manager with zone control
change initialize timings
If zone is not zero we expect to initialize the entity manager during zone manager initialization
Add constexpr for zone control LOT
* Add proper error handling
* revert vanity changes
* Update WorldServer.cpp
* Update dZoneManager.cpp
* Fix vehicle serialization during races
- Add missing frame stats reading
- correct the inversion of rotation
- correct serialization order
- use proper dirty flags
Tested that racers are no longer sideways on certain vertical slopes and stay in sync throughout the whole race.
* Update ClientPackets.cpp
* Update ClientPackets.cpp
* Update VehiclePhysicsComponent.h
* Fix incorrect serialization of SendTeleport
- Fixes all incorrect teleports in the game
- remove hacks in mast teleport
- ...
- ......
Update GameMessages.cpp
* Remove stupid argument
there got it all out
* remove extra true
Fixes an issue where most smashables did not explode into bricks upon death. This included anything that was spawned or didnt have the flag is_smashable set.
Tested that in races, all objects smash into bricks
Tested that the player properly explodes in their car if they crash
Tested that Shooting Gallery plays the special smash animation when a ship is smashed
Tested that all spawned objects play smash animations
* Fix warning, Fix modular assembly not smashing
* Rename variable to correct name
* Update AMFDeserializeTests.cpp
Redo Amf3 functionality
Overhaul the whole thing due to it being outdated and clunky to use
Sometimes you want to keep the value
Update AMFDeserializeTests.cpp
* Fix enum and constructors
Correct enum to a class and simplify names.
Add a proper default constructor
* Update MasterServer.cpp
* Fix bugs and add more tests
* Refactor: AMF with templates in mind
- Remove hard coded bodge
- Use templates and generics to allow for much looser typing and strengthened implementation
- Move code into header only implementation for portability
Refactor: Convert AMF implementation to templates
- Rip out previous implementation
- Remove all extraneous terminology
- Add proper overloads for all types of inserts
- Fix up tests and codebase
* Fix compiler errors
* Check for null first
* Add specialization for const char*
* Update tests for new template specialization
* Switch BitStream to use references
* Rename files
* Check enum bounds on deserialize
I did this on a phone
* Hacky FallSpeedBehavior
* Fixup
* Make it more robust like speedboost
add check for default
Fix error in GetActiveSpeedboosts
* simplify and address feedback
Fixes#1048
Tested that closing the dialog via esc, the x in the top right, or the big red x doesn't exit the race
Tested that the green check button does exit the race
* Fix overread in projectile behavior
* Fix stuns
* Correctly read in bitStream
* Fix projectile behavior
* Address movement type issues
* Update shutdown time to be accurate
* Fix small issues
* Fix missing template
* Add note for compile jobs
* Add bounds check for speed division
* Add better logs
* Breakout rest of the enums from dcommonvars
so we don't have to deal with merge conflicts
ePlayerFlags is not a scoped enum, yet, due to it's complexity
* address feedback
* make player flag types consistent
* fix typo
* randominze between 0 and 7 inclusive
for the different animation types
* Make the end behavior deterministic unpon loading
So that all players see the same animations for each other
- Modularize tests
- Add migrations
- Fix switch case so it actually breaks
- Add in missing writes
- Beginning work on custom migration to move the leaderboard to the final state
* Implement maelstrom fog for alpha FV
add OnOffCollisionPhantom call to cppscripts
Add physics shape for gas blocking volume
* Add Ninja Sensie Script for alpha FV
and migration
* Fix private var casing
* And ninja wild scripts
they keep making me add more things
* address feedback
---------
Co-authored-by: Gie "Max" Vanommeslaeghe <gievanom@hotmail.com>
Fix an issue where the Wingreaper birds no longer moved. The client seems to do the following:
Default speed set to 10.0f
Check the PhysicsComponent table for the column speed and if it exists set speed to that value and if the value was null set it to the default again.
Clean up macros
more tomorrow
Cleanup and optimize CDActivities table
Remove unused include
Further work on CDActivityRewards
Update MasterServer.cpp
Further animations work
Activities still needs work for a better PK.
fix type
All of these replacements worked
Create internal interface for animations
Allows for user to just call GetAnimationTIme or PlayAnimation rather than passing in arbitrary true false statements
* Implement some trigger event calls
and command handlers
* add zone summary dimissed GM
* break and remove log
* some cleanup in Gather Targets
and blocking out
* fix default value of unlock for play cinematic
* Log on errors
add enum for physics effect type
simplify nipoint3 logic
check arg count
add enum for End behavior
* tryparse for nipoint3
* totally didn't forget to include it
* bleh c++ is blah
* ???
* address feedback
* Fix for #1028
* breakout gmlevel enum and make it a class
tested that things still work
slash command,
chat restrictions,
packets and serializations
* fix GM level for some slash commands
* fix new use of this enum
* CDClient cleanup and optimization
- Use static function to get table name
- Remove unused GetName function
- Replace above function with a static GetTableName function
- Remove verbose comments
- Remove verbose initializers
- Remove need to specify table name when getting a table by name
- Remove unused typedef for mac and linux
* Re-add unused table
Convert tables to singletons
- Convert all CDClient tables to singletons
- Move Singleton.h to dCommon
- Reduce header clutter in CDClientManager
* breakout the component types into a scoped enum
tested that things are the same as they were before
* fix missed rename
* fix brick-by-brick name to be crafting
because that's what it is
* Make wrapper for casting skills
this is to reduce magic numbers in the code base
Only updated one use of this to demo that this works.
Will be do more in a sepearate PR.
Also, inadvertantly fix damage stacking and self-damage in the teslapack
* add skill<->behavior caching
* explicit by reference
* address emo's feedback
* Split out LUTriggers into it's own component
* some cleanup
* fix debug log
* use emplace and tryParse
* slight refactor to make the work on startup
rather than at runtime
Also TODO's for getting targets via all the possible methods
* address feedback
* load values once
so that it doesn't check every time
don't return, just skip
don't realod char
* address feedback
* don't drop the only item you can't get again
* address most feedback
* move settings for HC mode
* fix comment
* claenup whitespace
* moving branch
* Add deleteinven slash command
* Change name of BRICKS_IN_BBB
* Use string_view instead of strcmp
* Clean up include tree
* Remove unneeded headers from PCH files
Removes unneeded headers from pre-compiled headers. This increases compile time, however reduces development time for most files.
* Update Entity.h
* Update EntityManager.h
* Update GameMessages.cpp
* There it compiles now
Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
* Fix overread in projectile behavior
* Fix stuns
* Correctly read in bitStream
* Fix projectile behavior
* Address movement type issues
* Update shutdown time to be accurate
* Fix small issues
* Fix trading taking the wrong item
* Add missing returns
* Improve further
Do all verification first. Then actually do the trade. Prevents possible cheating attempts
* Add speed base readling and writing
to the level prograssion component
Add retroactive fix to the world transfer
TODO: see about versioning charxml fixes to make them not run every time
* version all current changes
* cleanup speed behavior
add calculate for future use in scripts
make < 1 speed multiplier possible
tested wormholer and it plays anims correctly
* cap the lower end of the speed multiplier
until the ending the behavior on hit properly works
* address feedback
add emun for character version
make set ignore multipliers consistent in speed behavior
switch case for char version upgrades
* remove the ability to stack speed boosts
* update value on level ups
* Add failArmor server side
Address out of bounds reading in behavior
Address the basicAttackBehavior reading out of bounds memory and reading bits that didnt exist, which occasionally caused crashes and also caused the behavior to do undefined behavior due to the bad reads.
Tested that attacking a wall anywhere with a projectile now does not crash the game. Tested with logs that the behavior correctly returned when there were no allocated bits or returned when other states were met.
Add back logs and add fail handle
Remove comment block
Revert "Add back logs and add fail handle"
This reverts commit db19be0906fc8bf35bf89037e2bfba39f5ef9c0c.
Split out checks
* Cleanup Behavior streams
* Add failArmor server side
Address out of bounds reading in behavior
Address the basicAttackBehavior reading out of bounds memory and reading bits that didnt exist, which occasionally caused crashes and also caused the behavior to do undefined behavior due to the bad reads.
Tested that attacking a wall anywhere with a projectile now does not crash the game. Tested with logs that the behavior correctly returned when there were no allocated bits or returned when other states were met.
Add back logs and add fail handle
Remove comment block
Revert "Add back logs and add fail handle"
This reverts commit db19be0906fc8bf35bf89037e2bfba39f5ef9c0c.
Split out checks
* Remove case 2
* Update SkillComponent.cpp
Unintentionally, bricks were not creating new stacks if you tried to get another stack. This prevents some missions from being completed. This issue is now fixed
Brick building as of right now does not implement the undo action properly. This commit addresses the issue with undoing button being non-functional server side and implements the GM needed for addressing further issues.
Implement GameMessage UnUseModel which is called when a model in BrickBuilding is UnUsed. Important for UGC content down the line. Final code has been tested as follows:
1. Placed a model in brick build
2. saved placed a brick
3. repeat 2 and 3 twice more for 6 total models
4. Place a new model in brick mode and then edit all 7 models into one brick model instance
5. Pressing undo returns the converted model to the inventory and properly discards the other 6 without crashing. Intended live behavior is to store this in the inventory instead however behind the scenes work is needed to implement UGC models properly.
Implement enum
Implement the BlueprintSaveResponseType enum so there are less magic numbers sent via packets.
Correct int sizes from unsigned int to uint32_t
Add deserialize test
Add a test for de-serializing a GM that is sent to the client. Assertions verify the data is in the correct order and has no extra information.
- Give entities that have a script component ID of zero a script component still
- Progress scripted entity missions within the for loop as we do for script calls
Tested that Boogie Down is (finally) completable.
Tested that Mission 737 is still completable
Checked that missions progressed inside OnEmoteReceived scripts to not double trigger progression
Allows the server to be run from a non-build directory. Also only read or write files relative to the build directory, regardless of where the server is run from
* Implement basic functionality
Implements the basic functionality and parsing of property behaviors.
Unhandled messages and logged and discarded for the time being. The only implemented message is a basic one that sends the needed info the the client side User Interface to pop up.
* Stop adding movingpla comps where they aren't needed
* move stuff around to make it more congruent
* invert if else block logic patter
Since setting up the comp will be longer han just adding the path
will make the readability flow better
* address feedback