minecraft-server 0.0.1.pre.43 → 0.0.1.pre.44

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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/minecraft/server.rb +19 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDc5YzAwNTI4YzJjNTc4MTE2NGEwMDg3NjA2NjRhMmEwZTQ0ZDg4MQ==
4
+ MDU4ODEwZjI3NTY5MzhlOGY0NGZlZWZkODZlZDAzNTAyYWY3ZmFiYQ==
5
5
  data.tar.gz: !binary |-
6
- OThlOGEyMTFiZmM1YjcwYWM3MDk5NjdlYjVhN2U5ZTY5N2JlZTYyNw==
6
+ N2ExMWMwMGNhODI2MDE2YWJiNDdkNzQ0YmU5NmQwMmQ5ZDQyNWE5Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2JhYTEyYjMxZDE3NDM1YWFlNDAwYzJjNjNjMTFjNjgyNzA0YjcyZGQzNjVl
10
- NjUwMDBhOGUzMmYzYjIyMjJjOGU5ZTBmN2Y2MjNiZWZlODRhNmQzOTU1ZTQ5
11
- MTMyMmVjMzNhOTA4OTNjNDU2YTJhYzFkMzgyNDdjOTM3Y2I4Mzg=
9
+ M2U1Mzg5ZGZlODZlY2M5ZjFlNmM4ODEwMDA3MTk2NjgxMmM1NTg2ODc1MjA0
10
+ ZDFkM2FiYjM2NmQ3NDU3YzA5ZTg5ODM1NGEzODdmMTNlMWJhZTEzNDQzYTVj
11
+ NDRhYjkxMGJhNmUxMmRmOWQzZmIxZjE1ZmQyM2IyZmU5YWVlNWM=
12
12
  data.tar.gz: !binary |-
13
- MTZkNTEzNmYwZjU1NmRhZDY4M2Y2Y2IzYTVkNjAwYWY2OTdiYzA4MWI5YTQw
14
- NjI3YzZiYWYwYTNiY2E1YWI0N2VlYjgxOTg5OWQ4OThhMWIxYzRhNjU4N2Mz
15
- YmZkNmE5MDZiNDczZWQ2ZmE1ZDAyZTJkMGY3YTZiZDhiODZjNTA=
13
+ Y2UyYjE3MWFkZjJiNmFiM2JmMTBmZjY4YTZhMjE2ODliYmJhZjFhYmNmMWE4
14
+ Zjg4ODU2N2Q2NTkwNjYyYmJiZTA3ZjI5MzllNGRhNDUyMDI1YjFjOTJmNTEz
15
+ ODZjZGZhYmRkYTdiNzJlNWQxM2MyNmY2MTJhNmEwMTVkN2VkMjQ=
@@ -4,25 +4,31 @@ require 'minecraft/server/logger'
4
4
  require 'minecraft/server/version'
5
5
 
6
6
  module Minecraft
7
+ # Control Center of the Minecraft Server.
8
+ # Can be run from this class, although not advised. If you wish to run a Minecraft Server proper please use executables
9
+ # included in the gem.
7
10
  class Server
8
- # @!attribute server
11
+ # @!attribute [r] server
9
12
  # Instance variable representing the current instance of {TCPServer} this instance of {Minecraft::Server} is
10
13
  # currently using for network communication.
11
14
  # @return [TCPServer] The TCP Server used for network communication
12
- attr_reader :server
13
-
14
- # @!attribute clients
15
+ # @!attribute [r] clients
15
16
  # Instance variable representing the Array of Clients Currently Connected.
16
17
  # @return [Array] The clients connected
17
- attr_reader :clients
18
+ # @!attribute [r] config
19
+ # Instance variable representing the configuration currently being used by the server.
20
+ # This should be defined using the DSL from {Minecraft::Server::Config}.
21
+ # @return [Hash] The configuration values
22
+ attr_reader :server, :clients, :config
18
23
 
19
24
  # @!attribute logger
20
25
  # Instance variable representing the Logger being used.
21
26
  # @return [Log4r::Logger]
22
27
  attr_accessor :logger
23
28
 
24
- attr_reader :config
25
-
29
+ # Sets up the instance of the server so that everything will function.
30
+ # Creates an appropriate logger and sets starts API detection and configuration.
31
+ # @param config [Hash] Contains the information for creating a new server, should be created using {Minecraft::Server::Configuration}
26
32
  def initialize(config = {})
27
33
  @logger = Minecraft::Server::Logger.new
28
34
  @config = config
@@ -35,6 +41,7 @@ module Minecraft
35
41
  logger.info "Running on port: #{config[:port]}"
36
42
  end
37
43
 
44
+ # If Bukkit API is enabled will configure server for use with API.
38
45
  def bukkit_api
39
46
  if config[:bukkit]
40
47
  require 'bukkit/server'
@@ -45,6 +52,7 @@ module Minecraft
45
52
  end
46
53
  end
47
54
 
55
+ # If the Minecraft Forge API is enabled will configure server for use with API.
48
56
  def minecraft_forge_api
49
57
  if config[:minecraft_forge]
50
58
  # self.extend Minecraft::Forge::Server
@@ -54,6 +62,7 @@ module Minecraft
54
62
  end
55
63
  end
56
64
 
65
+ # If the Spigot API is enabled will configure server for use with API.
57
66
  def spigot_api
58
67
  if config[:spigot]
59
68
  # self.extend Spigot::Server
@@ -63,6 +72,7 @@ module Minecraft
63
72
  end
64
73
  end
65
74
 
75
+ # If the Sponge API is enabled will configure server for use with API.
66
76
  def sponge_api
67
77
  if config[:sponge]
68
78
  # self.extend Sponge::Server
@@ -80,6 +90,7 @@ module Minecraft
80
90
  accept_clients
81
91
  end
82
92
 
93
+ # Starts a new loop in a new thread to accept new clients.
83
94
  def accept_clients
84
95
  Thread.new do
85
96
  loop do
@@ -91,6 +102,7 @@ module Minecraft
91
102
  end.join
92
103
  end
93
104
 
105
+ # Drops all currently connected clients.
94
106
  def drop_clients
95
107
  logger.info 'Now Dropping all Recorded Clients'
96
108
  clients.each do |client|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minecraft-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.43
4
+ version: 0.0.1.pre.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kepler Sticka-Jones
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-27 00:00:00.000000000 Z
11
+ date: 2014-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor