diff --git a/app/controllers/log_events_controller.rb b/app/controllers/log_events_controller.rb deleted file mode 100644 index e1064ee..0000000 --- a/app/controllers/log_events_controller.rb +++ /dev/null @@ -1,85 +0,0 @@ -class LogEventsController < ApplicationController - # GET /log_events - # GET /log_events.xml - def index - @log_events = LogEvent.all - - respond_to do |format| - format.html # index.html.erb - format.xml { render xml: @log_events } - end - end - - # GET /log_events/1 - # GET /log_events/1.xml - def show - @log_event = LogEvent.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.xml { render xml: @log_event } - end - end - - # GET /log_events/new - # GET /log_events/new.xml - def new - @log_event = LogEvent.new - - respond_to do |format| - format.html # new.html.erb - format.xml { render xml: @log_event } - end - end - - # GET /log_events/1/edit - def edit - @log_event = LogEvent.find(params[:id]) - end - - # POST /log_events - # POST /log_events.xml - def create - @log_event = LogEvent.new(params[:log_event]) - - respond_to do |format| - if @log_event.save - flash[:notice] = t(:logevent_create) - format.html { redirect_to(@log_event) } - format.xml { render xml: @log_event, :status => :created, :location => @log_event } - else - format.html { render :new } - format.xml { render xml: @log_event.errors, :status => :unprocessable_entity } - end - end - end - - # PUT /log_events/1 - # PUT /log_events/1.xml - def update - @log_event = LogEvent.find(params[:id]) - - respond_to do |format| - if @log_event.update_attributes(params[:log_event]) - flash[:notice] = t(:logevent_update) - format.html { redirect_to(@log_event) } - format.xml { head :ok } - else - format.html { render :edit } - format.xml { render xml: @log_event.errors, :status => :unprocessable_entity } - end - end - end - - # DELETE /log_events/1 - # DELETE /log_events/1.xml - def destroy - @log_event = LogEvent.find(params[:id]) - @log_event.destroy - - respond_to do |format| - format.html { redirect_to(log_events_url) } - format.xml { head :ok } - end - end -end diff --git a/app/controllers/log_files_controller.rb b/app/controllers/log_files_controller.rb deleted file mode 100644 index dda7433..0000000 --- a/app/controllers/log_files_controller.rb +++ /dev/null @@ -1,42 +0,0 @@ -class LogFilesController < ApplicationController - def index - LogFile.process - render text: 'Ok' - end - - def handle - LogFile.find(params[:id]).deal - render text: 'Ok' - end - - def refresh - LogFile.unhandled.each do |lf| - lf.deal - end - end - - def fix - Rounder.find_in_batches(batch_size: 100) do |rounders| - rounders.each do |r| - r.team_id = nil - if r.user and t = Teamer.historic(r.user, r.round.start).first - r.team_id = t.team_id - end - r.save - end - end - end - - def pix - Round.all.each do |r| - r.team1_id = nil - r.team2_id = nil - [1, 2].each do |team| - if s = r.rounders.team(team).stats.first - r["team#{team}_id"] = s["team_id"] - end - end - r.save - end - end -end diff --git a/app/controllers/rounds_controller.rb b/app/controllers/rounds_controller.rb deleted file mode 100644 index b09511b..0000000 --- a/app/controllers/rounds_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -class RoundsController < ApplicationController - def index - sort = case params['sort'] - when "start" then "start" - when "server" then "server_id" - when "team1" then "team1_id" - when "team2" then "team2_id" - when "map" then "map_name" - when "commander" then "commander_id" - end - - @rounds = Round.basic.paginate \ - order: sort, - page: params[:page], - per_page: 30 - - if params[:ajax] - render partial: 'list', layout: false - return - end - end - - def show - @round = Round.find(params[:id]) - end -end diff --git a/app/models/log.rb b/app/models/log.rb deleted file mode 100644 index 71e0794..0000000 --- a/app/models/log.rb +++ /dev/null @@ -1,197 +0,0 @@ -# == Schema Information -# -# Table name: logs -# -# id :integer not null, primary key -# server_id :integer -# text :text -# domain :integer -# created_at :datetime -# round_id :integer -# details :string(255) -# actor_id :integer -# target_id :integer -# specifics1 :string(255) -# specifics2 :string(255) -# log_file_id :integer -# - -class Log < ActiveRecord::Base - include Extra - attr_accessor :text - - DOMAIN_LOG = 1 - DOMAIN_INFO = 4 - - TEAM_MARINES = 1 - TEAM_ALIENS = 2 - - RE_PLAYER = /".*?<\d*><\w*>"/ - RE_PLAYER_ID = /".*?<\d*><\w*>"/ - RE_PLAYER_ID_NAME_TEAM = /"(.*?)<\d*><([a-z]*)1team>"/ - RE_PLAYER_NAME = /"(.*?)<\d*><[a-z]*1team>"/ - RE_PLAYER_NAME_TEAM = /"(.*?)<\d*><([a-z]*)1team>"/ - - scope :recent, :order => "id DESC", :limit => 5 - scope :ordered, :order => "created_at ASC, id ASC" - scope :with_details, - lambda { |details| {:conditions => ["details LIKE ?", details]} } - scope :unhandled, :conditions => {:details => nil} - scope :stats, - :select => "id, details, COUNT(*) as num", - :group => "details", - :order => "details" - - belongs_to :details, :class_name => "LogEvent" - belongs_to :server - belongs_to :round - belongs_to :server - belongs_to :log_file - belongs_to :actor, :class_name => "Rounder" - belongs_to :target, :class_name => "Rounder" - - def since - (created_at - round.start).to_i - end - - def time - return sprintf("%02d:%02d", since/60, since%60) - end - - def frag - text.match(/^#{RE_PLAYER_NAME_TEAM} killed #{RE_PLAYER_NAME_TEAM} with "([a-z0-9_]*)"$/) - end - - def role - text.match(/^#{RE_PLAYER_NAME} changed role to "([a-z0-9_]*)"$/) - end - - def match_map vars - if m = text.match(/^Started map "([A-Za-z0-9_]*)"/) - vars[:map] = m[1] - self.details = LogEvent.get "map" - self.specifics1 = m[1] - end - end - - def match_start vars - if text.match(/^Game reset complete.$/) - vars[:round] = Round.new - vars[:round].server = server - vars[:round].start = created_at - vars[:round].map_name = vars[:map] - vars[:round].map = Map.with_name(vars[:map]).first - vars[:round].save - vars[:lifeforms] = {} - self.details = LogEvent.get "start" - end - end - - def match_end vars - if m = text.match(/^Team ([1-2]) has lost.$/) - vars[:round].winner = (m[1].to_i == 1 ? 2 : 1) - vars[:round].end = created_at - [1, 2].each do |team| - if s = vars[:round].rounders.team(team).stats.first - vars[:round]["team#{team}_id"] = s["team_id"] - end - end - vars[:round].save - vars[:round] = nil - self.details = LogEvent.get "end" - end - end - - def match_join vars - if m = text.match(/^#{RE_PLAYER_ID_NAME_TEAM} .*$/) and !(self.actor = vars[:round].rounders.match(m[2]).first) - self.actor = Rounder.new - self.actor.round = vars[:round] - self.actor.name = m[1] - self.actor.steamid = m[2] - self.actor.user = User.first(:conditions => {:steamid => m[2]}) or User.historic(m[2]) - self.actor.team = (m[3] == "marine" ? TEAM_MARINES : TEAM_ALIENS) - if self.actor.user and t = Teamer.historic(actor.user, vars[:round].start).first - self.actor.ensl_team = t.team - end - self.actor.kills = 0 - self.actor.deaths = 0 - self.actor.save - self.details = LogEvent.get "join" - end - end - - def match_kill vars - if m = text.match(/^#{RE_PLAYER} killed #{RE_PLAYER_ID} with "([a-z0-9_]*)"$/) - if self.actor - actor.increment :kills - actor.save - end - if self.target = vars[:round].rounders.match(m[1]).first - target.increment :deaths - target.save - end - self.details = LogEvent.get "kill" - self.specifics1 = m[3] - save - end - end - - def match_say vars - if m = text.match(/^#{RE_PLAYER} (say(_team)?) ".*"$/) - self.details = "say" - self.specifics1 = m[1] - end - end - - def match_built vars - if m = text.match(/^#{RE_PLAYER} triggered "structure_built" \(type "([a-z0-9_]*)"\)$/) - self.details = "built_" + m[1] - end - end - - def match_destroyed vars - if m = text.match(/^#{RE_PLAYER} triggered "structure_destroyed" \(type "([a-z0-9_]*)"\)$/) - self.details = "destroyed_" + m[1] - end - end - - def match_research_start vars - if m = text.match(/^#{RE_PLAYER} triggered "research_start" \(type "([a-z0-9_]*)"\)$/) - self.details = m[1] - end - end - - def match_research_cancel vars - if m = text.match(/^#{RE_PLAYER} triggered "research_cancel" \(type "([a-z0-9_]*)"\)$/) - self.details = "research_cancel" - end - end - - def match_role vars - if m = text.match(/^#{RE_PLAYER_ID} changed role to "([a-z0-9_]*)"$/) - if m[2] == "gestate" - self.details = "gestate" - elsif actor - if m[2] == "commander" and !vars[:round].commander - vars[:round].commander = actor - vars[:round].save - end - if !actor.roles - actor.update_attribute :roles, m[2] - elsif !self.actor.roles.include?(m[2]) - actor.update_attribute :roles, actor.roles + ", " + m[2] - end - self.details = ((vars[:lifeforms].include? actor.id and vars[:lifeforms][actor.id] == m[2]) ? "upgrade" : m[2]) - vars[:lifeforms][actor.id] = m[2] - end - end - end - - def self.add server, domain, text - log = new - log.server = server - log.domain = domain - log.text = text - log.save - end -end diff --git a/app/models/log_event.rb b/app/models/log_event.rb deleted file mode 100644 index 65b0b4f..0000000 --- a/app/models/log_event.rb +++ /dev/null @@ -1,25 +0,0 @@ -# == Schema Information -# -# Table name: log_events -# -# id :integer not null, primary key -# name :string(255) -# description :string(255) -# team :integer -# created_at :datetime -# updated_at :datetime -# - -class LogEvent < ActiveRecord::Base - def self.get search, team = nil - if f = first({:conditions => {:name => search}}) - return f - else - f = LogEvent.new - f.name = "get" - f.team = team if team - f.save - return f - end - end -end diff --git a/app/models/log_file.rb b/app/models/log_file.rb deleted file mode 100644 index f430d05..0000000 --- a/app/models/log_file.rb +++ /dev/null @@ -1,95 +0,0 @@ -# encoding: US-ASCII -# == Schema Information -# -# Table name: log_files -# -# id :integer not null, primary key -# name :string(255) -# md5 :string(255) -# size :integer -# server_id :integer -# updated_at :datetime -# - - -require 'digest/md5' - -class LogFile < ActiveRecord::Base - NON_ASCII = /[\x80-\xff]/ - LOGS = File.join(Rails.root, "tmp", "logs") - - attr_accessor :path - belongs_to :server - - has_many :logs - has_many :rounds, :through => :logs - - def after_create - Pathname(path).each_line do |line| - if m = line.gsub(NON_ASCII, "").match(/\d{2}:\d{2}:\d{2}: (.*)/) - log = Log.new - log.server = server - log.domain = Log::DOMAIN_LOG - log.log_file = self - log.text = m[1].strip - next if log.text.match(/^Server cvar/) - next if log.text.match(/^\[ENSL\]/) - next if log.text.match(/STEAM USERID validated/) - next if log.text.match(/^\[META\]/) - l.created_at = DateTime.parse(line.match(/\d{2}\/\d{2}\/\d{4} \- \d{2}:\d{2}:\d{2}:/)[0]) - vars = {} - log.match_map vars or log.match_start vars - if vars[:round] and !log.details - log.match_end vars \ - or log.match_join vars \ - or log.match_kill vars \ - or log.match_say vars \ - or log.match_built vars \ - or log.match_destroyed vars \ - or log.match_research_start vars \ - or log.match_research_cancel vars \ - or log.match_role vars \ - end - if log.details - log.round = vars[:round] if vars[:round] - log.save - end - end - end - rounds.each do |r| - unless r.end - r.destroy - end - end - Log.delete_all(["details IS NULL AND log_file_id = ?", self.id]) - end - - def format path - self.name = File.basename(path) - self.size = File.size(path) - self.md5 = Digest::MD5.hexdigest(File.read(path)) - self.updated_at = File.mtime(path) - self.path = path - end - - def deal - # TODO - end - - def self.process - Dir.glob("#{LOGS}/*").each do |entry| - dir = File.basename(entry).to_i - if File.directory?(entry) and dir > 0 and Server.find(dir) - Dir.glob("#{entry}/*.log").each do |file| - lf = LogFile.new - lf.format file - lf.server_id = dir - - unless LogFile.first(:conditions => {:name => lf.name, :size => lf.size, :server_id => dir.to_i}) - lf.save - end - end - end - end - end -end diff --git a/app/models/round.rb b/app/models/round.rb deleted file mode 100644 index 3263114..0000000 --- a/app/models/round.rb +++ /dev/null @@ -1,128 +0,0 @@ -# == Schema Information -# -# Table name: rounds -# -# id :integer not null, primary key -# server_id :integer -# start :datetime -# end :datetime -# winner :integer -# match_id :integer -# commander_id :integer -# team1_id :integer -# team2_id :integer -# map_name :string(255) -# map_id :integer -# - -class Round < ActiveRecord::Base - scope :basic, :include => [:commander, :map, :server, :team1, :team2], :order => "start DESC" - scope :team_stats, - :select => "team1_id AS team_id, COUNT(*) as rounds, AVG(winner) AS wlr, teams.name", - :joins => "LEFT JOIN teams ON teams.id = team1_id", - :group => "team_id", - :order => "rounds DESC", - :having => "rounds > 10 AND team_id IS NOT NULL", - :limit => 100 - - has_many :rounders, :dependent => :destroy - has_many :logs, :dependent => :destroy - - belongs_to :team1, :class_name => "Team" - belongs_to :team2, :class_name => "Team" - belongs_to :server - belongs_to :match - belongs_to :commander, :class_name => "Rounder" - belongs_to :map - - def length - sprintf("%02d:%02d", (self.end - self.start).to_i/60, (self.end - self.start).to_i%60) - end - - def winner_s - winner == 1 ? "Marines" : "Aliens" - end - - def marine_stats - {"built_resourcetower" => "Marine RTs", - "built_item_genericammo" => "Ammo Packs", - "built_item_health" => "Medpacks"} - end - - def alien_stats - {"built_alienresourcetower" => "Alien RTs", - "lerk" => "Lerks", - "fade" => "Fades", - "onos" => "Onoses"} - end - - def self.marine_events - {"built_resourcetower" => "RT Built", - "built_phasegate" => "PG Built", - "built_team_infportal" => "IP Built", - "built_team_armory" => "Armory Built", - "built_team_observatory" => "Obs Built", - "built_team_armslab" => "ARMS Built", - "built_team_command" => "CC Built", - "built_team_prototypelab" => "Proto Built", - "built_team_turretfactory" => "TF Built", - "built_team_turret" => "Turret Built", - "built_team_siegeturret" => "Siege Built", - "destroyed_resourcetower" => "RT Destroyed", - "destroyed_phasegate" => "PG Destroyed", - "destroyed_team_infportal" => "IP Destroyed", - "destroyed_team_armory" => "Armory Destroyed", - "destroyed_team_observatory" => "Obs Destroyed", - "destroyed_team_armslab" => "ARMS Destroyed", - "destroyed_team_command" => "CC Destroyed", - "destroyed_team_prototypelab" => "Proto Destroyed", - "destroyed_team_turretfactory" => "TF Destroyed", - "destroyed_team_turret" => "Turret Destroyed", - "destroyed_team_siegeturret" => "Siege Destroyed", - "scan" => "Scan", - "research_motiontracking" => "MT Tech", - "research_phasetech" => "PG Tech", - "research_distressbeacon" => "Beacon", - "research_armorl1" => "Armor 1", - "research_armorl2" => "Armor 2", - "research_armorl3" => "Armor 3", - "research_weaponsl1" => "Weapons 1", - "research_weaponsl2" => "Weapons 2", - "research_weaponsl3" => "Weapons 3", - "research_advarmory" => "AA", - "research_electrical" => "Electrify", - "research_advturretfactory" => "A-TFAC", - "research_cancel" => "Research Cancel", - "kill" => "Frag"} - end - - def self.alien_events - {"built_team_hive" => "Hive Built", - "built_movementchamber" => "MC Built", - "built_sensorychamber" => "SC Built", - "built_defensechamber" => "DC Built", - "built_offensechamber" => "OC Built", - "built_alienresourcetower" => "RT Built", - "destroyed_team_hive" => "Hive Destroyed", - "destroyed_movementchamber" => "MC Destroyed", - "destroyed_sensorychamber" => "SC Destroyed", - "destroyed_defensechamber" => "DC Destroyed", - "destroyed_offensechamber" => "OC Destroyed", - "destroyed_alienresourcetower" => "RT Destroyed", - "gorge" => "Gorge up", - "lerk" => "Lerk up", - "fade" => "Fade up", - "onos" => "Onos up", - "kill" => "Frag"} - end - - def self.alien_event event - return alien_events[event] if alien_events.include?(event) - return nil - end - - def self.marine_event event - return marine_events[event] if marine_events.include?(event) - return nil - end -end diff --git a/app/models/rounder.rb b/app/models/rounder.rb deleted file mode 100644 index 0914f5d..0000000 --- a/app/models/rounder.rb +++ /dev/null @@ -1,52 +0,0 @@ -# == Schema Information -# -# Table name: rounders -# -# id :integer not null, primary key -# round_id :integer -# user_id :integer -# team :integer -# roles :string(255) -# kills :integer -# deaths :integer -# name :string(255) -# steamid :string(255) -# team_id :integer -# - -class Rounder < ActiveRecord::Base - attr_accessor :lifeform - - scope :team, lambda { |team| {:conditions => {:team => team}} } - scope :match, lambda { |steamid| {:conditions => {:steamid => steamid}} } - scope :ordered, :order => "kills DESC, deaths ASC" - scope :stats, - :select => "id, team_id, COUNT(*) as num", - :group => "team_id", - :order => "num DESC", - :having => "num > 3" - scope :player_stats, - :select => "id, user_id, SUM(kills)/SUM(deaths) as kpd, COUNT(*) as rounds", - :group => "user_id", - :order => "kpd DESC", - :having => "rounds > 30 AND kpd > 0 AND user_id IS NOT NULL", - :limit => 100 - scope :team_stats, - :select => "id, team_id, SUM(kills)/SUM(deaths) as kpd, COUNT(DISTINCT round_id) as rounds", - :group => "team_id", - :order => "kpd DESC", - :having => "rounds > 30 AND kpd > 0 AND team_id IS NOT NULL", - :limit => 100 - scope :extras, :include => [:round, :user] - scope :within, - lambda { |from, to| - {:conditions => ["created_at > ? AND created_at < ?", from.utc, to.utc]} } - - belongs_to :round - belongs_to :user - belongs_to :ensl_team, :class_name => "Team", :foreign_key => "team_id" - - def to_s - user ? user.username : name - end -end diff --git a/app/views/log_events/edit.html.erb b/app/views/log_events/edit.html.erb deleted file mode 100644 index bd1c0d8..0000000 --- a/app/views/log_events/edit.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Editing log_event

- -<%= form_for(@log_event) do |f| %> - <%= f.error_messages %> - -

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.submit 'Update' %> -

-<% end %> - -<%= link_to 'Show', @log_event %> | -<%= link_to 'Back', log_events_path %> \ No newline at end of file diff --git a/app/views/log_events/index.html.erb b/app/views/log_events/index.html.erb deleted file mode 100644 index 5619d98..0000000 --- a/app/views/log_events/index.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -

Listing log_events

- - - - - - - <% @log_events.each do |log_event| %> - - - - - - - <% end %> -
Name
<%=h log_event.name %><%= link_to 'Show', log_event %><%= link_to 'Edit', edit_log_event_path(log_event) %><%= link_to 'Destroy', log_event, :confirm => 'Are you sure?', :method => :delete %>
- -
- -<%= link_to 'New log_event', new_log_event_path %> diff --git a/app/views/log_events/new.html.erb b/app/views/log_events/new.html.erb deleted file mode 100644 index d2e38e1..0000000 --- a/app/views/log_events/new.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -

New log_event

- -<%= form_for(@log_event) do |f| %> - <%= f.error_messages %> - -

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.submit 'Create' %> -

-<% end %> - -<%= link_to 'Back', log_events_path %> \ No newline at end of file diff --git a/app/views/log_events/show.html.erb b/app/views/log_events/show.html.erb deleted file mode 100644 index 9c64c19..0000000 --- a/app/views/log_events/show.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

- Name: - <%=h @log_event.name %> -

- - -<%= link_to 'Edit', edit_log_event_path(@log_event) %> | -<%= link_to 'Back', log_events_path %> \ No newline at end of file diff --git a/app/views/rounds/_rounds.html.erb b/app/views/rounds/_rounds.html.erb deleted file mode 100644 index a807b82..0000000 --- a/app/views/rounds/_rounds.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - <% rounds.each do |round| %> - - - - - - - - - <% end %> -
<%= sort_link "Date", :start %><%= sort_link "Server", :server %><%= sort_link "Team 1", :team1 %><%= sort_link "Team 2", :team2 %><%= sort_link "Map", :map %><%= sort_link "commander", :commander %>
<%= link_to (shorttime round.start), round %><%= namelink round.server %><%= namelink round.team1 if round.team1 %><%= namelink round.team2 if round.team2 %><%= round.map.nil? ? h(round.map_name) : namelink(round.map) %><%= (round.commander.nil? or round.commander.user.nil?) ? h(round.commander) : namelink(round.commander.user) %>
- -<%= will_paginate rounds %> diff --git a/app/views/rounds/index.html.erb b/app/views/rounds/index.html.erb deleted file mode 100644 index e3ce175..0000000 --- a/app/views/rounds/index.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

