six-updater-web 0.24.0 → 0.24.1
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.
data/Rakefile
CHANGED
@@ -124,29 +124,6 @@ class MainController < ApplicationController
|
|
124
124
|
action = fetch_param([:act], Action, action)
|
125
125
|
setting = fetch_param([:setting], Appsetting, setting)
|
126
126
|
|
127
|
-
# Handle gamespy update
|
128
|
-
case params["commit"].downcase
|
129
|
-
when "update_gamespy"
|
130
|
-
gslist_installed = begin
|
131
|
-
%x[gslist -h]
|
132
|
-
$? == 0
|
133
|
-
rescue
|
134
|
-
false
|
135
|
-
end
|
136
|
-
|
137
|
-
if gslist_installed
|
138
|
-
@msg << "<b>A window should open displaying the gamespy progress</b>"
|
139
|
-
if gs_geo
|
140
|
-
@system_setting.update_gamespy(setting) #(true)
|
141
|
-
else
|
142
|
-
@system_setting.update_gamespy_nogeo(setting) #(true)
|
143
|
-
end
|
144
|
-
else
|
145
|
-
@error << "<b>ERROR: gslist tool is missing!</b>"
|
146
|
-
@error << "Please download from <a href=\"http://six.dev-heaven.net/wagn/Six_Updater_Suite+download+gslist\" target=\"_blank\">Six Updater Wagn</a>, and put in #{SixUpdaterWeb::TOOL_PATH}"
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
127
|
# Handle gamespy server
|
151
128
|
begin
|
152
129
|
queryserver = Queryserver.find(@system_setting.favorite_server)
|
@@ -327,6 +304,27 @@ class MainController < ApplicationController
|
|
327
304
|
@disabled.sort! { |a, b| a.name <=> b.name }
|
328
305
|
|
329
306
|
case params["commit"].downcase
|
307
|
+
# Handle gamespy update
|
308
|
+
when "update_gamespy"
|
309
|
+
gslist_installed = begin
|
310
|
+
%x[gslist -h]
|
311
|
+
$? == 0
|
312
|
+
rescue
|
313
|
+
false
|
314
|
+
end
|
315
|
+
|
316
|
+
if gslist_installed
|
317
|
+
@msg << "<b>A window should open displaying the gamespy progress</b>"
|
318
|
+
if gs_geo
|
319
|
+
@system_setting.update_gamespy(setting) #(true)
|
320
|
+
else
|
321
|
+
@system_setting.update_gamespy_nogeo(setting) #(true)
|
322
|
+
end
|
323
|
+
else
|
324
|
+
@error << "<b>ERROR: gslist tool is missing!</b>"
|
325
|
+
@error << "Please download from <a href=\"http://six.dev-heaven.net/wagn/Six_Updater_Suite+download+gslist\" target=\"_blank\">Six Updater Wagn</a>, and put in #{SixUpdaterWeb::TOOL_PATH}"
|
326
|
+
end
|
327
|
+
|
330
328
|
when "server mod check"
|
331
329
|
if queryserver
|
332
330
|
queryserver.latest
|
@@ -47,15 +47,6 @@ class SystemSetting < ActiveRecord::Base
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def synchronize
|
50
|
-
if ENV["RAILS_ENV"] == "production" && (RUBY_VERSION > "1.9.1" || RUBY_VERSION < "1.9.1")
|
51
|
-
begin
|
52
|
-
# TODO: This should be in after_initialize yet there it fails..
|
53
|
-
SixUpdaterWeb.update_site_controllers # Update the list of controllers - give default adminstrator permission to
|
54
|
-
rescue => e
|
55
|
-
logger.debug "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
50
|
l = []
|
60
51
|
begin
|
61
52
|
Six::Network::Panel.setlogger(logger)
|
@@ -79,12 +70,24 @@ class SystemSetting < ActiveRecord::Base
|
|
79
70
|
l
|
80
71
|
end
|
81
72
|
|
73
|
+
def update_sitecontrollers
|
74
|
+
if ENV["RAILS_ENV"] == "production" && (RUBY_VERSION > "1.9.1" || RUBY_VERSION < "1.9.1")
|
75
|
+
begin
|
76
|
+
# TODO: This should be in after_initialize yet there it fails..
|
77
|
+
SixUpdaterWeb.update_site_controllers # Update the list of controllers - give default adminstrator permission to
|
78
|
+
rescue => e
|
79
|
+
logger.debug "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
82
84
|
def sync
|
83
85
|
self.synchronized_at = Time.now
|
84
86
|
self.save
|
85
87
|
#Mod.delete_all("type IS NULL or name IS NULL")
|
86
88
|
#Appsetting.delete_all("type IS NULL or name IS NULL")
|
87
89
|
l = self.synchronize
|
90
|
+
self.update_sitecontrollers
|
88
91
|
content = l.size > 0 ? "Synchronized #{l.size} records with server-site!" : "WARNING: No objects received, possibly issue with connection (timeout?), or server site"
|
89
92
|
#Mod.delete_all("type IS NULL or name IS NULL")
|
90
93
|
#Appsetting.delete_all("type IS NULL or name IS NULL")
|