Changes
Page history
Update How to add Terminal Commands
authored
Apr 01, 2020
by
Kevin Marek
Hide whitespace changes
Inline
Side-by-side
How-to-add-Terminal-Commands.md
View page @
097124c9
...
@@ -41,10 +41,10 @@ The buildHashMap() method used to add the commands to the hashmap
...
@@ -41,10 +41,10 @@ The buildHashMap() method used to add the commands to the hashmap
*
If it is not in the client side HashMap then we call the CommandSendTerminalText command that starts the message sequence to the server.
*
If it is not in the client side HashMap then we call the CommandSendTerminalText command that starts the message sequence to the server.
*
It will eventually hit the CommandReceivedTerminalText command that will check the server side HashMap for the command
*
It will eventually hit the CommandReceivedTerminalText command that will check the server side HashMap for the command
*
Some of the commands will have arguments
*
Some of the commands will have arguments
*
We strip the argument from the command identifier, store
i
t as a String, and pass
it i
nto the execute
*
We strip the argument
s
from the command identifier, store t
hem
as a String
array
, and pass
them o
nto the execute
*
We then check if the command is in the server HashMap
*
We then check if the command is in the server HashMap
*
If it is, we run its execute method
*
If it is, we run its execute method
*
We pass in the argument
String
and the playerID into the execute method
*
We pass in the argument
array
and the playerID into the execute method
*
Some commands don't need either the argument or the playerID
*
Some commands don't need either the argument or the playerID
*
You just don't use either if you don't need it
*
You just don't use either if you don't need it
*
All the execute methods return a string
*
All the execute methods return a string
...
...
...
...