Adds a instruction to prevent automatically reconnecting the client to the server
This commit is contained in:
parent
4de135284f
commit
043010aad3
2 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue