sbpanel 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +20 -2
- data/bin/sbpanel +41 -11
- data/lib/sbpanel/game.rb +1 -1
- data/lib/sbpanel/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4c82849beeed3147b81c1552109eb5cc1777293
|
4
|
+
data.tar.gz: bea13ff6078706e0b8aeafa62a62e63901d7478e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fd101d9c148f0c0e2fa25c12e4a702bb4d6d1b5e8883c433ed07c800921aeec5c9a32a7ad9fff8b2572196f0ec20b650f34e05f76a6bdbf53fda291257cef10
|
7
|
+
data.tar.gz: 658532dcc552b67da91869d827dbb7cd8157676e8b978aea7d2c4fc3cd4e17b9816797350d76781d1c2146f0b8b77ce27756278a760aa7253ee8e537eb7dcaa1
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg
|
data/README.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
-
# sbpanel
|
1
|
+
# sbpanel 0.0.2
|
2
2
|
|
3
|
-
|
3
|
+
Starbound web status panel! Parses the server debug log to show connected players, active worlds and chat history. Can be observed here: [starbound.mispy.me](http://starbound.mispy.me/)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Requires [Ruby 1.9.3+](https://www.ruby-lang.org/en/). Since it relies on [fuser](https://en.wikipedia.org/wiki/Fuser_\(Unix\)) to find the Starbound process, probably UNIX systems only for the moment.
|
8
|
+
|
9
|
+
```bash
|
10
|
+
gem install sbpanel
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
```
|
16
|
+
Usage: sbpanel [options] STARBOUND_LOG_PATH
|
17
|
+
-b, --bind ADDR Address to bind [0.0.0.0]
|
18
|
+
-p, --port PORT Port to bind [8000]
|
19
|
+
-a, --address ADDR Server address to display [hostname]
|
20
|
+
-h, --help Display this screen
|
21
|
+
```
|
data/bin/sbpanel
CHANGED
@@ -1,31 +1,61 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'sbpanel'
|
4
|
-
require 'sinatra'
|
5
4
|
require 'optparse'
|
5
|
+
require 'socket'
|
6
6
|
|
7
7
|
options = {
|
8
8
|
bind: "0.0.0.0",
|
9
9
|
port: 8000,
|
10
|
+
address: Socket.gethostname
|
10
11
|
}
|
11
12
|
|
12
|
-
|
13
|
-
OptionParser.new do |opts|
|
13
|
+
optparse = OptionParser.new do |opts|
|
14
14
|
opts.banner = "Usage: sbpanel [options] STARBOUND_LOG_PATH"
|
15
15
|
|
16
|
-
opts.on("-
|
16
|
+
opts.on("-b", "--bind ADDR", "Address to bind [#{options[:bind]}]") do |bind|
|
17
|
+
options[:bind] = bind
|
18
|
+
end
|
19
|
+
|
20
|
+
opts.on("-p", "--port PORT", "Port to bind [#{options[:port]}]") do |port|
|
21
|
+
options[:port] = port
|
22
|
+
end
|
23
|
+
|
24
|
+
opts.on("-a", "--address ADDR", "Server address to display [#{options[:address]}]") do |address|
|
25
|
+
options[:address] = address
|
26
|
+
end
|
27
|
+
|
28
|
+
opts.on('-h', '--help', 'Display this screen') do
|
29
|
+
puts opts
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
optparse.parse!
|
35
|
+
|
36
|
+
if ARGV.empty?
|
37
|
+
puts optparse
|
38
|
+
exit 1
|
17
39
|
end
|
18
40
|
|
41
|
+
if !File.exists?(ARGV[-1])
|
42
|
+
puts "Error: Couldn't find log file: #{ARGV[-1]}"
|
43
|
+
puts optparse
|
44
|
+
exit 1
|
45
|
+
end
|
46
|
+
|
47
|
+
require 'sinatra'
|
19
48
|
|
20
|
-
set :port,
|
21
|
-
set :bind,
|
49
|
+
set :port, options[:port]
|
50
|
+
set :bind, options[:bind]
|
22
51
|
set :root, File.join(File.dirname(__FILE__), '..')
|
23
52
|
|
24
|
-
|
53
|
+
game = SBPanel::Game.load(ARGV[0])
|
54
|
+
game.address = options[:address]
|
25
55
|
|
26
56
|
Thread.new do
|
27
57
|
begin
|
28
|
-
|
58
|
+
game.read_logs
|
29
59
|
rescue Exception => e
|
30
60
|
puts e.message
|
31
61
|
puts e.backtrace.join("\n")
|
@@ -35,9 +65,9 @@ end
|
|
35
65
|
helpers ActionView::Helpers::DateHelper
|
36
66
|
|
37
67
|
get '/' do
|
38
|
-
|
39
|
-
|
40
|
-
instance_variable_set var,
|
68
|
+
game.update_status
|
69
|
+
game.instance_variables.each do |var|
|
70
|
+
instance_variable_set var, game.instance_variable_get(var)
|
41
71
|
end
|
42
72
|
erb :index
|
43
73
|
end
|
data/lib/sbpanel/game.rb
CHANGED
data/lib/sbpanel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbpanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaiden Mispy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -74,6 +74,7 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- .gitignore
|
77
78
|
- Gemfile
|
78
79
|
- LICENSE
|
79
80
|
- README.md
|