teeworlds_network 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/net_base.rb +4 -0
- data/lib/teeworlds_client.rb +13 -12
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44430eb78b0d4285979d9175d20f15c944c19ae4974a8a2da31f24858ae42fc9
|
4
|
+
data.tar.gz: 0f7590ae3eab3a25d1f7c51921393b5365396265302b3276341039dc75791128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27a40a6eb10f66a309e2e7adb4d73fa4305abbe2f86d202b1858fc377362350778e08ce309db1b75dc5985ca1454e92ee4a1baa2f83623cd579652837167b75
|
7
|
+
data.tar.gz: 3a116e79f188867b9de788f1158027db91783b76bdc23c6d7c8cc8275048e095eb3cd0a987f715b37156796cad527f06dfb4475b5a1e527609edcb02698bc131
|
data/lib/net_base.rb
CHANGED
data/lib/teeworlds_client.rb
CHANGED
@@ -191,8 +191,9 @@ class TeeworldsClient
|
|
191
191
|
|
192
192
|
def disconnect
|
193
193
|
puts 'disconnecting.'
|
194
|
-
send_ctrl_close
|
194
|
+
send_ctrl_close unless @s.nil?
|
195
195
|
@s&.close
|
196
|
+
@s = nil
|
196
197
|
@signal_disconnect = true
|
197
198
|
end
|
198
199
|
|
@@ -309,18 +310,18 @@ class TeeworldsClient
|
|
309
310
|
)
|
310
311
|
end
|
311
312
|
|
312
|
-
def send_input
|
313
|
+
def send_input(input = {})
|
313
314
|
inp = {
|
314
|
-
direction: -1,
|
315
|
-
target_x: 10,
|
316
|
-
target_y: 10,
|
317
|
-
jump: rand(0..1),
|
318
|
-
fire: 0,
|
319
|
-
hook: 0,
|
320
|
-
player_flags: 0,
|
321
|
-
wanted_weapon: 0,
|
322
|
-
next_weapon: 0,
|
323
|
-
prev_weapon: 0
|
315
|
+
direction: input[:direction] || -1,
|
316
|
+
target_x: input[:target_x] || 10,
|
317
|
+
target_y: input[:target_y] || 10,
|
318
|
+
jump: input[:jump] || rand(0..1),
|
319
|
+
fire: input[:fire] || 0,
|
320
|
+
hook: input[:hook] || 0,
|
321
|
+
player_flags: input[:player_flags] || 0,
|
322
|
+
wanted_weapon: input[:wanted_weapon] || 0,
|
323
|
+
next_weapon: input[:next_weapon] || 0,
|
324
|
+
prev_weapon: input[:prev_weapon] || 0
|
324
325
|
}
|
325
326
|
|
326
327
|
data = []
|
data/lib/version.rb
CHANGED