otstatus 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/otstatus.rb +17 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ea2e64aebf2ea9c2b10d84b231e66e646553d9e0
|
4
|
+
data.tar.gz: ee6e386f45994497c41a0f5c7102a8700d1bbd32
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d3df77ac526c3a63cecc77a80e835bba8ec736c226d5b6a2fb1bb7e6ed249ffe04c9fd24b4894f367b63c06cdf405d03c327145a4855ffb2684de9fec182af08
|
7
|
+
data.tar.gz: c1f823c3218324291939a393a23beb134ab36dedaeb187cd2fbf216dc6a94ea687b02e9e4677066630aa84eb10e10158e9bcc9318520ec683852cc42be7c88f3
|
data/lib/otstatus.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'nori'
|
3
|
+
|
4
|
+
module OtStatus
|
5
|
+
VERSION = '0.1.1'
|
6
|
+
QUERY = [6.chr, 0.chr, 255.chr, 255.chr, 'info'].join
|
7
|
+
|
8
|
+
def self.query hostname, port, timeout=1
|
9
|
+
socket = Socket.tcp "classicus.org", 7171, connect_timeout: timeout
|
10
|
+
socket.print QUERY
|
11
|
+
socket.close_write
|
12
|
+
result = socket.read
|
13
|
+
socket.close
|
14
|
+
parser = Nori.new
|
15
|
+
parser.parse(result)['tsqp']
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: otstatus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jimmy Thelander
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nori
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.6'
|
27
|
+
description: MMORPG game server querying
|
28
|
+
email: jimmy.thelander@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- lib/otstatus.rb
|
34
|
+
homepage: https://github.com/jthelander/otstatus
|
35
|
+
licenses:
|
36
|
+
- MIT
|
37
|
+
metadata: {}
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
requirements: []
|
53
|
+
rubyforge_project:
|
54
|
+
rubygems_version: 2.4.6
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: otstatus
|
58
|
+
test_files: []
|