-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding command for connect commands.
- Loading branch information
1 parent
2411537
commit 2f88ac1
Showing
7 changed files
with
55 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module AresMUSH | ||
module Login | ||
class OnConnectCmd | ||
include CommandHandler | ||
|
||
attr_accessor :commands | ||
|
||
def parse_args | ||
self.commands = list_arg(cmd.args, ",") || [] | ||
end | ||
|
||
def check_num_commands | ||
return t('login.too_many_onconnect_commands') if self.commands.count > 5 | ||
return nil | ||
end | ||
|
||
def handle | ||
if (self.commands.empty?) | ||
enactor.update(onconnect_commands: []) | ||
client.emit_success t('login.onconnect_commands_cleared') | ||
else | ||
enactor.update(onconnect_commands: self.commands) | ||
client.emit_success t('login.onconnect_commands_set') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
toc: Miscellaneous | ||
summary: Commands to run when you connect. | ||
--- | ||
|
||
You always see the notices screen when you connect, which shows you a summary of what's new on the game. You can optionally run additional commands (commonly 'where' or 'jobs' when you first connect). | ||
|
||
`onconnect <comma-separated list of commands to run>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters