Skip to content

Commit

Permalink
Merge branch 'master' into csgo
Browse files Browse the repository at this point in the history
  • Loading branch information
Arie committed Dec 13, 2017
2 parents 31ee561 + 104b275 commit 70678dd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 27 deletions.
52 changes: 26 additions & 26 deletions Gemfile.lock
Expand Up @@ -74,7 +74,7 @@ GEM
sshkit (>= 1.6.1, != 1.7.0)
american_date (1.1.1)
arel (8.0.0)
autoprefixer-rails (7.1.6)
autoprefixer-rails (7.2.2)
execjs
backports (3.10.3)
base32_pure (0.1.0)
Expand All @@ -89,7 +89,7 @@ GEM
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
builder (3.2.3)
capistrano (3.10.0)
capistrano (3.10.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand All @@ -103,7 +103,7 @@ GEM
capistrano (>= 3.1)
capistrano-maintenance (1.2.0)
capistrano (>= 3.0)
capistrano-rails (1.3.0)
capistrano-rails (1.3.1)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rbenv (2.1.3)
Expand All @@ -117,7 +117,7 @@ GEM
capistrano-bundler
puma (~> 3.4)
capistrano_colors (0.5.5)
capybara (2.16.0)
capybara (2.16.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
Expand Down Expand Up @@ -166,27 +166,27 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.3)
cucumber (3.0.2)
cucumber (3.1.0)
builder (>= 2.1.2)
cucumber-core (~> 3.0.0)
cucumber-expressions (~> 4.0.3)
cucumber-core (~> 3.1.0)
cucumber-expressions (~> 5.0.4)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 4.0)
gherkin (~> 5.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (3.0.0)
cucumber-core (3.1.0)
backports (>= 3.8.0)
cucumber-tag_expressions (>= 1.0.1)
gherkin (>= 4.1.3)
cucumber-expressions (4.0.4)
cucumber-tag_expressions (~> 1.1.0)
gherkin (>= 5.0.0)
cucumber-expressions (5.0.7)
cucumber-rails (1.5.0)
capybara (>= 1.1.2, < 3)
cucumber (>= 1.3.8, < 4)
mime-types (>= 1.17, < 4)
nokogiri (~> 1.5)
railties (>= 4, < 5.2)
cucumber-tag_expressions (1.0.1)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
dalli (2.7.6)
dante (0.2.0)
Expand Down Expand Up @@ -228,9 +228,9 @@ GEM
fuubar (2.2.0)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.4.4)
geocoder (1.4.5)
geoip (1.6.3)
gherkin (4.1.3)
gherkin (5.0.0)
globalid (0.4.1)
activesupport (>= 4.2.0)
haml (5.0.4)
Expand Down Expand Up @@ -280,7 +280,7 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.10.3)
msgpack (1.1.0)
msgpack (1.2.0)
multi_json (1.12.2)
multi_test (0.1.2)
multi_xml (0.6.0)
Expand Down Expand Up @@ -308,7 +308,7 @@ GEM
multi_json
omniauth-openid
orm_adapter (0.5.0)
paypal-sdk-rest (1.6.1)
paypal-sdk-rest (1.7.1)
multi_json (~> 1.0)
xml-simple
pg (0.21.0)
Expand All @@ -319,7 +319,7 @@ GEM
pry-nav (0.2.4)
pry (>= 0.9.10, < 0.11.0)
public_suffix (3.0.1)
puma (3.10.0)
puma (3.11.0)
rack (2.0.3)
rack-attack (5.0.1)
rack
Expand All @@ -330,7 +330,7 @@ GEM
ruby-openid (>= 2.1.8)
rack-protection (2.0.0)
rack
rack-test (0.7.0)
rack-test (0.8.2)
rack (>= 1.0, < 3)
rails (5.1.4)
actioncable (= 5.1.4)
Expand Down Expand Up @@ -387,7 +387,7 @@ GEM
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.1)
rspec-rails (3.7.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
Expand Down Expand Up @@ -441,10 +441,10 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.15.0)
sshkit (1.15.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stripe (3.8.0)
stripe (3.9.0)
faraday (~> 0.10)
temple (0.8.0)
term-ansicolor (1.6.0)
Expand All @@ -457,19 +457,19 @@ GEM
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.8)
tins (1.15.1)
tins (1.16.3)
trollop (2.1.2)
tzinfo (1.2.4)
thread_safe (~> 0.1)
uglifier (3.2.0)
uglifier (4.0.2)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
vcr (3.0.3)
vcr (4.0.0)
warden (1.2.7)
rack (>= 1.0)
webmock (3.1.0)
webmock (3.1.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
Expand Down
2 changes: 1 addition & 1 deletion app/workers/log_worker.rb
Expand Up @@ -9,7 +9,7 @@ class LogWorker
EXTEND_COMMAND = /!extend.*/
RCON_COMMAND = /!rcon.*/
TIMELEFT_COMMAND = /!timeleft.*/
WHOIS_RESERVER = /!who.*/
WHOIS_RESERVER = /^!who$/
LOG_LINE_REGEX = '(?\'secret\'\d*)(?\'line\'.*)'

def perform(raw_line)
Expand Down
10 changes: 10 additions & 0 deletions lib/reservation.cfg.erb
Expand Up @@ -38,7 +38,17 @@ sv_rcon_whitelist_address "<%= whitelist_ip %>"
tf_preround_push_from_damage_enable 1

#Trolling Miggy's steam profile
banid 0 [U:1:174426785] kick
banid 0 [U:1:3298857] kick
banid 0 [U:1:106952549] kick
banid 0 [U:1:112473157] kick
addip 66.235.11.19

banid 0 [U:1:107449062] kick
banid 0 [U:1:197188887] kick
banid 0 [U:1:97668794] kick
banid 0 [U:1:324896153] kick
banid 0 [U:1:107449062] kick
addip 68.146.176.92
addip 198.53.37.54
addip 104.205.176.52
7 changes: 7 additions & 0 deletions spec/workers/log_worker_spec.rb
Expand Up @@ -17,6 +17,7 @@
let(:de_dust2_start_line) { '1234567L 02/07/2015 - 20:39:40: Started map "de_dust2" (CRC "a7e226a1ff6dd4b8d546d7d341d446dc")' }
let(:who_line) { '1234567L 03/29/2014 - 13:15:53: "Troll<3><[U:1:12345]><Red>" say "!who"' }
let(:csgo_rcon_line) { '1234567L 07/03/2017 - 21:38:39: "Arie - serveme.tf<3><STEAM_1:0:115851><TERRORIST>" say "!rcon say hi"' }
let(:who_troll) { '1234567L 03/29/2014 - 19:15:53: "BindTroll<3><[U:1:12344]><Red>" say "!who is the best"' }
subject(:logworker) { LogWorker.perform_async(line) }

before do
Expand Down Expand Up @@ -112,6 +113,12 @@
LogWorker.perform_async(who_line)
end

it "should not return if there is text before or after the command" do
server.should_not_receive(:rcon_say)
ReservationWorker.should_not_receive(:perform_async).with("Reservation created by: '#{reservation.user.name}'")
LogWorker.perform_async(who_troll)
end

end

describe "csgo" do
Expand Down

0 comments on commit 70678dd

Please sign in to comment.