Update docs for latest PRs

This commit is contained in:
Griatch 2022-10-23 10:58:19 +02:00
parent bf7f8e63c5
commit 9a2a3fc2cb
9 changed files with 148 additions and 12 deletions

View file

@ -203,6 +203,8 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10
- Add new setting `MAX_NR_SIMULTANEUS_PUPPETS` - how many puppets the account
can run at the same time. Used to limit multi-playing.
- Make setting `MAX_NR_CHARACTERS` interact better with the new settings above.
- Allow `$search` funcparser func to search tags and to accept kwargs for more
powerful searches passed into the regular search functions.
## Evennia 0.9.5

View file

@ -2,6 +2,13 @@
Contrib by Griatch 2022
```{warning}
NOTE - this tutorial is WIP and NOT complete! It was put on hold to focus on
releasing Evennia 1.0. You will still learn things from it, but don't expect
perfection.
```
A complete example MUD using Evennia. This is the final result of what is
implemented if you follow the Getting-Started tutorial. It's recommended
that you follow the tutorial step by step and write your own code. But if

View file

@ -0,0 +1,73 @@
# In-game Git Integration
Contribution by helpme (2022)
A module to integrate a stripped-down version of git within the game, allowing developers to view their git status, change branches, and pull updated code of both their local mygame repo and Evennia core. After a successful pull or checkout, the git command will reload the game: Manual restarts may be required to to apply certain changes that would impact persistent scripts etc.
Once the contrib is set up, integrating remote changes is as simple as entering the following into your game:
```
git pull
```
The repositories you want to work with, be it only your local mygame repo, only Evennia core, or both, must be git directories for the command to function. If you are only interested in using this to get upstream Evennia changes, only the Evennia repository needs to be a git repository. [Get started with version control here.](https://www.evennia.com/docs/1.0-dev/Coding/Version-Control.html)
## Dependencies
This package requires the dependency "gitpython", a python library used to interact with git repositories. To install, it's easiest to install Evennia's extra requirements:
- Activate your `virtualenv`
- `cd` to the root of the Evennia repository. There should be an `requirements_extra.txt` file here.
- `pip install -r requirements_extra.txt`
## Installation
This utility adds a simple assortment of 'git' commands. Import the module into your commands and add it to your command set to make it available.
Specifically, in `mygame/commands/default_cmdsets.py`:
```python
...
from evennia.contrib.utils.git_integration import GitCmdSet # <---
class CharacterCmdset(default_cmds.Character_CmdSet):
...
def at_cmdset_creation(self):
...
self.add(GitCmdSet) # <---
```
Then `reload` to make the git command available.
## Usage
This utility will only work if the directory you wish to work with is a git directory. If they are not, you will be prompted to initiate your directory as a git repository using the following commands in your terminal:
```
git init
git remote add origin 'link to your repository'
```
By default, the git commands are only available to those with Developer permissions and higher. You can change this by overriding the command and setting its locks from "cmd:pperm(Developer)" to the lock of your choice.
The supported commands are:
* git status: An overview of your git repository, which files have been changed locally, and the commit you're on.
* git branch: What branches are available for you to check out.
* git checkout 'branch': Checkout a branch.
* git pull: Pull the latest code from your current branch.
* All of these commands are also available with 'evennia', to serve the same functionality related to your Evennia directory. So:
* git evennia status
* git evennia branch
* git evennia checkout 'branch'
* git evennia pull: Pull the latest Evennia code.
## Settings Used
The utility uses the existing GAME_DIR and EVENNIA_DIR settings from settings.py. You should not need to alter these if you have a standard directory setup, they ought to exist without any setup required from you.
----
<small>This document page is generated from `evennia/contrib/utils/git_integration/README.md`. Changes to this
file will be overwritten, so edit that file rather than this one.</small>

View file

@ -53,28 +53,31 @@ Exits: northeast and east
(then go back to your mygame/ folder)
This will install all optional requirements of Evennia.
2. Import and add the `evennia.contrib.commands.XYZGridCmdSet` to the
2. Import and [add] the `evennia.contrib.grid.xyzgrid.commands.XYZGridCmdSet` to the
`CharacterCmdset` cmdset in `mygame/commands.default_cmds.py`. Reload
the server. This makes the `map`, `goto/path` and the modified `teleport` and
`open` commands available in-game.
[add]: ../Components/Command-Sets
3. Edit `mygame/server/conf/settings.py` and add
EXTRA_LAUNCHER_COMMANDS['xyzgrid'] = 'evennia.contrib.launchcmd.xyzcommand'
and
PROTOTYPE_MODULES += [evennia.contrib.grid.xyzgrid.prototypes]
EXTRA_LAUNCHER_COMMANDS['xyzgrid'] = 'evennia.contrib.grid.xyzgrid.launchcmd.xyzcommand'
PROTOTYPE_MODULES += ['evennia.contrib.grid.xyzgrid.prototypes']
This will add the new ability to enter `evennia xyzgrid <option>` on the
command line. It will also make the `xyz_room` and `xyz_exit` prototypes
available for use as prototype-parents when spawning the grid.
4. Run `evennia xyzgrid help` for available options.
5. (Optional): By default, the xyzgrid will only spawn module-based
[prototypes](../Components/Prototypes.md). This is an optimization and usually makes sense
[prototypes]. This is an optimization and usually makes sense
since the grid is entirely defined outside the game anyway. If you want to
also make use of in-game (db-) created prototypes, add
`XYZGRID_USE_DB_PROTOTYPES = True` to settings.
[prototypes]: ../Components/Prototypes
## Overview

View file

@ -609,11 +609,12 @@ character make small verbal observations at irregular intervals.
_Contrib by Griatch 2022_
A complete example MUD using Evennia. This is the final result of what is
implemented if you follow the Getting-Started tutorial. It's recommended
that you follow the tutorial step by step and write your own code. But if
you prefer you can also pick apart or use this as a starting point for your
own game.
```{warning}
NOTE - this tutorial is WIP and NOT complete! It was put on hold to focus on
releasing Evennia 1.0. You will still learn things from it, but don't expect
perfection.
```
[Read the documentation](./Contrib-Evadventure.md) - [Browse the Code](evennia.contrib.tutorials.evadventure)
@ -680,6 +681,7 @@ and more._
Contrib-Auditing.md
Contrib-Fieldfill.md
Contrib-Git-Integration.md
Contrib-Name-Generator.md
Contrib-Random-String-Generator.md
Contrib-Tree-Select.md
@ -714,6 +716,16 @@ to any callable of your choice.
### Contrib: `git_integration`
_Contribution by helpme (2022)_
A module to integrate a stripped-down version of git within the game, allowing developers to view their git status, change branches, and pull updated code of both their local mygame repo and Evennia core. After a successful pull or checkout, the git command will reload the game: Manual restarts may be required to to apply certain changes that would impact persistent scripts etc.
[Read the documentation](./Contrib-Git-Integration.md) - [Browse the Code](evennia.contrib.utils.git_integration)
### Contrib: `name_generator`
_Contribution by InspectorCaracal (2022)_

View file

@ -0,0 +1,10 @@
```{eval-rst}
evennia.contrib.utils.git\_integration.git\_integration
==============================================================
.. automodule:: evennia.contrib.utils.git_integration.git_integration
:members:
:undoc-members:
:show-inheritance:
```

View file

@ -0,0 +1,18 @@
```{eval-rst}
evennia.contrib.utils.git\_integration
==============================================
.. automodule:: evennia.contrib.utils.git_integration
:members:
:undoc-members:
:show-inheritance:
.. toctree::
:maxdepth: 6
evennia.contrib.utils.git_integration.git_integration
evennia.contrib.utils.git_integration.tests
```

View file

@ -0,0 +1,10 @@
```{eval-rst}
evennia.contrib.utils.git\_integration.tests
===================================================
.. automodule:: evennia.contrib.utils.git_integration.tests
:members:
:undoc-members:
:show-inheritance:
```

View file

@ -13,6 +13,7 @@ evennia.contrib.utils
evennia.contrib.utils.auditing
evennia.contrib.utils.fieldfill
evennia.contrib.utils.git_integration
evennia.contrib.utils.name_generator
evennia.contrib.utils.random_string_generator
evennia.contrib.utils.tree_select