mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Update with latest contribs, write summary-changelog
This commit is contained in:
parent
30a53b71ae
commit
c272beef99
10 changed files with 514 additions and 7 deletions
|
|
@ -221,6 +221,7 @@ Increase requirements: Django 4.1+, Twisted 22.10+ Python 3.9, 3.10, 3.11. Post
|
|||
- Add `tags=` search criterion to `DefaultObject.search`.
|
||||
- Add `AT_EXIT_TRAVERSE` signal, firing when an exit is traversed.
|
||||
- Add integration between Evennia and Discord channels (PR by Inspector Cararacal)
|
||||
- Support for using a Godot-powered client with Evennia (PR by ChrisLR)
|
||||
|
||||
## Evennia 0.9.5
|
||||
|
||||
|
|
|
|||
|
|
@ -26,3 +26,8 @@ Setting-up-PyCharm.md
|
|||
Changelog.md
|
||||
```
|
||||
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
Release-Notes-1.0
|
||||
```
|
||||
148
docs/source/Coding/Release-Notes-1.0.md
Normal file
148
docs/source/Coding/Release-Notes-1.0.md
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
# Evennia 1.0 Release Notes
|
||||
|
||||
This summarizes the changes. See the [Changelog](./Changelog.md) for the full list.
|
||||
|
||||
## Minimum requirements
|
||||
|
||||
- Python 3.10 is now required minimum. Ubuntu LTS now installs with 3.10. Evennia 1.0 is also tested with Python 3.11 - this is the recommended version for Linux/Mac. Windows users may want to stay on Python 3.10 unless they are okay with installing a C++ compiler.
|
||||
- Twisted 22.10+
|
||||
- Django 4.1+
|
||||
|
||||
## Major new features
|
||||
|
||||
- Evennia is now on PyPi and is installable as [pip install evennia](../Setup/Installation.md).
|
||||
- A completely revamped documentation at https://www.evennia.com/docs/latest. The old wiki and readmedocs pages will close.
|
||||
- Evennia 1.0 now has a REST API which allows you access game objects using CRUD operations GET/POST etc. See [The Web-API docs][Web-API] for more information.
|
||||
- [Evennia<>Discord Integration](../Setup/Channels-to-Discord.md) between Evennia channels and Discord servers.
|
||||
- [Script](../Components/Scripts.md) overhaul: Scripts' timer component independent from script object deletion; can now start/stop timer without deleting Script. The `.persistent` flag now only controls if timer survives reload - Script has to be removed with `.delete()` like other typeclassed entities. This makes Scripts even more useful as general storage entities.
|
||||
- The [FuncParser](../Components/FuncParser.md) centralizes and vastly improves all in-string function calls, such as `say the result is $eval(3 * 7)` and say the result `the result is 21`. The parser completely replaces the old `parse_inlinefunc`. The new parser can handle both arguments and kwargs and are also used for in-prototype parsing as well as director stance messaging, such as using `$You()` to represent yourself in a string and having the result come out differently depending on who see you.
|
||||
- [Channels](../Components/Channels.md) New Channel-System using the `channel` command and nicks. The old `ChannelHandler` was removed and the customization and operation of channels have been simplified a lot. The old command syntax commands are now available as a contrib.
|
||||
- [Help System](../Components/Help-System.md) was refactored.
|
||||
- A new type of `FileHelp` system allows you to add in-game help files as external Python files. This means there are three ways to add help entries in Evennia: 1) Auto-generated from Command's code. 2) Manually added to the database from the `sethelp` command in-game and 3) Created as external Python files that Evennia loads and makes available in-game.
|
||||
- We now use `lunr` search indexing for better `help` matching and suggestions. Also improve
|
||||
the main help command's default listing output.
|
||||
- Help command now uses `view` lock to determine if cmd/entry shows in index and `read` lock to determine if it can be read. It used to be `view` in the role of the latter.
|
||||
- `sethelp` command now warns if shadowing other help-types when creating a new entry.
|
||||
- Make `help` index output clickable for webclient/clients with MXP (PR by davewiththenicehat)
|
||||
- Rework of the [Web](../Components/Website.md) setup, into a much more consistent structure and update to latest Django. The `mygame/web/static_overrides` and `-template_overrides` were removed. The folders are now just `mygame/web/static` and `/templates` and handle the automatic copying of data behind the scenes. `app.css` to `website.css` for consistency. The old `prosimii-css` files were removed.
|
||||
- [AttributeProperty](../Components/Attributes.md#using-attributeproperty)/[TagProperty](../Components/Tags.md) along with `AliasProperty` and `PermissionProperty` to allow managing Attributes, Tags, Aliases and Permissios on typeclasses in the same way as Django fields. This dramatically reduces the need to assign Attributes/Tags in `at_create_object` hook.
|
||||
- The old `MULTISESSION_MODE` was divided into smaller settings, for better controlling what happens when a user connects, if a character should be auto-created, and how many characters they can control at the same time. See [Connection-Styles](../Concepts/Connection-Styles.md) for a detailed explanation.
|
||||
- Evennia now supports custom `evennia` launcher commands (e.g. `evennia mycmd foo bar`). Add new commands as callables accepting `*args`, as `settings.EXTRA_LAUNCHER_COMMANDS = {'mycmd': 'path.to.callable', ...}`.
|
||||
|
||||
|
||||
## Contribs
|
||||
|
||||
The `contrib` folder structure was changed from 0.9.5. All contribs are now in sub-folders and organized into categories. All import paths must be updated. See [Contribs overview](../Contribs/Contribs-Overview.md).
|
||||
|
||||
- New [Traits contrib](../Contribs/Contrib-Traits.md), converted and expanded from Ainneve project. (whitenoise, Griatch)
|
||||
- New [Crafting contrib](../Contribs/Contrib-Crafting.md), adding a full crafting subsystem (Griatch)
|
||||
- New [XYZGrid contrib](../Contribs/Contrib-XYZGrid.md), adding x,y,z grid coordinates with in-game map and pathfinding. Controlled outside of the game via custom evennia launcher command (Griatch)
|
||||
- New [Command cooldown contrib](../Contribs/Contrib-Cooldowns.md) contrib for making it easier to manage commands using
|
||||
dynamic cooldowns between uses (owllex)
|
||||
- New [Godot Protocol contrib](../Contribs/Contrib-Godotwebsocket.md) for connecting to Evennia from a client written in the open-source game engine [Godot](https://godotengine.org/) (ChrisLR).
|
||||
- New [name_generator contrib](../Contribs/Contrib-Name-Generator.md) for building random real-world based or fantasy-names based on phonetic rules (InspectorCaracal)
|
||||
- New [Buffs contrib](../Contribs/Contrib-Buffs.md) for managing temporary and permanent RPG status buffs effects (tegiminis)
|
||||
- The existing [RPSystem contrib](../Contribs/Contrib-RPSystem.md) was refactored and saw a speed boost (InspectorCaracal, other contributors)
|
||||
|
||||
## Translations
|
||||
|
||||
- New Latin (la) i18n translation (jamalainm)
|
||||
- Updated Italian translation (rpolve)
|
||||
- Updated Swedish translation
|
||||
|
||||
## Utils
|
||||
|
||||
- New `utils.format_grid` for easily displaying long lists of items in a block. This is now used for the default help display.
|
||||
- Add `utils.repeat` and `utils.unrepeat` as shortcuts to TickerHandler add/remove, similar
|
||||
to how `utils.delay` is a shortcut for TaskHandler add.
|
||||
- Add `utils/verb_conjugation` for automatic verb conjugation (English only). This
|
||||
is useful for implementing actor-stance emoting for sending a string to different targets.
|
||||
- `utils.evmenu.ask_yes_no` is a helper function that makes it easy to ask a yes/no question
|
||||
to the user and respond to their input. This complements the existing `get_input` helper.
|
||||
- New `tasks` command for managing tasks started with `utils.delay` (PR by davewiththenicehat)
|
||||
- Add `.deserialize()` method to `_Saver*` structures to help completely
|
||||
decouple structures from database without needing separate import.
|
||||
- Add `run_in_main_thread` as a helper for those wanting to code server code
|
||||
from a web view.
|
||||
- Update `evennia.utils.logger` to use Twisted's new logging API. No change in Evennia API
|
||||
except more standard aliases logger.error/info/exception/debug etc can now be used.
|
||||
- Made `utils.iter_to_str` format prettier strings, using Oxford comma.
|
||||
- Move `create_*` functions into db managers, leaving `utils.create` only being
|
||||
wrapper functions (consistent with `utils.search`). No change of api otherwise.
|
||||
|
||||
## Locks
|
||||
|
||||
- New `search:` lock type used to completely hide an object from being found by
|
||||
the `DefaultObject.search` (`caller.search`) method. (CloudKeeper)
|
||||
- New default for `holds()` lockfunc - changed from default of `True` to default of `False` in order to disallow dropping nonsensical things (such as things you don't hold).
|
||||
|
||||
## Hook changes
|
||||
|
||||
- Changed all `at_before/after_*` hooks to `at_pre/post_*` for consistency
|
||||
across Evennia (the old names still work but are deprecated)
|
||||
- New `at_pre_object_leave(obj, destination)` method on `Objects`.
|
||||
- New `at_server_init()` hook called before all other startup hooks for all
|
||||
startup modes. Used for more generic overriding (volund)
|
||||
- New `at_pre_object_receive(obj, source_location)` method on Objects. Called on
|
||||
destination, mimicking behavior of `at_pre_move` hook - returning False will abort move.
|
||||
- `Object.normalize_name` and `.validate_name` added to (by default) enforce latinify
|
||||
on character name and avoid potential exploits using clever Unicode chars (trhr)
|
||||
- Make `object.search` support 'stacks=0' keyword - if ``>0``, the method will return
|
||||
N identical matches instead of triggering a multi-match error.
|
||||
- Add `tags.has()` method for checking if an object has a tag or tags (PR by ChrisLR)
|
||||
- Add `Msg.db_receiver_external` field to allowe external, string-id message-receivers.
|
||||
- Add `$pron()` and `$You()` inlinefuncs for pronoun parsing in actor-stance strings using `msg_contents`.
|
||||
|
||||
## Command changes
|
||||
|
||||
- Change default multi-match syntax from `1-obj`, `2-obj` to `obj-1`, `obj-2`, which seems to be what most expect.
|
||||
- Split `return_appearance` hook with helper methods and have it use a template
|
||||
string in order to make it easier to override.
|
||||
- Command executions now done on copies to make sure `yield` don't cause crossovers. Add
|
||||
`Command.retain_instance` flag for reusing the same command instance.
|
||||
- Allow sending messages with `page/tell` without a `=` if target name contains no spaces.
|
||||
- The `typeclass` command will now correctly search the correct database-table for the target
|
||||
obj (avoids mistakenly assigning an AccountDB-typeclass to a Character etc).
|
||||
- Merged `script` and `scripts` commands into one, for both managing global- and
|
||||
on-object Scripts. Moved `CmdScripts` and `CmdObjects` to `commands/default/building.py`.
|
||||
- The `channel` commands replace all old channel-related commands, such as `cset` etc
|
||||
- Expand `examine` command's code to much more extensible and modular. Show
|
||||
attribute categories and value types (when not strings).
|
||||
- Add ability to examine `/script` and `/channel` entities with `examine` command.
|
||||
- Add support for `$dbref()` and `$search` when assigning an Attribute value
|
||||
with the `set` command. This allows assigning real objects from in-game.
|
||||
- Have `type/force` default to `update`-mode rather than `reset`mode and add more verbose
|
||||
warning when using reset mode.
|
||||
|
||||
## Coding improvement highlights
|
||||
|
||||
- The db pickle-serializer now checks for methods `__serialize_dbobjs__` and `__deserialize_dbobjs__` to allow custom packing/unpacking of nested dbobjs, to allow storing in Attribute. See [Attributes](../Components/Attributes.md) documentation.
|
||||
- Add `ObjectParent` mixin to default game folder template as an easy, ready-made
|
||||
way to override features on all ObjectDB-inheriting objects easily.
|
||||
source location, mimicking behavior of `at_pre_move` hook - returning False will abort move.
|
||||
- New Unit test parent classes, for use both in Evenia core and in mygame. Restructured unit tests to always honor default settings.
|
||||
|
||||
|
||||
## Other
|
||||
|
||||
- Homogenize manager search methods to always return querysets and not sometimes querysets and sometimes lists.
|
||||
- Attribute/NAttribute got a homogenous representation, using intefaces, both
|
||||
`AttributeHandler` and `NAttributeHandler` has same api now.
|
||||
- Added `content_types` indexing to DefaultObject's ContentsHandler. (volund)
|
||||
- Made most of the networking classes such as Protocols and the SessionHandlers
|
||||
replaceable via `settings.py` for modding enthusiasts. (volund)
|
||||
- The `initial_setup.py` file can now be substituted in `settings.py` to customize
|
||||
initial game database state. (volund)
|
||||
- Make IP throttle use Django-based cache system for optional persistence (PR by strikaco)
|
||||
- In modules given by `settings.PROTOTYPE_MODULES`, spawner will now first look for a global
|
||||
list `PROTOTYPE_LIST` of dicts before loading all dicts in the module as prototypes.
|
||||
concept of a dynamically created `ChannelCmdSet`.
|
||||
- Prototypes now allow setting `prototype_parent` directly to a prototype-dict.
|
||||
This makes it easier when dynamically building in-module prototypes.
|
||||
- Make `@lazy_property` decorator create read/delete-protected properties. This is because it's used for handlers, and e.g. self.locks=[] is a common beginner mistake.
|
||||
- Change `settings.COMMAND_DEFAULT_ARG_REGEX` default from `None` to a regex meaning that
|
||||
a space or `/` must separate the cmdname and args. This better fits common expectations.
|
||||
- Add `settings.MXP_ENABLED=True` and `settings.MXP_OUTGOING_ONLY=True` as sane defaults, to avoid known security issues with players entering MXP links.
|
||||
- Made `MonitorHandler.add/remove` support `category` for monitoring Attributes with a category (before only key was used, ignoring category entirely).
|
||||
|
||||
|
||||
290
docs/source/Contribs/Contrib-Godotwebsocket.md
Normal file
290
docs/source/Contribs/Contrib-Godotwebsocket.md
Normal file
|
|
@ -0,0 +1,290 @@
|
|||
# Godot Websocket
|
||||
|
||||
Contribution by ChrisLR, 2022
|
||||
|
||||
This contrib allows you to connect a Godot Client directly to your mud,
|
||||
and display regular text with color in Godot's RichTextLabel using BBCode.
|
||||
You can use Godot to provide advanced functionality with proper Evennia support.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
You need to add the following settings in your settings.py and restart evennia.
|
||||
|
||||
```python
|
||||
PORTAL_SERVICES_PLUGIN_MODULES.append('evennia.contrib.base_systems.godotwebsocket.webclient')
|
||||
GODOT_CLIENT_WEBSOCKET_PORT = 4008
|
||||
GODOT_CLIENT_WEBSOCKET_CLIENT_INTERFACE = "127.0.0.1"
|
||||
```
|
||||
|
||||
This will make evennia listen on the port 4008 for Godot.
|
||||
You can change the port and interface as you want.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
The tl;dr of it is to connect using a Godot Websocket using the port defined above.
|
||||
It will let you transfer data from Evennia to Godot, allowing you
|
||||
to get styled text in a RichTextLabel with bbcode enabled or to handle
|
||||
the extra data given from Evennia as needed.
|
||||
|
||||
|
||||
This section assumes you have basic knowledge on how to use Godot.
|
||||
You can read the following url for more details on Godot Websockets
|
||||
and to implement a minimal client.
|
||||
|
||||
https://docs.godotengine.org/en/stable/tutorials/networking/websocket.html
|
||||
|
||||
The rest of this document will be for Godot 3, an example is left at the bottom
|
||||
of this readme for Godot 4.
|
||||
|
||||
|
||||
At the top of the file you must change the url to point at your mud.
|
||||
```
|
||||
extends Node
|
||||
|
||||
# The URL we will connect to
|
||||
export var websocket_url = "ws://localhost:4008"
|
||||
|
||||
```
|
||||
|
||||
|
||||
You must also remove the protocol from the `connect_to_url` call made
|
||||
within the `_ready` function.
|
||||
|
||||
```
|
||||
func _ready():
|
||||
# ...
|
||||
# Change the following line from this
|
||||
var err = _client.connect_to_url(websocket_url, ["lws-mirror-protocol"])
|
||||
# To this
|
||||
var err = _client.connect_to_url(websocket_url)
|
||||
# ...
|
||||
```
|
||||
|
||||
This will allow you to connect to your mud.
|
||||
After that you need to properly handle the data sent by evennia.
|
||||
To do this, you should replace your `_on_data` method.
|
||||
You will need to parse the JSON received to properly act on the data.
|
||||
Here is an example
|
||||
```
|
||||
func _on_data():
|
||||
# The following two lines will get us the data from Evennia.
|
||||
var data = _client.get_peer(1).get_packet().get_string_from_utf8()
|
||||
var json_data = JSON.parse(data).result
|
||||
# The json_data is an array
|
||||
|
||||
# The first element informs us this is simple text
|
||||
# so we add it to the RichTextlabel
|
||||
if json_data[0] == 'text':
|
||||
for msg in json_data[1]: label.append_bbcode(msg)
|
||||
|
||||
# Always useful to print the data and see what we got.
|
||||
print(data)
|
||||
```
|
||||
|
||||
The first element is the type, it will be `text` if it is a message
|
||||
It can be anything you would provide to the Evennia `msg` function.
|
||||
The second element will be the data related to the type of message, in this case it is a list of text to display.
|
||||
Since it is parsed BBCode, we can add that directly to a RichTextLabel by calling its append_bbcode method.
|
||||
|
||||
If you want anything better than fancy text in Godot, you will have
|
||||
to leverage Evennia's OOB to send extra data.
|
||||
|
||||
You can [read more on OOB here](https://www.evennia.com/docs/latest/OOB.html#oob).
|
||||
|
||||
In this example, we send coordinates whenever we message our character.
|
||||
|
||||
Evennia
|
||||
```python
|
||||
caller.msg(coordinates=(9, 2))
|
||||
```
|
||||
|
||||
Godot
|
||||
```
|
||||
func _on_data():
|
||||
...
|
||||
if json_data[0] == 'text':
|
||||
for msg in json_data[1]: label.append_bbcode(msg)
|
||||
|
||||
# Notice the first element is the name of the kwarg we used from evennia.
|
||||
elif json_data[0] == 'coordinates':
|
||||
var coords_data = json_data[2]
|
||||
player.set_pos(coords_data)
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
A good idea would be to set up Godot Signals you can trigger based on the data
|
||||
you receive, so you can manage the code better.
|
||||
|
||||
## Known Issues
|
||||
|
||||
- Sending SaverDicts and similar objects straight from Evennia .DB will cause issues,
|
||||
cast them to dict() or list() before doing so.
|
||||
|
||||
- Background colors are only supported by Godot 4.
|
||||
|
||||
## Godot 3 Example
|
||||
|
||||
This is an example of a Script to use in Godot 3.
|
||||
The script can be attached to the root UI node.
|
||||
|
||||
```
|
||||
extends Node
|
||||
|
||||
# The URL to connect to, should be your mud.
|
||||
export var websocket_url = "ws://127.0.0.1:4008"
|
||||
|
||||
# These are references to controls in the scene
|
||||
onready var parent = get_parent()
|
||||
onready var label = parent.get_node("%ChatLog")
|
||||
onready var txtEdit = parent.get_node("%ChatInput")
|
||||
|
||||
onready var room = get_node("/root/World/Room")
|
||||
|
||||
# Our WebSocketClient instance
|
||||
var _client = WebSocketClient.new()
|
||||
|
||||
var is_connected = false
|
||||
|
||||
func _ready():
|
||||
# Connect base signals to get notified of connection open, close, errors and messages
|
||||
_client.connect("connection_closed", self, "_closed")
|
||||
_client.connect("connection_error", self, "_closed")
|
||||
_client.connect("connection_established", self, "_connected")
|
||||
_client.connect("data_received", self, "_on_data")
|
||||
print('Ready')
|
||||
|
||||
# Initiate connection to the given URL.
|
||||
var err = _client.connect_to_url(websocket_url)
|
||||
if err != OK:
|
||||
print("Unable to connect")
|
||||
set_process(false)
|
||||
|
||||
func _closed(was_clean = false):
|
||||
# was_clean will tell you if the disconnection was correctly notified
|
||||
# by the remote peer before closing the socket.
|
||||
print("Closed, clean: ", was_clean)
|
||||
set_process(false)
|
||||
|
||||
func _connected(proto = ""):
|
||||
is_connected = true
|
||||
print("Connected with protocol: ", proto)
|
||||
|
||||
func _on_data():
|
||||
# This is called when Godot receives data from evennia
|
||||
var data = _client.get_peer(1).get_packet().get_string_from_utf8()
|
||||
var json_data = JSON.parse(data).result
|
||||
# Here we have the data from Evennia which is an array.
|
||||
# The first element will be text if it is a message
|
||||
# and would be the key of the OOB data you passed otherwise.
|
||||
if json_data[0] == 'text':
|
||||
# In this case, we simply append the data as bbcode to our label.
|
||||
for msg in json_data[1]: label.append_bbcode(msg)
|
||||
elif json_data[0] == 'coordinates':
|
||||
# Dummy signal emitted if we wanted to handle the new coordinates
|
||||
# elsewhere in the project.
|
||||
self.emit_signal('updated_coordinates', json_data[1])
|
||||
|
||||
|
||||
# We only print this for easier debugging.
|
||||
print(data)
|
||||
|
||||
func _process(delta):
|
||||
# Required for websocket to properly react
|
||||
_client.poll()
|
||||
|
||||
func _on_button_send():
|
||||
# This is called when we press the button in the scene
|
||||
# with a connected signal, it sends the written message to Evennia.
|
||||
var msg = txtEdit.text
|
||||
var msg_arr = ['text', [msg], {}]
|
||||
var msg_str = JSON.print(msg_arr)
|
||||
_client.get_peer(1).put_packet(msg_str.to_utf8())
|
||||
|
||||
func _notification(what):
|
||||
# This is a special method that allows us to notify Evennia we are closing.
|
||||
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
|
||||
if is_connected:
|
||||
var msg_arr = ['text', ['quit'], {}]
|
||||
var msg_str = JSON.print(msg_arr)
|
||||
_client.get_peer(1).put_packet(msg_str.to_utf8())
|
||||
get_tree().quit() # default behavior
|
||||
|
||||
```
|
||||
|
||||
## Godot 4 Example
|
||||
|
||||
This is an example of a Script to use in Godot 4.
|
||||
Note that the version is not final so the code may break.
|
||||
It requires a WebSocketClientNode as a child of the root node.
|
||||
The script can be attached to the root UI node.
|
||||
|
||||
```
|
||||
extends Control
|
||||
|
||||
# The URL to connect to, should be your mud.
|
||||
var websocket_url = "ws://127.0.0.1:4008"
|
||||
|
||||
# These are references to controls in the scene
|
||||
@onready
|
||||
var label: RichTextLabel = get_node("%ChatLog")
|
||||
@onready
|
||||
var txtEdit: TextEdit = get_node("%ChatInput")
|
||||
@onready
|
||||
var websocket = get_node("WebSocketClient")
|
||||
|
||||
func _ready():
|
||||
# We connect the various signals
|
||||
websocket.connect('connected_to_server', self._connected)
|
||||
websocket.connect('connection_closed', self._closed)
|
||||
websocket.connect('message_received', self._on_data)
|
||||
|
||||
# We attempt to connect and print out the error if we have one.
|
||||
var result = websocket.connect_to_url(websocket_url)
|
||||
if result != OK:
|
||||
print('Could not connect:' + str(result))
|
||||
|
||||
|
||||
func _closed():
|
||||
# This emits if the connection was closed by the remote host or unexpectedly
|
||||
print('Connection closed.')
|
||||
set_process(false)
|
||||
|
||||
func _connected():
|
||||
# This emits when the connection succeeds.
|
||||
print('Connected!')
|
||||
|
||||
func _on_data(data):
|
||||
# This is called when Godot receives data from evennia
|
||||
var json_data = JSON.parse_string(data)
|
||||
# Here we have the data from Evennia which is an array.
|
||||
# The first element will be text if it is a message
|
||||
# and would be the key of the OOB data you passed otherwise.
|
||||
if json_data[0] == 'text':
|
||||
# In this case, we simply append the data as bbcode to our label.
|
||||
for msg in json_data[1]: # Here we include a newline at every message.
|
||||
label.append_text("\n" + msg)
|
||||
elif json_data[0] == 'coordinates':
|
||||
# Dummy signal emitted if we wanted to handle the new coordinates
|
||||
# elsewhere in the project.
|
||||
self.emit_signal('updated_coordinates', json_data[1])
|
||||
|
||||
# We only print this for easier debugging.
|
||||
print(data)
|
||||
|
||||
func _on_button_pressed():
|
||||
# This is called when we press the button in the scene
|
||||
# with a connected signal, it sends the written message to Evennia.
|
||||
var msg = txtEdit.text
|
||||
var msg_arr = ['text', [msg], {}]
|
||||
var msg_str = JSON.stringify(msg_arr)
|
||||
websocket.send(msg_str)
|
||||
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
<small>This document page is generated from `evennia/contrib/base_systems/godotwebsocket/README.md`. Changes to this
|
||||
file will be overwritten, so edit that file rather than this one.</small>
|
||||
|
|
@ -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 **46** contribs currently included
|
||||
This page is auto-generated and summarizes all **47** contribs currently included
|
||||
with the Evennia distribution.
|
||||
|
||||
All contrib categories are imported from `evennia.contrib`, such as
|
||||
|
|
@ -33,12 +33,12 @@ If you want to add a contrib, see [the contrib guidelines](./Contribs-Guidelines
|
|||
| [buffs](#buffs) | [building_menu](#building_menu) | [character_creator](#character_creator) | [clothing](#clothing) | [color_markups](#color_markups) |
|
||||
| [components](#components) | [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) | [health_bar](#health_bar) | [ingame_map_display](#ingame_map_display) | [ingame_python](#ingame_python) |
|
||||
| [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) | [talking_npc](#talking_npc) | [traits](#traits) |
|
||||
| [tree_select](#tree_select) | [turnbattle](#turnbattle) | [tutorial_world](#tutorial_world) | [unixcommand](#unixcommand) | [wilderness](#wilderness) |
|
||||
| [xyzgrid](#xyzgrid) |
|
||||
| [gendersub](#gendersub) | [git_integration](#git_integration) | [godotwebsocket](#godotwebsocket) | [health_bar](#health_bar) | [ingame_map_display](#ingame_map_display) |
|
||||
| [ingame_python](#ingame_python) | [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) | [talking_npc](#talking_npc) |
|
||||
| [traits](#traits) | [tree_select](#tree_select) | [turnbattle](#turnbattle) | [tutorial_world](#tutorial_world) | [unixcommand](#unixcommand) |
|
||||
| [wilderness](#wilderness) | [xyzgrid](#xyzgrid) |
|
||||
|
||||
|
||||
|
||||
|
|
@ -62,6 +62,7 @@ Contrib-Color-Markups.md
|
|||
Contrib-Components.md
|
||||
Contrib-Custom-Gametime.md
|
||||
Contrib-Email-Login.md
|
||||
Contrib-Godotwebsocket.md
|
||||
Contrib-Ingame-Python.md
|
||||
Contrib-Menu-Login.md
|
||||
Contrib-Mux-Comms-Cmds.md
|
||||
|
|
@ -143,6 +144,18 @@ it just uses it as the identifier rather than a username.
|
|||
|
||||
|
||||
|
||||
### `godotwebsocket`
|
||||
|
||||
_Contribution by ChrisLR, 2022_
|
||||
|
||||
This contrib allows you to connect a Godot Client directly to your mud,
|
||||
and display regular text with color in Godot's RichTextLabel using BBCode.
|
||||
You can use Godot to provide advanced functionality with proper Evennia support.
|
||||
|
||||
[Read the documentation](./Contrib-Godotwebsocket.md) - [Browse the Code](evennia.contrib.base_systems.godotwebsocket)
|
||||
|
||||
|
||||
|
||||
### `ingame_python`
|
||||
|
||||
_Contrib by Vincent Le Goff 2017_
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
```{eval-rst}
|
||||
evennia.contrib.base\_systems.godotwebsocket
|
||||
====================================================
|
||||
|
||||
.. automodule:: evennia.contrib.base_systems.godotwebsocket
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 6
|
||||
|
||||
evennia.contrib.base_systems.godotwebsocket.test_text2bbcode
|
||||
evennia.contrib.base_systems.godotwebsocket.text2bbcode
|
||||
evennia.contrib.base_systems.godotwebsocket.webclient
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```{eval-rst}
|
||||
evennia.contrib.base\_systems.godotwebsocket.test\_text2bbcode
|
||||
=====================================================================
|
||||
|
||||
.. automodule:: evennia.contrib.base_systems.godotwebsocket.test_text2bbcode
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```{eval-rst}
|
||||
evennia.contrib.base\_systems.godotwebsocket.text2bbcode
|
||||
===============================================================
|
||||
|
||||
.. automodule:: evennia.contrib.base_systems.godotwebsocket.text2bbcode
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
```{eval-rst}
|
||||
evennia.contrib.base\_systems.godotwebsocket.webclient
|
||||
=============================================================
|
||||
|
||||
.. automodule:: evennia.contrib.base_systems.godotwebsocket.webclient
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
```
|
||||
|
|
@ -17,6 +17,7 @@ evennia.contrib.base\_systems
|
|||
evennia.contrib.base_systems.components
|
||||
evennia.contrib.base_systems.custom_gametime
|
||||
evennia.contrib.base_systems.email_login
|
||||
evennia.contrib.base_systems.godotwebsocket
|
||||
evennia.contrib.base_systems.ingame_python
|
||||
evennia.contrib.base_systems.menu_login
|
||||
evennia.contrib.base_systems.mux_comms_cmds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue