glowstone 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- @motd = status.motd
26
- @gamemode = status.gametype
27
- @version = status.version
28
- @plugins = status.plugins.split(/;\s*/)
29
- @map_name = status.map_name
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
- @players = status.players
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
@@ -1,3 +1,3 @@
1
1
  module Glowstone
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glowstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: