Commit Graph

10510 Commits

Author SHA1 Message Date
e63fbe14f4 Add deprecation warning for custom cmdparser lacking new session kwarg 2026-04-11 11:37:47 +02:00
1e1cc63bda Merge pull request #3885 from jaborsh/pr-3583
is_ooc(): Thread session through lock system in multi-session mode
2026-04-11 11:34:09 +02:00
0b87da170a Merge pull request #3884 from jaborsh/pr-3802
postgresql: Formally support postgresql
2026-04-11 11:23:20 +02:00
39f25f1773 Merge pull request #3883 from jaborsh/pr-3855
taskhandler: Fix TaskHandlerTask stale references & clean up
2026-04-11 11:17:58 +02:00
0d5fd50cea Merge pull request #3877 from InspectorCaracal/disambig-patch
Fixes multimatch numbering display to be case insensitive
2026-04-11 11:11:04 +02:00
f1af999212 Remove some superfluous code checking 2026-04-11 11:01:19 +02:00
8ccfd474bf Merge pull request #3875 from Machine-Garden-MUD/main
Fix TypeError in telnet HTTP check when command stacking sends bytes
2026-04-11 10:58:19 +02:00
10d917ac70 Cleaned up CHANGELOG.md 2026-04-11 10:12:05 +02:00
20f05c912e Extend /ev skill with more helpful things 2026-04-11 10:01:09 +02:00
865de5a874 st 2026-04-11 09:51:30 +02:00
f8fdb0d3f7 Merge pull request #3869 from jaborsh/patch-1
launch: Allow evennia to log in background
2026-04-11 09:49:30 +02:00
45c7dbb834 Merge pull request #3866 from jaborsh/patch-4
nit: Remove 'None' print in LogObserver
2026-04-11 09:34:41 +02:00
fb1c495a4d Add small /ev skill for pr/issue reviewing 2026-04-11 09:32:11 +02:00
a1732baf40 Some more PR-related agent context 2026-04-11 08:40:15 +02:00
1dc8694370 Refinement of agent context, after testing 2026-04-11 00:35:07 +02:00
5b9a2acfac Add agent scaffolding for those wanting to work in the Evennia repo 2026-04-11 00:30:13 +02:00
7b693d6577 Improve east asian len/formatting operations. Inspired by stale PR from
user hhsiao.
2026-04-10 22:52:51 +02:00
bb5774c288 Tests were too dependent on implementation. Reverting.
I was thinking maybe we should add some tests to validate the caching behavior but really that isn't going to be useful and it'll break if something else changes. This isn't a very good test so I am taking it back out.
2026-04-09 14:02:02 -04:00
26ca94c459 Move fingerprint computation into CmdSet for O(1) cache lookups
The fingerprint was being recomputed from scratch on every command
input. Move it to a lazy cached property on CmdSet itself, invalidated
only when commands are added or removed. The merge cache lookup in
cmdhandler now just reads pre-computed fingerprints. O(N) in the
number of cmdsets rather than O(total commands).
2026-04-09 11:15:20 -04:00
f1a2a43b71 Fix cmdset merge cache using content-based fingerprints
The id()-based merge cache keys never produced cache hits because
cmdset objects are recreated on each call. Replace with content-based
fingerprints (key, priority, mergetype, options, and sorted command
matchsets) so semantically identical cmdset combinations share a
cache entry.

Also switch from a plain dict to a bounded OrderedDict with LRU
eviction (max 1000 entries) to prevent unbounded memory growth.

Add test verifying cache hit behavior.
2026-04-09 11:05:12 -04:00
6760e730c7 Fix MXP parse to not escape surrounding text as HTML entities 2026-04-09 00:00:11 +02:00
d39fe83f21 Fix funcparser treating $" as malformed function call 2026-04-08 11:29:08 +02:00
33cbf7b5e0 Refactor: deduplicate system commands in __add__ using Command equality
The previous fix filtered system commands by string prefix (startswith("__"))
in _replace and _union. I felt a string comparison like that was kind of fragile so took a different approach. This reimplements the detection logic
that CmdSet.add() already uses to populate system_commands, and couples the merge methods to an implementation detail of how system commands are named.

Since __add__ is the single site responsible for re-adding system commands to
the merged result, the deduplication belongs there. Before calling
add(sys_commands, allow_duplicates=True), strip any system commands that were carried through in the raw commands[:] copy by filtering against the already-computed sys_commands set using Command.__eq__/__hash__. This keeps the merge methods clean and ensures the fix applies regardless of merge type.
2026-04-05 12:44:39 -04:00
c90ca4afa2 Fix system commands duplicated in CmdSet Replace/Union merges
_replace and _union both copied cmdset_a.commands[:] verbatim, which
includes system commands (key starts with "__"). CmdSet.__add__ then
re-added the correctly-merged system commands via add(sys_commands,
allow_duplicates=True), causing them to appear twice in the result.

This manifested as "more than one match for 'q'" when exiting EvMore,
because cmdparser.build_matches found two identical system command entries.