- ENSL Round Archive -

- -
- <%= render :partial => "rounds", :object => @rounds %> -
diff --git a/app/views/rounds/show.html.erb b/app/views/rounds/show.html.erb deleted file mode 100644 index 0d74984..0000000 --- a/app/views/rounds/show.html.erb +++ /dev/null @@ -1,150 +0,0 @@ -
-

- <%= namelink @round.server %> : <%= longtime @round.start %> -

-
- -
-

- General Info and Statistics -

- -
- <%= cascade @round, ["winner_s", "length", "commander", "map_name"] %> -
- -
- <% @round.logs.stats.each do |s| %> - <% next unless @round.marine_stats.include? s.details %> - <%= @round.marine_stats[s.details] %>: <%= s.num %>
- <% end %> -
-
- <% @round.logs.stats.each do |s| %> - <% next unless @round.alien_stats.include? s.details %> - <%= @round.alien_stats[s.details] %>: <%= s.num %>
- <% end %> -
-
- -<% {Log::TEAM_MARINES => "Marines", Log::TEAM_ALIENS => "Aliens"}.each do |team, name| %> -
-

- <%= name %> -

- - - - - - - - - - - <% @round.rounders.team(team).ordered.each do |rounder| %> - - - - - - - - - <% end %> -
NameENSLTeamRolesKillsDeaths
<%= h rounder.name %><%= namelink rounder.user if rounder.user %><%= namelink rounder.ensl_team if rounder.ensl_team %><%= h rounder.roles %><%= rounder.kills %><%= rounder.deaths %>
-
-<% end %> - -
-

