Skip to content

Conversation

@Ruzihm
Copy link
Contributor

@Ruzihm Ruzihm commented Jan 6, 2026

Closes #2342.

The verb list classes didn't override ContainsKey, ContainsValue, or RemoveValue, which led to verb removal not working as expected. I also added an explicit verb refresh step to appearance updates on the client side. to ensure that atom verb updates are kept up to date on the client.

Also, while testing listx.Remove(listx) I had an issue where the list was being modified while iterated over so now list.remove will copy lists passed as arguments before iterating over them.

Testing code on top of testgame:

/mob 
	// ...

	verb/thing1()
		world.log << "thing1"
		for(var/i=src.verbs.len, i>=1, i--)
			src.verbs.Remove(src.verbs[i])
	
	verb/thing2()
		world.log << "thing2"
		src.verbs.Remove(src.verbs)

	verb/thing3()
		world.log << "thing3"
		for(var/i=src.verbs.len, i>=1, i--)
			src.verbs -= src.verbs[i]

	verb/thing4()
		world.log << "thing4"
		src.verbs -= src.verbs

/client		
	verb/thing5()
		world.log << "thing5"
		for(var/i=src.verbs.len, i>=1, i--)
			src.verbs.Remove(src.verbs[i])

	verb/thing6()
		world.log << "thing6"
		src.verbs.Remove(src.verbs)

	verb/thing7()
		world.log << "thing7"
		for(var/i=src.verbs.len, i>=1, i--)
			src.verbs -= src.verbs[i]

	verb/thing8()
		world.log << "thing8"
		src.verbs -= src.verbs

Results: thing1-4 remove the mob verbs, thing5-8 remove the client verbs.

@boring-cyborg boring-cyborg bot added the Runtime Involves the OpenDream server/runtime label Jan 6, 2026
@github-actions github-actions bot added the size/M label Jan 6, 2026
@Ruzihm Ruzihm marked this pull request as draft January 6, 2026 08:15
@boring-cyborg boring-cyborg bot added the Client Involves the OpenDream client label Jan 6, 2026
@Ruzihm Ruzihm marked this pull request as ready for review January 6, 2026 16:37
@Ruzihm Ruzihm changed the title Makes removing client verbs work as expected shows results of removing client/mob verbs on client Jan 6, 2026
@Ruzihm Ruzihm marked this pull request as draft January 6, 2026 17:35
}

Appearance = appearance;
appearanceSystem.RefreshVerbs();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is causing way too much overhead when connected to a real server. Will need an alternative to this....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm a little unsure what else could be done here. Ideally, we would only update verbs for clients which are gaining or losing executable verbs.

But I'm wondering if it's acceptable to do something simple and just have the client periodically call RefreshVerbs on a timer of some kind...

Comment on lines 374 to 379
private async Task StartVerbRefresher() {
while (true) {
await Task.Delay(TimeSpan.FromSeconds(timeToRefreshVerbs));
_taskManager.RunOnMainThread(_verbSystem.RefreshVerbs);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works but I'm not sure if this is the best way.

@Ruzihm
Copy link
Contributor Author

Ruzihm commented Jan 6, 2026

Also I noticed that when reading/clearing client.verbs, I can see/remove builtins like /client/verb/Center, /client/verb/Northwest, and so on. So clearing client.verbs actually makes the character stop responding to the arrow keys in TestGame. In Byond, they are not included in client.verbs and not removable. That's probably worthy of a different PR/issue.

@Ruzihm Ruzihm marked this pull request as ready for review January 6, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client Involves the OpenDream client Runtime Involves the OpenDream server/runtime size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removing client verbs doesn't update the panels

1 participant