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

Initial command cleanups #213

Merged
merged 17 commits into from
Mar 23, 2020
Merged

Initial command cleanups #213

merged 17 commits into from
Mar 23, 2020

Conversation

mathiascode
Copy link
Member

Initial work on cleaning up the code style and unifying in-game and console commands.

@mathiascode

This comment has been minimized.

@madmaxoft
Copy link
Member

This approach will make it harder for us when we finally get to refactoring the console command handlers and adding command block handlers. The general idea is that the command handlers' signature will be unified into function cmdHandler(aSplit, aSource), where aSource is either a cPlayer, or a cCommandBlockEntity, cMinecartWithCommandBlock or cConsole. The current status (separate handlers) will continue working after such a change, but your changed code will try to detect console by comparing aSource to nil, which won't be true for console anymore.

@mathiascode
Copy link
Member Author

I suppose we could use a wrapper approach in the meantime (such as https://github.com/cuberite/Core/blob/master/weather.lua#L37)?

@madmaxoft
Copy link
Member

Well, the changes will be done after the big 1.13 refactoring anyway, so we can postpone until then, and merge this PR in the meantime.

@mathiascode
Copy link
Member Author

I still want to add some comments to the code. Feel free to point out areas you think should have them.

@mathiascode mathiascode merged commit 12b1c3c into master Mar 23, 2020
@mathiascode mathiascode deleted the cmdcleanup branch March 24, 2020 09:18
mathiascode added a commit that referenced this pull request May 10, 2020
* Initial command cleanups

* Fix command response for command blocks

* /list command

* /tps command

* /kick command

* /kill command

* /spawn command

* /weather command

* Make reponse clearer

* /viewdistance command

* Add console command wrappers

* Documentation for GetWorld and SendMessage

* Fix error in tps command

* KickPlayer cleanups

* Remove unused variable

* Remove redundant else
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