Refactor/core common#105
Open
emyhrberg wants to merge 10 commits into
Open
Conversation
- Make all files use file scoped namespaces - Moved client and server configs to Common/Configs - Moved everything Discord related to Core/Discord This was made to follow best practices from tML code style guide, among others. This was just moving files, no renames or splitting classes into feature-based names yet.
Split into: 1. DiscordAuthPlayer (discord authentication) 2. LatencyTrackerPlayer (ping pong tracker) 3. CombatPlayer (combat) 4. SpawnboxPlayer (recall, spawnbox restrictions) 5. PreventAutoReuse : GlobalItem 6. BlockSocialSlots : ModSystem
Split into: 1. Spawnbox/BlockProjectilesInSpawn 2. Combat/CombatProjectile
Split into: 1. Combat/CombatNpc 2. Npcs/NpcRules 3. Statistics/NpcStatistics
Split into: 1. Items/ItemBalance 2. Items/ItemRules 3. Items/ItemTooltips 4. Items/ItemQuality
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase by reorganizing code from flat namespaces into feature-based namespaces under Common (gameplay features) and Core (infrastructure). The large monolithic AdventurePlayer, AdventureItem, and AdventureNpc classes have been split into smaller, feature-specific classes. Discord SDK files have been moved from Discord/ to Core/Discord/ with updated namespaces.
Changes:
- Reorganized code into
Common(gameplay) andCore(infrastructure) namespaces - Split large monolithic classes into feature-specific modules (e.g.,
AdventurePlayer→StatisticsPlayer,CombatPlayer,DiscordAuthPlayer, etc.) - Moved Discord SDK integration from
Discord/toCore/Discord/namespace - Renamed
AdventureConfigtoAdventureServerConfigfor clarity
Reviewed changes
Copilot reviewed 69 out of 71 changed files in this pull request and generated 47 comments.
Show a summary per file
| File | Description |
|---|---|
| PvPAdventure.cs | Updated imports to use new namespaces and renamed classes |
| AdventurePlayer.cs | Deleted - split into StatisticsPlayer, CombatPlayer, SpawnboxPlayer, etc. |
| AdventureItem.cs | Deleted - split into ItemBalance, ItemRules, ItemTooltips, ItemQuality, etc. |
| Core/Discord/* | Discord SDK files moved from Discord/ with namespace updates |
| Common/Combat/* | Combat-related logic extracted into dedicated classes |
| Common/Statistics/* | Statistics and scoring logic extracted |
| Common/Spawnbox/* | Spawn region management extracted |
| Core/Net/* | Network/latency tracking extracted |
| Core/Input/Keybinds.cs | Moved from System/Client with added KeybindsPlayer |
| Core/Config/* | Config classes moved and AdventureConfig renamed to AdventureServerConfig |
Comments suppressed due to low confidence (5)
Common/Npcs/NpcRules.cs:23
- The class is named
NpcRulesbut the old class wasAdventureNpc. Consider a more descriptive name likeNpcBehaviororNpcModificationsto better reflect that this handles spawn rules, boss modifications, and loot changes.
Common/Teams/TeamChatManager.cs:13 - The namespace is
Common.Chatbut the file is in theCommon/Teams/directory. Either move the file toCommon/Chat/or change the namespace toCommon.Teamsfor consistency.
Common/Teams/TeamColoredBeds.cs:9 - The namespace is
Common.TeamBedsbut the file is in theCommon/Teams/directory. Either move the file toCommon/TeamBeds/or change the namespace toCommon.Teamsfor consistency.
Common/Recipes/RecipeManager.cs:6 - The namespace is
Common.Lootbut the file is in theCommon/Recipes/directory. Either move the file toCommon/Loot/or change the namespace toCommon.Recipesfor consistency.
Common/Npcs/BoundNpc.cs:7 - The namespace is
Content.NPCsbut the file is in theCommon/Npcs/directory. This should beCommon.Npcsto match the directory structure and the pattern described in the PR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fixed so all classnames match filenames - Remove some duplicate code in NpcRules and NpcStatistics - Fixed so namespaces match filenames
emyhrberg
force-pushed
the
refactor/core-common
branch
2 times, most recently
from
January 19, 2026 01:40
c1a96a7 to
1aa353b
Compare
emyhrberg
force-pushed
the
refactor/core-common
branch
from
January 19, 2026 16:58
3939212 to
92c2c57
Compare
emyhrberg
force-pushed
the
refactor/core-common
branch
from
January 19, 2026 17:05
92c2c57 to
b97a2c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: Feature-based namespace organization (Common/Core)
This PR is a pure refactor based on
master. There are no intended gameplay changes.Summary
CommonorCore.AdventurePlayer/AdventureProjectile/AdventureItem/AdventureNPCinto feature-based namespaces underCommon.Namespace layout
Common(gameplay features)Gameplay mechanics/features that directly implement how the mod behaves in-game.
Common.Combat— PvP/PvE changes, i-frames, hit/kill markers, ghost heal/LoS adjustments, etc.Common.DropRates— rewrites loot pools for bosses, etc.Common.GameTimer— match state, countdown, time remaining, etc.Common.Items— item stat changes, bans, shimmer transforms, prefixes.Common.Npcs— spawn rules, boss changes, hitmarker sound, etc.Common.Recipes— crafting recipes.Common.Spawnbox— random teleport, disallow movement in 50x50 box, recall, etc.Common.Statistics— K/D, boss score, bounties, team points, pickups, etc.Common.Teams— team chat, team beds.Common.UI— player outlines, remove social slots, etc.Core(infrastructure)Foundational infrastructure that other modules depend on, but that is not itself gameplay.
Core.Config— client & server config.Core.Discord— Discord integration.Core.Input— keybinds.Core.Net— ping, section sync, spawn sync, etc.