Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Commands now use self.msg() instead of self.caller.msg() #3349

Merged
merged 2 commits into from Dec 2, 2023

Conversation

volundmush
Copy link
Contributor

Brief overview of PR changes/additions

The Evennia default command has a handy self.msg() which has some unique behavior not found on objects, sessions, and accounts.

Unfortunately, many commands aren't using it, instead going straight for self.caller.msg()

This fixes that, where prudent. The only command I didn't touch is the CmdPy-related things, because that does some special weird stuff I don't want to mess up.

Motivation for adding to Evennia

Twofold. First, the Default commands should better conform to their own standards and resources to show off how to write commands.

Second, I have an awesome output-buffering system for Athanor in the works (which we may be able to backport to Evennia later) which bundles up all calls to cmd.msg() for a single operation so that webclients can group up the output of a specific command with the input. So, I need the default commands to be using cmd.msg(), or I need to replace all of them...

Like, if you sent in:
["text", ["look"], {"results_id": "whatever"}]
Then you will get a response back that looks something like this:
["results", [{"look": (["<text>"], {"type": "look"})], {"results_id": "whatever"}]

Other info (issues closed, discussion etc)

There seems to be a weird recursion issue going on with CmdExamine. I'm not sure how to deal with it yet, still investigating.

Copy link
Member

@Griatch Griatch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice cleanup for default commands. The Command.msg() method is indeed more powerful than the direct caller.msg() one.

@Griatch Griatch merged commit a928e41 into evennia:main Dec 2, 2023
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants