Skip to content

Commit

Permalink
Merge pull request #167 from AresMUSH/dev
Browse files Browse the repository at this point in the history
Version 1.0.9
  • Loading branch information
lynnfaraday authored Nov 7, 2023
2 parents f1d41d8 + 93347dd commit 25ee082
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 56 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ source 'http://rubygems.org'

gem 'ansi', '~> 1.5'

gem "activesupport", ">= 6.0.3.1"
gem "activesupport", ">= 6.1.7"
gem 'ohm', '~> 3.1.1'

gem 'erubis', '~> 2.7.0'
gem 'bcrypt', '~> 3.1.11'
gem 'eventmachine', '~> 1.2.7'
gem 'em-websocket', '~> 0.5'
gem 'i18n', '~> 0.7'
gem 'i18n', '~> 1.14'
gem 'log4r', '~> 1.1.10'
gem 'rake', '~> 12.3'
gem 'rspec', '~> 3.7.0'
gem 'timezone', '~> 1.2.10'
gem 'dentaku', '~>3.1'
gem 'json', '~> 2.3.1'
gem 'redcarpet', '~> 3.5.1'
gem 'sinatra', '~> 2.2.2'
gem 'sinatra', '~> 2.2.3'
gem 'thin', '~> 1.8.1'
gem 'sinatra-cross_origin', '~>0.4.0'
gem "ox", ">= 2.14.11"
Expand All @@ -28,4 +28,4 @@ gem 'diffy', '~> 3.4.1'
gem 'sassc', '~> 2.4.0'
gem 'htmlentities', '~>4.3.4'
gem 'handlebars-engine', '~>0.3'
gem "rack", ">= 2.2.4"
gem "rack", ">= 2.2.6"
48 changes: 28 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (6.0.6)
activesupport (7.1.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ansi (1.5.0)
aws-eventstream (1.2.0)
aws-partitions (1.636.0)
Expand All @@ -24,13 +28,18 @@ GEM
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.1)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt (3.1.18)
bigdecimal (3.1.4)
concurrent-ruby (1.1.10)
connection_pool (2.4.1)
daemons (1.4.1)
dentaku (3.5.0)
concurrent-ruby
diff-lcs (1.5.0)
diffy (3.4.2)
drb (2.2.0)
ruby2_keywords
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand All @@ -44,7 +53,7 @@ GEM
hiredis (0.6.3)
htmlentities (4.3.4)
http_parser.rb (0.8.0)
i18n (0.9.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jmespath (1.6.1)
json (2.3.1)
Expand All @@ -53,18 +62,19 @@ GEM
log4r (1.1.10)
mini_racer (0.6.3)
libv8-node (~> 16.10.0.0)
minitest (5.16.3)
minitest (5.20.0)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
nest (3.2.0)
redic
ohm (3.1.1)
nest (~> 3)
redic (~> 1.5.0)
stal
ox (2.14.11)
rack (2.2.4)
rack-protection (2.2.2)
rack (2.2.8)
rack-protection (2.2.4)
rack
rake (12.3.3)
redcarpet (3.5.1)
Expand All @@ -87,10 +97,10 @@ GEM
rubyzip (1.3.0)
sassc (2.4.0)
ffi (~> 1.9)
sinatra (2.2.2)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.2)
rack-protection (= 2.2.4)
tilt (~> 2.0)
sinatra-cross_origin (0.4.0)
stal (0.3.0)
Expand All @@ -99,19 +109,17 @@ GEM
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thread_safe (0.3.6)
tilt (2.0.11)
tilt (2.3.0)
timezone (1.2.12)
tzinfo (1.2.10)
thread_safe (~> 0.1)
zeitwerk (2.6.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
activesupport (>= 6.0.3.1)
activesupport (>= 6.1.7)
ansi (~> 1.5)
aws-sdk-s3 (~> 1.114)
bcrypt (~> 3.1.11)
Expand All @@ -123,18 +131,18 @@ DEPENDENCIES
eventmachine (~> 1.2.7)
handlebars-engine (~> 0.3)
htmlentities (~> 4.3.4)
i18n (~> 0.7)
i18n (~> 1.14)
json (~> 2.3.1)
log4r (~> 1.1.10)
ohm (~> 3.1.1)
ox (>= 2.14.11)
rack (>= 2.2.4)
rack (>= 2.2.6)
rake (~> 12.3)
redcarpet (~> 3.5.1)
rspec (~> 3.7.0)
rubyzip (~> 1.3.0)
sassc (~> 2.4.0)
sinatra (~> 2.2.2)
sinatra (~> 2.2.3)
sinatra-cross_origin (~> 0.4.0)
thin (~> 1.8.1)
timezone (~> 1.2.10)
Expand Down
12 changes: 12 additions & 0 deletions engine/aresmush/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ def self.help
help_reader.help
end

def self.shutdown(delay_sec = 1)
# Don't use dispatcher here because we want a hard kill
EventMachine.add_timer(delay_sec) do
EventMachine.stop_event_loop

#path = File.join( AresMUSH.root_path, "bin", "killares" )
#`#{path}`

raise SystemExit.new
end
end

mattr_accessor :client_monitor, :config_reader, :dispatcher, :plugin_manager, :locale, :help_reader, :database, :ares_logger, :notifier, :use_api_proxy, :server_start
end
end
16 changes: 8 additions & 8 deletions engine/aresmush/locale/locale.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Short global alias for translate and localize
def t(str, *args)
AresMUSH::Locale.translate(str, *args)
def t(str, **args)
AresMUSH::Locale.translate(str, **args)
end

def l(object, options = {})
AresMUSH::Locale.localize(object, options)
def l(object, **options)
AresMUSH::Locale.localize(object, **options)
end

module AresMUSH
Expand Down Expand Up @@ -40,19 +40,19 @@ def setup
reload
end

def self.translate(str, *args)
def self.translate(str, **args)
begin
I18n.t(str, *args)
I18n.t(str, **args)
rescue I18n::InvalidLocaleData => ex
I18n.load_path.delete ex.filename
Global.logger.error "Error in translations file! #{ex}"
"%xh%xrOops! Something's wrong with one of the language files. Please inform the admins: #{ex.filename}.%xn"
end
end

def self.localize(object, *args)
def self.localize(object, **args)
if (object.is_a?(Date) || object.is_a?(Time))
I18n.l(object, *args)
I18n.l(object, **args)
else
sep = t('number.format.separator')
object.to_s.gsub(/\./, sep)
Expand Down
3 changes: 2 additions & 1 deletion engine/aresmush/models/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def is_special_char?(char)
def self.web_portal_url
host = Global.read_config('server', 'hostname')
port = Global.read_config('server', 'web_portal_port')
use_https = Global.read_config('server', 'use_https')

if (port.to_s == '80')
port_str = ""
Expand All @@ -36,7 +37,7 @@ def self.web_portal_url
website = Global.read_config("game", "website")

if (website.blank?)
return "http://#{host}#{port_str}"
return "#{use_https ? 'https' : 'http'}://#{host}#{port_str}"
else
return website
end
Expand Down
1 change: 0 additions & 1 deletion plugins/demographics/public/demographics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ def self.build_web_profile_edit_data(char, viewer, is_profile_manager)
value: "#{char.demographic(d)}"
}
end
puts props
{
demographics: demographics,
genders: Demographics.genders
Expand Down
1 change: 1 addition & 0 deletions plugins/login/events/idled_out_event_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def on_event(event)

char = Character[event.char_id]
char.wipe_login_data
char.cleanup_login_notices
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions plugins/login/public/login_char.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ class Character

collection :login_notices, "AresMUSH::LoginNotice"

before_delete :cleanup_login
before_delete :cleanup_login_notices

def unread_notifications
self.login_notices.find(is_unread: true)
end

def cleanup_login
def cleanup_login_notices
self.login_notices.each { |n| n.delete }
end

Expand Down
7 changes: 1 addition & 6 deletions plugins/manage/commands/game/shutdown_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ def handle
end

Manage.save_db

# Don't use dispatcher here because we want a hard kill
EventMachine.add_timer(1) do
EventMachine.stop_event_loop
raise SystemExit.new
end
Global.shutdown
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/scenes/web/get_scene_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def handle(request)
icdate: scene.icdate,
participants: participants,
limit: scene.limit,
privacy: scene.completed ? "Open" : (scene.private_scene ? "Private" : "Open"),
privacy: scene.shared ? "Open" : (scene.private_scene ? "Private" : "Open"),
scene_type: scene.scene_type ? scene.scene_type.titlecase : 'unknown',
scene_pacing: scene.scene_pacing,
log: log,
Expand Down
12 changes: 1 addition & 11 deletions plugins/website/web/shutdown_request_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ def handle(request)
Global.notifier.notify_ooc(:shutdown, t('manage.shutdown', :name => enactor.name)) do |char|
true
end

# Don't use dispatcher here because we want a hard kill
EventMachine.add_timer(5) do
EventMachine.stop_event_loop

path = File.join( AresMUSH.root_path, "bin", "killares" )
`#{path}`

raise SystemExit.new
end

Global.shutdown

{}
end
Expand Down
1 change: 0 additions & 1 deletion plugins/website/website.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def self.init_plugin

def self.get_cmd_handler(client, cmd, enactor)

puts cmd
case cmd.root
when "website"
if (cmd.switch_is?("deploy"))
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.8
1.0.9

0 comments on commit 25ee082

Please sign in to comment.