Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

Story resets currently require a full server restart, disconnecting all players and losing session state.

Changes

Command Layer (tale/cmds/wizard.py)

  • Added !reset_story wizard command with confirmation dialog
  • Catches and reports exceptions during reset

Driver Layer (tale/driver.py)

  • Implemented Driver.reset_story() method that:
    • Clears deferreds, items, NPCs, locations, exits from MudObjRegistry
    • Preserves player objects by filtering by vnum before registry clear
    • Reloads story module and zone modules via sys.modules removal + importlib.reload()
    • Resets game clock and re-registers periodicals
    • Moves players to starting locations

Tests (tests/test_reset_story.py)

  • Unit tests for command registration, confirmation flow, and driver integration

Usage

# As wizard in-game
!reset_story
# Prompts: "Are you sure you want to reset the story? This will affect all players!"
# On confirmation: resets world, preserves player inventory/stats/connections

Preserved vs Reset

Preserved: Player objects, inventory, stats, privileges, active connections, server uptime

Reset: All NPCs/items/locations/exits, deferreds, game clock, zone state

The solution is general at the Driver level as requested, working with any story type.

Original prompt

This section details on the original issue you should resolve

<issue_title>investigate restarting/resetting story</issue_title>
<issue_description>Currently, a story is started when the server is started, ie

python stories.my_story.story

investigate if it's possible to restart a story, without having to restart the server.

preferably a general solution, either in Story, or Driver level.

it should be a wizard command, like "reset_story".</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 6 commits November 23, 2025 16:51
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
…q_nr logic

Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate restarting stories without server restart Add !reset_story wizard command to restart story without server restart Nov 23, 2025
Copilot AI requested a review from neph1 November 23, 2025 17:03
@neph1 neph1 marked this pull request as ready for review November 23, 2025 21:09
@neph1 neph1 changed the base branch from master to update-v0.42.0 November 26, 2025 20:19
@neph1 neph1 merged commit 112d6e0 into update-v0.42.0 Nov 26, 2025
2 checks 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.

investigate restarting/resetting story

2 participants