- Round Timeline -

- -
-
-

- Aliens -

- - <% alien_total = 0 %> - <% consecutives = 0 %> - <% @round.logs.each do |log| %> - <% next unless e = Round.alien_event(log.details) %> - <% next if log.details == "kill" and (m = log.frag)[2] != "alien" %> - <% add = log.since*8 - alien_total %> - <% consecutives = add < 0 ? (consecutives + 1) : 0 %> - <% left = 145 - (add < 0 ? 105*consecutives : 0) %> - - <% if log.details == "kill" %> -
- - <%= Verification.uncrap(m[1])[0, 7] %> - - <%= image_tag 'weapons/' + m[5] + '.gif', :width => 22, :height => 14 %> - - <%= Verification.uncrap(m[3])[0, 7] %> - -
- <% else %> -
- <% if ["onos", "fade", "lerk", "gorge"].include? log.details %> - <%= Verification.uncrap(log.role[1])[0, 7] %> <%= log.role[2] %>s - <% else %> - <%= h e %> - <% end %> -
- <% end %> - - <% add = add + 15 %> - <% alien_total = alien_total + (add > 0 ? add : 0) %> - <% end %> -
- -
- -
-

- Marines -

- - <% marine_total = 0 %> - <% consecutives = 0 %> - <% @round.logs.each do |log| %> - <% next unless e = Round.marine_event(log.details) %> - <% next if log.details == "kill" and (m = log.frag)[2] != "marine" %> - <% add = log.since*8 - marine_total %> - <% consecutives = add < 0 ? (consecutives + 1) : 0 %> - <% left = 3 + (add < 0 ? 105*consecutives : 0) %> - - <% if log.details == "kill" %> -
- - <%= Verification.uncrap(m[1])[0, 7] %> - - <%= image_tag 'weapons/' + m[5] + '.gif', :width => 30, :height => 14 %> - - <%= Verification.uncrap(m[3])[0, 7] %> - -
- <% else %> -
- <%= h e %> -
- <% end %> - - <% add = add + 15 %> - <% marine_total = marine_total + (add > 0 ? add : 0) %> - <% end %> -
- - <% total = marine_total > alien_total ? marine_total : alien_total %> - -
-
- -
diff --git a/db/schema.rb b/db/schema.rb index e0aad41..fb40af1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,21 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150518162749) do - - create_table "admin_requests", :force => true do |t| - t.string "addr" - t.string "pwd" - t.integer "server_id" - t.string "player" - t.integer "user_id" - t.string "msg" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "admin_requests", ["server_id"], :name => "index_admin_requests_on_server_id" - add_index "admin_requests", ["user_id"], :name => "index_admin_requests_on_user_id" +ActiveRecord::Schema.define(:version => 20150621212615) do create_table "article_versions", :force => true do |t| t.integer "article_id" @@ -214,16 +200,6 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "data_files", ["directory_id"], :name => "index_data_files_on_directory_id" add_index "data_files", ["related_id"], :name => "index_data_files_on_related_id" - create_table "deleteds", :force => true do |t| - t.integer "deletable_id" - t.string "deletable_type" - t.integer "user_id" - t.text "reason" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "related_id" - end - create_table "directories", :force => true do |t| t.string "name" t.string "description" @@ -236,21 +212,6 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "directories", ["parent_id"], :name => "index_directories_on_parent_id" - create_table "firms", :force => true do |t| - t.string "name" - t.string "y_code" - t.string "email" - t.string "website" - t.string "phone" - t.string "address" - t.integer "zipcode" - t.string "town" - t.integer "owner" - t.string "opentime" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "forumers", :force => true do |t| t.integer "forum_id" t.integer "group_id" @@ -379,44 +340,6 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "locks", ["lockable_id", "lockable_type"], :name => "index_locks_on_lockable_id_and_lockable_type" - create_table "log_events", :force => true do |t| - t.string "name" - t.string "description" - t.integer "team" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "log_files", :force => true do |t| - t.string "name" - t.string "md5" - t.integer "size" - t.integer "server_id" - t.datetime "updated_at" - end - - add_index "log_files", ["server_id"], :name => "index_log_files_on_server_id" - - create_table "logs", :force => true do |t| - t.integer "server_id" - t.text "text" - t.integer "domain" - t.datetime "created_at" - t.integer "round_id" - t.string "details" - t.integer "actor_id" - t.integer "target_id" - t.string "specifics1" - t.string "specifics2" - t.integer "log_file_id" - end - - add_index "logs", ["actor_id"], :name => "index_logs_on_actor_id" - add_index "logs", ["log_file_id"], :name => "index_logs_on_log_file_id" - add_index "logs", ["round_id"], :name => "index_logs_on_round_id" - add_index "logs", ["server_id"], :name => "index_logs_on_server_id" - add_index "logs", ["target_id"], :name => "index_logs_on_target_id" - create_table "maps", :force => true do |t| t.string "name" t.string "download" @@ -518,13 +441,6 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "movies", ["status"], :name => "index_movies_on_status" add_index "movies", ["user_id"], :name => "index_movies_on_user_id" - create_table "nodes", :force => true do |t| - t.string "name" - t.integer "foreign_key" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "options", :force => true do |t| t.string "option" t.integer "poll_id" @@ -667,42 +583,6 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "readings", ["user_id", "readable_id", "readable_type"], :name => "index_readings_on_user_id_and_readable_id_and_readable_type" add_index "readings", ["user_id"], :name => "index_readings_on_user_id" - create_table "rounders", :force => true do |t| - t.integer "round_id" - t.integer "user_id" - t.integer "team" - t.string "roles" - t.integer "kills" - t.integer "deaths" - t.string "name" - t.string "steamid" - t.integer "team_id" - end - - add_index "rounders", ["round_id"], :name => "index_rounders_on_round_id" - add_index "rounders", ["team_id"], :name => "index_rounders_on_team_id" - add_index "rounders", ["user_id"], :name => "index_rounders_on_user_id" - - create_table "rounds", :force => true do |t| - t.integer "server_id" - t.datetime "start" - t.datetime "end" - t.integer "winner" - t.integer "match_id" - t.integer "commander_id" - t.integer "team1_id" - t.integer "team2_id" - t.string "map_name" - t.integer "map_id" - end - - add_index "rounds", ["commander_id"], :name => "index_rounds_on_commander_id" - add_index "rounds", ["map_id"], :name => "index_rounds_on_map_id" - add_index "rounds", ["match_id"], :name => "index_rounds_on_match_id" - add_index "rounds", ["server_id"], :name => "index_rounds_on_server_id" - add_index "rounds", ["team1_id"], :name => "index_rounds_on_team1_id" - add_index "rounds", ["team2_id"], :name => "index_rounds_on_team2_id" - create_table "server_versions", :force => true do |t| t.integer "server_id" t.integer "version" @@ -758,6 +638,18 @@ ActiveRecord::Schema.define(:version => 20150518162749) do add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" + create_table "shoutmsg_archive", :force => true do |t| + t.integer "user_id" + t.string "text" + t.datetime "created_at" + t.datetime "updated_at" + t.string "shoutable_type" + t.integer "shoutable_id" + end + + add_index "shoutmsg_archive", ["shoutable_type", "shoutable_id"], :name => "index_shoutmsgs_on_shoutable_type_and_shoutable_id" + add_index "shoutmsg_archive", ["user_id"], :name => "index_shoutmsgs_on_user_id" + create_table "shoutmsgs", :force => true do |t| t.integer "user_id" t.string "text" diff --git a/public/images/weapons/acidrocket.gif b/public/images/weapons/acidrocket.gif deleted file mode 100644 index 0fb434f..0000000 Binary files a/public/images/weapons/acidrocket.gif and /dev/null differ diff --git a/public/images/weapons/bilebomb.gif b/public/images/weapons/bilebomb.gif deleted file mode 100644 index b4029c9..0000000 Binary files a/public/images/weapons/bilebomb.gif and /dev/null differ diff --git a/public/images/weapons/bite2gun.gif b/public/images/weapons/bite2gun.gif deleted file mode 100644 index 8e7fb79..0000000 Binary files a/public/images/weapons/bite2gun.gif and /dev/null differ diff --git a/public/images/weapons/bitegun.gif b/public/images/weapons/bitegun.gif deleted file mode 100644 index b6c159d..0000000 Binary files a/public/images/weapons/bitegun.gif and /dev/null differ diff --git a/public/images/weapons/bitegun2.gif b/public/images/weapons/bitegun2.gif deleted file mode 100644 index 8e7fb79..0000000 Binary files a/public/images/weapons/bitegun2.gif and /dev/null differ diff --git a/public/images/weapons/charge.gif b/public/images/weapons/charge.gif deleted file mode 100644 index 035cc34..0000000 Binary files a/public/images/weapons/charge.gif and /dev/null differ diff --git a/public/images/weapons/claws.gif b/public/images/weapons/claws.gif deleted file mode 100644 index 2e93c8e..0000000 Binary files a/public/images/weapons/claws.gif and /dev/null differ diff --git a/public/images/weapons/devour.gif b/public/images/weapons/devour.gif deleted file mode 100644 index 394be8e..0000000 Binary files a/public/images/weapons/devour.gif and /dev/null differ diff --git a/public/images/weapons/digest.gif b/public/images/weapons/digest.gif deleted file mode 100644 index 394be8e..0000000 Binary files a/public/images/weapons/digest.gif and /dev/null differ diff --git a/public/images/weapons/gernades.gif b/public/images/weapons/gernades.gif deleted file mode 100644 index 083b5e4..0000000 Binary files a/public/images/weapons/gernades.gif and /dev/null differ diff --git a/public/images/weapons/gore.gif b/public/images/weapons/gore.gif deleted file mode 100644 index 2e93c8e..0000000 Binary files a/public/images/weapons/gore.gif and /dev/null differ diff --git a/public/images/weapons/grenade.gif b/public/images/weapons/grenade.gif deleted file mode 100644 index 083b5e4..0000000 Binary files a/public/images/weapons/grenade.gif and /dev/null differ diff --git a/public/images/weapons/handgrenade.gif b/public/images/weapons/handgrenade.gif deleted file mode 100644 index 1a42295..0000000 Binary files a/public/images/weapons/handgrenade.gif and /dev/null differ diff --git a/public/images/weapons/healspray.gif b/public/images/weapons/healspray.gif deleted file mode 100644 index cf7419d..0000000 Binary files a/public/images/weapons/healspray.gif and /dev/null differ diff --git a/public/images/weapons/heavymachinegun.gif b/public/images/weapons/heavymachinegun.gif deleted file mode 100644 index b1b1243..0000000 Binary files a/public/images/weapons/heavymachinegun.gif and /dev/null differ diff --git a/public/images/weapons/item_mine.gif b/public/images/weapons/item_mine.gif deleted file mode 100644 index 076d125..0000000 Binary files a/public/images/weapons/item_mine.gif and /dev/null differ diff --git a/public/images/weapons/knife.gif b/public/images/weapons/knife.gif deleted file mode 100644 index 4bc36aa..0000000 Binary files a/public/images/weapons/knife.gif and /dev/null differ diff --git a/public/images/weapons/leap.gif b/public/images/weapons/leap.gif deleted file mode 100644 index 883677b..0000000 Binary files a/public/images/weapons/leap.gif and /dev/null differ diff --git a/public/images/weapons/machinegun.gif b/public/images/weapons/machinegun.gif deleted file mode 100644 index 4b9c796..0000000 Binary files a/public/images/weapons/machinegun.gif and /dev/null differ diff --git a/public/images/weapons/mines.gif b/public/images/weapons/mines.gif deleted file mode 100644 index 076d125..0000000 Binary files a/public/images/weapons/mines.gif and /dev/null differ diff --git a/public/images/weapons/oc.gif b/public/images/weapons/oc.gif deleted file mode 100644 index 306e056..0000000 Binary files a/public/images/weapons/oc.gif and /dev/null differ diff --git a/public/images/weapons/offensechamber.gif b/public/images/weapons/offensechamber.gif deleted file mode 100644 index 306e056..0000000 Binary files a/public/images/weapons/offensechamber.gif and /dev/null differ diff --git a/public/images/weapons/para.gif b/public/images/weapons/para.gif deleted file mode 100644 index 7b0e128..0000000 Binary files a/public/images/weapons/para.gif and /dev/null differ diff --git a/public/images/weapons/pistol.gif b/public/images/weapons/pistol.gif deleted file mode 100644 index 41368b4..0000000 Binary files a/public/images/weapons/pistol.gif and /dev/null differ diff --git a/public/images/weapons/sentry.gif b/public/images/weapons/sentry.gif deleted file mode 100644 index fcbe2f4..0000000 Binary files a/public/images/weapons/sentry.gif and /dev/null differ diff --git a/public/images/weapons/shotgun.gif b/public/images/weapons/shotgun.gif deleted file mode 100644 index bdfcd82..0000000 Binary files a/public/images/weapons/shotgun.gif and /dev/null differ diff --git a/public/images/weapons/siege.gif b/public/images/weapons/siege.gif deleted file mode 100644 index c7d7ff6..0000000 Binary files a/public/images/weapons/siege.gif and /dev/null differ diff --git a/public/images/weapons/spikes.gif b/public/images/weapons/spikes.gif deleted file mode 100644 index dc5e988..0000000 Binary files a/public/images/weapons/spikes.gif and /dev/null differ diff --git a/public/images/weapons/spit.gif b/public/images/weapons/spit.gif deleted file mode 100644 index c978d56..0000000 Binary files a/public/images/weapons/spit.gif and /dev/null differ diff --git a/public/images/weapons/spitgunspit.gif b/public/images/weapons/spitgunspit.gif deleted file mode 100644 index c978d56..0000000 Binary files a/public/images/weapons/spitgunspit.gif and /dev/null differ diff --git a/public/images/weapons/spore.gif b/public/images/weapons/spore.gif deleted file mode 100644 index 653cc1e..0000000 Binary files a/public/images/weapons/spore.gif and /dev/null differ diff --git a/public/images/weapons/sporegunprojectile.gif b/public/images/weapons/sporegunprojectile.gif deleted file mode 100644 index 653cc1e..0000000 Binary files a/public/images/weapons/sporegunprojectile.gif and /dev/null differ diff --git a/public/images/weapons/swipe.gif b/public/images/weapons/swipe.gif deleted file mode 100644 index 5c53f53..0000000 Binary files a/public/images/weapons/swipe.gif and /dev/null differ diff --git a/public/images/weapons/welder.gif b/public/images/weapons/welder.gif deleted file mode 100644 index d044f1a..0000000 Binary files a/public/images/weapons/welder.gif and /dev/null differ diff --git a/public/images/weapons/xeno.gif b/public/images/weapons/xeno.gif deleted file mode 100644 index 858b739..0000000 Binary files a/public/images/weapons/xeno.gif and /dev/null differ diff --git a/script/shell/log_file_update.sh b/script/shell/log_file_update.sh deleted file mode 100644 index 5ff20b8..0000000 --- a/script/shell/log_file_update.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -LIMIT=5985 -a=4268 - -while [ "$a" -le $LIMIT ] -do - wget -O /dev/null http://www.ensl.org/log_files/handle/"$a" - let "a+=1" -done