Fix: filter system commands out of the commands[:] copy in _replace and
_union, and from the cmdset_b extend in _union. __add__ is already
responsible for collecting and re-adding system commands from both sides.

Adds regression tests for Replace and Union merges with system commands.
2026-04-05 12:27:33 -04:00
45ce2e2cc9 Merge remote-tracking branch 'upstream/main' into main 2026-04-03 23:10:09 +00:00
53c1a077bf Fix @teleport showing double error message on failed search
When a destination search failed, the caller saw two messages:
1. "Could not find 'X'." (from caller.search)
2. "Destination not found." (from func)

Removed the redundant second message in func() since the search
already reported the specific error. Same fix applied to the
obj_to_teleport search path.

Tests updated to expect the single informative search message.
2026-03-29 13:46:58 +01:00
b36e8ab6d7 Fix O(N²) cmdset merge by hashing commands on key instead of constant
Command.__hash__ returned hash("command") for all instances, putting
every command in the same hash bucket. This made set() operations in
CmdSet._union O(N) per lookup instead of O(1). With large command
sets (700+ commands), a single merge took ~1000ms.

Now hashes on self.key. This isn't perfectly consistent with __eq__
(which uses _matchset intersection — two commands sharing only an
alias would be equal but have different hashes), but that edge case
is extremely rare in practice and the performance difference is
massive for games with large command sets.

Benchmarked: cmdset merge drops from ~1000ms to <50ms with 700 commands.
2026-03-29 11:55:38 +01:00
73372ab7cc Fix @teleport showing double error message on failed search
CmdTeleport.parse() called caller.search() without quiet=True, so a
failed search would show Evennia's default "Could not find X" message.
Then func() would show a second "Destination not found." message.

Now uses quiet=True and extracts [0] from the results list, giving
a single clean error message from func().
2026-03-29 11:00:58 +01:00
aa7c66e252 Fix TypeError in MSDP encode when args contain non-string values
Wraps args[0] in str() before string concatenation in encode_msdp.
Without this, MSDP clients sending numeric values cause a TypeError
on the += operation.
2026-03-29 11:00:22 +01:00
8c216e4dab Merge pull request #3896 from evennia/dependabot/pip/simpleeval-1.0.5
Build(deps): Bump simpleeval from 1.0.3 to 1.0.5
2026-03-25 18:11:17 +01:00
4bce6e490f fix: pass caller instead of self to purge_processor in CmdStateCC (fixes #3891) 2026-03-21 13:23:51 +01:00
83d0a96704 Build(deps): Bump simpleeval from 1.0.3 to 1.0.5
Bumps [simpleeval](https://github.com/danthedeckie/simpleeval) from 1.0.3 to 1.0.5.
- [Release notes](https://github.com/danthedeckie/simpleeval/releases)
- [Commits](https://github.com/danthedeckie/simpleeval/compare/1.0.3...1.0.5)

---
updated-dependencies:
- dependency-name: simpleeval
  dependency-version: 1.0.5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 00:49:45 +00:00
3396a7ad0d Fix typo $dbef and extra whitespace in CmdSetAttribute. 2026-03-10 13:53:35 -04:00
519b568ccb fix: close stale DB connections before first query 2026-03-07 00:22:19 -08:00
43423f3184 docs: Update installation instructions to recommend Python 3.12 and clarify Windows setup commands and build tool requirements. 2026-03-06 16:10:33 -08:00
465a46a91b cleanup: Remove duplicate 'objtag' method 2026-03-05 00:06:27 -08:00
3898752678 cleanup: Remove unused local variable orig_string 2026-03-05 00:04:26 -08:00
708662dd48 is_ooc(): thread session through lock system 2026-03-05 00:03:42 -08:00
c6d042cf0a postgresql: Update docs, add optional dependency, fix bug, remove dead code 2026-03-04 22:45:03 -08:00
53dbc57ba3 taskhandler: check task membership directly 2026-03-04 22:14:02 -08:00
bae500c165 taskhandler: remove add() variable shadowing 2026-03-04 22:13:38 -08:00
9313659074 Next: remove misleading comments on active() and self-evident on cancel() 2026-03-04 22:13:38 -08:00
94c503b4e6 taskhandler: fix exists() verbosity. 2026-03-04 22:13:38 -08:00
f94f5c581f taskhandler: remove redundant dict lookups and tuple/list/tuple conversion 2026-03-04 22:13:38 -08:00
b0fe487126 taskhandler: inline cleanup, save at the end 2026-03-04 22:13:38 -08:00
6d90a4cf20 taskhandler: remove dead code 2026-03-04 22:13:38 -08:00
8e2a9ecf76 taskhandler: compute now before looping tasks 2026-03-04 22:13:38 -08:00
5a5304f38f fix: Add validity check to TaskHandlerTask 2026-03-04 21:45:59 -08:00
Cal
6e12314d8b make search disambiguation numbering case insensitive 2026-03-02 11:37:44 -07:00
b1f647bf6d Fix TypeError in telnet HTTP check when command stacking sends bytes data 2026-03-02 01:00:43 +01:00