make mildly safer
This commit is contained in:
parent
c32a4143dc
commit
41bb37b3c6
1 changed files with 9 additions and 6 deletions
11
mewny.rb
11
mewny.rb
|
|
@ -21,7 +21,7 @@ OptionParser.new do |opt|
|
|||
options[:port] = o
|
||||
end
|
||||
opt.on('-S', '--server',
|
||||
'Make this instance function as a server.'
|
||||
'Make this instance function as a server'
|
||||
) do
|
||||
options[:server] = true
|
||||
end
|
||||
|
|
@ -44,12 +44,14 @@ OptionParser.new do |opt|
|
|||
) do |o|
|
||||
options[:cols] = o
|
||||
end
|
||||
opt.on('-X', '--public',
|
||||
opt.on('--expose-this-instance-for-the-world-to-see-because-I-know-what-I\'m-doing [please]',
|
||||
# X -- eXposed
|
||||
'(server only) Serve publicly, rather than privately'
|
||||
) do
|
||||
'(server only) Serve publicly, rather than privately. Please ONLY add this option if you entierly know what you\'re doing and have permission from/are the server owner. Say please to expose.'
|
||||
) do |o|
|
||||
if o == "please"
|
||||
options[:server_host] = PUBLIC_HOST
|
||||
end
|
||||
end
|
||||
opt.on('-x', '--private',
|
||||
# x -- not visible
|
||||
'(server only) Serve privately, rather than publicly (default)'
|
||||
|
|
@ -80,6 +82,7 @@ def do_server
|
|||
|
||||
puts "PORT: #{PORT}"
|
||||
puts "GRID SIZE: #{ROWS}r#{COLS}c"
|
||||
if SRV_HOST == PUBLIC_HOST then puts "EXPOSED" end
|
||||
puts 'Listening...'
|
||||
|
||||
pre = "#{ROWS}r#{COLS}c >>> "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue