Update Changelog and contrib docs

This commit is contained in:
Griatch 2025-06-30 17:10:52 +02:00
parent 671cab5cfd
commit 867b8c68cf
8 changed files with 226 additions and 27 deletions

View file

@ -0,0 +1,121 @@
# DebugPy VSCode debugger integration
Contribution by electroglyph, 2025
This registers an in-game command `debugpy` which starts the debugpy debugger and listens on port 5678.
For now this is only available for Visual Studio Code (VS Code).
If you are a JetBrains PyCharm user and would like to use this, make some noise at:
https://youtrack.jetbrains.com/issue/PY-63403/Support-debugpy
Credit for this goes to Moony on the Evennia Discord getting-help channel, thx Moony!
## Installation
This requires VS Code and debugpy, so make sure you're using VS Code.
From the venv where you installed Evennia run:
`pip install debugpy`
### Enable the command in Evennia
In your Evennia mygame folder, open up `/commands/default_cmdsets.py`
add `from evennia.contrib.utils.debugpy import CmdDebugPy` somewhere near the top.
in `CharacterCmdSet.at_cmdset_creation` add this under `super().at_cmdset_creation()`:
`self.add(CmdDebugPy)`
### Add "remote attach" option to VS Code debugger
Start VS Code and open your launch.json like this:
![screenshot](./vscode.png)
Add this to your configuration:
```json
{
"name": "Python Debugger: Remote Attach",
"justMyCode": false,
"type": "debugpy",
"request": "attach",
"connect": {
"host": "127.0.0.1",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
},
```
Use `127.0.0.1` for the host if you are running Evennia from the same machine you'll be debugging from. Otherwise, if you want to debug a remote server, change host (and possibly remoteRoot mapping) as necessary.
Afterwards it should look something like this:
```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
},
{
"name": "Python Debugger: Remote Attach",
"justMyCode": false,
"type": "debugpy",
"request": "attach",
"connect": {
"host": "127.0.0.1",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
},
]
}
```
(notice the comma between the curly braces)
## Usage
Set a breakpoint in VS Code where you want the debugger to stop at.
In Evennia run `debugpy` command.
You should see "Waiting for debugger attach..."
Back in VS Code attach the debugger:
![screenshot](./attach.png)
Back in Evennia you should see "Debugger attached."
Now trigger the breakpoint you set and you'll be using a nice graphical debugger.
----
<small>This document page is generated from `evennia/contrib/utils/debugpy/README.md`. Changes to this
file will be overwritten, so edit that file rather than this one.</small>

View file

@ -7,7 +7,7 @@ in the [Community Contribs & Snippets][forum] forum.
_Contribs_ are optional code snippets and systems contributed by
the Evennia community. They vary in size and complexity and
may be more specific about game types and styles than 'core' Evennia.
This page is auto-generated and summarizes all **52** contribs currently included
This page is auto-generated and summarizes all **53** contribs currently included
with the Evennia distribution.
All contrib categories are imported from `evennia.contrib`, such as
@ -32,14 +32,14 @@ If you want to add a contrib, see [the contrib guidelines](./Contribs-Guidelines
| [achievements](#achievements) | [auditing](#auditing) | [awsstorage](#awsstorage) | [barter](#barter) | [batchprocessor](#batchprocessor) |
| [bodyfunctions](#bodyfunctions) | [buffs](#buffs) | [building_menu](#building_menu) | [character_creator](#character_creator) | [clothing](#clothing) |
| [color_markups](#color_markups) | [components](#components) | [containers](#containers) | [cooldowns](#cooldowns) | [crafting](#crafting) |
| [custom_gametime](#custom_gametime) | [dice](#dice) | [email_login](#email_login) | [evadventure](#evadventure) | [evscaperoom](#evscaperoom) |
| [extended_room](#extended_room) | [fieldfill](#fieldfill) | [gendersub](#gendersub) | [git_integration](#git_integration) | [godotwebsocket](#godotwebsocket) |
| [health_bar](#health_bar) | [ingame_map_display](#ingame_map_display) | [ingame_python](#ingame_python) | [ingame_reports](#ingame_reports) | [llm](#llm) |
| [mail](#mail) | [mapbuilder](#mapbuilder) | [menu_login](#menu_login) | [mirror](#mirror) | [multidescer](#multidescer) |
| [mux_comms_cmds](#mux_comms_cmds) | [name_generator](#name_generator) | [puzzles](#puzzles) | [random_string_generator](#random_string_generator) | [red_button](#red_button) |
| [rpsystem](#rpsystem) | [simpledoor](#simpledoor) | [slow_exit](#slow_exit) | [storage](#storage) | [talking_npc](#talking_npc) |
| [traits](#traits) | [tree_select](#tree_select) | [turnbattle](#turnbattle) | [tutorial_world](#tutorial_world) | [unixcommand](#unixcommand) |
| [wilderness](#wilderness) | [xyzgrid](#xyzgrid) |
| [custom_gametime](#custom_gametime) | [debugpy](#debugpy) | [dice](#dice) | [email_login](#email_login) | [evadventure](#evadventure) |
| [evscaperoom](#evscaperoom) | [extended_room](#extended_room) | [fieldfill](#fieldfill) | [gendersub](#gendersub) | [git_integration](#git_integration) |
| [godotwebsocket](#godotwebsocket) | [health_bar](#health_bar) | [ingame_map_display](#ingame_map_display) | [ingame_python](#ingame_python) | [ingame_reports](#ingame_reports) |
| [llm](#llm) | [mail](#mail) | [mapbuilder](#mapbuilder) | [menu_login](#menu_login) | [mirror](#mirror) |
| [multidescer](#multidescer) | [mux_comms_cmds](#mux_comms_cmds) | [name_generator](#name_generator) | [puzzles](#puzzles) | [random_string_generator](#random_string_generator) |
| [red_button](#red_button) | [rpsystem](#rpsystem) | [simpledoor](#simpledoor) | [slow_exit](#slow_exit) | [storage](#storage) |
| [talking_npc](#talking_npc) | [traits](#traits) | [tree_select](#tree_select) | [turnbattle](#turnbattle) | [tutorial_world](#tutorial_world) |
| [unixcommand](#unixcommand) | [wilderness](#wilderness) | [xyzgrid](#xyzgrid) |
@ -804,6 +804,7 @@ Contribs-Guidelines.md
:maxdepth: 1
Contrib-Auditing.md
Contrib-Debugpy.md
Contrib-Fieldfill.md
Contrib-Git-Integration.md
Contrib-Name-Generator.md
@ -824,6 +825,17 @@ quality assurance, post-incident investigations and debugging.
### `debugpy`
_Contribution by electroglyph, 2025_
This registers an in-game command `debugpy` which starts the debugpy debugger and listens on port 5678.
For now this is only available for Visual Studio Code (VS Code).
[Read the documentation](./Contrib-Debugpy.md) - [Browse the Code](evennia.contrib.utils.debugpy)
### `fieldfill`
_Contribution by Tim Ashley Jenkins, 2018_