24 lines
711 B
Dart
24 lines
711 B
Dart
import 'package:libac_flutter/nbt/Stream.dart';
|
|
import 'package:libac_flutter/nbt/Tag.dart';
|
|
import 'package:libac_flutter/nbt/impl/CompoundTag.dart';
|
|
import 'package:libac_flutter/packets/packets.dart';
|
|
|
|
void main() async {
|
|
PacketRegistry reg = PacketRegistry();
|
|
reg.registerDefaults();
|
|
|
|
PacketClient client = PacketClient();
|
|
await client.startConnect("127.0.0.1");
|
|
|
|
S2CResponse response = await client.send(C2SPing());
|
|
CompoundTag tag = response.contents;
|
|
StringBuilder builder = StringBuilder();
|
|
Tag.writeStringifiedNamedTag(tag, builder, 0);
|
|
|
|
print("Response from server: \n${builder}");
|
|
|
|
await client.send(StopServerPacket());
|
|
|
|
if (client.connected) await client.close();
|
|
return;
|
|
}
|