glowstone 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/glowstone/server.rb +13 -6
- data/lib/glowstone/version.rb +1 -1
- metadata +1 -1
data/lib/glowstone/server.rb
CHANGED
@@ -22,14 +22,21 @@ module Glowstone
|
|
22
22
|
response = perform_request(MAGIC_BYTES + REQUEST_BYTE[:query] + CLIENT_ID + get_session_id + CLIENT_ID)
|
23
23
|
status = StatusPacket.read response
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
25
|
+
# there's some kind of weird bug with BinData wherein its native
|
26
|
+
# datatypes don't play well with rails, so i'm converting them all here
|
27
|
+
@motd = status.motd.to_s
|
28
|
+
@gamemode = status.gametype.to_s
|
29
|
+
@version = status.version.to_s
|
30
|
+
@plugins = status.plugins.to_s.split(/;\s*/)
|
31
|
+
@map_name = status.map_name.to_s
|
30
32
|
@num_players = status.num_players.to_i
|
31
33
|
@max_players = status.max_players.to_i
|
32
|
-
|
34
|
+
|
35
|
+
player_array = status.players.to_ary
|
36
|
+
player_array.each_with_index do |player, index|
|
37
|
+
player_array[index] = player.to_s
|
38
|
+
end
|
39
|
+
@players = player_array
|
33
40
|
|
34
41
|
self
|
35
42
|
end
|
data/lib/glowstone/version.rb
CHANGED