Adds a instruction to prevent automatically reconnecting the client to the server

This commit is contained in:
zontreck 2024-05-24 15:48:50 -07:00
parent 4de135284f
commit 043010aad3
2 changed files with 4 additions and 3 deletions

View file

@ -10,14 +10,14 @@ void main() async {
PacketClient client = PacketClient();
await client.startConnect("127.0.0.1");
S2CResponse response = await client.send(C2SPing());
S2CResponse response = await client.send(C2SPing(), true);
CompoundTag tag = response.contents;
StringBuilder builder = StringBuilder();
Tag.writeStringifiedNamedTag(tag, builder, 0);
print("Response from server: \n${builder}");
await client.send(StopServerPacket());
await client.send(StopServerPacket(), false);
if (client.connected) await client.close();
return;