Commit Graph

5931 Commits

Author SHA1 Message Date
NotAlwaysTrue
fc35d888fc Merge pull request #6 from NotAlwaysTrue/master-dev 2025-12-23 23:12:38 +08:00
NotAlwaysTrue
eb01597dd3 Try-catch Sever Entity Event Manager thread-safety issue 2025-12-23 22:38:06 +08:00
Eero
572430cc2b Add server-only usage warning to README
Added prominent warnings in both English and Chinese indicating that this release is intended for server-side use only and should not be run on the client. Users are advised to thoroughly test compatibility before deployment.
2025-12-23 13:19:10 +08:00
eero
7b263676e0 Reapply "Refactor ServerEntityEventManager event processing"
This reverts commit bdd6c52e4e.
2025-12-23 00:36:47 +08:00
NotAlwaysTrue
c8123383d5 Add another try-catch to avoid Destination array was not long enough. Check the destination index, length, and the array's lower bounds issue 2025-12-23 00:17:45 +08:00
eero
bdd6c52e4e Revert "Refactor ServerEntityEventManager event processing"
This reverts commit de65cd88bc.
2025-12-23 00:16:02 +08:00
eero
de65cd88bc Refactor ServerEntityEventManager event processing
Introduces async event processing with cancellation support using SemaphoreSlim and CancellationTokenSource. Improves client event handling logic, separates in-game and mid-round sync clients, and adds proper disposal of resources. Enhances robustness and maintainability of event management.
2025-12-23 00:07:47 +08:00
NotAlwaysTrue
83ca51a99b Fixed compile errors :( 2025-12-22 22:58:22 +08:00
NotAlwaysTrue
1def7b7b8d add catch code for previous commit :( 2025-12-22 22:54:33 +08:00
NotAlwaysTrue
dadd6c598f try-finally multiple UniqueEvents.ToList() to avoid issues(Destination array was not long enough. Check the destination index, length, and the array's lower bounds) 2025-12-22 22:43:02 +08:00
NotAlwaysTrue
b891ec7793 Add a try-finally in HumanPrefab to fix an issue causing issue(Destination array was not long enough. )
Fixed another Collection was modified in SubmarineBody.Update()
2025-12-22 21:51:07 +08:00
eero
5b823d8684 Clarify thread safety in update methods
Updated comments in GameScreen.cs to indicate that StatusEffect.UpdateAll and Character.UpdateAnimAll are not thread-safe and must be executed on the main thread. Also removed a non-English comment from MapEntity.cs for consistency.
2025-12-22 18:07:17 +08:00
eero
b146fa326d Refactor MapEntity.UpdateAll for improved parallelism
Rewrites MapEntity.UpdateAll to use more granular parallelism, reducing contention and improving performance by parallelizing hull, structure, and gap resets, while keeping order-dependent and non-thread-safe updates sequential. Updates GameScreen to pass ParallelOptions to UpdateAll.
2025-12-22 17:48:14 +08:00
NotAlwaysTrue
bab02fca8a Tried to fix all errors realted to UniqueEvent and Events(Collection was modified) 2025-12-22 17:16:49 +08:00
NotAlwaysTrue
0b6882c37f Reduced max threadcount for main thread to avoid issue 2025-12-22 17:00:03 +08:00
NotAlwaysTrue
b1072b7a50 Merge branch 'Dev' of https://github.com/NotAlwaysTrue/LuaCsForBarotraumaEP into Dev 2025-12-22 16:58:00 +08:00
NotAlwaysTrue
70a039da83 Added a command to show server perfomence (ShowServerPerf)
Removed unwanted PhysicsTask that was accideltally readded via revert action
Removed a parallel operation for SE.UpdateAll and ME.UpdateAll.
Cancelled roll back for ServerEntityEventManager
2025-12-22 16:57:58 +08:00
eero
7efb112058 Add contributors and Chinese documentation to README
Added a Main Contributors section and acknowledgements to the README. Also included a full Chinese translation of the project introduction, contributors, acknowledgements, and setup instructions.
2025-12-22 16:57:43 +08:00
NotAlwaysTrue
9c2f300325 Rolled back ServerEntityEventManager 2025-12-22 15:56:29 +08:00
eero
4d4f1f8351 Parallelize game update loops for performance
Refactored GameScreen update logic to use Parallel.Invoke and Parallel.ForEach for physics bodies, submarines, particles, level, characters, map entities, and status effects. This change aims to improve performance by leveraging multi-core processing. Also removed a debug Console.WriteLine from GameMain.
2025-12-22 15:47:15 +08:00
eero
9dc98192f4 Merge branch 'Dev' of https://github.com/NotAlwaysTrue/LuaCsForBarotraumaEP into Dev 2025-12-22 10:08:24 +08:00
eero
b1a9757b40 Revert "Enable and improve threaded physics execution"
This reverts commit 7d9642a5b1.
2025-12-22 10:07:24 +08:00
NotAlwaysTrue
522f58511c (Temp) Fixed an issue causing SV to crash due to PhysicsThread(Cannot modify the transform of a body when the World is locked) 2025-12-22 09:14:27 +08:00
NotAlwaysTrue
d98f9de5d4 Updated PM, uses 60s average to match message update time, modified message to display Server Running Time(Total Time Elapsed) in h:m:s.ms format
Readded perviously removed update interval condition
2025-12-22 00:24:33 +08:00
eero
7d9642a5b1 Enable and improve threaded physics execution
Activated the RUN_PHYSICS_IN_SEPARATE_THREAD directive and refactored the physics threading logic. Added cancellation support, improved error handling, and used synchronization primitives to coordinate physics updates. These changes aim to improve performance and stability when running physics in a separate thread.
2025-12-22 00:16:25 +08:00
NotAlwaysTrue
dc08b6b92a Merge branch 'Dev' of https://github.com/NotAlwaysTrue/LuaCsForBarotraumaEP into Dev 2025-12-22 00:07:04 +08:00
NotAlwaysTrue
220ccb2eac Updated CreateEvent() to make it thread safe 2025-12-22 00:07:01 +08:00
eero
eb8c59efb5 Add .vscode/settings.json to .gitignore
Exclude VS Code workspace settings from version control to prevent local configuration from being committed.
2025-12-22 00:02:02 +08:00
NotAlwaysTrue
f87e943a1a Move a lot of thing around to fix collection was modified.
Note: For now I can only adjust orders and cannot make some real thing. It will take time to check and refactor everything necessary.
2025-12-20 14:16:51 +08:00
NotAlwaysTrue
2f845b40ca Moved Item related stuff to the end of MapEntity.UpdateAll to avoid issues
Added a threadlock to avoid some issue(someday i will take care of)
Add a function that automatically log server performence every 60s
2025-12-20 00:08:42 +08:00
NotAlwaysTrue
d0a5d13a0e Update README.md
Use same stuff in main branch
2025-12-19 13:59:32 +08:00
NotAlwaysTrue
fff157d5ca Added a Performence Monitor for debug
Many multi-threading work in ServerSource
2025-12-19 13:43:12 +08:00
Evil Factory
c38d519ee6 Merge branch 'master' of https://github.com/Regalis11/Barotrauma 2025-12-18 08:15:42 -03:00
Regalis11
783499f152 Updated bug-reports.yml 2025-12-18 12:33:57 +02:00
Regalis11
4dc0ce9a2f Release 1.11.5.0 - Winter Update 2025 Hotfix 1 2025-12-18 12:26:30 +02:00
Evil Factory
352625af28 Merge remote-tracking branch 'upstream/master' 2025-12-08 12:35:44 -03:00
Markus Isberg
b6c3724bf8 Updated bug-reports.yml 2025-12-08 16:58:15 +02:00
Markus Isberg
598966f200 Release 1.11.4.1 (Winter Update) 2025-12-08 14:56:47 +00:00
Joonas Rikkonen
21e34e5cd8 Updated bug-reports.yml 2025-11-19 10:31:53 +02:00
Evil Factory
0d223636f6 Merge branch 'master' of https://github.com/regalis11/Barotrauma 2025-10-22 10:55:51 -03:00
Joonas Rikkonen
51db93fabc Update bug-reports.yml
Updated version options in bug report template.
2025-10-22 14:57:25 +03:00
Regalis11
7e25111487 Release 1.10.7.2 - Autumn Update 2025 Hotfix 4 2025-10-22 14:54:03 +03:00
Evil Factory
9799a2a97b Merge remote-tracking branch 'upstream/master' 2025-10-10 08:41:26 -03:00
Markus Isberg
37ffc94551 Update bug-reports.yml 2025-10-10 14:00:36 +03:00
Markus Isberg
b732009056 Hotfix 1.10.7.1 2025-10-10 10:43:19 +00:00
Evil Factory
e902ba673d Merge remote-tracking branch 'upstream/master' 2025-10-02 08:12:37 -03:00
Joonas Rikkonen
3f5c17c779 Update bug-reports.yml 2025-10-02 12:45:13 +03:00
Regalis11
6c1b18a56d Release 1.10.7.0 - Autumn Update 2025 Hotfix 2 2025-10-02 12:31:41 +03:00
Evil Factory
da13162c60 Merge branch 'master' of https://github.com/Regalis11/Barotrauma 2025-09-25 09:00:20 -03:00
Regalis11
b2d91cde7c Release 1.10.6.0 - Autumn Update 2025 Hotfix 1 2025-09-25 11:11:35 +03:00