Skip to content

Conversation

@BubbaJoeX
Copy link
Member

@BubbaJoeX BubbaJoeX commented Jan 13, 2024

/admin setCount
/admin messageTo <timeToDelay (float)>

.gitignore for default IntelliJ IDEA build copies.

Note: /admin messageTo does not take any params, as it just calls the handler. In the future I may add a SUI textbox window to enter the message and delay line by line and parse it. TBD.

/admin setCount <integer>
/admin messageTo <messageHandler> <timeToDelay (float)>
@BubbaJoeX BubbaJoeX changed the title Commonly requested commands admin subcommands Commonly requested commands (admin subcommands) Jan 13, 2024
sendConsoleMessage(self, "sets the weather for the current scene");
sendConsoleMessage(self, "\\#00ffff setCount \\#bfff00 <integer> \\#.");
sendConsoleMessage(self, "sets the amount of a stackable item.");
sendConsoleMessage(self, "\\#00ffff sendMessageTo \\#bfff00 <messageHandler> <time as float> \\#.");
Copy link
Member

Choose a reason for hiding this comment

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

The command is just “messageTo” but here it’s listed as “sendMessageTo”

float messageDelay;
if(st.hasMoreTokens()) {
message = st.nextToken();
messageDelay = utils.stringToFloat(st.nextToken());
Copy link
Member

Choose a reason for hiding this comment

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

With StringTokenizer you need to check hasMoreTokens() for each parameter. This currently has the potential to throw a null pointer exception because you’re calling nextToken() twice without knowing there are actually 2 more tokens (vs just 1 for the message param).

As an aside, these command scripts could really be cleaned up with a helper method and class used to validate params and return syntax because it’s so messy the way we currently do it over and over. A todo for another time.

count = 500;
}
setCount(target, count);
sendConsoleMessage(self, "You have added " + count + " to " + target + " (" + getName(target) + ")");
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why these are console messages when standard pattern is system messages for admin command results. Not a big deal but curious deviation.

@Cekis
Copy link
Contributor

Cekis commented Sep 3, 2024

Bubba... changes... LFG!

@BubbaJoeX
Copy link
Member Author

BubbaJoeX commented Sep 3, 2024

I'll get to these this month with Aconite's suggestions.

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.

3 participants