-
Notifications
You must be signed in to change notification settings - Fork 119
Rewrite repeating verbs to use VerbSystem, incl. overrides #2289
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
Rewrite repeating verbs to use VerbSystem, incl. overrides #2289
Conversation
f3ac4e6
to
219d4c6
Compare
d27c141
to
3069aa3
Compare
3069aa3
to
9b3a084
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
* Repeating macros can now run any verb * Repeating behavior closely mimicks BYOND, where the last sent repeated key is the one being repeated * Verbs now execute its last override on an atom/client
9b3a084
to
9d0dea5
Compare
This removes the need for the server to find the "newest" verb definition every time I also moved where `AddVerb()` is called on the compiler to fix a compile order issue
return; | ||
public void RunRepeatingVerbs() { | ||
using (Profiler.BeginZone("Repeating Verbs", color: (uint)Color.OrangeRed.ToArgb())) { | ||
foreach (var repeatingVerb in _repeatingVerbs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should pull out the contents of OnVerbExecuted()
into a shared method and use that instead to execute verbs, to ensure behavior is consistent and doesn't copy code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted not to for this, since OnVerbExecuted
handles argument checking, of which verbs wouldn't have any, so we can skip that block entirely.
I also wanted to distinct regular verbs and repeating verbs in the name (1st param) of the DreamThread#Run
call.
var client = repeatingVerb.Key; | ||
var verbId = repeatingVerb.Value.Last(); | ||
|
||
var src = _dreamManager.GetFromClientReference(client, ClientObjectReference.Client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes the verb is always on the client. It needs to use RegisterRepeatVerbEvent
's Src
instead of ClientObjectReference.Client
.
Superseded by #2365 |
Uh oh!
There was an error while loading. Please reload this page.