mirror of
https://github.com/jie65535/gc-opencommand-plugin.git
synced 2025-06-02 17:49:12 +08:00
添加多服务器状态下的多命令支持
This commit is contained in:
parent
896b802bff
commit
726b9ef62d
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,7 +9,7 @@
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
.vscode/
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
|
@ -130,8 +130,18 @@ public final class OpenCommandOnlyHttpHandler implements Router {
|
||||
public void timeout() {
|
||||
}
|
||||
};
|
||||
|
||||
SocketServer.sendPacketAndWait(server.ip, new RunConsoleCommand(req.data.toString()), wait);
|
||||
String[] parsedData = req.data.toString().split("\n[/!]|\\|");
|
||||
if (parsedData.length > 1)
|
||||
{
|
||||
for (String parsed:parsedData)
|
||||
{
|
||||
SocketServer.sendPacketAndWait(server.ip, new RunConsoleCommand(parsed), wait);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SocketServer.sendPacketAndWait(server.ip, new RunConsoleCommand(req.data.toString()), wait);
|
||||
}
|
||||
var packet = wait.getData();
|
||||
if (packet == null) {
|
||||
context.json(new JsonResponse(408, "Timeout"));
|
||||
|
Loading…
Reference in New Issue
Block a user