Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8f32ec8
Updated gitignore
bubthegreat Sep 3, 2020
8d5a8a6
Removing source C stuff
bubthegreat Sep 3, 2020
16aca38
Fixes for gitignore and nanny
bubthegreat Sep 3, 2020
3ee29b4
Revert "Removing source C stuff"
bubthegreat Sep 3, 2020
755291e
Restructuring and updated logging call
bubthegreat Dec 1, 2021
e0aa899
Moving into better directory structure
bubthegreat Dec 1, 2021
7817913
Updated so you can run it from src/rom24/pyom.py instead now that upd…
bubthegreat Dec 1, 2021
57dbbd7
Functional libary with pip install
bubthegreat Dec 1, 2021
7b4c8f9
Updated readme to have new installation/run instructions
bubthegreat Dec 1, 2021
d8d05be
Working owhere function, and mostly functional stuff
bubthegreat Dec 2, 2021
e868138
Rmoving old C code
bubthegreat Dec 2, 2021
d25371e
default to show exits and fixed bug with item location on equip
bubthegreat Dec 2, 2021
63635b0
Improving owhere to have vnums too
bubthegreat Dec 2, 2021
d5becc0
Removing old setup file
bubthegreat Dec 2, 2021
a660025
Remove egg info and update gitignore
bubthegreat Dec 2, 2021
613ce9e
Trying some more things.
bubthegreat Dec 2, 2021
a24bd4e
Update README.md
bubthegreat Dec 2, 2021
0d22f14
Update README.md
bubthegreat Dec 2, 2021
ac254f5
Added scan command
bubthegreat Dec 2, 2021
7611869
Adding black formatting
bubthegreat Dec 2, 2021
c89e710
Adding black for autoformatting and formatted
bubthegreat Dec 2, 2021
227fa05
Implementing mypy typing improvements and bug fixes from that.
bubthegreat Dec 2, 2021
901635f
mypy passing and blacked
bubthegreat Dec 2, 2021
496b7d3
Update README.md
bubthegreat Dec 2, 2021
69f0e62
Added our first pytest test!
bubthegreat Dec 2, 2021
bc42a58
Adding pre-commit and some basic hooks
bubthegreat Dec 2, 2021
0536614
More pre-commit hooks
bubthegreat Dec 2, 2021
6d92d7e
Yay whitespace fixes!
bubthegreat Dec 2, 2021
55c9e50
create basic pytest workflow
bubthegreat Dec 2, 2021
86d43f4
Updates workflow name and fixes pytest requirements
bubthegreat Dec 2, 2021
5856305
Update README.md
bubthegreat Dec 2, 2021
6e7959d
Adding mypy workflow and badge
bubthegreat Dec 2, 2021
1d495f9
Create python-publish.yml
bubthegreat Dec 2, 2021
dff5685
Add publish badge to readme
bubthegreat Dec 2, 2021
6de60f3
Incrementing version
bubthegreat Dec 2, 2021
66663bd
Adding manifest
bubthegreat Dec 2, 2021
3788caf
incrementing version
bubthegreat Dec 2, 2021
78573ea
Updating manifest
bubthegreat Dec 2, 2021
65fb069
Updating version
bubthegreat Dec 2, 2021
decb4bc
Fixed data missing json and added default char
bubthegreat Dec 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: mypy

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run mypy
run: |
mypy src
30 changes: 30 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pytest

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run Tests
run: |
pytest tests
36 changes: 36 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ __pycache__/
*.pyproj
*.sln
*.suo
.idea/
.idea/
venv/
data/players/
data/world/instances/
instance_tracker.txt
*.egg-info/
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- id: mypy
additional_dependencies: [types-all]
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include ./requirements.txt
include README.md
include src/area/*
graft *.are
92 changes: 34 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,57 @@
## Welcome to the Pyom project! ##

*Pyom* is a re-authoring of the *Rom DikuMUD* derivative, using version 3 of the
python programming language. We've tried to use as few external modules as
possible, but are using the excellent *Miniboa* telnet stack as our core.

In most cases, we're trying to keep the overall feel of the code to be
familiar to people who have worked on the original C implementation of Rom.
Changes are being made where they have to be, often due to *Rom* relying on C
specific memory handling tricks, or where it simplifies something by
re-factoring it.
![pytest](https://github.com/bubthegreat/rom24/actions/workflows/pytest.yml/badge.svg)
![mypy](https://github.com/bubthegreat/rom24/actions/workflows/mypy.yml/badge.svg)
![python-publish](https://github.com/bubthegreat/rom24/actions/workflows/python-publish.yml/badge.svg)

For example, the old **send_to_char()** function has been replaced by a send()
method in the character class, giving us the much simpler **ch.send()** method.
*rom24* is a re-authoring of the *Rom DikuMUD* derivative using python3.
We've tried to use as few external modules as
possible, but are using the excellent *Miniboa* telnet stack as our core.

The initial goal of the project is to provide a fully working copy of *Rom*, in
python, which can act as a stepping stone to help others convert their aging C
dikurivatives to a more modern language. On today's hardware, there is little
value in over-optimizing such a small project, and a great deal to gain by
allowing fast and easy coding.

We've included a modified version of *Miniboa*. The original can be found [here](https://code.google.com/p/miniboa/).

and for Python 3, [here](https://code.google.com/p/miniboa-py3/).

You are, of course, required to follow all the licenses of everything this
code was derived from. This includes the *Miniboa* license, and the licenses
for *Rom*, *Merc*, and *DikuMUD*.

The original C source and data files are included for comparison. The root
of the python project itself is in **./Rom24/pysrc/**, and this should be used as
the source directory for any IDE you might use.
Licensing is still in force, please see the docs for licensing information.

## Installation and Usage ##

### Windows ###

1. Grab and install a copy of the latest version of Python3 (currently tested on 3.4.x)
1. Ensure that the Python directory is available on your PATH environment variable
1. Open a new command prompt window
1. Navigate to "~/pyom/Rom24/pysrc/"
1. Run "python pyom.py"

If all went well, you should be seeing a barrage of initialization messages and the MUD will be booting up. By default the MUD uses port 1337. You can connect to localhost:1337 and login.

A basic interactive shell is available in **shell.py**. Various configuration
options can be adjusted in **settings.py**. If you're running from a command
line,
```
#!bash

cd ./Rom24/pysrc && python3 ./pyom.py
cd PyRom
pip install -e .
rom24
```
should get things started. If
you're using an IDE, make sure you set **pyom.py** as the start file.
Normal python install via pip should get things started.

## Configuring an Implementor Character ##
The more up-to-date home of the project that this was not forked from is [here](https://bitbucket.org/mudbytes/pyom).

An Implementor is a superadmin/root/GM/immortal that has all privilages. To set your first character up as an Implementor:
## TO DO ##

1. Create a character
1. Get to level 2
1. Save and log out
1. Locate your character file in "~pyom/Rom24/player/<yourname>.json"
1. Open and modify the Trust (Tru) and Level (Levl) variables to 60
1. Save the file
1. Log back into your character
1. If you have access to commands like "load" "restore" and "vnum" then you are an implementor
* Straighten out legacy loads vs. new loads and remove anything legacy
* Make data consistently relative and make it deployable in docker with volumes
* Add docker and compose for simple local build and testing
* start adding some unit testing
* Move to a more functional paradigm for as much as possible to improve iteration speed (less stateful class shenanigans is better imho)
* Add docstrings to everything as I figure out what the hell it's doing
* Make sure licensing and credits are all still there
* Fix lots and lots of bugs
* Investigate sqllite or another alternative instead of straight json files for performance and sanity
* Change to a real data structure instead of custom class json hooks
* add debug logging everywhere under the sun so it's easier to tell why things are breaking
* Refactor to remove circular dependencies (This is going to be a lot of work, and means stateful classes and functions will have to be redone) but will be worth it.

This isn't finished, and we're still learning python, so things may be
flat-out broken, or done in a really inefficient or silly way, as we unlearn
bad habits C has taught us.
## Contributing ##

In case you found this elsewhere, the actual up-to-date home of the project
is [here](https://bitbucket.org/mudbytes/pyom).
For the love of god, someone please help - I'm doing this because it's fun, but it's more fun to do it together! Just PR changes - I'm not going to be very picky as long as they're an improvement.

You can also contact our project lead, Davion, via PM at [mudbytes](http://www.mudbytes.net/).
Even if you just pull it and test it locally to open bugs, opening bugs is awesome and appreciated. If you're interested in becoming an owner on the repo, send me an email at [email protected]

We hope you have fun with this, and find it useful!
The typing is incredibly loose with lots of Any getting thrown around - as we add more typing, we'll find more bugs ahead of time. We're using black for formatting to keep formatting consistent.

-Quixadhal.
If you're going to contribute, please use the pre-commit hooks. It's got some things that will keep consistent formatting, clean up line endings, etc.
```
pip install -r requirements.txt
pre-commit install
```
Loading