Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Adding RCON Connector #8

Merged
merged 4 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Splitting RCON in Input and Output.
While output only returns if command was successful
Input will return RCON return message. (There is not often one. But e.g. while using /list in minecraft RCON). Input will return null will it was unsuccessful
  • Loading branch information
strifel committed Jun 27, 2019
commit 85992f53a2e1c458b33cdffdd0cc6c86c4e2e448
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.codeoverflow.chatoverflow.api.io.input;

public interface RconInput extends Input {
String getCommandOutput(String command);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface RconOutput extends Output {

String sendCommand(String command);
boolean sendCommand(String command);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.codeoverflow.chatoverflow.api.plugin.configuration;

import org.codeoverflow.chatoverflow.api.io.input.FileInput;
import org.codeoverflow.chatoverflow.api.io.input.RconInput;
import org.codeoverflow.chatoverflow.api.io.input.SampleInput;
import org.codeoverflow.chatoverflow.api.io.input.SerialInput;
import org.codeoverflow.chatoverflow.api.io.input.chat.DiscordChatInput;
Expand Down Expand Up @@ -101,6 +102,18 @@ public Requirement<FileInput> file(String uniqueRequirementId, String displayNam
return requirements.requireInput(uniqueRequirementId, displayName, isOptional, FileInput.class);
}

/**
* Requires a connection to a RCON Server
*
* @param uniqueRequirementId any unique id by which your plugin can identify the requirement
* @param displayName Is displayed to the framework user and to tell him what to enter
* @param isOptional true if this requirement is optional, false if mandatory
* @return the requirement object
*/
public Requirement<RconInput> rcon(String uniqueRequirementId, String displayName, boolean isOptional) {
return requirements.requireInput(uniqueRequirementId, displayName, isOptional, RconInput.class);
}

// Add more inputs here

}