Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
8844c25
Initial divergent approach to entity system
Extremelyd1 Jun 8, 2022
e619349
Server entity data and scene host tracking
Extremelyd1 Jun 9, 2022
7838809
Fix animation wrap mode on scene entry
Extremelyd1 Jun 10, 2022
a72813e
Entity components and FSM action handling
Extremelyd1 Jul 25, 2022
8ca6d6d
Network entity object activity
Extremelyd1 Jul 30, 2022
97440d5
Improvements to activity networking
Extremelyd1 Jul 31, 2022
4b90153
Use reflection to access FSM action methods
Extremelyd1 Aug 6, 2022
2bae2dd
Fix client FSM interference
Extremelyd1 Aug 14, 2022
4ab3377
Partial implementation of health manager component
Extremelyd1 Aug 17, 2022
ef9ec07
Finish health manager component
Extremelyd1 Aug 19, 2022
952686f
Merge branch 'master' into entity-system-v2
Extremelyd1 Aug 19, 2022
bc79fc6
Merge master
Extremelyd1 Aug 19, 2022
705af97
Remove false knight file from master merge
Extremelyd1 Aug 19, 2022
ada4d3e
Implement collider component, fix animations
Extremelyd1 Aug 19, 2022
d7eaebe
Add support for a few enemies, fix FSM action hook
Extremelyd1 Aug 20, 2022
f9aae01
Handle entity deaths on scene enter, update workflow
Extremelyd1 Aug 25, 2022
66d0efb
Update documentation on entity system classes
Extremelyd1 Aug 26, 2022
9399a2d
Fix references and gitignore
Extremelyd1 Nov 11, 2022
d4bfba2
Minor improvements and add zombie shield
Extremelyd1 Nov 11, 2022
95cda3f
Added a few enemies in crossroads
Extremelyd1 Nov 12, 2022
658c80c
Merge branch 'master' into entity-system-v2
Extremelyd1 Nov 26, 2022
fcee6bb
Register spawned entities
Extremelyd1 Nov 26, 2022
4bd953e
Improve entity spawning
Extremelyd1 Nov 27, 2022
0e1d4c3
Initialze spawned entity properly
Extremelyd1 Nov 27, 2022
939829e
Persistent entity spawning
Extremelyd1 Dec 3, 2022
b6c8517
Improve entity spawning and entity data tracking
Extremelyd1 Dec 4, 2022
5e40b56
Merge branch 'master' into entity-system-v2
Extremelyd1 May 13, 2023
687f597
Optimize imports
Extremelyd1 May 13, 2023
ce22a2f
Improvements to entity spawning system
Extremelyd1 May 13, 2023
aae71c4
Add SetVelocity2d as entity action
Extremelyd1 May 14, 2023
43153b6
Progress towards scene host transfer
Extremelyd1 May 20, 2023
7879e19
Finish scene host transfer
Extremelyd1 May 21, 2023
9715009
Fix issue with null client entity
Extremelyd1 May 22, 2023
d21f8fa
Add a bunch of FSM actions, add DamageHero component
Extremelyd1 May 24, 2023
221a1c6
Add mesh renderer component, add non-fsm entities
Extremelyd1 May 27, 2023
1f68ee5
Add velocity component for FK, various other fixes
Extremelyd1 May 29, 2023
c98640e
Remove debug logs
Extremelyd1 May 29, 2023
e354703
Fix animation issue with host transfer
Extremelyd1 May 29, 2023
9ecdf8a
Add action registry for smooth host transfer
Extremelyd1 Jun 3, 2023
ca1fe08
Add support for Brooding Mawlek and fixes for it
Extremelyd1 Jun 4, 2023
8fdc5b0
Disable registered entities from becoming active
Extremelyd1 Jun 5, 2023
f35ef69
Add gravity scale entity component
Extremelyd1 Jun 9, 2023
476d59b
Refactor entity detection to respect object hierarchy
Extremelyd1 Jun 18, 2023
096c204
Refactor specific component initialization
Extremelyd1 Jun 19, 2023
dc5ee0e
Add all Greenpath enemies, fix entity registry detection
Extremelyd1 Jun 22, 2023
9465a80
Fix entity spawning for Vengefly
Extremelyd1 Jun 24, 2023
3a59c1d
Add Charged Lumafly, fix collider comp
Extremelyd1 Jun 25, 2023
0dd49d7
Start on Fungal Wastes enemies
Extremelyd1 Jun 25, 2023
f2b4324
Fixes for Mantis Lords and Ooma corpses
Extremelyd1 Jun 26, 2023
026216d
Fix Sporg, Ambloom, add Uumuu
Extremelyd1 Jun 26, 2023
a6aeddc
Refactor FSM variable snapshot and entity scaling
Extremelyd1 Jun 28, 2023
b8861ca
Add City of Tears enemies, including The Collector
Extremelyd1 Jun 30, 2023
57aba40
Add Waterways enemies, including Dung Defender and Flukemarm
Extremelyd1 Jun 30, 2023
8bada3e
Add Crystal Peak enemies, fix position error
Extremelyd1 Jul 2, 2023
ee83c77
Add Infected Crossroads enemies
Extremelyd1 Jul 2, 2023
b186a51
Add Deepnest enemies
Extremelyd1 Jul 2, 2023
69a4ed0
Fix some Deepnest enemies
Extremelyd1 Jul 2, 2023
1336cfb
Add Abyss, Kingdom's Edge, Hive, Queen's Gardens and Colosseum enemies
Extremelyd1 Jul 2, 2023
42723b3
Fix issues in Colosseum trials
Extremelyd1 Jul 4, 2023
11f17d6
Fix Hopper, Spiny Husk and Mantis Petra
Extremelyd1 Jul 4, 2023
78e7a3a
Increase networking limits for entities, fix Colosseum trials
Extremelyd1 Jul 5, 2023
fe16310
Add some dream bosses, Hornet Sentinel and the final bosses
Extremelyd1 Jul 6, 2023
d278d5d
Add remaining non-Godhome enemies
Extremelyd1 Jul 7, 2023
cd95fca
Fix abilities/spells not able to hit remote entities
Extremelyd1 Jul 8, 2023
1d80a56
Fix White Defender and Grimm
Extremelyd1 Jul 8, 2023
a3a5d7e
Various fixes
Extremelyd1 Jul 9, 2023
177124d
Add audio actions and support continuous actions
Extremelyd1 Jul 11, 2023
2265afa
Fix issues with False Knight and battle gates
Extremelyd1 Jul 12, 2023
e9e4c54
Keep track of hooks and dispose properly
Extremelyd1 Jul 16, 2023
faff2d6
Refactor entity networking into reliable and non-reliable
Extremelyd1 Jul 21, 2023
0e16ffa
Fix out-of-order host transfer and entity updates
Extremelyd1 Jul 29, 2023
0781ec9
Add Godhome bosses
Extremelyd1 Jul 29, 2023
d726139
Fix memory buildup issue
Extremelyd1 Jul 30, 2023
b5f4693
Fix hooks not applying correctly
Extremelyd1 Jul 30, 2023
897821b
Merge branch 'master' into entity-system-v2
Extremelyd1 Oct 8, 2023
d83211b
Fix nail-based attacks not dealing damage to remote entities
Extremelyd1 Oct 9, 2023
13213a8
Allow slashes to interact with remote worlds
Extremelyd1 Oct 15, 2023
88ad3e1
Synchronise configurable PlayerData values
Extremelyd1 Nov 12, 2023
6894cd0
Synchronise geo rocks and persistent items
Extremelyd1 Nov 24, 2023
479d8f3
Fix `FlingObjectsFromGlobalPoolTime` action networking and improve en…
Extremelyd1 Dec 22, 2023
af1fdd8
Improvements to Radiance
Extremelyd1 Dec 25, 2023
17a5545
Merge branch 'master' into entity-system-v2
Extremelyd1 Feb 9, 2024
f4be15d
Save data synchronisation on server host/join
Extremelyd1 Mar 3, 2024
45246fe
Add support for string lists and godhome specific savedata syncing
Extremelyd1 Mar 17, 2024
73f6266
Fix Shroomal Ogres, various other fixes
Extremelyd1 Mar 30, 2024
545af94
Fixes for save data syncing, warp on connect
Extremelyd1 Apr 6, 2024
f20b2d2
Update UI, fix standalone server saves
Extremelyd1 May 10, 2024
2cb9c4a
Fix UI softlock and navigation inconsistencies
Extremelyd1 May 11, 2024
8961034
Refactor team selection to command
Extremelyd1 May 19, 2024
ed657d7
Refactor skin selection to command
Extremelyd1 May 20, 2024
96a8554
Fix nail-based attacks environment interaction
Extremelyd1 May 26, 2024
6ef53c5
Fix save-sync issue with string data
Extremelyd1 May 26, 2024
b1e203a
Fix duplicate enemies, rigidbody sync issues
Extremelyd1 Jun 29, 2024
9de4dac
Fix certain Godhome fights not ending on scene clients
Extremelyd1 Jun 30, 2024
a7c2376
Preliminary refactor of save synchronisation
Extremelyd1 Jul 7, 2024
44799e2
Improve player specific saves
Extremelyd1 Jul 8, 2024
4ec6aaf
Improve server save data
Extremelyd1 Jul 9, 2024
152c7d4
Fix switches not activating for remote players, improvements to battl…
Extremelyd1 Jul 9, 2024
9a0eae9
Fix FSM util method
Extremelyd1 Jul 10, 2024
7695736
Fix Greenpath Vine platforms not syncing
Extremelyd1 Jul 10, 2024
8e9cc13
Fix bugs with Mantis Lords
Extremelyd1 Jul 12, 2024
56f70cf
Fix challenge prompt for Mantis Lords
Extremelyd1 Jul 12, 2024
4d3b60d
Fix issue with Grub Mimics
Extremelyd1 Jul 12, 2024
e5a115d
Fix remote attacks having physics
Extremelyd1 Jul 14, 2024
7f32dca
Add camera lock areas to entity registry
Extremelyd1 Jul 14, 2024
f27d3fa
Fix Nosk glob projectiles
Extremelyd1 Jul 15, 2024
c248c55
Fix issues with Sly fight
Extremelyd1 Jul 15, 2024
7cb9fc7
Rename some entities
Extremelyd1 Jul 15, 2024
787d40e
Fix various save data issues
Extremelyd1 Jul 17, 2024
e135b15
Fix issue with Pantheons
Extremelyd1 Jul 17, 2024
213a746
Fix Godhome Gorb
Extremelyd1 Jul 17, 2024
6491176
Fix Vengefly King in Godhome
Extremelyd1 Jul 18, 2024
33be489
Fix standalone server issues and crashes
Extremelyd1 Jul 18, 2024
f31617d
Fix soul being gained from remote nail swings
Extremelyd1 Jul 19, 2024
e8e5aee
Fix issue with entity objects being null
Extremelyd1 Jul 19, 2024
5f685d0
Improve save data handling for in-game hosting
Extremelyd1 Jul 20, 2024
797c238
Initial work for sound/music networking
Extremelyd1 Jul 20, 2024
c0ce06b
Implement music synchronisation
Extremelyd1 Jul 21, 2024
e16e430
Fix Geo drops for entities
Extremelyd1 Jul 21, 2024
4d3909c
Fix Charm page not showing
Extremelyd1 Jul 21, 2024
2c74661
Fix various issues with Mantis Lords
Extremelyd1 Jul 22, 2024
f624f3d
Improve immediate save synchronisation
Extremelyd1 Jul 22, 2024
446640e
Refactor commands to fit new UI
Extremelyd1 Jul 24, 2024
5c2a857
Remove unused server manager in client manager
Extremelyd1 Jul 24, 2024
d609a95
Fix scene entry issue with new saves
Extremelyd1 Jul 24, 2024
57747a4
Fix player lock if remote player hits City bridge lever
Extremelyd1 Jul 25, 2024
0ac08b5
Refactor game patches to separate class
Extremelyd1 Jul 25, 2024
6ed94bb
Fix City entrance door opening not syncing
Extremelyd1 Jul 25, 2024
1844e06
Fix synchronisation of City elevators
Extremelyd1 Jul 26, 2024
49086ef
Fix Crystal Peak platforms not syncing
Extremelyd1 Jul 26, 2024
2564362
Improve nail detection and interference for remote players
Extremelyd1 Jul 26, 2024
4f68c06
Add Crystal Laser turrets to entity system
Extremelyd1 Jul 26, 2024
5a62e1e
Sync Waterways entrance and quake floors
Extremelyd1 Jul 26, 2024
0e7d956
Partial refactor of save synchronisation
Extremelyd1 Jul 26, 2024
e6eaa71
Improve save synchronisation
Extremelyd1 Jul 27, 2024
5b0b2fb
Fix Dung Defender, Broken Vessel, and Lost Kin
Extremelyd1 Jul 27, 2024
8f47e1e
Adjust logging for music component
Extremelyd1 Jul 27, 2024
0e7de2e
Synchronise dream platforms
Extremelyd1 Jul 28, 2024
561063b
Fix camera lock host transfer issue
Extremelyd1 Jul 28, 2024
61acfee
Fix Flower quest placement synchronisation
Extremelyd1 Jul 28, 2024
d1f4441
Fix packet fragmentation
Extremelyd1 Jul 30, 2024
04217f6
Fix remote nail swings causing recoil
Extremelyd1 Jul 30, 2024
18c1efd
Improve enter scene detection, fix backwards walking players
Extremelyd1 Jul 30, 2024
78e0a6e
Synchronise placed markers
Extremelyd1 Aug 1, 2024
20be638
Fix crashes from boss scene mismatch
Extremelyd1 Aug 3, 2024
92cdc2d
Bump version number
Extremelyd1 Aug 3, 2024
0de18d6
Fix issue with hosting server on new save
Extremelyd1 Aug 19, 2024
2b8eb22
Various fixes for Dream Warriors in Godhome
Extremelyd1 Sep 1, 2024
33579f1
Fix Enraged Guardian synchronisation
Extremelyd1 Sep 7, 2024
31442cf
Fix save data soft-locks
Extremelyd1 Sep 7, 2024
1987de2
Fix issue with FSM templates on entities that activate late
Extremelyd1 Sep 7, 2024
84be183
Update workflows
Extremelyd1 Sep 7, 2024
481a121
Bump version number
Extremelyd1 Sep 7, 2024
ed2048b
Fix music component causing issues for FSMs
Extremelyd1 Sep 12, 2024
8efd694
Fix errors with boss scene entity mismatch
Extremelyd1 Sep 12, 2024
20b5576
Add command to copy saves, fix save sync issue
Extremelyd1 Sep 29, 2024
2156130
Fix issue with battle fight music
Extremelyd1 Oct 4, 2024
ee149e3
Fix issue with scene encoding for save data
Extremelyd1 Oct 4, 2024
fd1afa7
Fix issue with late action hook registration
Extremelyd1 Oct 15, 2024
593cb44
Fix issue with Elder Baldur not spawning Baldurs
Extremelyd1 Oct 20, 2024
d37cb1f
Patch chests to remove range check
Extremelyd1 Oct 20, 2024
471a8aa
Sync Ancestral Mound gate
Extremelyd1 Oct 20, 2024
773de9d
Potential fix for battle gate on host transfer
Extremelyd1 Oct 21, 2024
a456aeb
Fix unusual behaviour of city elevators
Extremelyd1 Oct 23, 2024
c9defaf
Fix soft-locks with toll machines, sync grimm lantern
Extremelyd1 Oct 26, 2024
ad5d966
Fix equipped charms not syncing
Extremelyd1 Oct 27, 2024
1cdd467
Properly dispose of enumerator
Extremelyd1 Nov 11, 2024
941e130
Fix rare save issue with shade position
Extremelyd1 Nov 25, 2024
3d21be4
Fix more missing string data
Extremelyd1 Nov 30, 2024
6342ca7
DTLS for the entity system (#107)
Extremelyd1 Jan 19, 2025
28aeadd
Fix various logging, connection and addon loading issues
Extremelyd1 Jan 20, 2025
05682e8
Remove obsolete assembly resolution code
Extremelyd1 Jan 20, 2025
b9b8a4b
Store server key and certificate and load on existing key/certificate
Extremelyd1 Jan 20, 2025
e4355c2
Increase expiration date on generated server certificate
Extremelyd1 Jan 23, 2025
e550425
Implement chunk system for handling large data transfer (#108)
Extremelyd1 Feb 14, 2025
c291484
Change BouncyCastle ref to reference package
Extremelyd1 Mar 13, 2025
c4efadb
Refactor save data handling to allow serialization to readable format
Extremelyd1 May 4, 2025
9353245
Implement Godseeker save files in the new save data system
Extremelyd1 May 5, 2025
5bd2b40
Implement loading back to bench after game completion
Extremelyd1 May 10, 2025
b0758b3
Fix Steel Soul save files
Extremelyd1 May 10, 2025
e9619a4
Fix newly joining players not playing cutscenes
Extremelyd1 May 10, 2025
ea971eb
Bump version number
Extremelyd1 May 11, 2025
5165996
Fix chat opening when focused on input field
Extremelyd1 May 13, 2025
6973b6f
Modify some logging
Extremelyd1 May 14, 2025
8d1e77b
Fix issues with connection cleanup
Extremelyd1 May 14, 2025
853de4a
Prevent overlapping menus with multiplayer UI
Extremelyd1 May 15, 2025
f59cf54
Refactor initialization and (de)registering of hooks and event
Extremelyd1 May 16, 2025
a8d19cc
Fix issues with multiplayer hooks
Extremelyd1 May 17, 2025
f795629
Improve/fix DTLS logic and cleanup
Extremelyd1 May 17, 2025
6e8ea48
Fix race conditions with save updates
Extremelyd1 May 22, 2025
f74b018
Fix issue with Godhome Mantis Lords
Extremelyd1 Jun 3, 2025
17defa5
Fix save data sync issue
Extremelyd1 Jun 3, 2025
3b45904
Fix black screen issue with temporary solution
Extremelyd1 Jun 3, 2025
deeb471
Fix enter/leave race conditions for transitions
Extremelyd1 Jun 3, 2025
1277560
Ignore timed out socket error message
Extremelyd1 Jun 4, 2025
45aaa8d
Fix entity activity changes not applying on host determination
Extremelyd1 Jun 4, 2025
dfe708a
Initial implementation for hazard respawn syncing
Extremelyd1 Jun 4, 2025
6cbbee9
Fully implement hazard respawn syncs for Radiance fights
Extremelyd1 Jun 5, 2025
7ebc18f
Disconnect socket logic from DTLS receive logic on client-side
Extremelyd1 Jun 8, 2025
d75bc70
Add initial values to variable properties for standalone save syncing
Extremelyd1 Jun 11, 2025
bf15a89
Fix breakable doors in king's pass not saving
Extremelyd1 Jun 11, 2025
12d4231
Improve entity processing by checking for uninitialized references
Extremelyd1 Jun 12, 2025
b1c0cc3
Fix radiance not triggering scene change on clients
Extremelyd1 Jun 12, 2025
e2ea4cd
Fix entity registry name detection for matching substrings
Extremelyd1 Jun 12, 2025
6dc0259
Fix Traitor Lord not loading is player does not have Shade Cloak
Extremelyd1 Jun 12, 2025
67c6629
Add extra check for additionally loaded scenes to prevent overlap
Extremelyd1 Jun 12, 2025
a76b6e5
Allow toggling full synchronisation via settings
Extremelyd1 Jun 21, 2025
5ab6edf
Add a mod menu to modify client and server settings
Extremelyd1 Jun 29, 2025
e0055ff
Simplify mod menu attribute for server settings
Extremelyd1 Jun 30, 2025
78538ce
Refactored mod menu to non-static class
Extremelyd1 Jun 30, 2025
3e22383
Add UI for modifying team and skin
Extremelyd1 Jul 4, 2025
e8ccfb5
Fix issue with duplicate packets after re-hosting a server
Extremelyd1 Jul 4, 2025
5c1ecfa
Fix nail damage not being stored in player specific save data
Extremelyd1 Jul 4, 2025
eccaf67
Improve connection UI
Extremelyd1 Jul 5, 2025
3ec042d
Revert UI scaling change
Extremelyd1 Jul 6, 2025
073e76c
Fix issue with scene client buying toll bench and messing up respawns
Extremelyd1 Sep 13, 2025
9de03be
Fix issue with cutscenes not playing in singleplayer
Extremelyd1 Sep 15, 2025
5897e12
Fix Whispering Roots not saving properly
Extremelyd1 Sep 15, 2025
5be3225
Merge branch 'master' into entity-system-v2
Extremelyd1 Oct 19, 2025
24d332b
Change default of full sync setting
Extremelyd1 Oct 19, 2025
aa90ec2
Add upstream fix for null or empty scenes
Extremelyd1 Oct 19, 2025
1062781
Remove obsolete debug messages
Extremelyd1 Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning

[{*.har,*.inputactions,*.jsb2,*.jsb3,*.json,*.yml,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
[{*.har,*.inputactions,*.jsb2,*.jsb3,*.yml,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
indent_style = space
indent_size = 2

[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,json,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
indent_style = space
indent_size = 4
tab_width = 4
9 changes: 7 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Download dependencies
run: wget https://files.catbox.moe/r5p6rr.gpg -O deps.zip.gpg
run: wget https://files.catbox.moe/t156ho.gpg -O deps.zip.gpg

- name: Decrypt dependencies
run: gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.DEPENDENCIES_ZIP_PASSPHRASE }}" --output deps.zip deps.zip.gpg
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore ${{ github.workspace }}
Expand All @@ -60,6 +60,7 @@ jobs:
${{ github.workspace }}/HKMP/bin/Release/net472/HKMP.dll
${{ github.workspace }}/HKMP/bin/Release/net472/HKMP.xml
${{ github.workspace }}/HKMP/bin/Release/net472/HKMP.pdb
${{ github.workspace }}/HKMP/bin/Release/net472/BouncyCastle.Cryptography.dll

- name: Upload HKMPServer artifact
uses: actions/upload-artifact@v4
Expand All @@ -68,3 +69,7 @@ jobs:
path: |
${{ github.workspace }}/HKMPServer/bin/Release/net472/HKMPServer.exe
${{ github.workspace }}/HKMPServer/bin/Release/net472/HKMPServer.pdb
${{ github.workspace }}/HKMPServer/bin/Release/net472/HKMP.dll
${{ github.workspace }}/HKMPServer/bin/Release/net472/HKMP.pdb
${{ github.workspace }}/HKMPServer/bin/Release/net472/Newtonsoft.Json.dll
${{ github.workspace }}/HKMPServer/bin/Release/net472/BouncyCastle.Cryptography.dll
18 changes: 8 additions & 10 deletions HKMP/Animation/AnimationEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@ public void SetServerSettings(ServerSettings serverSettings) {
}

/// <summary>
/// Locate the damages_enemy FSM and change the attack type to generic. This will avoid the local
/// player taking knock back from remote players hitting shields etc.
/// Locate the damages_enemy FSM and change the attack direction to the given direciton. This will ensure that
/// enemies are getting knocked back in the correct direction from remote player's attacks.
/// </summary>
/// <param name="targetObject">The target GameObject to change.</param>
protected static void ChangeAttackTypeOfFsm(GameObject targetObject) {
/// <param name="direction">The direction in float that the damage is coming from.</param>
protected static void ChangeAttackDirection(GameObject targetObject, float direction) {
var damageFsm = targetObject.LocateMyFSM("damages_enemy");
if (damageFsm == null) {
return;
}

var takeDamage = damageFsm.GetFirstAction<TakeDamage>("Send Event");
takeDamage.AttackType.Value = (int) AttackTypes.Generic;
takeDamage = damageFsm.GetFirstAction<TakeDamage>("Parent");
takeDamage.AttackType.Value = (int) AttackTypes.Generic;
takeDamage = damageFsm.GetFirstAction<TakeDamage>("Grandparent");
takeDamage.AttackType.Value = (int) AttackTypes.Generic;

// Find the variable that controls the slash direction for damaging enemies
var directionVar = damageFsm.FsmVariables.GetFsmFloat("direction");
directionVar.Value = direction;
}
}
94 changes: 59 additions & 35 deletions HKMP/Animation/AnimationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
using Hkmp.Game.Client;
using Hkmp.Game.Settings;
using Hkmp.Networking.Client;
using Hkmp.Networking.Packet;
using Hkmp.Networking.Packet.Data;
using Hkmp.Util;
using HutongGames.PlayMaker.Actions;
using Modding;
using UnityEngine;
using UnityEngine.SceneManagement;
using Logger = Hkmp.Logging.Logger;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;

namespace Hkmp.Animation;

Expand All @@ -33,14 +34,14 @@ internal class AnimationManager {
/// <summary>
/// Animations that are allowed to loop, because they need to transmit the effect.
/// </summary>
private static readonly string[] AllowedLoopAnimations = { "Focus Get", "Run" };
private static readonly string[] AllowedLoopAnimations = ["Focus Get", "Run"];

/// <summary>
/// Clip names of animations that are handled by the animation controller.
/// </summary>
private static readonly string[] AnimationControllerClipNames = {
private static readonly string[] AnimationControllerClipNames = [
"Airborne"
};
];

/// <summary>
/// The animation effect for cancelling the Crystal Dash Charge. Stored since it needs to be called
Expand Down Expand Up @@ -406,20 +407,29 @@ internal class AnimationManager {

public AnimationManager(
NetClient netClient,
PlayerManager playerManager,
PacketManager packetManager,
ServerSettings serverSettings
PlayerManager playerManager
) {
_netClient = netClient;
_playerManager = playerManager;

_chargedEffectStopwatch = new Stopwatch();
_chargedEndEffectStopwatch = new Stopwatch();
}

// Register packet handler
packetManager.RegisterClientPacketHandler<GenericClientData>(ClientPacketId.PlayerDeath,
OnPlayerDeath);
/// <summary>
/// Initialize the animation manager by registering packet handlers and initializing animation effects.
/// </summary>
public void Initialize(ServerSettings serverSettings) {
// Set the server settings for all animation effects
foreach (var effect in AnimationEffects.Values) {
effect.SetServerSettings(serverSettings);
}
}

/// <summary>
/// Register the game hooks for the animation manager.
/// </summary>
public void RegisterHooks() {
// Register scene change, which is where we update the animation event handler
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += OnSceneChange;

Expand All @@ -443,18 +453,39 @@ ServerSettings serverSettings
On.GameManager.HazardRespawn += GameManagerOnHazardRespawn;

// Register when the HeroController starts, so we can register dung trail events
On.HeroController.Start += HeroControllerOnStart;
CustomHooks.HeroControllerStartAction += HeroControllerOnStart;

// Relinquish Control cancels a lot of effects, so we need to broadcast the end of these effects
On.HeroController.RelinquishControl += HeroControllerOnRelinquishControl;

// Register when the player dies to send the animation
ModHooks.BeforePlayerDeadHook += OnDeath;
}

// Set the server settings for all animation effects
foreach (var effect in AnimationEffects.Values) {
effect.SetServerSettings(serverSettings);
}
/// <summary>
/// Deregister the game hooks for the animation manager.
/// </summary>
public void DeregisterHooks() {
UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= OnSceneChange;

On.HeroAnimationController.Play -= HeroAnimationControllerOnPlay;
On.HeroAnimationController.PlayFromFrame -= HeroAnimationControllerOnPlayFromFrame;

On.tk2dSpriteAnimator.WarpClipToLocalTime -= Tk2dSpriteAnimatorOnWarpClipToLocalTime;
On.tk2dSpriteAnimator.ProcessEvents -= Tk2dSpriteAnimatorOnProcessEvents;

On.HeroController.CancelDash -= HeroControllerOnCancelDash;

ModHooks.HeroUpdateHook -= OnHeroUpdateHook;

On.HeroController.DieFromHazard -= HeroControllerOnDieFromHazard;
On.GameManager.HazardRespawn -= GameManagerOnHazardRespawn;

CustomHooks.HeroControllerStartAction -= HeroControllerOnStart;

On.HeroController.RelinquishControl -= HeroControllerOnRelinquishControl;

ModHooks.BeforePlayerDeadHook -= OnDeath;
}

/// <summary>
Expand All @@ -470,15 +501,13 @@ public void OnPlayerAnimationUpdate(ushort id, int clipId, int frame, bool[] eff

var animationClip = (AnimationClip) clipId;

if (AnimationEffects.ContainsKey(animationClip)) {
if (AnimationEffects.TryGetValue(animationClip, out var animationEffect)) {
var playerObject = _playerManager.GetPlayerObject(id);
if (playerObject == null) {
if (!playerObject) {
// Logger.Get().Warn(this, $"Tried to play animation effect {clipName} with ID: {id}, but player object doesn't exist");
return;
}

var animationEffect = AnimationEffects[animationClip];

// Check if the animation effect is a DamageAnimationEffect and if so,
// set whether it should deal damage based on player teams
if (animationEffect is DamageAnimationEffect damageAnimationEffect) {
Expand Down Expand Up @@ -507,7 +536,7 @@ public void OnPlayerAnimationUpdate(ushort id, int clipId, int frame, bool[] eff
/// <param name="frame">The frame that the animation should play from.</param>
public void UpdatePlayerAnimation(ushort id, int clipId, int frame) {
var playerObject = _playerManager.GetPlayerObject(id);
if (playerObject == null) {
if (!playerObject) {
// Logger.Get().Warn(this, $"Tried to update animation, but there was not matching player object for ID {id}");
return;
}
Expand Down Expand Up @@ -615,8 +644,8 @@ private void OnAnimationEvent(tk2dSpriteAnimationClip clip) {
var animationClip = ClipEnumNames[clip.name];

// Check whether there is an effect that adds info to this packet
if (AnimationEffects.ContainsKey(animationClip)) {
var effectInfo = AnimationEffects[animationClip].GetEffectInfo();
if (AnimationEffects.TryGetValue(animationClip, out var effect)) {
var effectInfo = effect.GetEffectInfo();

_netClient.UpdateManager.UpdatePlayerAnimation(animationClip, 0, effectInfo);
} else {
Expand Down Expand Up @@ -783,7 +812,7 @@ float time
orig(self, clip, time);

var localPlayer = HeroController.instance;
if (localPlayer == null) {
if (!localPlayer) {
return;
}

Expand Down Expand Up @@ -820,7 +849,7 @@ int direction
orig(self, start, last, direction);

var localPlayer = HeroController.instance;
if (localPlayer == null) {
if (!localPlayer) {
return;
}

Expand Down Expand Up @@ -862,10 +891,10 @@ private IEnumerator HeroControllerOnDieFromHazard(On.HeroController.orig_DieFrom
return orig(self, hazardType, angle);
}

_netClient.UpdateManager.UpdatePlayerAnimation(AnimationClip.HazardDeath, 0, new[] {
_netClient.UpdateManager.UpdatePlayerAnimation(AnimationClip.HazardDeath, 0, [
hazardType.Equals(HazardType.SPIKES),
hazardType.Equals(HazardType.ACID)
});
]);

// Execute the original method and return its value
return orig(self, hazardType, angle);
Expand All @@ -891,7 +920,7 @@ private void GameManagerOnHazardRespawn(On.GameManager.orig_HazardRespawn orig,
/// Callback method for when a player death is received.
/// </summary>
/// <param name="data">The generic client data for this event.</param>
private void OnPlayerDeath(GenericClientData data) {
public void OnPlayerDeath(GenericClientData data) {
// And play the death animation for the ID in the packet
MonoBehaviourUtil.Instance.StartCoroutine(PlayDeathAnimation(data.Id));
}
Expand Down Expand Up @@ -1004,12 +1033,7 @@ private IEnumerator PlayDeathAnimation(ushort id) {
/// <summary>
/// Callback method on the HeroController#Start method.
/// </summary>
/// <param name="orig">The original method.</param>
/// <param name="self">The HeroController instance.</param>
private void HeroControllerOnStart(On.HeroController.orig_Start orig, HeroController self) {
// Execute original method
orig(self);

private void HeroControllerOnStart() {
SetDescendingDarkLandEffectDelay();
RegisterDefenderCrestEffects();
}
Expand Down Expand Up @@ -1061,12 +1085,12 @@ private void SetDescendingDarkLandEffectDelay() {
/// </summary>
private void RegisterDefenderCrestEffects() {
var charmEffects = HeroController.instance.gameObject.FindGameObjectInChildren("Charm Effects");
if (charmEffects == null) {
if (!charmEffects) {
return;
}

var dungObject = charmEffects.FindGameObjectInChildren("Dung");
if (dungObject == null) {
if (!dungObject) {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions HKMP/Animation/Effects/CycloneSlash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public override void Play(GameObject playerObject, bool[] effectInfo) {
cycloneObj,
playerAttacks.transform
);
cycloneSlash.layer = 22;
cycloneSlash.layer = 17;

var hitLComponent = cycloneSlash.FindGameObjectInChildren("Hit L");
ChangeAttackTypeOfFsm(hitLComponent);
ChangeAttackDirection(hitLComponent, 0f);

var hitRComponent = cycloneSlash.FindGameObjectInChildren("Hit R");
ChangeAttackTypeOfFsm(hitRComponent);
ChangeAttackDirection(hitRComponent, 180f);

cycloneSlash.SetActive(true);

Expand Down
46 changes: 32 additions & 14 deletions HKMP/Animation/Effects/DashBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,38 @@ protected void Play(GameObject playerObject, bool[] effectInfo, bool shadowDash,
// Lastly, disable the player collider, since we are in a shadow dash
// We only do this, if we don't have sharp shadow
playerObject.GetComponent<BoxCollider2D>().enabled = false;
} else if (
!ServerSettings.IsBodyDamageEnabled &&
ServerSettings.IsPvpEnabled &&
ShouldDoDamage &&
damage != 0
) {
// If body damage is disabled, but PvP is enabled and we are performing a sharp shadow dash
// we need to enable the DamageHero component and move the player object to the correct layer
// to allow the local player to collide with it
playerObject.layer = 11;

var damageHero = playerObject.GetComponent<DamageHero>();
damageHero.enabled = true;
damageHero.damageDealt = damage;
} else {
var localPlayerAttacks = HeroController.instance.gameObject.FindGameObjectInChildren("Attacks");
var playerAttacks = playerObject.FindGameObjectInChildren("Attacks");

var sharpShadowPrefab = localPlayerAttacks.FindGameObjectInChildren("Sharp Shadow");

var sharpShadowObject = Object.Instantiate(
sharpShadowPrefab,
playerAttacks.transform
);
sharpShadowObject.name = "Sharp Shadow";
sharpShadowObject.SetActive(true);
sharpShadowObject.layer = 17;

if (
!ServerSettings.IsBodyDamageEnabled &&
ServerSettings.IsPvpEnabled &&
ShouldDoDamage &&
damage != 0
) {
// If body damage is disabled, but PvP is enabled and we are performing a sharp shadow dash
// we need to enable the DamageHero component and move the player object to the correct layer
// to allow the local player to collide with it
playerObject.layer = 11;

var damageHero = playerObject.GetComponent<DamageHero>();
damageHero.enabled = true;
damageHero.damageDealt = damage;
}

// As a failsafe, we remove the sharp shadow object again on a timer
Object.Destroy(sharpShadowObject, 1f);
}
} else {
// Instantiate the dash burst relative to the player effects
Expand Down
Loading