Add in more implementation

This commit is contained in:
zontreck 2024-05-24 13:51:21 -07:00
parent 1b2ec0e74d
commit 0181ea4cf8

View file

@ -10,6 +10,7 @@ import 'package:libac_flutter/packets/packets.dart';
import 'package:libac_flutter/utils/IOTools.dart';
import 'package:libac_flutter/utils/uuid/NbtUUID.dart';
import 'package:libac_flutter/utils/uuid/UUID.dart';
import 'package:mc_rcon_dart/mc_rcon_dart.dart';
import 'package:servermanager/statemachine.dart';
import 'package:servermanager/structs/credentials.dart';
import 'package:servermanager/structs/mod.dart';
@ -272,8 +273,17 @@ class Settings {
runProton("echo", ["hello"]);
}
Future<String> sendRconCommand(String command) async {
createSocket("127.0.0.1", port: inst!.serverSettings.RconPort);
Future<bool> sendRconCommand(String command) async {
try {
createSocket("127.0.0.1", port: inst!.serverSettings.RconPort);
if (inst!.serverSettings.RconPassword.isNotEmpty)
login(inst!.serverSettings.RconPassword);
return sendCommand(command);
} finally {
close();
}
}
Future<void> initializeProton() async {