From 43c34fb0eb7c162b2d792d307cd6f2c67e185ba7 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sun, 18 Feb 2024 15:34:51 +0800 Subject: [PATCH] Add example only for the verbose snap Same as `./client_sample.rb -s` But easier to find, link and reason about. --- examples/11_snap_debugger.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 examples/11_snap_debugger.rb diff --git a/examples/11_snap_debugger.rb b/examples/11_snap_debugger.rb new file mode 100755 index 0000000..2e402c7 --- /dev/null +++ b/examples/11_snap_debugger.rb @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# connects to a server and prints color annotated snap items +# https://chillerdragon.github.io/teeworlds-protocol/img/snap_dump_07.png + +require_relative '../lib/teeworlds_client' + +client = TeeworldsClient.new(verbose: false, verbose_snap: true) + +# connect to localhost and block the current thread +client.connect('localhost', 8303, detach: false)