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

Have a way to pause/exit and resume the command loop while in game #261

Open
marcelomoreli opened this issue Aug 20, 2017 · 1 comment
Open
Assignees

Comments

@marcelomoreli
Copy link
Contributor

Having a way to pause/exit the command loop would have utility on some situations, like:

1 - logout command - Send the player back to character selection screen
2 - write command - Write big messages (multi-line) into boards, mail, player description, etc
3 - ability to create OLC or compound commands (where you would have to input more than one line of command)

@marcelomoreli
Copy link
Contributor Author

As per Shawn's suggestion:
For the logout/quit command, have now with state.PlayerManager.removePlayer(player) and player.socket.emit('choose-character', player.socket, { account: player.account });. Create a new Error class (essentially copy/paste the RestrictedCommandError and rename it something like EndCommandLoopError. At the end of your command when you're all done throw that error. Update the commands.js file to specifically catch that error just like it catches RestrictedCommandError but instead of doing break; do return; that will prevent the command event from looping
then when you want to resume the command input event you can do it manually with player.socket.emit('commands', player);

@shawncplus shawncplus self-assigned this Aug 22, 2017
@shawncplus shawncplus added this to the v3.0.0 milestone Sep 20, 2017
@shawncplus shawncplus removed this from the v3.0.0 milestone Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants