Skip to content

Refactoring and porting over features from old gamemode - #12

Merged
KoertLichtendonk merged 9 commits into
mainfrom
dev
Nov 6, 2026
Merged

KoertLichtendonk merged 9 commits into
mainfrom
dev

Conversation

@KoertLichtendonk

Copy link
Copy Markdown
Member

No description provided.

Finish the Harvestables feature, built for many plant types.

- IHarvestableObject is the plant contract, implemented by the abstract
  HarvestablePlant component; each plant type derives its own
  component (IndianHempPlant) and model (HarvestableModel<TPlant>),
  registered with AddHarvestableModel<T>().
- HarvestableService: timed harvesting through PlayerHarvesting and a
  1-second timer, AddHarvestable for objects placed by a world
  generator, CreateHarvestable to place plants, and a startup check
  for duplicate names or object models.
- A finished harvest removes one harvest from the plant and publishes
  OnResourceHarvested, the hook for rewards later.
- /harvest uses the service and lists all registered resources.
- Actor conversations run their loop from the main thread instead of
  Task.Run, so sending messages and reading components no longer
  happens off SampSharp's main thread. Loop errors are logged.
- CreateVehicleCommand and EditVehicleCommand take BaseDataContext as a
  method parameter instead of keeping one for the whole server run.
Move /help from the gamemodes into Shared/Commands.

- HelpCommand calls IHelpDialogService, registered in AddCommands().
- It lists the groups and commands the player may run, from the same
  permissions the command handler checks, with a details view.
- Back on a command's details returns to the group it was listed in.
Move the vehicle key check from the gamemodes into the Vehicles
feature.

- VehicleKeyService.HasVehicleKey replaces ICharacterVehicleManager,
  which every host had to implement; it's registered in AddVehicles().
- InventoryItem.GetVehicleId() reads which vehicle a key opens.
- /engine uses the new service.
… doors as child entities of their property

- Persist and sync properties and doors with PropertyManager and PropertyDoorManager
- Add PropertyService for /enter and /exit, with errors for no nearby door and unlinked doors
- Move players to the linked door's position, facing angle, interior and virtual world
- Create door labels in the door's interior and virtual world, and redraw them when a door or property reloads
- Add an OnComponentLoaded hook to BaseManager
- Register AddProperties in AddOpenRoleplayFramework
- Add HasDefaultData, which seeds rows like HasData with fixed CreatedOn/UpdatedOn
- Use it for all default data, so new migrations no longer update every seed row

Database: seed rows get fixed timestamps; hosts need a migration (UpdateData only)
- Add Features/ChickenCoops: ChickenCoop component, PlayerCollectingEgg marker and ChickenCoopService
- Run egg collection on the main thread through a timer system instead of System.Timers
- Send one message when not near a coop, and block starting a second collection
- Re-check the coop's eggs and inventory space when a collection finishes
- Play coop sounds only when the CDN feature is registered
- Add ChatColor.LightGray
- Register AddChickenCoops in AddOpenRoleplayFramework
- Give unsaved rows their own entity type (UnsavedEntities) instead of the inventory item countdown
- Count runtime entity ids up with Interlocked.Increment everywhere
- Handle OnAccountLoggedIn in MainMenuServerSystem: open the character selection, going back to the main menu choices
- Add Features/Factions: Faction component, FactionManager on BaseManager and FactionService
- Load factions at startup, sync them every minute and save on shutdown
- Look up parent and child factions by id instead of nesting entities, since a sub-faction can load before its parent
- Register AddFactions in AddOpenRoleplayFramework
@KoertLichtendonk
KoertLichtendonk merged commit 120c05a into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant